Gossamer Forum
Home : Products : DBMan : Discussions :

Can I set up DBMan to allow user to input several records with common information and only have to enter the common information once?

Quote Reply
Can I set up DBMan to allow user to input several records with common information and only have to enter the common information once?
I am setting up DBMan to be used as a Calendar of Events. Often, we have the same event at multiple locations. I would like for the user who will be entering the information to be able to choose to not only replace a record when using the modify option, but have an option to be able to keep the original and also add a new record with the modifiied information.

In other words, I would like to have a choice with the modify option: to either replace a record, or keep the record, and add a similar one with some of the fields changed.

If anyone needs to see my files, they are at

http://www.ebr.lib.la.us/default_cfg.txt

http://www.ebr.lib.la.us/html_pl.txt

http://www.ebr.lib.la.us/db_cgi.txt

Does anyone know if this customization is possible?

Thanks,

Elizabeth
Quote Reply
Re: [ebm76] Can I set up DBMan to allow user to input several records with common information and only have to enter the common information once? In reply to
Hi Elizabeth,

Yes, it is possible if I do not misunderstand

Put a variable called $replace_on_modify=1 or 0 in the default.cfg file
Then in the db.cgi file, in the modify_record sub,
at the beginning of this function add the following lines

if(!$replace_on_modify){&add_record()}

Hope that helps

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Can I set up DBMan to allow user to input several records with common information and only have to enter the common information once? In reply to
Tandat,

It still doesn't allow me to keep the previous entry and add a similar one rather than replace.

Thanks for replying, though, and I'm going to keep on "fiddling" with it :)



Elizabeth

Last edited by:

ebm76: Jul 17, 2002, 6:49 AM
Quote Reply
Re: [ebm76] Can I set up DBMan to allow user to input several records with common information and only have to enter the common information once? In reply to
Hi,

In this case, you may get the error message 'duplicated key', right?

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Can I set up DBMan to allow user to input several records with common information and only have to enter the common information once? In reply to
Sorry for the belated reply.

Actually, I have deleted those particular changes now but if I recall correctly nothing at all different happened. I may try again.



Thanks,

Elizabeth
Quote Reply
Re: [ebm76] Can I set up DBMan to allow user to input several records with common information and only have to enter the common information once? In reply to
I'm responding to my own problem here, but I thought the solution might help someone else. Several days ago I found a modification that would allow an entry to be made that would allow the user to input several records with common information and only enter the common information once.

For example, if I already had the record:

Name: John Smith

DOB: 10-01-70

Place of Birth: San Diego, CA

The modification whose link I will list below would allow the user entering the recrods to do a search after entering this record, click on a button labeled "Add Duplicate" to get to a form where s/he can modify the record, keep the original, and only modify the fields that have changed to produce the new record.

For example, if the next person I wanted to enter was John's sister Mary Smith who was also born in San Diego, Ca but whose DOB was 09-05-72, clicking on "Add Duplicate" would bring up the record above. The user would then change the DOB, click on "Add Record," and then have these two records:

Name: John Smith

DOB: 10-01-70

Place of Birth: San Diego, CA

AND

Name: Mary Smith

DOB: 09-05-72

Place of Birth: San Diego, CA

Make sense? Cool

As promised above, here is the link which I found by reading through Lois' Unofficial FAQ. This modification was written by Kellner.

http://webmagic.hypermart.net/.../db/text/dbfaq59.txt

I must say, the support available for this script is *amazing*!

Elizabeth