Inspired by an idea of JP Deni, which enabled me to add a "modify" button to search results that allows users to immediately jump to the modify form for a record without having to go through the modify subroutine in the footer, I thought of an alternate approach to long/short displays. The basic idea is: Search results return short displays be default. Next to each record there is a "display complete results"-button. Pressing the button gets the user to the full display for that very record.
Here's what I've done:
- in "html.pl": rename sub "html_record" to "html_record_complete"
- in "html.pl": add a new sub sub "html_record" which contains code for the short display embedded in form-tags: <form action="$db_script_url" METHOD="POST"><input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid"><input type=hidden name="complete" value="$rec{$db_key}">Here comes whatever code you need to print the short version.
<input type="SUBMIT" name="complete_record" value="complete record"></form>
- in "db.pl" (which is, in my case, called "db.cgi"), go to the section that is commented as "Main Menu". To the list of "elsif"-clauses that's already there, add the following:
elsif ($in{'complete_record'}){ if ($per_view) { &html_record_complete; } else { &html_unauth; } }
Only problem is: I always get internal server errors when I call html_record_complete by pressing the button, and have no idea why. I ran both html.pl and db.cgi from the command-line, but the syntax is OK. Any ideas on why this doesn't work?
kellner
Here's what I've done:
- in "html.pl": rename sub "html_record" to "html_record_complete"
- in "html.pl": add a new sub sub "html_record" which contains code for the short display embedded in form-tags: <form action="$db_script_url" METHOD="POST"><input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid"><input type=hidden name="complete" value="$rec{$db_key}">Here comes whatever code you need to print the short version.
<input type="SUBMIT" name="complete_record" value="complete record"></form>
- in "db.pl" (which is, in my case, called "db.cgi"), go to the section that is commented as "Main Menu". To the list of "elsif"-clauses that's already there, add the following:
elsif ($in{'complete_record'}){ if ($per_view) { &html_record_complete; } else { &html_unauth; } }
Only problem is: I always get internal server errors when I call html_record_complete by pressing the button, and have no idea why. I ran both html.pl and db.cgi from the command-line, but the syntax is OK. Any ideas on why this doesn't work?
kellner