rel_3_0 moved to HEAD
[koha.git] / admin / auth_tag_structure.pl
index b86a17e..0dd8524 100755 (executable)
@@ -25,7 +25,6 @@ use C4::Koha;
 use C4::Context;
 use C4::Output;
 use C4::Interface::CGI::Output;
-use C4::Search;
 use C4::Context;
 
 
@@ -118,6 +117,7 @@ if ($op eq 'add_form') {
        my $authorised_value  = CGI::scrolling_list(-name=>'authorised_value',
                        -values=> \@authorised_values,
                        -size=>1,
+                       -tabindex=>'',
                        -multiple=>0,
                        -default => $data->{'authorised_value'},
                        );
@@ -134,8 +134,8 @@ if ($op eq 'add_form') {
        $template->param('use-heading-flags-p' => 1);
        $template->param(liblibrarian => $data->{'liblibrarian'},
                                                        libopac => $data->{'libopac'},
-                                                       repeatable => CGI::checkbox('repeatable',$data->{'repeatable'}?'checked':'',1,''),
-                                                       mandatory => CGI::checkbox('mandatory',$data->{'mandatory'}?'checked':'',1,''),
+                                                       repeatable => "".$data->{'repeatable'},
+                                                       mandatory => "".$data->{'mandatory'},
                                                        authorised_value => $authorised_value,
                                                        authtypecode => $authtypecode,
                                                        );
@@ -161,7 +161,7 @@ if ($op eq 'add_form') {
                                                );
        }
        $sth->finish;
-       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=auth_tag_structure.pl?tagfield=$tagfield&authtypecode=$authtypecode\"></html>";
+       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=auth_tag_structure.pl?searchfield=$tagfield&authtypecode=$authtypecode\">";
        exit;
                                                                                                        # END $OP eq ADD_VALIDATE
 ################## DELETE_CONFIRM ##################################
@@ -210,13 +210,13 @@ if ($op eq 'add_form') {
        }
        my $env;
        my ($count,$results)=StringSearch($env,$searchfield,$authtypecode);
-       my $toggle="white";
+       my $toggle=1;
        my @loop_data = ();
        for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
-               if ($toggle eq 'white'){
-                       $toggle="#ffffcc";
+               if ($toggle eq 1){
+                       $toggle=0;
                } else {
-                       $toggle="white";
+                       $toggle=1;
                }
                my %row_data;  # get a fresh hash for the row data
                $row_data{tagfield} = $results->[$i]{'tagfield'};
@@ -227,7 +227,7 @@ if ($op eq 'add_form') {
                $row_data{subfield_link} ="auth_subfields_structure.pl?tagfield=".$results->[$i]{'tagfield'}."&authtypecode=".$authtypecode;
                $row_data{edit} = "$script_name?op=add_form&amp;searchfield=".$results->[$i]{'tagfield'}."&authtypecode=".$authtypecode;
                $row_data{delete} = "$script_name?op=delete_confirm&amp;searchfield=".$results->[$i]{'tagfield'}."&authtypecode=".$authtypecode;
-               $row_data{bgcolor} = $toggle;
+               $row_data{toggle} = $toggle;
                push(@loop_data, \%row_data);
        }
        $template->param(loop => \@loop_data,
@@ -250,7 +250,12 @@ if ($op eq 'add_form') {
        }
 } #---- END $OP eq DEFAULT
 
-$template->param(loggeninuser => $loggedinuser);
+$template->param(loggeninuser => $loggedinuser,
+               intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
+
 output_html_with_http_headers $input, $cookie, $template->output;