Technology Tools for Ministry

Community

Web-Empowered Church User Community
All Categories > Ministry Tools > Staff Directory > Automatic creation of staff info records
Total Posts: 4 - Pages (1): [1]
Author: Rafael Álvarez
Posted: Sep 20 2007 - 07:07 AM
Subject: Automatic creation of staff info records
I would like to use wec staff directory with all my FE users. Anyone knows a way to automatically create a staff record for each user (the "in staff directory" is already marked)?.

A second point is a way to automatically create a new user and the related staff record. Any suggestion?
user picture Author: Mark Stephenson
Posted: Sep 20 2007 - 07:49 AM
Subject: re: Automatic creation of staff info records
Rafael,

Just to help us understand, can you tell us why you want to do this? Is it because everyone who creates an account will be on your staff or do you just like the way the staff directory can list all the people?

In Christ,
Mark
user picture Author: Mark Stephenson
Posted: Sep 20 2007 - 08:47 AM
Subject: re: Automatic creation of staff info records
Rafael,

From your direct e-mail to me, you are using this website for more of an Intranet where the information about people can be available to all. I will answer here so more people can see it.

Dave, the developer of this extension may have a suggestion, but I can think of a few options that might work:

1. You could make registration and the staff directory separate. You can set up the staff directory so everyone who is registered can administrate the staff directory. Then they can add themselves (and others if needed) and change the records at any time. We use the staff directory this way internally within WEC to have a shared contact list that we can all refer to. I love it! We can all add an update entries. The only drawback is that anyone can modify any entry.

2. If there are not that many people and the staff do not change too often, it would probably not be that hard to manually check the staff option and to add the staff record for each person.

3. I have not done this, but you could just use the FE user data table and list the users from that. Then there is no need to use the staff directory at all. I think there are some extensions that can help with listing FE user records too. FE records have a lot of fields so that may be all you need. Of course, this would be a totally automatic solution. If you needed categories like departments then those could be FE user groups.

Sorry I do not have an easier solution. This extension was not designed for this so solutions are not as nice.

In Christ,
Mark
Author: Christian Boltz
Posted: Sep 20 2007 - 03:44 PM
Subject: re: Automatic creation of staff info records
a) for the existing users:

Maybe some SQL can help you ;-)

First step:
SELECT uid FROM fe_users WHERE tx_wecstaffdirectory_in = 1
will give you a list of all fe_user user-IDs.

Second step:
Insert a row in tx_wecstaffdirectory_info for each user. You have to set the columns pid (page-ID of the storage folder) and feuser_id (user-IDs from the first step). If you have many users, autogenerating the INSERT commands (hint: search & replace start and end of the line) will save you lots of time.

With some luck, the following query does both steps at once. (DISCLAIMER: Please test on a copy of the database before running it on your live system. The query is completely untested.)
I assume the storage folder has pid 42.

INSERT INTO tx_wecstaffdirectory_info SELECT 42 as pid, uid as feuser_id FROM fe_users WHERE tx_wecstaffdirectory_in = 1

- OR -

change the wec_staffdirectory code to INSERT a row in tx_wecstaffdirectory_info if it doesn't exist yet for the feuser_id. The record would then be created when someone enters his data.


b) to create new staff entries

AFAIK the latest version of wec_staffdirectory comes with the option to create new staff directly from the frontend (at least I submitted a patch that does this).

In my patch, this is admin-only (removing the permission check shouldn't be that hard).

Hmmm, I just see in the changelog that adding staff should be possible for non-admin users also. Even better :-)

I guess the best advise is to update to wec_staffdirectory 1.0.2 ;-)
Total Posts: 4 - Pages (1): [1]
You must login to post a message to this conference.