Modified opac search script to use itemtypesearchgroups table to generate class
list.
This commit is contained in:
parent
610d03763b
commit
a845bd2489
|
|
@ -39,7 +39,7 @@ type=radio name=ttype value=exact>Exact</td>
|
|||
<select size="1" name="class">
|
||||
<option value="">Any
|
||||
<!-- fetch class list -->
|
||||
<TMPL_INCLUDE NAME="cat-class-list.inc">
|
||||
<TMPL_VAR name="classlist">
|
||||
<!--#include virtual="/includes/cat-class-list.inc" -->
|
||||
</select>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,16 @@ require Exporter;
|
|||
use C4::Output;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use C4::Context;
|
||||
|
||||
my $classlist='';
|
||||
my $dbh=C4::Context->dbh();
|
||||
my $sth=$dbh->prepare("select groupname,itemtypes from itemtypesearchgroups order by groupname");
|
||||
$sth->execute;
|
||||
while (my ($groupname,$itemtypes) = $sth->fetchrow) {
|
||||
$classlist.="<option value=\"$itemtypes\">$groupname\n";
|
||||
}
|
||||
|
||||
|
||||
my $query = new CGI;
|
||||
|
||||
|
|
@ -15,6 +25,7 @@ my ($loggedinuser, $cookie, $sessionID) = checkauth($query ,1, $flagsrequired);
|
|||
|
||||
my $template = gettemplate("opac-search.tmpl", "opac");
|
||||
|
||||
$template->param(loggedinuser => $loggedinuser);
|
||||
$template->param(loggedinuser => $loggedinuser,
|
||||
classlist => $classlist);
|
||||
|
||||
print "Content-Type: text/html\n\n", $template->output;
|
||||
|
|
|
|||
Loading…
Reference in New Issue