Fixing link to toggle between full and limited display
[koha.git] / admin / thesaurus.pl
index 3caaf3c..c1aa218 100755 (executable)
@@ -29,7 +29,7 @@ use C4::Authorities;
 
 my $input = new CGI;
 my $search_category=$input->param('search_category');
-$search_category=$input->param('category') unless $search_category;
+$search_category=$input->param('category') unless $search_category;
 #my $toponly = $input->param('toponly');
 my $branch = $input->param('branch');
 my $searchstring = $input->param('searchstring');
@@ -38,7 +38,7 @@ my $id = $input->param('id');
 my $offset=$input->param('offset');
 my $father=$input->param('father');
 
-my $reqsel="select category,stdlib,freelib from bibliothesaurus where id='$id'";
+my $reqsel="";
 my $reqdel="delete from bibliothesaurus where id='$id'";
 my $script_name="/cgi-bin/koha/admin/thesaurus.pl";
 my $dbh = C4::Context->dbh;
@@ -73,8 +73,8 @@ if ($op eq 'add_form') {
        my $data;
        if ($id) {
                my $dbh = C4::Context->dbh;
-               my $sth=$dbh->prepare("select id,category,freelib,stdlib from bibliothesaurus where id='$id'");
-               $sth->execute;
+               my $sth=$dbh->prepare("select id,category,freelib,stdlib from bibliothesaurus where id=?");
+               $sth->execute($id);
                $data=$sth->fetchrow_hashref;
                $sth->finish;
        } else {
@@ -123,8 +123,8 @@ if ($op eq 'add_form') {
 # called by default form, used to confirm deletion of data in DB
 } elsif ($op eq 'delete_confirm') {
        my $dbh = C4::Context->dbh;
-       my $sth=$dbh->prepare($reqsel);
-       $sth->execute;
+       my $sth=$dbh->prepare("select category,stdlib,freelib from bibliothesaurus where id=?");
+       $sth->execute($id);
        my $data=$sth->fetchrow_hashref;
        $sth->finish;
        $template->param(search_category => $search_category,
@@ -257,10 +257,10 @@ if ($op eq 'add_form') {
                                                        branch => $branch,
                                                        father => $father);
        if ($offset>0) {
-               $template->param(previous => "<a href=$script_name?branch=$branch&search_category=$search_category&searchstring=$searchstring&offset=$prevpage>&lt;&lt; Prev</a>");
+               $template->param(previous => "$script_name?branch=$branch&search_category=$search_category&searchstring=$searchstring&offset=$prevpage");
        }
        if ($pagesize<$count) {
-               $template->param(next => "<a href=$script_name?branch=$branch&search_category=$search_category&searchstring=$searchstring&offset=$nextpage>Next &gt;&gt;</a>");
+               $template->param(next => "$script_name?branch=$branch&search_category=$search_category&searchstring=$searchstring&offset=$nextpage");
        }
 } #---- END $OP eq DEFAULT