moving fields around toCVS: ----------------------------------------------------...
[koha_fer] / admin / marctagstructure.pl
index 070ec8c..4a2315b 100755 (executable)
@@ -23,6 +23,7 @@ use CGI;
 use C4::Auth;
 use C4::Context;
 use C4::Output;
+use C4::Interface::CGI::Output;
 use C4::Search;
 use C4::Context;
 use HTML::Template;
@@ -33,7 +34,7 @@ sub StringSearch  {
        $searchstring=~ s/\'/\\\'/g;
        my @data=split(' ',$searchstring);
        my $count=@data;
-       my $query="Select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where (tagfield > $data[0]) order by tagfield";
+       my $query="Select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where (tagfield >= $data[0]) order by tagfield";
        my $sth=$dbh->prepare($query);
        $sth->execute;
        my @results;
@@ -49,6 +50,7 @@ sub StringSearch  {
 
 my $input = new CGI;
 my $searchfield=$input->param('searchfield');
+$searchfield=0 unless $searchfield;
 my $pkfield="tagfield";
 my $reqsel="select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where $pkfield='$searchfield'";
 my $offset=$input->param('offset');
@@ -186,13 +188,13 @@ if ($op eq 'add_form') {
        $template->param(loop => \@loop_data);
        if ($offset>0) {
                my $prevpage = $offset-$pagesize;
-               $template->param(previous => "<a href=$script_name?offset=".$prevpage.'>&lt;&lt; Prev</a>');
+               $template->param(previous => "<a href=\"$script_name?offset=".$prevpage.'">');
        }
        if ($offset+$pagesize<$count) {
                my $nextpage =$offset+$pagesize;
-               $template->param(next => "<a href=$script_name?offset=".$nextpage.'>Next &gt;&gt;</a>');
+               $template->param(next => "<a href=\"$script_name?offset=".$nextpage.'">');
        }
 } #---- END $OP eq DEFAULT
 
 $template->param(loggeninuser => $loggedinuser);
-print $input->header(-cookie => $cookie), $template->output;
+output_html_with_http_headers $input, $cookie, $template->output;