Gossamer Forum
Home : Products : DBMan : Customization :

Show modify page without any other action just after i add new and want to modify it?

Quote Reply
Show modify page without any other action just after i add new and want to modify it?
when user add a data, and want to modify it just after he gets sucess page, he needs to find the data he just added by using searching mod.

To omit this searching step, how can i modify script ?

I mean,
If he clicks "modify" after he added a data, the data should be shown up in modify mod directly without any other action.

It may need another "Modify" link on adding sucess page for it.

Thanks in advance.


[This message has been edited by koreags (edited June 28, 1999).]
Quote Reply
Re: Show modify page without any other action just after i add new and want to modify it? In reply to
You could make a link on the add success page.

You would have to alter your html_add_success routine a little bit.

Instead of

&html_record(&get_record($in{$db_key}));

use

%rec=&get_record($in{$db_key});
&html_record(%rec);

In the place where you want to place you extra link, use

print qq|
<a href="$db_script_link_url&$db_key=$rec{$db_key}&modify_form=1">Modify this record</a>|;


------------------
JPD





Quote Reply
Re: Show modify page without any other action just after i add new and want to modify it? In reply to
Thank you JPDeni

It works good.


Quote Reply
Re: Show modify page without any other action just after i add new and want to modify it? In reply to
Hi, JPDeni

Is it possible to handle to print "&html_footer;" according to login ID ?

1. Can omit to print "&html_footer;" , when login with default id/passwd.

2. However, when login with admin id/passwd, "&html_footer;" should be printed.

If it is not possible, can I use two names defferent db.cgi (admin-db.cgi), html.pl(admin-html.pl), default.cfg(admin-default.cfg) for one DB ?
If so, How can I handle it?
I tried this, but reads db.cgi not admin-db.cgi even though i changed some links.


Quote Reply
Re: Show modify page without any other action just after i add new and want to modify it? In reply to
You can have the html_footer print out only for admins or only for registered users or whatever you want.

If you don't want the footer to print out for default users, the easiest way to do it is to make a change to sub html_footer.

Code:
sub html_footer {
# --------------------------------------------------------
# Print the menu.
#
# We only print options that the user have permissions for.
#

unless ($db_userid eq "default") {

print qq|......[all the links in the footer]|;

}
}

Just add the part that's in bold at the beginning and end of the subroutine.

------------------
JPD





Quote Reply
Re: Show modify page without any other action just after i add new and want to modify it? In reply to
Thank you JPDeni

It works good.