koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/admin admin-home.pl aqbookfund.pl aqbudget...


From: paul poulain
Subject: [Koha-cvs] koha/admin admin-home.pl aqbookfund.pl aqbudget...
Date: Fri, 09 Mar 2007 14:30:56 +0000

CVSROOT:        /sources/koha
Module name:    koha
Changes by:     paul poulain <tipaul>   07/03/09 14:30:55

Modified files:
        admin          : admin-home.pl aqbookfund.pl aqbudget.pl 
                         authorised_values.pl 
                         auth_subfields_structure.pl 
                         auth_tag_structure.pl authtypes.pl branches.pl 
                         categorie.pl categoryitem.pl checkmarc.pl 
                         cities.pl currency.pl issuingrules.pl 
                         itemtypecategory.pl itemtypes.pl 
                         itemtypesubcategory.pl letter.pl mediatype.pl 
                         printers.pl roadtype.pl systempreferences.pl 
                         thesaurus.pl z3950servers.pl 

Log message:
        rel_3_0 moved to HEAD

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/admin/admin-home.pl?cvsroot=koha&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/koha/admin/aqbookfund.pl?cvsroot=koha&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/koha/admin/aqbudget.pl?cvsroot=koha&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/koha/admin/authorised_values.pl?cvsroot=koha&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/koha/admin/auth_subfields_structure.pl?cvsroot=koha&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/koha/admin/auth_tag_structure.pl?cvsroot=koha&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/koha/admin/authtypes.pl?cvsroot=koha&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/koha/admin/branches.pl?cvsroot=koha&r1=1.37&r2=1.38
http://cvs.savannah.gnu.org/viewcvs/koha/admin/categorie.pl?cvsroot=koha&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/koha/admin/categoryitem.pl?cvsroot=koha&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/koha/admin/checkmarc.pl?cvsroot=koha&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/koha/admin/cities.pl?cvsroot=koha&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/koha/admin/currency.pl?cvsroot=koha&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/koha/admin/issuingrules.pl?cvsroot=koha&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/koha/admin/itemtypecategory.pl?cvsroot=koha&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/koha/admin/itemtypes.pl?cvsroot=koha&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/koha/admin/itemtypesubcategory.pl?cvsroot=koha&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/koha/admin/letter.pl?cvsroot=koha&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/koha/admin/mediatype.pl?cvsroot=koha&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/koha/admin/printers.pl?cvsroot=koha&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/koha/admin/roadtype.pl?cvsroot=koha&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/koha/admin/systempreferences.pl?cvsroot=koha&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/koha/admin/thesaurus.pl?cvsroot=koha&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/koha/admin/z3950servers.pl?cvsroot=koha&r1=1.14&r2=1.15

Patches:
Index: admin-home.pl
===================================================================
RCS file: /sources/koha/koha/admin/admin-home.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- admin-home.pl       15 Nov 2006 01:41:51 -0000      1.4
+++ admin-home.pl       9 Mar 2007 14:30:55 -0000       1.5
@@ -1,18 +1,35 @@
 #!/usr/bin/perl
 
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
 use strict;
 use CGI;
 use C4::Auth;
+use C4::Output;
 use C4::Interface::CGI::Output;
 
 
+
 my $query = new CGI;
 my ($template, $loggedinuser, $cookie)
     = get_template_and_user({template_name => "admin/admin-home.tmpl",
                             query => $query,
                             type => "intranet",
                             authnotrequired => 0,
-                            flagsrequired => {parameters => 1, management => 
1, tools => 1},
+                            flagsrequired => {parameters => 1},
                             debug => 1,
                             });
 

Index: aqbookfund.pl
===================================================================
RCS file: /sources/koha/koha/admin/aqbookfund.pl,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- aqbookfund.pl       27 Sep 2006 21:19:21 -0000      1.32
+++ aqbookfund.pl       9 Mar 2007 14:30:55 -0000       1.33
@@ -52,20 +52,21 @@
 
 use strict;
 use CGI;
-use C4::Output;
+use C4::Branch; # GetBranches
 use List::Util qw/min/;
 use C4::Auth;
 use C4::Koha;
 use C4::Context;
 use C4::Bookfund;
+use C4::Output;
 use C4::Interface::CGI::Output;
-use C4::Search;
 use C4::Date;
 
 my $dbh = C4::Context->dbh;
 my $input = new CGI;
 my $script_name="/cgi-bin/koha/admin/aqbookfund.pl";
 my $bookfundid=$input->param('bookfundid');
+my $branchcodeid=$input->param('branchcode')|'';
 my $pagesize = 10;
 my $op = $input->param('op') || '';
 
@@ -75,7 +76,7 @@
          query => $input,
          type => "intranet",
          authnotrequired => 0,
-         flagsrequired => {parameters => 1, management => 1},
+         flagsrequired => {parameters => 1},
          debug => 1,
         }
     );
@@ -101,7 +102,7 @@
        my $dataaqbookfund;
        my $header;
        if ($bookfundid) {
-       $dataaqbookfund = GetBookFund($bookfundid);
+       $dataaqbookfund = GetBookFund($bookfundid,$branchcodeid);
        }
        if ($bookfundid) {
            $header = "Modify book fund";
@@ -111,7 +112,7 @@
            $template->param('header-is-add-p' => 1);
        }
        $template->param('use-header-flags-p' => 1);
-       $template->param(header => $header); 
+       $template->param(header => $header); # NOTE deprecated
        my $add_or_modify=0;
        if ($bookfundid) {
            $add_or_modify=1;
@@ -119,7 +120,7 @@
        $template->param(add_or_modify => $add_or_modify);
        $template->param(bookfundid =>$bookfundid);
        $template->param(bookfundname =>$dataaqbookfund->{'bookfundname'});
-warn $dataaqbookfund->{'bookfundname'};
+
         my @branchloop;
         foreach my $branchcode (sort keys %{$branches}) {
             my $row = {
@@ -127,7 +128,9 @@
                 branchname => $branches->{$branchcode}->{branchname},
             };
 
-            if ( $bookfundid    && $dataaqbookfund->{branchcode} eq 
$branchcode) {
+            if (defined $bookfundid
+                and defined $dataaqbookfund->{branchcode}
+                and $dataaqbookfund->{branchcode} eq $branchcode) {
                 $row->{selected} = 1;
             }
 
@@ -143,21 +146,21 @@
 elsif ($op eq 'add_validate') {
        my $bookfundid = uc $input->param('bookfundid');
 
-    my $number = Countbookfund($bookfundid);
+    my $number = Countbookfund($bookfundid,$branchcodeid);
 
     my $bookfund_already_exists = $number > 0 ? 1 : 0;
 
     if ($bookfund_already_exists) {
         my $bookfundname = $input->param('bookfundname');
         my $branchcode = $input->param('branchcode') || undef;
-
-        ModBookFund($bookfundname,$branchcode,$bookfundid);
+         warn "name :$bookfundname branch:$branchcode";
+        ModBookFund($bookfundname,$bookfundid,$branchcode);
     }
     else {
         NewBookFund(
             $bookfundid,
             $input->param('bookfundname'),
-            $input->param('branchcode')
+            $input->param('branchcode')||''
         );
     }
     $input->redirect('aqbookfund.pl');
@@ -167,16 +170,17 @@
 # called by default form, used to confirm deletion of data in DB
 
 elsif ($op eq 'delete_confirm') {
-    my $data = GetBookFund($bookfundid);
+    my $data = GetBookFund($bookfundid,$branchcodeid);
        $template->param(bookfundid => $bookfundid);
        $template->param(bookfundname => $data->{'bookfundname'});
+       $template->param(branchcode => $data->{'branchcode'});
 } # END $OP eq DELETE_CONFIRM
 
 
 ################## DELETE_CONFIRMED ##################################
 # called by delete_confirm, used to effectively confirm deletion of data in DB
 elsif ($op eq 'delete_confirmed') {
-    DelBookFund(uc($input->param('bookfundid')));
+    DelBookFund(uc($input->param('bookfundid')),$branchcodeid);
 
 }# END $OP eq DELETE_CONFIRMED
 

Index: aqbudget.pl
===================================================================
RCS file: /sources/koha/koha/admin/aqbudget.pl,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- aqbudget.pl 27 Sep 2006 21:19:21 -0000      1.24
+++ aqbudget.pl 9 Mar 2007 14:30:55 -0000       1.25
@@ -39,20 +39,22 @@
 
 use strict;
 use CGI;
+use C4::Branch; # GetBranches
 use List::Util qw/min/;
+
 use C4::Date;
 use C4::Auth;
 use C4::Acquisition;
 use C4::Context;
+use C4::Output;
 use C4::Interface::CGI::Output;
-use C4::Search;
 use C4::Koha;
-use C4::Output;
 
 my $input = new CGI;
 my $script_name="/cgi-bin/koha/admin/aqbudget.pl";
 my $bookfundid=$input->param('bookfundid');
 my $aqbudgetid=$input->param('aqbudgetid');
+my $branchcodeid=$input->param('branchcode');
 my $pagesize = 20;
 my $op = $input->param('op');
 
@@ -96,7 +98,8 @@
        budgetamount,
        aqbudget.branchcode
   FROM aqbudget
-    INNER JOIN aqbookfund ON aqbudget.bookfundid = aqbookfund.bookfundid
+    INNER JOIN aqbookfund ON (aqbudget.bookfundid = aqbookfund.bookfundid AND
+      aqbudget.branchcode = aqbookfund.branchcode)
   WHERE aqbudgetid = ?
 ';
         $sth=$dbh->prepare($query);
@@ -111,11 +114,12 @@
        aqbookfund.bookfundname
   FROM aqbookfund
     LEFT JOIN branches ON aqbookfund.branchcode = branches.branchcode
-  WHERE bookfundid = ?
+  WHERE bookfundid = ? AND aqbookfund.branchcode=?
 ';
     $sth=$dbh->prepare($query);
     $sth->execute(
         defined $aqbudgetid ? $dataaqbudget->{bookfundid} : $bookfundid,
+        $branchcodeid
     );
     $dataaqbookfund=$sth->fetchrow_hashref;
     $sth->finish;
@@ -123,12 +127,14 @@
     if (defined $aqbudgetid) {
         $template->param(
             bookfundid => $dataaqbudget->{'bookfundid'},
+            branchcode => $dataaqbudget->{'branchcode'},
             bookfundname => $dataaqbudget->{'bookfundname'}
         );
     }
     else {
         $template->param(
             bookfundid => $bookfundid,
+            branchcode => $dataaqbookfund->{'branchcode'},
             bookfundname => $dataaqbookfund->{bookfundname},
         );
     }
@@ -197,7 +203,7 @@
             format_date_in_iso($input->param('startdate')),
             format_date_in_iso($input->param('enddate')),
             $input->param('budgetamount'),
-            $input->param('branch') || undef,
+            $input->param('branch') || '',
             $aqbudgetid,
         );
         $sth->finish;
@@ -216,7 +222,7 @@
             format_date_in_iso($input->param('startdate')),
             format_date_in_iso($input->param('enddate')),
             $input->param('budgetamount'),
-            $input->param('branch') || undef,
+            $input->param('branch') || '',
         );
         $sth->finish;
     }

Index: authorised_values.pl
===================================================================
RCS file: /sources/koha/koha/admin/authorised_values.pl,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- authorised_values.pl        1 Sep 2006 22:03:00 -0000       1.18
+++ authorised_values.pl        9 Mar 2007 14:30:55 -0000       1.19
@@ -23,7 +23,7 @@
 use C4::Context;
 use C4::Output;
 use C4::Interface::CGI::Output;
-use C4::Search;
+
 use C4::Context;
 
 
@@ -58,7 +58,7 @@
                             query => $input,
                             type => "intranet",
                             authnotrequired => 0,
-                            flagsrequired => {parameters => 1, management => 
1},
+                            flagsrequired => {parameters => 1},
                             debug => 1,
                             });
 my $pagesize=20;
@@ -84,14 +84,14 @@
        } else {
                $data->{'category'} = $input->param('category');
        }
-       if ($searchfield) {
-               $template->param(action => "Modify authorised value");
+       if ($id) {
+               $template->param(action_modify => 1);
                $template->param('heading-modify-authorized-value-p' => 1);
        } elsif ( ! $data->{'category'} ) {
-               $template->param(action => "Add new category");
+               $template->param(action_add_category => 1);
                $template->param('heading-add-new-category-p' => 1);
        } else {
-               $template->param(action => "Add authorised value");
+               $template->param(action_add_value => 1);
                $template->param('heading-add-authorized-value-p' => 1);
        }
        $template->param('use-heading-flags-p' => 1);
@@ -125,7 +125,7 @@
        $sth->execute($id);
        my $data=$sth->fetchrow_hashref;
        $sth->finish;
-       
+       $id = $input->param('id') unless $id;
        $template->param(searchfield => $searchfield,
                                                        Tvalue => 
$data->{'authorised_value'},
                                                        id =>$id,
@@ -136,10 +136,10 @@
 # called by delete_confirm, used to effectively confirm deletion of data in DB
 } elsif ($op eq 'delete_confirmed') {
        my $dbh = C4::Context->dbh;
+       my $id = $input->param('id');
        my $sth=$dbh->prepare("delete from authorised_values where id=?");
        $sth->execute($id);
        $sth->finish;
-       
        print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=authorised_values.pl?searchfield=$searchfield\"></html>";
        exit;
 
@@ -158,6 +158,7 @@
                        -values=> address@hidden,
                        -default=>"",
                        -size=>1,
+                       -tabindex=>'',
                        -multiple=>0,
                        );
        if (!$searchfield) {
@@ -203,5 +204,8 @@
                );
        }
 } #---- END $OP eq DEFAULT
-
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
 output_html_with_http_headers $input, $cookie, $template->output;

Index: auth_subfields_structure.pl
===================================================================
RCS file: /sources/koha/koha/admin/auth_subfields_structure.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- auth_subfields_structure.pl 6 Sep 2006 16:21:04 -0000       1.9
+++ auth_subfields_structure.pl 9 Mar 2007 14:30:55 -0000       1.10
@@ -23,7 +23,6 @@
 use C4::Interface::CGI::Output;
 use C4::Auth;
 use CGI;
-use C4::Search;
 use C4::Context;
 
 
@@ -86,10 +85,18 @@
        my $data;
        my $dbh = C4::Context->dbh;
        my $more_subfields = $input->param("more_subfields")+1;
+       # builds kohafield tables
+       my @kohafields;
+       push @kohafields, "";
+       my $sth2=$dbh->prepare("SHOW COLUMNS from auth_header");
+       $sth2->execute;
+       while ((my $field) = $sth2->fetchrow_array) {
+               push @kohafields, "auth_header.".$field;
+       }
        
        # build authorised value list
-
-my     $sth2 = $dbh->prepare("select distinct category from 
authorised_values");
+       $sth2->finish;
+       $sth2 = $dbh->prepare("select distinct category from 
authorised_values");
        $sth2->execute;
        my @authorised_values;
        push @authorised_values,"";
@@ -99,6 +106,16 @@
        push (@authorised_values,"branches");
        push (@authorised_values,"itemtypes");
 
+    # build thesaurus categories list
+    $sth2->finish;
+    $sth2 = $dbh->prepare("select authtypecode from auth_types");
+    $sth2->execute;
+    my @authtypes;
+    push @authtypes, "";
+    while ( ( my $authtypecode ) = $sth2->fetchrow_array ) {
+        push @authtypes, $authtypecode;
+    }
+
        # build value_builder list
        my @value_builder=('');
 
@@ -107,9 +124,9 @@
        # on a standard install, /cgi-bin need to be added. 
        # test one, then the other
        my $cgidir = C4::Context->intranetdir ."/cgi-bin";
-       unless (opendir(DIR, "$cgidir/value_builder")) {
+       unless (opendir(DIR, "$cgidir/cataloguing/value_builder")) {
                $cgidir = C4::Context->intranetdir;
-               opendir(DIR, "$cgidir/value_builder") || die "can't opendir 
$cgidir/value_builder: $!";
+               opendir(DIR, "$cgidir/cataloguing/value_builder") || die "can't 
opendir $cgidir/value_builder: $!";
        } 
        while (my $line = readdir(DIR)) {
                if ($line =~ /\.pl$/) {
@@ -134,26 +151,28 @@
                }
                $row_data{tab} = CGI::scrolling_list(-name=>'tab',
                                        -id=>"tab$i",
-                                       
-values=>['-1','0','1','2','3','4','5','6','7','8','9'],
-                                       -labels => {'-1' 
=>'ignore','0'=>'0','1'=>'1','2' =>'2','3'=>'3','4'=>'4',
-                                                                       '5' 
=>'5','6'=>'6','7'=>'7',
-                                                                       '8' 
=>'8','9'=>'9',},
+                                       -values=>['-1','0'],
+                                       -labels => {'-1' =>'ignore','0'=>'0',
+                                                                       },
                                        -default=>$data->{'tab'},
                                        -size=>1,
+                                       -tabindex=>'',
                                        -multiple=>0,
                                        );
                $row_data{ohidden} = CGI::scrolling_list(-name=>'ohidden',
                                        -id=>"ohidden$i",
-                                       -values=>['0','2'],
-                                       -labels => {'0'=>'Show','2' =>'Hide',},
+                                       -values=>['0','1','2'],
+                                       -labels => {'0'=>'Show','1'=>'Show 
Collapsed',
+                                                                       '2' 
=>'Hide',
+                                                                       },
                                        -default=>substr($data->{'hidden'},0,1),
                                        -size=>1,
                                        -multiple=>0,
                                        );
                $row_data{ihidden} = CGI::scrolling_list(-name=>'ihidden',
                                        -id=>"ihidden$i",
-                                       -values=>['0','2'],
-                                       -labels => {'0'=>'Show',
+                                       -values=>['0','1','2'],
+                                       -labels => {'0'=>'Show','1'=>'Show 
Collapsed',
                                                                        '2' 
=>'Hide',
                                                                        },
                                        -default=>substr($data->{'hidden'},1,1),
@@ -166,7 +185,7 @@
                                        -labels => {'0'=>'Show','1'=>'Show 
Collapsed',
                                                                        '2' 
=>'Hide',
                                                                        },
-                                       -default=>substr($data->{'hidden'},2,1),
+                                       -default=>substr($data->{'hidden'}."  
",2,1),
                                        -size=>1,
                                        -multiple=>0,
                                        );
@@ -174,11 +193,27 @@
                $row_data{liblibrarian} = 
CGI::escapeHTML($data->{'liblibrarian'});
                $row_data{libopac} = CGI::escapeHTML($data->{'libopac'});
                $row_data{seealso} = CGI::escapeHTML($data->{'seealso'});
+               $row_data{kohafield}= CGI::scrolling_list( -name=>"kohafield",
+                                       -id=>"kohafield$i",
+                                       -values=> address@hidden,
+                                       -default=> "$data->{'kohafield'}",
+                                       -size=>1,
+                                       -multiple=>0,
+                                       );
                $row_data{authorised_value}  = 
CGI::scrolling_list(-name=>'authorised_value',
                                        -id=>'authorised_value',
                                        -values=> address@hidden,
                                        -default=>$data->{'authorised_value'},
                                        -size=>1,
+                                       -tabindex=>'',
+                                       -multiple=>0,
+                                       );
+               $row_data{frameworkcode}  = 
CGI::scrolling_list(-name=>'frameworkcode',
+                                       -id=>'frameworkcode',
+                                       -values=> address@hidden,
+                                       -default=>$data->{'frameworkcode'},
+                                       -size=>1,
+                                       -tabindex=>'',
                                        -multiple=>0,
                                        );
                $row_data{value_builder}  = 
CGI::scrolling_list(-name=>'value_builder',
@@ -186,6 +221,7 @@
                                        -values=> address@hidden,
                                        -default=>$data->{'value_builder'},
                                        -size=>1,
+                                       -tabindex=>'',
                                        -multiple=>0,
                                        );
                
@@ -220,19 +256,21 @@
        for (my $i=1;$i<=$more_subfields;$i++) {
                my %row_data;  # get a fresh hash for the row data
                $row_data{tab} = CGI::scrolling_list(-name=>'tab',
-                                       -id=>"tab$i",
-                                       
-values=>['-1','0','1','2','3','4','5','6','7','8','9'],
-                                       -labels => {'-1' 
=>'ignore','0'=>'0','1'=>'1','2' =>'2','3'=>'3','4'=>'4',
-                                                                       '5' 
=>'5','6'=>'6','7'=>'7',
-                                                                       '8' 
=>'8','9'=>'9',},
+                                       -id => "tab$i",
+                                       -values=>['-1','0'],
+                                       -labels => {'-1' =>'ignore','0'=>'0',
+                                                                       },
                                        -default=>"",
                                        -size=>1,
+                                       -tabindex=>'',
                                        -multiple=>0,
                                        );
                $row_data{ohidden} = CGI::scrolling_list(-name=>'ohidden',
                                        -id=>"ohidden$i",
-                                       -values=>['0','2'],
-                                       -labels => {'0'=>'Show','2' =>'Hide',},
+                                       -values=>['0','1','2'],
+                                       -labels => {'0'=>'Show','1'=>'Show 
Collapsed',
+                                                                       '2' 
=>'Hide',
+                                                                       },
                                        -default=>"0",
                                        -size=>1,
                                        -multiple=>0,
@@ -240,8 +278,10 @@
 
                $row_data{ihidden} = CGI::scrolling_list(-name=>'ihidden',
                                        -id=>"ihidden$i",
-                                       -values=>['0','2'],
-                                       -labels => {'0'=>'Show','2' =>'Hide',},
+                                       -values=>['0','1','2'],
+                                       -labels => {'0'=>'Show','1'=>'Show 
Collapsed',
+                                                                       '2' 
=>'Hide',
+                                                                       },
                                        -default=>"0",
                                        -size=>1,
                                        -multiple=>0,
@@ -276,11 +316,34 @@
                        -checked => '',
                        -value => 1,
                        -label => '');
-               
+               $row_data{kohafield}= CGI::scrolling_list( -name=>'kohafield',
+                                       -id => "kohafield$i",
+                                       -values=> address@hidden,
+                                       -default=> "",
+                                       -size=>1,
+                                       -multiple=>0,
+                                       );
+               $row_data{frameworkcode}  = 
CGI::scrolling_list(-name=>'frameworkcode',
+                                       -id=>'frameworkcode',
+                                       -values=> address@hidden,
+                                       -default=>$data->{'frameworkcode'},
+                                       -size=>1,
+                                       -tabindex=>'',
+                                       -multiple=>0,
+                                       );
                $row_data{authorised_value}  = 
CGI::scrolling_list(-name=>'authorised_value',
                                        -id => 'authorised_value',
                                        -values=> address@hidden,
                                        -size=>1,
+                                       -tabindex=>'',
+                                       -multiple=>0,
+                                       );
+               $row_data{value_builder}  = 
CGI::scrolling_list(-name=>'value_builder',
+                                       -id=>'value_builder',
+                                       -values=> address@hidden,
+                                       -default=>$data->{'value_builder'},
+                                       -size=>1,
+                                       -tabindex=>'',
                                        -multiple=>0,
                                        );
                $row_data{link} = CGI::checkbox( -name => "link",
@@ -296,7 +359,7 @@
        $template->param('use-heading-flags-p' => 1);
        $template->param('heading-edit-subfields-p' => 1);
        $template->param(action => "Edit subfields",
-                                                       tagfield => "<input 
type=\"hidden\" name=\"tagfield\" value=\"$tagfield\">$tagfield",
+                                                       tagfield => "<input 
type=\"hidden\" name=\"tagfield\" value=\"$tagfield\" />$tagfield",
                                                        loop => address@hidden,
                                                        more_subfields => 
$more_subfields,
                                                        more_tag => $tagfield);
@@ -307,20 +370,21 @@
 } elsif ($op eq 'add_validate') {
        my $dbh = C4::Context->dbh;
        $template->param(tagfield => "$input->param('tagfield')");
-       my $sth=$dbh->prepare("replace auth_subfield_structure 
(tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,tab,seealso,authorised_value,authtypecode,value_builder,hidden,isurl,
 link)
-                                                                       values 
(?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
+       my $sth=$dbh->prepare("replace auth_subfield_structure 
(authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,frameworkcode,value_builder,hidden,isurl,
 link)
+                                                                       values 
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
        my @tagsubfield = $input->param('tagsubfield');
        my @liblibrarian        = $input->param('liblibrarian');
        my @libopac             = $input->param('libopac');
+       my @kohafield           = $input->param('kohafield');
        my @tab                         = $input->param('tab');
        my @seealso             = $input->param('seealso');
-       #my @hidden             = $input->param('hidden');
        my @hidden;
        my @ohidden             = $input->param('ohidden');
        my @ihidden             = $input->param('ihidden');
        my @ehidden             = $input->param('ehidden');
        my @authorised_values   = $input->param('authorised_value');
-#      my $authtypecodes       = $input->param('authtypecode');
+       my $authtypecode        = $input->param('authtypecode');
+       my @frameworkcodes      = $input->param('frameworkcode');
        my @value_builder       =$input->param('value_builder');
        my @link                =$input->param('link');
        for (my $i=0; $i<= $#tagsubfield ; $i++) {
@@ -331,32 +395,32 @@
                my $libopac                     =$libopac[$i];
                my $repeatable          =$input->param("repeatable$i")?1:0;
                my $mandatory           =$input->param("mandatory$i")?1:0;
-
+               my $kohafield           =$kohafield[$i];
                my $tab                         =$tab[$i];
                my $seealso                             =$seealso[$i];
                my $authorised_value            =$authorised_values[$i];
-#              my $authtypecode                =$authtypecodes;
+               my $frameworkcode               =$frameworkcodes[$i];
                my $value_builder=$value_builder[$i];
                my $hidden = $ohidden[$i].$ihidden[$i].$ehidden[$i]; #collate 
from 3 hiddens;
                my $isurl = $input->param("isurl$i")?1:0;
                my $link = $input->param("link$i")?1:0;
                if ($liblibrarian) {
                        unless (C4::Context->config('demo') eq 1) {
-                               $sth->execute ($tagfield,
+                               $sth->execute($authtypecode,
+                              $tagfield,
                                                                        
$tagsubfield,
                                                                        
$liblibrarian,
                                                                        
$libopac,
                                                                        
$repeatable,
                                                                        
$mandatory,
+                              $kohafield,
                                                                        $tab,
                                                                        
$seealso,
                                                                        
$authorised_value,
-                                                                       
$authtypecode,
+                              $frameworkcode,
                                                                        
$value_builder,
                                                                        $hidden,
                                                                        $isurl,
-                                                                       
-
         $link,
                                              );
                        }
@@ -413,6 +477,7 @@
                $row_data{tagfield} = $results->[$i]{'tagfield'};
                $row_data{tagsubfield} = $results->[$i]{'tagsubfield'};
                $row_data{liblibrarian} = $results->[$i]{'liblibrarian'};
+               $row_data{kohafield} = $results->[$i]{'kohafield'};
                $row_data{repeatable} = $results->[$i]{'repeatable'};
                $row_data{mandatory} = $results->[$i]{'mandatory'};
                $row_data{tab} = $results->[$i]{'tab'};

Index: auth_tag_structure.pl
===================================================================
RCS file: /sources/koha/koha/admin/auth_tag_structure.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- auth_tag_structure.pl       1 Sep 2006 22:03:00 -0000       1.7
+++ auth_tag_structure.pl       9 Mar 2007 14:30:55 -0000       1.8
@@ -25,7 +25,6 @@
 use C4::Context;
 use C4::Output;
 use C4::Interface::CGI::Output;
-use C4::Search;
 use C4::Context;
 
 
@@ -118,6 +117,7 @@
        my $authorised_value  = CGI::scrolling_list(-name=>'authorised_value',
                        -values=> address@hidden,
                        -size=>1,
+                       -tabindex=>'',
                        -multiple=>0,
                        -default => $data->{'authorised_value'},
                        );
@@ -134,8 +134,8 @@
        $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 @@
                                                );
        }
        $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 @@
        }
        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 @@
                $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 => address@hidden,
@@ -250,7 +250,12 @@
        }
 } #---- 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;
 
 

Index: authtypes.pl
===================================================================
RCS file: /sources/koha/koha/admin/authtypes.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- authtypes.pl        1 Sep 2006 22:03:00 -0000       1.6
+++ authtypes.pl        9 Mar 2007 14:30:55 -0000       1.7
@@ -25,10 +25,10 @@
 use CGI;
 use C4::Context;
 use C4::Output;
-use C4::Search;
 use C4::Auth;
 use C4::Interface::CGI::Output;
 
+
 sub StringSearch  {
        my ($env,$searchstring,$type)address@hidden;
        my $dbh = C4::Context->dbh;
@@ -68,7 +68,7 @@
                                                $op              => 1); # we 
show only the TMPL_VAR names $op
 } else {
 $template->param(script_name => $script_name,
-                                               else              => 1); # we 
show only the TMPL_VAR names $op
+                                               'else'              => 1); # we 
show only the TMPL_VAR names $op
 }
 ################## ADD_FORM ##################################
 # called by default. Used to create form to add or  modify a record
@@ -83,7 +83,7 @@
                $data=$sth->fetchrow_hashref;
                $sth->finish;
        }
-#      warn "=> $data->{'authtypetext'} : ".$data->{'summary'};
+       warn "=> $data->{'authtypetext'} : ".$data->{'summary'};
        $template->param(authtypecode => $authtypecode,
                                                        authtypetext => 
$data->{'authtypetext'},
                                                        auth_tag_to_report => 
$data->{'auth_tag_to_report'},
@@ -170,6 +170,10 @@
                $template->param(next => "$script_name?offset=".$nextpage);
        }
 } #---- END $OP eq DEFAULT
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
 output_html_with_http_headers $input, $cookie, $template->output;
 
 # Local Variables:

Index: branches.pl
===================================================================
RCS file: /sources/koha/koha/admin/branches.pl,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- branches.pl 11 Sep 2006 17:41:54 -0000      1.37
+++ branches.pl 9 Mar 2007 14:30:55 -0000       1.38
@@ -1,7 +1,5 @@
 #!/usr/bin/perl
 
-
-
 # Copyright 2000-2002 Katipo Communications
 #
 # This file is part of Koha.
@@ -19,159 +17,249 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
+=head1 branches.pl
+
+ FIXME: individual fields in branch address need to be exported to templates,
+        in order to fix bug 180; need to notify translators
+FIXME: looped html (e.g., list of checkboxes) need to be properly
+        TMPL_LOOP'ized; doing this properly will fix bug 130; need to
+        notify translators
+ FIXME: need to implement the branch categories stuff
+ FIXME: there are too many TMPL_IF's; the proper way to do it is to have
+        separate templates for each individual action; need to notify
+        translators
+ FIXME: there are lots of error messages exported to the template; a lot
+        of these should be converted into exported booleans / counters etc
+        so that the error messages can be localized; need to notify translators
+
+ NOTE:  heading() should now be called like this:
+        1. Use heading() as before
+        2. $template->param('heading-LISPISHIZED-HEADING-p' => 1);
+        3. $template->param('use-heading-flags-p' => 1);
+        This ensures that both converted and unconverted templates work
+
+ Finlay working on this file from 26-03-2002
+ Reorganising this branches admin page.....
+ 
+=cut
+
 use strict;
 use CGI;
 use C4::Auth;
 use C4::Context;
 use C4::Output;
 use C4::Interface::CGI::Output;
-use C4::Search;
-# Fixed variables
-my $linecolor1='#ffffcc';
-my $linecolor2='white';
-
-my $script_name="/cgi-bin/koha/admin/branches.pl";
-my $pagesize=20;
+use C4::Koha;
+use C4::Branch;
 
+# Fixed variables
+my $script_name = "/cgi-bin/koha/admin/branches.pl";
+my $pagesize    = 20;
 
-#######################################################################################
+################################################################################
 # Main loop....
 my $input = new CGI;
-my $branchcode=$input->param('branchcode');
-my $branchname=$input->param('branchname');
+my $branchcode   = $input->param('branchcode');
+my $branchname   = $input->param('branchname');
 my $categorycode = $input->param('categorycode');
 my $op = $input->param('op');
 
-my ($template, $borrowernumber, $cookie)
-    = get_template_and_user({template_name => "admin/branches.tmpl",
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+    {
+        template_name   => "admin/branches.tmpl",
                             query => $input,
                             type => "intranet",
                             authnotrequired => 0,
-                            flagsrequired => {parameters => 1, management => 
1},
+        flagsrequired   => { parameters => 1},
                             debug => 1,
-                            });
+    }
+);
 if ($op) {
-       $template->param(script_name => $script_name,
-                               $op         => 1); # we show only the TMPL_VAR 
names $op
-} else {
-       $template->param(script_name => $script_name,
-                               else        => 1); # we show only the TMPL_VAR 
names $op
+    $template->param(
+        script_name => $script_name,
+        $op         => 1
+    );    # we show only the TMPL_VAR names $op
+}
+else {
+    $template->param(
+        script_name => $script_name,
+        else        => 1
+    );    # we show only the TMPL_VAR names $op
 }
-$template->param(action => $script_name);
-if ($op eq 'add') {
+$template->param( action => $script_name );
+if ( $op eq 'add' ) {
+
        # If the user has pressed the "add new branch" button.
-       heading("Branches: Add Branch");
-       $template->param('heading-branches-add-branch-p' => 1);
-       $template->param('use-heading-flags-p' => 1);
-       editbranchform();
+    $template->param( 'heading-branches-add-branch-p' => 1 );
+    editbranchform($branchcode,$template);
+
+}
+elsif ( $op eq 'edit' ) {
 
-} elsif ($op eq 'edit') {
        # if the user has pressed the "edit branch settings" button.
-       heading("Branches: Edit Branch");
-       $template->param('heading-branches-edit-branch-p' => 1);
-       $template->param('use-heading-flags-p' => 1);
-       $template->param(add => 1);
-       editbranchform($branchcode);
-} elsif ($op eq 'add_validate') {
+    $template->param( 'heading-branches-add-branch-p' => 0,
+                        'add' => 1, );
+    editbranchform($branchcode,$template);
+}
+elsif ( $op eq 'add_validate' ) {
+
        # confirm settings change...
        my $params = $input->Vars;
-       unless ($params->{'branchcode'} && $params->{'branchname'}) {
-               default ("Cannot change branch record: You must specify a 
Branchname and a Branchcode");
-       } else {
-               setbranchinfo($params);
-               $template->param(else => 1);
-               default ("Branch record changed for branch: 
$params->{'branchname'}");
+    unless ( $params->{'branchcode'} && $params->{'branchname'} ) {
+        $template->param( else => 1 );
+        default("MESSAGE1",$template);
        }
-} elsif ($op eq 'delete') {
+    else {
+        ModBranch($params);
+        $template->param( else => 1 );
+        default("MESSAGE2",$template);
+    }
+}
+elsif ( $op eq 'delete' ) {
        # if the user has pressed the "delete branch" button.
-       my $message = checkdatabasefor($branchcode);
+    
+    # check to see if the branchcode is being used in the database 
somewhere....
+    my $dbh = C4::Context->dbh;
+    my $sth = $dbh->prepare("select count(*) from items where holdingbranch=? 
or homebranch=?");
+    $sth->execute( $branchcode, $branchcode );
+    my ($total) = $sth->fetchrow_array;
+    $sth->finish;
+    
+    my $message;
+
+    if ($total) {
+        $message = "MESSAGE7";
+    }
+   
        if ($message) {
-               $template->param(else => 1);
-               default($message);
-       } else {
-               $template->param(branchname => $branchname);
-               $template->param(delete_confirm => 1);
-               $template->param(branchcode => $branchcode);
+        $template->param( else => 1 );
+        default($message,$template);
        }
-} elsif ($op eq 'delete_confirmed') {
+    else {
+        $template->param( branchname     => $branchname );
+        $template->param( delete_confirm => 1 );
+        $template->param( branchcode     => $branchcode );
+    }
+}
+elsif ( $op eq 'delete_confirmed' ) {
+
        # actually delete branch and return to the main screen....
-       deletebranch($branchcode);
-       $template->param(else => 1);
-       default("The branch \"$branchname\" ($branchcode) has been deleted.");
-} elsif ($op eq 'editcategory') {
+    DelBranch($branchcode);
+    $template->param( else => 1 );
+    default("MESSAGE3",$template);
+}
+elsif ( $op eq 'editcategory' ) {
+
        # If the user has pressed the "add new category" or "modify" buttons.
-       heading("Branches: Edit Category");
-       $template->param('heading-branches-edit-category-p' => 1);
-       $template->param('use-heading-flags-p' => 1);
-       editcatform($categorycode);
-} elsif ($op eq 'addcategory_validate') {
+    $template->param( 'heading-branches-edit-category-p' => 1 );
+    editcatform($categorycode,$template);
+}
+elsif ( $op eq 'addcategory_validate' ) {
+
        # confirm settings change...
        my $params = $input->Vars;
-       unless ($params->{'categorycode'} && $params->{'categoryname'}) {
-               default ("Cannot change branch record: You must specify a 
Branchname and a Branchcode");
-       } else {
-               setcategoryinfo($params);
-               $template->param(else => 1);
-               default ("Category record changed for category 
$params->{'categoryname'}");
+    unless ( $params->{'categorycode'} && $params->{'categoryname'} ) {
+        $template->param( else => 1 );
+        default("MESSAGE4",$template);
        }
-} elsif ($op eq 'delete_category') {
+    else {
+        ModBranchCategoryInfo($params);
+        $template->param( else => 1 );
+        default("MESSAGE5",$template);
+    }
+}
+elsif ( $op eq 'delete_category' ) {
+
        # if the user has pressed the "delete branch" button.
-       my $message = checkcategorycode($categorycode);
+    my $message = "MESSAGE8" if CheckBranchCategorycode($categorycode);
        if ($message) {
-               $template->param(else => 1);
-               default($message);
-       } else {
-               $template->param(delete_category => 1);
-               $template->param(categorycode => $categorycode);
+        $template->param( else => 1 );
+        default($message,$template);
+    }
+    else {
+        $template->param( delete_category => 1 );
+        $template->param( categorycode    => $categorycode );
        }
-} elsif ($op eq 'categorydelete_confirmed') {
+}
+elsif ( $op eq 'categorydelete_confirmed' ) {
+
        # actually delete branch and return to the main screen....
-       deletecategory($categorycode);
-       $template->param(else => 1);
-       default("The category with code $categorycode has been deleted.");
+    DeleteBranchCategory($categorycode);
+    $template->param( else => 1 );
+    default("MESSAGE6",$template);
 
-} else {
-       # if no operation has been set...
-       default();
 }
+else {
 
+    # if no operation has been set...
+    default("",$template);
+}
 
-
-######################################################################################################
+################################################################################
 #
 # html output functions....
 
 sub default {
-       my ($message) = @_;
-       heading("Branches");
-       $template->param('heading-branches-p' => 1);
-       $template->param('use-heading-flags-p' => 1);
-       $template->param(message => $message);
-       $template->param(action => $script_name);
-       branchinfotable();
-}
-
-# FIXME: this function should not exist; otherwise headings are untranslatable
-sub heading {
-       my ($head) = @_;
-       $template->param(head => $head);
+    my ($message,$innertemplate) = @_;
+    $innertemplate->param( 'heading-branches-p' => 1 );
+    $innertemplate->param( "$message"           => 1 );
+    $innertemplate->param( action               => $script_name );
+    branchinfotable("",$innertemplate);
 }
 
 sub editbranchform {
-       # prepares the edit form...
-       my ($branchcode) = @_;
+    my ($branchcode,$innertemplate) = @_;
+    # initiate the scrolling-list to select the printers
+    my %env;
+    my $printers = GetPrinters( \%env );
+    my @printerloop;
+    my $printercount = 0;
+    my $oldprinter;
+    my $CGIprinter;
+    
        my $data;
+
        if ($branchcode) {
-               $data = getbranchinfo($branchcode);
+        $data = GetBranchInfo($branchcode);
                $data = $data->[0];
-               $template->param(branchcode => $data->{'branchcode'});
-               $template->param(branchname => $data->{'branchname'});
-               $template->param(branchaddress1 => $data->{'branchaddress1'});
-               $template->param(branchaddress2 => $data->{'branchaddress2'});
-               $template->param(branchaddress3 => $data->{'branchaddress3'});
-               $template->param(branchphone => $data->{'branchphone'});
-               $template->param(branchfax => $data->{'branchfax'});
-               $template->param(branchemail => $data->{'branchemail'});
+
+        # get the old printer of the branch
+        $oldprinter = $data->{'branchprinter'};
+
+        #      printer loop
+        foreach my $thisprinter ( keys %$printers ) {
+            my $selected = 1
+              if $oldprinter eq $printers->{$thisprinter}->{'printqueue'};
+            my %row = (
+                value         => $thisprinter,
+                selected      => $selected,
+                branchprinter => $printers->{$thisprinter}->{'printqueue'},
+            );
+            push @printerloop, \%row;
+        }
+
+        $innertemplate->param( 
+             printerloop    => address@hidden,
+             branchcode     => $data->{'branchcode'},
+             branch_name    => $data->{'branchname'},
+             branchaddress1 => $data->{'branchaddress1'},
+             branchaddress2 => $data->{'branchaddress2'},
+             branchaddress3 => $data->{'branchaddress3'},
+             branchphone    => $data->{'branchphone'},
+             branchfax      => $data->{'branchfax'},
+             branchemail    => $data->{'branchemail'},
+             branchip       => $data->{'branchip'} 
+        );
+    }
+    else {    #case of an add branch select printer
+        foreach my $thisprinter ( keys %$printers ) {
+            my %row = (
+                value         => $thisprinter,
+                branchprinter => $printers->{$thisprinter}->{'printqueue'},
+            );
+            push @printerloop, \%row;
+        }
+        $innertemplate->param( printerloop => address@hidden );
     }
 
     # make the checkboxs.....
@@ -181,66 +269,75 @@
     # 'checked' fields. The $checked field is either '' or 'checked'
     # (see bug 130)
     #
-    my $catinfo = getcategoryinfo();
+    my $catinfo = GetBranchCategory();
     my $catcheckbox;
-#    print DEBUG "catinfo=".cvs($catinfo)."\n";
+
+    #    print DEBUG "catinfo=".cvs($catinfo)."\n";
     my @categoryloop = ();
     foreach my $cat (@$catinfo) {
        my $checked = "";
-       my $tmp = quotemeta($cat->{'categorycode'});
-       if (grep {/^$tmp$/} @{$data->{'categories'}}) {
+        my $tmp     = quotemeta( $cat->{'categorycode'} );
+        if ( grep { /^$tmp$/ } @{ $data->{'categories'} } ) {
                $checked = "checked=\"checked\"";
        }
-       push @categoryloop, {
+        push @categoryloop,
+          {
                categoryname    => $cat->{'categoryname'},
                categorycode    => $cat->{'categorycode'},
                codedescription => $cat->{'codedescription'},
                checked         => $checked,
            };
        }
-       $template->param(categoryloop => address@hidden);
+    $innertemplate->param( categoryloop => address@hidden );
 
     # {{{ Leave this here until bug 130 is completely resolved in the templates
-       for my $obsolete ('categoryname', 'categorycode', 'codedescription') {
-               $template->param($obsolete => 'Your template is out of date 
(bug 130)');
+    for my $obsolete ( 'categoryname', 'categorycode', 'codedescription' ) {
+        $innertemplate->param(
+            $obsolete => 'Your template is out of date (bug 130)' );
        }
+
     # }}}
 }
 
 sub editcatform {
+
        # prepares the edit form...
-       my ($categorycode) = @_;
+    my ($categorycode,$innertemplate) = @_;
        warn "cat : $categorycode";
        my $data;
        if ($categorycode) {
-               $data = getcategoryinfo($categorycode);
+        $data = GetBranchCategory($categorycode);
                $data = $data->[0];
-               $template->param(categorycode => $data->{'categorycode'});
-               $template->param(categoryname => $data->{'categoryname'});
-               $template->param(codedescription => $data->{'codedescription'});
+        $innertemplate->param( categorycode    => $data->{'categorycode'} );
+        $innertemplate->param( categoryname    => $data->{'categoryname'} );
+        $innertemplate->param( codedescription => $data->{'codedescription'} );
     }
 }
 
 sub deleteconfirm {
-# message to print if the
+
+    # message to print if the
     my ($branchcode) = @_;
 }
 
-
 sub branchinfotable {
+
 # makes the html for a table of branch info from reference to an array of 
hashs.
 
-       my ($branchcode) = @_;
+    my ($branchcode,$innertemplate) = @_;
        my $branchinfo;
        if ($branchcode) {
-               $branchinfo = getbranchinfo($branchcode);
-       } else {
-               $branchinfo = getbranchinfo();
+        $branchinfo = GetBranchInfo($branchcode);
        }
-       my $color;
-       my @loop_data =();
+    else {
+        $branchinfo = GetBranchInfo();
+    }
+    my $toggle;
+    my $i;
+    my @loop_data = ();
        foreach my $branch (@$branchinfo) {
-               ($color eq $linecolor1) ? ($color=$linecolor2) : 
($color=$linecolor1);
+        ( $i % 2 ) ? ( $toggle = 1 ) : ( $toggle = 0 );
+
                #
                # We export the following fields to the template. These are not
                # pre-composed as a single "address" field because the template
@@ -267,28 +364,37 @@
 
                # Handle address fields separately
                my $address_empty_p = 1;
-               for my $field ('branchaddress1', 'branchaddress2', 
'branchaddress3',
-                       'branchphone', 'branchfax', 'branchemail') {
+        for my $field (
+            'branchaddress1', 'branchaddress2',
+            'branchaddress3', 'branchphone',
+            'branchfax',      'branchemail',
+            'branchip',       'branchprinter'
+          )
+        {
                        $row{$field} = $branch->{$field};
                        if ( $branch->{$field} ) {
                                $address_empty_p = 0;
                        }
                }
                $row{'address-empty-p'} = $address_empty_p;
+
                # {{{ Leave this here until bug 180 is completely resolved in 
templates
                $row{'address'} = 'Your template is out of date (see bug 180)';
+
                # }}}
 
                # Handle categories
                my $no_categories_p = 1;
                my @categories = '';
-               foreach my $cat (@{$branch->{'categories'}}) {
-                       my ($catinfo) = @{getcategoryinfo($cat)};
-                       push @categories, {'categoryname' => 
$catinfo->{'categoryname'}};
+        foreach my $cat ( @{ $branch->{'categories'} } ) {
+            my ($catinfo) = @{ GetBranchCategory($cat) };
+            push @categories, { 'categoryname' => $catinfo->{'categoryname'} };
                        $no_categories_p = 0;
                }
+
                # {{{ Leave this here until bug 180 is completely resolved in 
templates
                $row{'categories'} = 'Your template is out of date (see bug 
180)';
+
                # }}}
                $row{'category_list'} = address@hidden;
                $row{'no-categories-p'} = $no_categories_p;
@@ -296,212 +402,55 @@
                # Handle all other fields
                $row{'branch_name'} = $branch->{'branchname'};
                $row{'branch_code'} = $branch->{'branchcode'};
-               $row{'color'} = $color;
+        $row{'toggle'}      = $toggle;
                $row{'value'} = $branch->{'branchcode'};
                $row{'action'} = '/cgi-bin/koha/admin/branches.pl';
 
-               push @loop_data, { %row };
+        push @loop_data, {%row};
+        $i++;
        }
-       my @branchcategories =();
-       my $catinfo = getcategoryinfo();
+    my @branchcategories = ();
+    my $catinfo          = GetBranchCategory();
+    $i = 0;
        foreach my $cat (@$catinfo) {
-               push @branchcategories, {
+        ( $i % 2 ) ? ( $toggle = 1 ) : ( $toggle = 0 );
+        push @branchcategories,
+          {
+            toggle          => $toggle,
                        categoryname    => $cat->{'categoryname'},
                        categorycode    => $cat->{'categorycode'},
                        codedescription => $cat->{'codedescription'},
                };
+        $i++;
        }
 
-       $template->param(branches => address@hidden,
-                                                       branchcategories => 
address@hidden);
+    $innertemplate->param(
+        branches         => address@hidden,
+        branchcategories => address@hidden
+    );
 
 }
 
 # FIXME logic seems wrong
 sub branchcategoriestable {
-#Needs to be implemented...
+    my $innertemplate = shift;
+    #Needs to be implemented...
 
-    my $categoryinfo = getcategoryinfo();
+    my $categoryinfo = GetBranchCategory();
     my $color;
     foreach my $cat (@$categoryinfo) {
-       ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
-       $template->param(color => $color);
-       $template->param(categoryname => $cat->{'categoryname'});
-       $template->param(categorycode => $cat->{'categorycode'});
-       $template->param(codedescription => $cat->{'codedescription'});
-    }
-}
-
-######################################################################################################
-#
-# Database functions....
-
-sub getbranchinfo {
-# returns a reference to an array of hashes containing branches,
-
-    my ($branchcode) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth;
-    if ($branchcode) {
-               $sth = $dbh->prepare("Select * from branches where branchcode = 
? order by branchcode");
-               $sth->execute($branchcode);
-    } else {
-               $sth = $dbh->prepare("Select * from branches order by 
branchcode");
-               $sth->execute();
-    }
-    my @results;
-    while (my $data = $sth->fetchrow_hashref) {
-       my $nsth = $dbh->prepare("select categorycode from branchrelations 
where branchcode = ?");
-       $nsth->execute($data->{'branchcode'});;
-       my @cats = ();
-       while (my ($cat) = $nsth->fetchrow_array) {
-           push(@cats, $cat);
-       }
-       $nsth->finish;
-       $data->{'categories'} = address@hidden;
-       push(@results, $data);
-    }
-    $sth->finish;
-    return address@hidden;
-}
-
-# FIXME This doesn't belong here; it should be moved into a module
-sub getcategoryinfo {
-# returns a reference to an array of hashes containing branches,
-       my ($catcode) = @_;
-       my $dbh = C4::Context->dbh;
-       my $sth;
-       #    print DEBUG "getcategoryinfo: entry: catcode=".cvs($catcode)."\n";
-       if ($catcode) {
-               $sth = $dbh->prepare("select * from branchcategories where 
categorycode = ?");
-               $sth->execute($catcode);
-       } else {
-               $sth = $dbh->prepare("Select * from branchcategories");
-               $sth->execute();
-       }
-       my @results;
-       while (my $data = $sth->fetchrow_hashref) {
-               push(@results, $data);
-       }
-       $sth->finish;
-       #    print DEBUG "getcategoryinfo: exit: returning 
".cvs(address@hidden)."\n";
-       return address@hidden;
-}
-
-# FIXME This doesn't belong here; it should be moved into a module
-sub setbranchinfo {
-# sets the data from the editbranch form, and writes to the database...
-       my ($data) = @_;
-       my $dbh = C4::Context->dbh;
-       my $sth=$dbh->prepare("replace branches 
(branchcode,branchname,branchaddress1,branchaddress2,branchaddress3,branchphone,branchfax,branchemail)
 values (?,?,?,?,?,?,?,?)");
-       $sth->execute(uc($data->{'branchcode'}), $data->{'branchname'},
-               $data->{'branchaddress1'}, $data->{'branchaddress2'},
-               $data->{'branchaddress3'}, $data->{'branchphone'},
-               $data->{'branchfax'}, $data->{'branchemail'});
-
-       $sth->finish;
-       # sort out the categories....
-       my @checkedcats;
-       my $cats = getcategoryinfo();
-       foreach my $cat (@$cats) {
-               my $code = $cat->{'categorycode'};
-               if ($data->{$code}) {
-                       push(@checkedcats, $code);
-               }
-       }
-       my $branchcode =uc($data->{'branchcode'});
-       my $branch = getbranchinfo($branchcode);
-       $branch = $branch->[0];
-       my $branchcats = $branch->{'categories'};
-       my @addcats;
-       my @removecats;
-       foreach my $bcat (@$branchcats) {
-               unless (grep {/^$bcat$/} @checkedcats) {
-                       push(@removecats, $bcat);
-               }
-       }
-       foreach my $ccat (@checkedcats){
-               unless (grep {/^$ccat$/} @$branchcats) {
-                       push(@addcats, $ccat);
-               }
-       }
-       foreach my $cat (@addcats) {
-               my $sth = $dbh->prepare("insert into branchrelations 
(branchcode, categorycode) values(?, ?)");
-               $sth->execute($branchcode, $cat);
-               $sth->finish;
-       }
-       foreach my $cat (@removecats) {
-               my $sth = $dbh->prepare("delete from branchrelations where 
branchcode=? and categorycode=?");
-               $sth->execute($branchcode, $cat);
-               $sth->finish;
-       }
-}
-
-sub deletebranch {
-# delete branch...
-    my ($branchcode) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth=$dbh->prepare("delete from branches where branchcode = ?");
-    $sth->execute($branchcode);
-    $sth->finish;
-}
-
-sub setcategoryinfo {
-# sets the data from the editbranch form, and writes to the database...
-       my ($data) = @_;
-       my $dbh = C4::Context->dbh;
-       my $sth=$dbh->prepare("replace branchcategories 
(categorycode,categoryname,codedescription) values (?,?,?)");
-       $sth->execute(uc($data->{'categorycode'}), 
$data->{'categoryname'},$data->{'codedescription'});
-
-       $sth->finish;
-}
-sub deletecategory {
-# delete branch...
-    my ($categorycode) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth=$dbh->prepare("delete from branchcategories where categorycode = 
?");
-    $sth->execute($categorycode);
-    $sth->finish;
-}
-
-sub checkdatabasefor {
-# check to see if the branchcode is being used in the database somewhere....
-    my ($branchcode) = @_;
-my @kohafield;
-my @value;
-my @relation;
-my @and_or;
- push @kohafield, "holdingbranch","homebranch";
-push @value, $branchcode,$branchcode;
-push @and_or, "address@hidden";
-push @relation ,"address@hidden 5=100","address@hidden 5=100"; ##do not 
truncate
-    my ($total,@results) 
=ZEBRAsearch_kohafields(address@hidden,address@hidden, address@hidden,"", 
address@hidden);
-   
-    my $message;
-    if ($total) {
-       # We do not return verbal messages but a flag. fix templates to accept 
$error=1 as a message
-       $message = "Branch cannot be deleted because there are $total items 
using that branch.";
-       
-    }
-    return $message;
-}
-
-sub checkcategorycode {
-# check to see if the branchcode is being used in the database somewhere....
-    my ($categorycode) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth=$dbh->prepare("select count(*) from branchrelations where 
categorycode=?");
-    $sth->execute($categorycode);
-    my ($total) = $sth->fetchrow_array;
-    $sth->finish;
-    my $message;
-    if ($total) {
-       # FIXME: need to be replaced by an exported boolean parameter
-       $message = "Category cannot be deleted because there are $total 
branches using that category.";
+        $innertemplate->param( categoryname    => $cat->{'categoryname'} );
+        $innertemplate->param( categorycode    => $cat->{'categorycode'} );
+        $innertemplate->param( codedescription => $cat->{'codedescription'} );
     }
-    return $message;
 }
 
+$template->param(
+    intranetcolorstylesheet =>
+      C4::Context->preference("intranetcolorstylesheet"),
+    intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+    IntranetNav        => C4::Context->preference("IntranetNav"),
+);
 output_html_with_http_headers $input, $cookie, $template->output;
 
 # Local Variables:

Index: categorie.pl
===================================================================
RCS file: /sources/koha/koha/admin/categorie.pl,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- categorie.pl        1 Sep 2006 22:03:00 -0000       1.24
+++ categorie.pl        9 Mar 2007 14:30:55 -0000       1.25
@@ -38,10 +38,9 @@
 
 use strict;
 use CGI;
-
 use C4::Context;
 use C4::Output;
-use C4::Search;
+
 use C4::Auth;
 use C4::Interface::CGI::Output;
 
@@ -51,7 +50,7 @@
        $searchstring=~ s/\'/\\\'/g;
        my @data=split(' ',$searchstring);
        my address@hidden;
-       my $sth=$dbh->prepare("Select * from categories where (description like 
?)");
+       my $sth=$dbh->prepare("Select * from categories where (description like 
?) order by category_type,description");
        $sth->execute("$data[0]%");
        my @results;
        while (my $data=$sth->fetchrow_hashref){
@@ -92,7 +91,7 @@
        my $data;
        if ($categorycode) {
                my $dbh = C4::Context->dbh;
-               my $sth=$dbh->prepare("select 
categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,overduenoticerequired,
 canmakepublicshelves, addRequestToShelves, allowrenewsfromopac from categories 
where categorycode=?");
+               my $sth=$dbh->prepare("select 
categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,overduenoticerequired,category_type
 from categories where categorycode=?");
                $sth->execute($categorycode);
                $data=$sth->fetchrow_hashref;
                $sth->finish;
@@ -102,13 +101,12 @@
                                enrolmentperiod         => 
$data->{'enrolmentperiod'},
                                upperagelimit           => 
$data->{'upperagelimit'},
                                dateofbirthrequired     => 
$data->{'dateofbirthrequired'},
-                               enrolmentfee            => 
$data->{'enrolmentfee'},
+                               enrolmentfee            => 
sprintf("%.2f",$data->{'enrolmentfee'}),
                                overduenoticerequired   => 
$data->{'overduenoticerequired'},
                                issuelimit              => 
$data->{'issuelimit'},
-                               reservefee              => 
$data->{'reservefee'},
-                               canmakepublicshelves    => 
$data->{'canmakepublicshelves'},
-                               addRequestToShelves             => 
$data->{'addRequestToShelves'},
-                               allowrenewsfromopac             => 
$data->{'allowrenewsfromopac'}
+                               reservefee              => 
sprintf("%.2f",$data->{'reservefee'}),
+                               category_type           => 
$data->{'category_type'},
+                               "type_".$data->{'category_type'} => " SELECTED 
",
        );
                                                                                
                        # END $OP eq ADD_FORM
 ################## ADD_VALIDATE ##################################
@@ -116,9 +114,11 @@
 } elsif ($op eq 'add_validate') {
        $template->param(add_validate => 1);
        my $dbh = C4::Context->dbh;
-       my $sth=$dbh->prepare("replace categories 
(categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,reservefee,overduenoticerequired,
 issuelimit, canmakepublicshelves, addRequestToShelves , allowrenewsfromopac) 
values (?,?,?,?,?,?,?,?,?,?,?,?)");
-       $sth->execute(map { $input->param($_) } 
('categorycode','description','enrolmentperiod','upperagelimit','dateofbirthrequired','enrolmentfee','reservefee','overduenoticerequired',
 'issuelimit', 'canmakepublicshelves', 'addRequestToShelves', 
'allowrenewsfromopac'));
+       my $sth=$dbh->prepare("replace categories 
(categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,reservefee,overduenoticerequired,category_type)
 values (?,?,?,?,?,?,?,?,?)");
+       $sth->execute(map { $input->param($_) } 
('categorycode','description','enrolmentperiod','upperagelimit','dateofbirthrequired','enrolmentfee','reservefee','overduenoticerequired','category_type'));
        $sth->finish;
+       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=categorie.pl\"></html>";
+       exit;
        
                                                                                
                        # END $OP eq ADD_VALIDATE
 ################## DELETE_CONFIRM ##################################
@@ -133,7 +133,7 @@
        $sth->finish;
        $template->param(total => $total->{'total'});
        
-       my $sth2=$dbh->prepare("select 
categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,overduenoticerequired,
 canmakepublicshelves, addRequestToShelves,allowrenewsfromopac  from categories 
where categorycode=?");
+       my $sth2=$dbh->prepare("select 
categorycode,description,enrolmentperiod,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,overduenoticerequired,category_type
 from categories where categorycode=?");
        $sth2->execute($categorycode);
        my $data=$sth2->fetchrow_hashref;
        $sth2->finish;
@@ -145,17 +145,12 @@
                                 enrolmentperiod         => 
$data->{'enrolmentperiod'},
                                 upperagelimit           => 
$data->{'upperagelimit'},
                                 dateofbirthrequired     => 
$data->{'dateofbirthrequired'},
-                                enrolmentfee            => 
$data->{'enrolmentfee'},
+                                enrolmentfee            =>  
sprintf("%.2f",$data->{'enrolmentfee'}),
                                 overduenoticerequired   => 
$data->{'overduenoticerequired'},
                                 issuelimit              => 
$data->{'issuelimit'},
-                                reservefee              => 
$data->{'reservefee'},
-                                                               
canmakepublicshelves    => $data->{'canmakepublicshelves'},
-                                                               
addRequestToShelves             => $data->{'addRequestToShelves'},
-                                                               
allowrenewsfromopac     => $data->{'allowrenewsfromopac'},
-               
+                                reservefee              =>  
sprintf("%.2f",$data->{'reservefee'}),
+                                category_type           => 
$data->{'category_type'},
                );
-
-
                                                                                
                        # END $OP eq DELETE_CONFIRM
 ################## DELETE_CONFIRMED ##################################
 # called by delete_confirm, used to effectively confirm deletion of data in DB
@@ -166,6 +161,9 @@
        my $sth=$dbh->prepare("delete from categories where categorycode=?");
        $sth->execute($categorycode);
        $sth->finish;
+       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=categorie.pl\"></html>";
+       exit;
+
                                                                                
                        # END $OP eq DELETE_CONFIRMED
 } else { # DEFAULT
        $template->param(else => 1);
@@ -179,25 +177,32 @@
                                enrolmentperiod => 
$results->[$i]{'enrolmentperiod'},
                                upperagelimit => 
$results->[$i]{'upperagelimit'},
                                dateofbirthrequired => 
$results->[$i]{'dateofbirthrequired'},
-                               enrolmentfee => $results->[$i]{'enrolmentfee'},
+                               enrolmentfee => 
sprintf("%.2f",$results->[$i]{'enrolmentfee'}),
                                overduenoticerequired => 
$results->[$i]{'overduenoticerequired'},
                                issuelimit => $results->[$i]{'issuelimit'},
-                               reservefee => $results->[$i]{'reservefee'},
-                               canmakepublicshelves => 
$results->[$i]{'canmakepublicshelves'},
-                               addRequestToShelves             => 
$results->[$i]{'addRequestToShelves'},
-                               allowrenewsfromopac => 
$results->[$i]{'allowrenewsfromopac'},
+                               reservefee => 
sprintf("%.2f",$results->[$i]{'reservefee'}),
+                               category_type => 
$results->[$i]{'category_type'},
+                               "type_".$results->[$i]{'category_type'} => 1,
                                toggle => $toggle );    
+                               warn "ICI".     $results->[$i]{'category_type'};
                push @loop, \%row;
-               $toggle = not $toggle;
+               if ( $toggle eq 0 )
+               {
+                       $toggle = 1;
+               }
+               else
+               {
+                       $toggle = 0;
+               }
        }
        $template->param(loop => address@hidden);
        # check that I (institution) and C (child) exists. otherwise => warning 
to the user
        my $dbh = C4::Context->dbh;
-       my $sth=$dbh->prepare("select categorycode from categories where 
categorycode='C'");
+       my $sth=$dbh->prepare("select category_type from categories where 
category_type='C'");
        $sth->execute;
        my ($categoryChild) = $sth->fetchrow;
        $template->param(categoryChild => $categoryChild);
-       $sth=$dbh->prepare("select categorycode from categories where 
categorycode='I'");
+       $sth=$dbh->prepare("select category_type from categories where 
category_type='I'");
        $sth->execute;
        my ($categoryInstitution) = $sth->fetchrow;
        $template->param(categoryInstitution => $categoryInstitution);
@@ -207,6 +212,9 @@
 } #---- END $OP eq DEFAULT
 
 
-
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
 output_html_with_http_headers $input, $cookie, $template->output;
 

Index: categoryitem.pl
===================================================================
RCS file: /sources/koha/koha/admin/categoryitem.pl,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- categoryitem.pl     1 Sep 2006 22:03:00 -0000       1.12
+++ categoryitem.pl     9 Mar 2007 14:30:55 -0000       1.13
@@ -39,10 +39,9 @@
 
 use strict;
 use CGI;
-
 use C4::Context;
 use C4::Output;
-use C4::Search;
+
 use C4::Auth;
 use C4::Interface::CGI::Output;
 
@@ -193,7 +192,10 @@
 
 
 } #---- END $OP eq DEFAULT
-
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
 output_html_with_http_headers $input, $cookie, $template->output;
 
 

Index: checkmarc.pl
===================================================================
RCS file: /sources/koha/koha/admin/checkmarc.pl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- checkmarc.pl        1 Sep 2006 22:03:00 -0000       1.10
+++ checkmarc.pl        9 Mar 2007 14:30:55 -0000       1.11
@@ -23,10 +23,10 @@
 use C4::Interface::CGI::Output;
 use C4::Auth;
 use CGI;
-use C4::Search;
 use C4::Context;
 use C4::Biblio;
 
+
 my $input = new CGI;
 
 my ($template, $borrowernumber, $cookie)
@@ -40,81 +40,111 @@
 
 my $dbh = C4::Context->dbh;
 my $total;
-# checks itemnumber field
-my $sth = $dbh->prepare("select tagfield from koha_attr where 
marctokoha=\"itemnumber\"");
+# checks itemnum field
+my $sth = $dbh->prepare("select tab from marc_subfield_structure where 
kohafield=\"items.itemnumber\"");
 $sth->execute;
 my ($res) = $sth->fetchrow;
-unless ($res) {
-       $template->param(itemnumber => 1);
+if ($res==-1) {
+       $template->param(itemnum => 0);
+} else {
+       $template->param(itemnum => 1);
        $total++;
 }
-#check biblionumber
-my $sth = $dbh->prepare("select tagfield from koha_attr where 
marctokoha=\"biblionumber\"");
+
+# checks biblio.biblionumber and biblioitem.biblioitemnumber (same tag and 
tab=-1)
+$sth = $dbh->prepare("select tagfield,tab from marc_subfield_structure where 
kohafield=\"biblio.biblionumber\"");
 $sth->execute;
-my ($res) = $sth->fetchrow;
-if ($res ){
-       ($res) = $sth->fetchrow;
-       unless ($res){
+my $tab;
+($res,$tab) = $sth->fetchrow;
+$sth = $dbh->prepare("select tagfield,tab from marc_subfield_structure where 
kohafield=\"biblioitems.biblioitemnumber\"");
+$sth->execute;
+my ($res2,$tab2) = $sth->fetchrow;
+if ($res && $res2 && $tab==-1 && $tab2==-1) {
+       $template->param(biblionumber => 0);
+} else {
        $template->param(biblionumber => 1);
        $total++;
-       }
 }
-#check barcode
-my $sth = $dbh->prepare("select tagfield from koha_attr where 
marctokoha=\"barcode\"");
+
+# checks all item fields are in the same tag and in tab 10
+
+$sth = $dbh->prepare("select tagfield,tab,kohafield from 
marc_subfield_structure where kohafield like \"items.%\"");
 $sth->execute;
-my ($res) = $sth->fetchrow;
-unless ($res){
-       $template->param(barcode=> 1);
+my $field;
+($res,$res2,$field) = $sth->fetchrow;
+my $tagfield = $res;
+my $tab = $res2;
+my $subtotal=0;
+#warn "TAGF : $tagfield";
+while (($res,$res2,$field) = $sth->fetchrow) {
+       # (ignore itemnumber, that must be in -1 tab)
+       if (($res ne $tagfield or $res2 ne $tab ) && $res2 ne -1) {
+               $subtotal++;
+       }
+}
+$sth = $dbh->prepare("select kohafield from marc_subfield_structure where 
tagfield=?");
+$sth->execute($tagfield);
+while (($res2) = $sth->fetchrow) {
+       if (!$res2 || $res2 =~ /^items/) {
+       } else {
+               $subtotal++;
+       }
+}
+if ($subtotal eq 0) {
+       $template->param(itemfields => 0);
+} else {
+       $template->param(itemfields => 1);
        $total++;
 }
-#check isbn
-my $sth = $dbh->prepare("select tagfield from koha_attr where 
marctokoha=\"isbn\"");
+
+$sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure 
where tab = 10");
 $sth->execute;
-my ($res) = $sth->fetchrow;
-unless ($res){
-       $template->param(isbn => 1);
+my $totaltags = 0;
+my $list = "";
+while (($res2) = $sth->fetchrow) {
+       $totaltags++;
+       $list.=$res2.",";
+}
+if ($totaltags > 1) {
+       $template->param(itemtags => $list);
        $total++;
+} else {
+       $template->param(itemtags => 0);
 }
-## Check for itemtype
-my $sth = $dbh->prepare("select tagfield,tagsubfield from koha_attr where 
marctokoha=\"itemtype\"");
+
+
+# checks biblioitems.itemtype must be mapped and use authorised_value=itemtype
+$sth = $dbh->prepare("select tagfield,tab,authorised_value from 
marc_subfield_structure where kohafield = \"biblioitems.itemtype\"");
 $sth->execute;
-my ($res,$res2) = $sth->fetchrow;
-if ($res) {
-$sth = $dbh->prepare("select authorised_value from biblios_subfield_structure 
where tagfield=? and tagsubfield=?");
-$sth->execute($res,$res2);
- my ($item)=$sth->fetchrow;
-    unless ($item eq "itemtypes"){
+($res,$res2,$field) = $sth->fetchrow;
+if ($res && $res2>=0 && $field eq "itemtypes") {
+       $template->param(itemtype => 0);
+} else {
        $template->param(itemtype => 1);
        $total++;
-    }
 }
 
-## Check for homebranch
-my $sth = $dbh->prepare("select tagfield from koha_attr where 
marctokoha=\"homebranch\"");
+# checks items.homebranch must be mapped and use authorised_value=branches
+$sth = $dbh->prepare("select tagfield,tab,authorised_value from 
marc_subfield_structure where kohafield = \"items.homebranch\"");
 $sth->execute;
-my ($res) = $sth->fetchrow;
-unless  ($res) {
+($res,$res2,$field) = $sth->fetchrow;
+if ($res && $res2 eq 10 && $field eq "branches") {
+       $template->param(branch => 0);
+} else {
        $template->param(branch => 1);
        $total++;
-    
 }
-
-## Check for holdingbranch
-my $sth = $dbh->prepare("select tagfield,tagsubfield from koha_attr where 
marctokoha=\"holdingbranch\"");
+# checks items.homebranch must be mapped and use authorised_value=branches
+$sth = $dbh->prepare("select tagfield,tab,authorised_value from 
marc_subfield_structure where kohafield = \"items.holdingbranch\"");
 $sth->execute;
-my ($res,$res2) = $sth->fetchrow;
-if ($res) {
-$sth = $dbh->prepare("select authorised_value from biblios_subfield_structure 
where tagfield=? and tagsubfield=?");
-$sth->execute($res,$res2);
- my ($item)=$sth->fetchrow;
-    unless ($item eq "branches"){
+($res,$res2,$field) = $sth->fetchrow;
+if ($res && $res2 eq 10 && $field eq "branches") {
+       $template->param(holdingbranch => 0);
+} else {
        $template->param(holdingbranch => 1);
        $total++;
-    }
 }
 
-
-
 # checks that itemtypes & branches tables are not empty
 $sth = $dbh->prepare("select count(*) from itemtypes");
 $sth->execute;
@@ -132,5 +162,31 @@
        $total++;
 }
 
-$template->param(total => $total);
+$sth = $dbh->prepare("select count(*) from marc_biblio where frameworkcode is 
NULL");
+$sth->execute;
+($res) = $sth->fetchrow;
+if ($res) {
+       $template->param(frameworknull =>1);
+       $total++;
+}
+$sth = $dbh->prepare("select count(*) from marc_subfield_structure where 
frameworkcode is NULL");
+$sth->execute;
+($res) = $sth->fetchrow;
+if ($res) {
+       $template->param(frameworknull =>1);
+       $total++;
+}
+$sth = $dbh->prepare("select count(*) from marc_tag_structure where 
frameworkcode is NULL");
+$sth->execute;
+($res) = $sth->fetchrow;
+if ($res) {
+       $template->param(frameworknull =>1);
+       $total++;
+}
+
+$template->param(total => $total,
+               intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
 output_html_with_http_headers $input, $cookie, $template->output;

Index: cities.pl
===================================================================
RCS file: /sources/koha/koha/admin/cities.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- cities.pl   23 May 2006 11:44:23 -0000      1.1
+++ cities.pl   9 Mar 2007 14:30:55 -0000       1.2
@@ -21,8 +21,7 @@
 use CGI;
 use C4::Context;
 use C4::Output;
-use C4::Search;
-use HTML::Template;
+
 use C4::Auth;
 use C4::Interface::CGI::Output;
 
@@ -54,7 +53,7 @@
                             query => $input,
                             type => "intranet",
                             authnotrequired => 0,
-                            flagsrequired => {parameters => 1, management => 
1},
+                            flagsrequired => {parameters => 1},
                             debug => 1,
                             });
 

Index: currency.pl
===================================================================
RCS file: /sources/koha/koha/admin/currency.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- currency.pl 1 Sep 2006 22:03:00 -0000       1.14
+++ currency.pl 9 Mar 2007 14:30:55 -0000       1.15
@@ -41,7 +41,7 @@
 use CGI;
 use C4::Context;
 use C4::Output;
-use C4::Search;
+
 use C4::Auth;
 use C4::Interface::CGI::Output;
 
@@ -79,7 +79,7 @@
     = get_template_and_user({template_name => "admin/currency.tmpl",
                              query => $input,
                              type => "intranet",
-                            flagsrequired => {parameters => 1, management => 
1},
+                            flagsrequired => {parameters => 1},
                             authnotrequired => 0,
                              debug => 1,
                              });
@@ -193,6 +193,9 @@
                                 nextpage => $offset+$pagesize);
        }
 } #---- END $OP eq DEFAULT
-
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
 output_html_with_http_headers $input, $cookie, $template->output;
 

Index: issuingrules.pl
===================================================================
RCS file: /sources/koha/koha/admin/issuingrules.pl,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- issuingrules.pl     27 Sep 2006 21:19:21 -0000      1.11
+++ issuingrules.pl     9 Mar 2007 14:30:55 -0000       1.12
@@ -21,9 +21,12 @@
 use CGI;
 use C4::Context;
 use C4::Output;
+
 use C4::Auth;
+use C4::Output;
 use C4::Koha;
 use C4::Interface::CGI::Output;
+use C4::Branch; # GetBranches
 
 my $input = new CGI;
 my $dbh = C4::Context->dbh;
@@ -40,7 +43,7 @@
                              query => $input,
                              type => "intranet",
                              authnotrequired => 0,
-                            flagsrequired => {parameters => 1, management => 
1},
+                            flagsrequired => {parameters => 1},
                              debug => 1,
                              });
 # save the values entered
@@ -52,8 +55,8 @@
        my $sth_Fupdate=$dbh->prepare("Update issuingrules set 
fine=?,firstremind=?,chargeperiod=? where branchcode=? and categorycode=? and 
itemtype=?");
        my $sth_Fdelete=$dbh->prepare("delete from issuingrules where 
branchcode=? and categorycode=? and itemtype=? and issuelength=0");
 
-       my $sth_Iinsert = $dbh->prepare("insert into issuingrules 
(branchcode,categorycode,itemtype,maxissueqty,issuelength) values (?,?,?,?,?)");
-       my $sth_Iupdate=$dbh->prepare("Update issuingrules set maxissueqty=?, 
issuelength=? where branchcode=? and categorycode=? and itemtype=?");
+       my $sth_Iinsert = $dbh->prepare("insert into issuingrules 
(branchcode,categorycode,itemtype,maxissueqty,issuelength,rentaldiscount) 
values (?,?,?,?,?,?)");
+       my $sth_Iupdate=$dbh->prepare("Update issuingrules set maxissueqty=?, 
issuelength=?, rentaldiscount=? where branchcode=? and categorycode=? and 
itemtype=?");
        my $sth_Idelete=$dbh->prepare("delete from issuingrules where 
branchcode=? and categorycode=? and itemtype=? and fine=0");
        foreach my $key (@names){
                # ISSUES
@@ -62,14 +65,14 @@
                        my $bor = $2; # borrower category
                        my $cat = $3; # item type
                        my $data=$input->param($key);
-                       my ($issuelength,$maxissueqty)=split(',',$data);
+                       my 
($issuelength,$maxissueqty,$rentaldiscount)=split(',',$data);
 #                      if ($maxissueqty >0) {
                                $sth_search->execute($br,$bor,$cat);
                                my $res = $sth_search->fetchrow_hashref();
                                if ($res->{total}) {
-                                       
$sth_Iupdate->execute($maxissueqty,$issuelength,$br,$bor,$cat);
+                                       
$sth_Iupdate->execute($maxissueqty,$issuelength,$rentaldiscount,$br,$bor,$cat);
                                } else {
-                                       
$sth_Iinsert->execute($br,$bor,$cat,$maxissueqty,$issuelength);
+                                       
$sth_Iinsert->execute($br,$bor,$cat,$maxissueqty,$issuelength,$rentaldiscount);
                                }
 #                      } else {
 #                              $sth_Idelete->execute($br,$bor,$cat);
@@ -110,7 +113,7 @@
 
 my $sth=$dbh->prepare("Select description,categorycode from categories order 
by description");
 $sth->execute;
- my @trow3;
+my @trow3;
 my @title_loop;
 # my $i=0;
 while (my $data=$sth->fetchrow_hashref){
@@ -155,11 +158,12 @@
                my $fine=$dat->{'fine'}+0;
                my $maxissueqty = $dat->{'maxissueqty'}+0;
                my $issuelength = $dat->{'issuelength'}+0;
+               my $rentaldiscount = $dat->{'rentaldiscount'}+0;
                my $finesvalue;
                $finesvalue= 
"$fine,$dat->{'firstremind'},$dat->{'chargeperiod'}" if 
$fine+$dat->{'firstremind'}+$dat->{'chargeperiod'}>0;
                my $issuingvalue;
 #              if ($maxissueqty>0) {
-                   $issuingvalue = "$issuelength,$maxissueqty" if 
$issuelength+$maxissueqty>0;
+                   $issuingvalue = "$issuelength,$maxissueqty,$rentaldiscount" 
if $issuelength+$maxissueqty>0;
 #              }
 #              else {          
 #                  $issuingvalue = "$issuelength, 5";
@@ -182,5 +186,9 @@
 $template->param(title => address@hidden,
                                                row => address@hidden,
                                                branchloop => address@hidden,
-                                               branch => $branch);
+                                               branch => $branch,
+                                               intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+                                               );
 output_html_with_http_headers $input, $cookie, $template->output;

Index: itemtypecategory.pl
===================================================================
RCS file: /sources/koha/koha/admin/itemtypecategory.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- itemtypecategory.pl 24 Feb 2006 11:15:01 -0000      1.2
+++ itemtypecategory.pl 9 Mar 2007 14:30:55 -0000       1.3
@@ -43,10 +43,9 @@
 use CGI;
 use C4::Context;
 use C4::Output;
-use C4::Search;
 use C4::Auth;
 use C4::Interface::CGI::Output;
-use HTML::Template;
+
 
 sub StringSearch  {
        my ($env,$searchstring,$type)address@hidden;
@@ -78,7 +77,7 @@
                             query => $input,
                             type => "intranet",
                             authnotrequired => 0,
-                            flagsrequired => {parameters => 1, management => 
1},
+                            flagsrequired => {parameters => 1},
                             debug => 1,
                             });
 

Index: itemtypes.pl
===================================================================
RCS file: /sources/koha/koha/admin/itemtypes.pl,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- itemtypes.pl        1 Sep 2006 22:03:00 -0000       1.25
+++ itemtypes.pl        9 Mar 2007 14:30:55 -0000       1.26
@@ -40,13 +40,15 @@
 
 use strict;
 use CGI;
+
+use List::Util qw/min/;
+
+use C4::Koha;
 use C4::Context;
 use C4::Output;
-use C4::Search;
 use C4::Auth;
 use C4::Interface::CGI::Output;
 
-
 sub StringSearch  {
        my ($env,$searchstring,$type)address@hidden;
        my $dbh = C4::Context->dbh;
@@ -66,10 +68,9 @@
 
 my $input = new CGI;
 my $searchfield=$input->param('description');
-my $offset=$input->param('offset');
 my $script_name="/cgi-bin/koha/admin/itemtypes.pl";
 my $itemtype=$input->param('itemtype');
-my $pagesize=20;
+my $pagesize=10;
 my $op = $input->param('op');
 $searchfield=~ s/\,//g;
 my ($template, $borrowernumber, $cookie)
@@ -77,7 +78,7 @@
                             query => $input,
                             type => "intranet",
                             authnotrequired => 0,
-                            flagsrequired => {parameters => 1, management => 
1},
+                            flagsrequired => {parameters => 1},
                             debug => 1,
                             });
 
@@ -96,29 +97,124 @@
        my $data;
        if ($itemtype) {
                my $dbh = C4::Context->dbh;
-               my $sth=$dbh->prepare("select 
itemtype,description,renewalsallowed,rentalcharge,notforloan from itemtypes 
where itemtype=?");
+               my $sth=$dbh->prepare("select * from itemtypes where 
itemtype=?");
                $sth->execute($itemtype);
                $data=$sth->fetchrow_hashref;
                $sth->finish;
        }
-       $template->param(itemtype => $itemtype,
+       # build list of images
+       my $imagedir_filesystem = getitemtypeimagedir();
+    my $imagedir_web = getitemtypeimagesrc();
+    opendir(DIR, $imagedir_filesystem)
+        or warn "can't opendir ".$imagedir_filesystem.": ".$!;
+       my @imagelist;
+       my $i=0;
+       my $image_per_line=12;
+       while (my $line = readdir(DIR)) {
+           $i++;
+               if ($line =~ /\.(gif|png)$/i) {
+                   if($i==$image_per_line){
+                       $i=0;
+                       push @imagelist,{KohaImage => '',KohaImageSrc => ''};
+                   }
+                   else{
+                push( @imagelist,
+                    {
+                        KohaImage => $line,
+                        KohaImageSrc => $imagedir_web.'/'.$line,
+                        checked => $line eq $data->{imageurl} ? 1 : 0,
+                    }
+                );
+            }
+               }
+       }
+       closedir DIR;
+
+    my $remote_image = undef;
+    if (defined $data->{imageurl} and $data->{imageurl} =~ m/^http/) {
+        $remote_image = $data->{imageurl};
+    }
+
+       $template->param(
+        itemtype => $itemtype,
                                                        description => 
$data->{'description'},
                                                        renewalsallowed => 
$data->{'renewalsallowed'},
                                                        rentalcharge => 
sprintf("%.2f",$data->{'rentalcharge'}),
-                                                       notforloan => 
$data->{'notforloan'}
+        notforloan => $data->{'notforloan'},
+        imageurl => $data->{'imageurl'},
+        template => C4::Context->preference('template'),
+        summary => $data->{summary},
+        IMAGESLOOP => address@hidden,
+        remote_image => $remote_image,
                                                        );
-;
                                                                                
                        # END $OP eq ADD_FORM
 ################## ADD_VALIDATE ##################################
 # called by add_form, used to insert/modify data in DB
 } elsif ($op eq 'add_validate') {
        my $dbh = C4::Context->dbh;
-       my $sth=$dbh->prepare("replace itemtypes 
(itemtype,description,renewalsallowed,rentalcharge,notforloan) values 
(?,?,?,?,?)");
+    
+    my $modif='';
+    my $query = "
+        SELECT itemtype
+        FROM   itemtypes
+        WHERE  itemtype = ?
+    ";
+    my $sth = $dbh->prepare($query);
+    $sth->execute($itemtype);
+    if($sth->fetchrow){
+        $modif = 1;
+    }
+    
+    if($modif){  # it 's a modification
+        my $query = '
+            UPDATE itemtypes
+            SET    description = ?
+                 , renewalsallowed = ?
+                 , rentalcharge = ?
+                 , notforloan = ?
+                 , imageurl = ?
+                 , summary = ?
+            WHERE itemtype = ?
+        ';
+        my $sth=$dbh->prepare($query);
        $sth->execute(
-               $input->param('itemtype'),$input->param('description'),
-               $input->param('renewalsallowed'),$input->param('rentalcharge'),
-               $input->param('notforloan')?1:0);
-       $sth->finish;
+                $input->param('description'),
+                       $input->param('renewalsallowed'),
+                $input->param('rentalcharge'),
+                       ($input->param('notforloan') ? 1 : 0),
+                ($input->param('image') eq 'removeImage'
+                        ?''
+                        :($input->param('image') eq 'remoteImage' 
+                            ? $input->param('remoteImage')
+                            :$input->param('image')."")
+                ),
+                $input->param('summary'),
+                       $input->param('itemtype')
+            );
+    }
+    else { # add a new itemtype & not modif an old
+        my $query = "
+            INSERT INTO itemtypes
+                (itemtype,description,renewalsallowed,rentalcharge, 
notforloan, imageurl,summary)
+            VALUES
+                (?,?,?,?,?,?,?);
+            ";
+        my $sth=$dbh->prepare($query);
+           $sth->execute(
+           $input->param('itemtype'),
+        $input->param('description'),
+           $input->param('renewalsallowed'),
+        $input->param('rentalcharge'),
+               $input->param('notforloan') ? 1 : 0,
+            $input->param('image') eq 'removeImage'
+            ? undef
+            : $input->param('image') eq 'remoteImage'
+                ? $input->param('remoteImage')
+                : $input->param('image'),
+        $input->param('summary'),
+        );
+    }
+    
        print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=itemtypes.pl\"></html>";
        exit;
                                                                                
                        # END $OP eq ADD_VALIDATE
@@ -143,9 +239,10 @@
        $sth->finish;
 
        $template->param(itemtype => $itemtype,
-                                                       description => 
$data->{'description'},
-                                                       renewalsallowed => 
$data->{'renewalsallowed'},
-                                                       rentalcharge => 
sprintf("%.2f",$data->{'rentalcharge'}),
+                                                       description => 
$data->{description},
+                                                       renewalsallowed => 
$data->{renewalsallowed},
+                                                       rentalcharge => 
sprintf("%.2f",$data->{rentalcharge}),
+                                                       imageurl => 
$data->{imageurl},
                                                        total => $total);
                                                                                
                        # END $OP eq DELETE_CONFIRM
 ################## DELETE_CONFIRMED ##################################
@@ -166,33 +263,43 @@
 } else { # DEFAULT
        my $env;
        my ($count,$results)=StringSearch($env,$searchfield,'web');
-       my $toggle=0;
-       my @loop_data;
-       for (my $i=$offset; $i < 
($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
-               my %row_data;
-               if ($toggle eq 0){
-                       $toggle=1;
-               } else {
-                       $toggle=0;
-               }
-               $row_data{toggle} = $toggle;
-               $row_data{itemtype} = $results->[$i]{itemtype};
-               $row_data{description} = $results->[$i]{description};
-               $row_data{renewalsallowed} = $results->[$i]{renewalsallowed};
-               $row_data{notforloan} = $results->[$i]{notforloan};
-               $row_data{rentalcharge} = 
sprintf("%.2f",$results->[$i]{rentalcharge});
-               push(@loop_data, \%row_data);
-       }
-       $template->param(loop => address@hidden);
-       if ($offset>0) {
-               my $prevpage = $offset-$pagesize;
-               $template->param(previous => "$script_name?offset=".$prevpage);
-       }
-       if ($offset+$pagesize<$count) {
-               my $nextpage =$offset+$pagesize;
-               $template->param(next => "$script_name?offset=".$nextpage);
+
+    my $page = $input->param('page') || 1;
+    my $first = ($page - 1) * $pagesize;
+
+    # if we are on the last page, the number of the last word to display
+    # must not exceed the length of the results array
+    my $last = min(
+        $first + $pagesize - 1,
+        scalar @{$results} - 1,
+    );
+
+    my $toggle = 0;
+    my @loop;
+    foreach my $result (@{$results}[$first .. $last]) {
+        my $itemtype = $result;
+        $itemtype->{toggle} = ($toggle++%2 eq 0 ? 1 : 0);
+        $itemtype->{imageurl} =
+            getitemtypeimagesrcfromurl($itemtype->{imageurl});
+        $itemtype->{rentalcharge} = sprintf('%.2f', $itemtype->{rentalcharge});
+
+        push(@loop, $itemtype);
        }
+
+    $template->param(
+        loop => address@hidden,
+        pagination_bar => pagination_bar(
+            $script_name,
+            getnbpages(scalar @{$results}, $pagesize),
+            $page,
+            'page'
+        )
+    );
 } #---- END $OP eq DEFAULT
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
 output_html_with_http_headers $input, $cookie, $template->output;
 
 # Local Variables:

Index: itemtypesubcategory.pl
===================================================================
RCS file: /sources/koha/koha/admin/itemtypesubcategory.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- itemtypesubcategory.pl      24 Feb 2006 11:15:01 -0000      1.2
+++ itemtypesubcategory.pl      9 Mar 2007 14:30:55 -0000       1.3
@@ -43,10 +43,9 @@
 use CGI;
 use C4::Context;
 use C4::Output;
-use C4::Search;
 use C4::Auth;
 use C4::Interface::CGI::Output;
-use HTML::Template;
+
 
 sub StringSearch  {
        my ($env,$searchstring,$type)address@hidden;
@@ -78,7 +77,7 @@
                             query => $input,
                             type => "intranet",
                             authnotrequired => 0,
-                            flagsrequired => {parameters => 1, management => 
1},
+                            flagsrequired => {parameters => 1},
                             debug => 1,
                             });
 

Index: letter.pl
===================================================================
RCS file: /sources/koha/koha/admin/letter.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- letter.pl   5 Aug 2005 15:51:43 -0000       1.4
+++ letter.pl   9 Mar 2007 14:30:55 -0000       1.5
@@ -44,8 +44,7 @@
 use C4::Context;
 use C4::Output;
 use C4::Interface::CGI::Output;
-use C4::Search;
-use HTML::Template;
+
 
 sub StringSearch  {
        my ($env,$searchstring,$type)address@hidden;
@@ -78,7 +77,7 @@
 my $dbh = C4::Context->dbh;
 
 my ($template, $borrowernumber, $cookie)
-    = get_template_and_user({template_name => "parameters/letter.tmpl",
+    = get_template_and_user({template_name => "tools/letter.tmpl",
                             query => $input,
                             type => "intranet",
                             authnotrequired => 0,

Index: mediatype.pl
===================================================================
RCS file: /sources/koha/koha/admin/mediatype.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- mediatype.pl        24 Feb 2006 11:15:01 -0000      1.2
+++ mediatype.pl        9 Mar 2007 14:30:55 -0000       1.3
@@ -44,10 +44,9 @@
 use CGI;
 use C4::Context;
 use C4::Output;
-use C4::Search;
 use C4::Auth;
 use C4::Interface::CGI::Output;
-use HTML::Template;
+
 
 sub StringSearch  {
        my ($env,$searchstring,$type)address@hidden;
@@ -79,7 +78,7 @@
                             query => $input,
                             type => "intranet",
                             authnotrequired => 0,
-                            flagsrequired => {parameters => 1, management => 
1},
+                            flagsrequired => {parameters => 1},
                             debug => 1,
                             });
 

Index: printers.pl
===================================================================
RCS file: /sources/koha/koha/admin/printers.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- printers.pl 1 Sep 2006 22:03:00 -0000       1.14
+++ printers.pl 9 Mar 2007 14:30:55 -0000       1.15
@@ -41,7 +41,7 @@
 use CGI;
 use C4::Context;
 use C4::Output;
-use C4::Search;
+
 use C4::Auth;
 use C4::Interface::CGI::Output;
 
@@ -180,6 +180,9 @@
        }
 
 } #---- END $OP eq DEFAULT
-
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
 output_html_with_http_headers $input, $cookie, $template->output;
 

Index: roadtype.pl
===================================================================
RCS file: /sources/koha/koha/admin/roadtype.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- roadtype.pl 23 May 2006 11:44:23 -0000      1.1
+++ roadtype.pl 9 Mar 2007 14:30:55 -0000       1.2
@@ -21,8 +21,7 @@
 use CGI;
 use C4::Context;
 use C4::Output;
-use C4::Search;
-use HTML::Template;
+
 use C4::Auth;
 use C4::Interface::CGI::Output;
 
@@ -54,7 +53,7 @@
                             query => $input,
                             type => "intranet",
                             authnotrequired => 0,
-                            flagsrequired => {parameters => 1, management => 
1},
+                            flagsrequired => {parameters => 1},
                             debug => 1,
                             });
 

Index: systempreferences.pl
===================================================================
RCS file: /sources/koha/koha/admin/systempreferences.pl,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- systempreferences.pl        15 Nov 2006 01:41:51 -0000      1.36
+++ systempreferences.pl        9 Mar 2007 14:30:55 -0000       1.37
@@ -4,22 +4,6 @@
 #written 20/02/2002 by address@hidden
 # This software is placed under the gnu General Public License, v2 
(http://www.gnu.org/licenses/gpl.html)
 
-# ALGO :
-# this script use an $op to know what to do.
-# if $op is empty or none of the above values,
-#      - the default screen is build (with all records, or filtered datas).
-#      - the   user can clic on add, modify or delete record.
-# if $op=add_form
-#      - if primkey exists, this is a modification,so we read the $primkey 
record
-#      - builds the add/modify form
-# if $op=add_validate
-#      - the user has just send datas, so we create/modify the record
-# if $op=delete_form
-#      - we show the record having primkey=$primkey and ask for deletion 
validation form
-# if $op=delete_confirm
-#      - we delete the record having primkey=$primkey
-
-
 # Copyright 2000-2002 Katipo Communications
 #
 # This file is part of Koha.
@@ -37,26 +21,57 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
+=head1 systempreferences.pl
+
+ALGO :
+ this script use an $op to know what to do.
+ if $op is empty or none of the above values,
+    - the default screen is build (with all records, or filtered datas).
+    - the   user can clic on add, modify or delete record.
+ if $op=add_form
+    - if primkey exists, this is a modification,so we read the $primkey record
+    - builds the add/modify form
+ if $op=add_validate
+    - the user has just send datas, so we create/modify the record
+ if $op=delete_form
+    - we show the record having primkey=$primkey and ask for deletion 
validation form
+ if $op=delete_confirm
+    - we delete the record having primkey=$primkey
+
+=cut
+
 use strict;
 use CGI;
 use C4::Auth;
 use C4::Context;
 use C4::Koha;
+use C4::Languages;
 use C4::Output;
 use C4::Interface::CGI::Output;
-use C4::Search;
 use C4::Context;
 
+
+# FIXME, shouldnt we store this stuff in the systempreferences table? 
+
 my %tabsysprefs;
 # Acquisitions
        $tabsysprefs{acquisitions}="Acquisitions";
        $tabsysprefs{gist}="Acquisitions";
 # Admin
        $tabsysprefs{dateformat}="Admin";
+    $tabsysprefs{delimiter}="Admin";
+    $tabsysprefs{IndependantBranches}="Admin";
        $tabsysprefs{insecure}="Admin";
        $tabsysprefs{KohaAdmin}="Admin";
+    $tabsysprefs{KohaAdminEmailAddress}="Admin";
+    $tabsysprefs{MIME}="Admin";
+    $tabsysprefs{timeout}="Admin";
+    $tabsysprefs{Intranet_includes}="Admin";
+    $tabsysprefs{AutoLocation}="Admin";
+
 # Authorities
        $tabsysprefs{authoritysep}="Authorities";
+    $tabsysprefs{AuthDisplayHierarchy}="Authorities";
 # Catalogue
        $tabsysprefs{advancedMARCEditor}="Catalogue";
        $tabsysprefs{autoBarcode}="Catalogue";
@@ -64,6 +79,7 @@
        $tabsysprefs{IntranetBiblioDefaultView} = "Catalogue";
        $tabsysprefs{ISBD}="Catalogue";
        $tabsysprefs{itemcallnumber}="Catalogue";
+    $tabsysprefs{kohaspsuggest} = "Catalogue";
        $tabsysprefs{LabelMARCView}="Catalogue";
        $tabsysprefs{marc}="Catalogue";
        $tabsysprefs{marcflavour}="Catalogue";
@@ -72,63 +88,89 @@
        $tabsysprefs{MARCOrgCode}="Catalogue";
        $tabsysprefs{z3950AuthorAuthFields}="Catalogue";
        $tabsysprefs{z3950NormalizeAuthor}="Catalogue";
-       $tabsysprefs{SQLorZEBRA}="Catalogue";
+    $tabsysprefs{Stemming}="Catalogue";
+    $tabsysprefs{WeightFields}="Catalogue";
+    $tabsysprefs{expandedSearchOption}="Catalogue";
        
 # Circulation
        $tabsysprefs{maxoutstanding}="Circulation";
        $tabsysprefs{maxreserves}="Circulation";
        $tabsysprefs{noissuescharge}="Circulation";
+    $tabsysprefs{IssuingInProcess}="Circulation";
        $tabsysprefs{patronimages}="Circulation";
        $tabsysprefs{printcirculationslips}="Circulation";
        $tabsysprefs{ReturnBeforeExpiry}="Circulation";
-       $tabsysprefs{allowrenewalsbefore}="Circulation";
-       $tabsysprefs{defaultBranch}="Circulation";
-       $tabsysprefs{strictrenewals}="Circulation";
+    $tabsysprefs{SpecifyDueDate}="Circulation";
+    $tabsysprefs{AutomaticItemReturn}="Circulation";
+    $tabsysprefs{ReservesMaxPickUpDelay}="Circulation";
+    $tabsysprefs{TransfersMaxDaysWarning}="Circulation";
+    $tabsysprefs{useDaysMode}="Circulation";
+
 # Intranet
        $tabsysprefs{TemplateEncoding}="Intranet";
        $tabsysprefs{template}="Intranet";
        $tabsysprefs{intranetstylesheet}="Intranet";
        $tabsysprefs{IntranetNav}="Intranet";
        $tabsysprefs{intranetcolorstylesheet}="Intranet";
-       $tabsysprefs{Activate_Log}="Intranet";
-       $tabsysprefs{allowrenewalsbefore}="Intranet";
-       
-       $tabsysprefs{zebrawait}="Intranet";
-       $tabsysprefs{retrieve_from}="Intranet";
-       $tabsysprefs{batchMode}="Intranet";
-       
+    $tabsysprefs{intranetuserjs}="Intranet";
 # Members
        $tabsysprefs{automembernum}="Members";
        $tabsysprefs{checkdigit}="Members";
+    $tabsysprefs{intranetreadinghistory}="Members";
        $tabsysprefs{NotifyBorrowerDeparture}="Members";
+    $tabsysprefs{memberofinstitution}="Members";
+    $tabsysprefs{ReadingHistory}="Members";
+    $tabsysprefs{BorrowerMandatoryField}="Members";
+    $tabsysprefs{borrowerRelationship}="Members";
+    $tabsysprefs{BorrowersTitles}="Members";    
+    $tabsysprefs{patronimages}="Members";
+    
 # OPAC
        $tabsysprefs{AmazonAssocTag}="OPAC";
        $tabsysprefs{AmazonContent}="OPAC";
        $tabsysprefs{AmazonDevKey}="OPAC";
-       $tabsysprefs{AnonSuggestions}="OPAC";
        $tabsysprefs{BiblioDefaultView}="OPAC";
-       $tabsysprefs{Disable_Dictionary}="OPAC";
-       $tabsysprefs{hidelostitems}="OPAC";
        $tabsysprefs{LibraryName}="OPAC";
-       $tabsysprefs{opacbookbag}="OPAC";
        $tabsysprefs{opaccolorstylesheet}="OPAC";
        $tabsysprefs{opaccredits}="OPAC";
        $tabsysprefs{opaclanguages}="OPAC";
-       $tabsysprefs{opaclanguagesdisplay}="OPAC";
        $tabsysprefs{opaclargeimage}="OPAC";
        $tabsysprefs{opaclayoutstylesheet}="OPAC";
        $tabsysprefs{OpacNav}="OPAC";
-       $tabsysprefs{OpacPasswordChange}="OPAC";
-       $tabsysprefs{opacreadinghistory}="OPAC";
        $tabsysprefs{opacsmallimage}="OPAC";
        $tabsysprefs{opacstylesheet}="OPAC";
        $tabsysprefs{opacthemes}="OPAC";
-       $tabsysprefs{opacuserlogin}="OPAC";
+    $tabsysprefs{opacuserjs}="OPAC";
        $tabsysprefs{SubscriptionHistory}="OPAC";
-       $tabsysprefs{suggestion}="OPAC";
-       $tabsysprefs{virtualshelves}="OPAC";
        $tabsysprefs{opacheader}="OPAC";
-       $tabsysprefs{allowrenewsfromopac}="OPAC";
+    
+# OPACFeatures
+    $tabsysprefs{Disable_Dictionary}="OPACFeatures";
+    $tabsysprefs{hidelostitems}="OPACFeatures";
+    $tabsysprefs{opacbookbag}="OPACFeatures";
+    $tabsysprefs{opaclanguagesdisplay}="OPACFeatures";
+    $tabsysprefs{OpacPasswordChange}="OPACFeatures";
+    $tabsysprefs{opacreadinghistory}="OPACFeatures";
+    $tabsysprefs{virtualshelves}="OPACFeatures";
+    $tabsysprefs{RequestOnOpac}="OPACFeatures";
+    $tabsysprefs{reviewson}="OPACFeatures";
+    $tabsysprefs{OpacTopissues}="OPACFeatures";
+    $tabsysprefs{OpacAuthorities}="OPACFeatures";
+    $tabsysprefs{OpacCloud}="OPACFeatures";
+    $tabsysprefs{opacuserlogin}="OPACFeatures";
+    $tabsysprefs{AnonSuggestions}="OPACFeatures";
+    $tabsysprefs{suggestion}="OPACFeatures";
+    $tabsysprefs{OpacTopissue}="OPACFeatures";
+    $tabsysprefs{OpacBrowser}="OPACFeatures";
+
+# LOGFeatures
+    $tabsysprefs{CataloguingLog}  = "LOGFeatures";
+    $tabsysprefs{BorrowersLog}    = "LOGFeatures";
+    $tabsysprefs{SubscriptionLog} = "LOGFeatures";
+    $tabsysprefs{IssueLog}        = "LOGFeatures";
+    $tabsysprefs{ReturnLog}       = "LOGFeatures";
+    $tabsysprefs{LetterLog}       = "LOGFeatures";
+    $tabsysprefs{FinesLog}        = "LOGFeatures";
 
 sub StringSearch  {
        my ($env,$searchstring,$type)address@hidden;
@@ -145,7 +187,7 @@
                                $sth->execute($syspref);
                                while (my $data=$sth->fetchrow_hashref){
                                        $data->{value} =~ s/</&lt;/g;
-                                       $data->{value} =~ s/>/&lt;/g;
+                    $data->{value} =~ s/>/&gt;/g;
                                        
$data->{value}=substr($data->{value},0,100)."..." if length($data->{value}) 
>100;
                                        push(@results,$data);
                                        $cnt++;
@@ -160,7 +202,6 @@
                }
                $strsth =~ s/,$/) /;
                $strsth .= " order by variable";
-               #warn $strsth;
                my $sth=$dbh->prepare($strsth);
                $sth->execute();
                while (my $data=$sth->fetchrow_hashref){
@@ -320,11 +361,12 @@
                    $currently_selected_languages->{$language}=1;
                    $counter++;
                }
-               foreach my $language (getalllanguages()) {
-                       next if $language eq 'images';
+               my $langavail = getTranslatedLanguages();
+        foreach my $language (@$langavail) {
                        my $selected='0';
-                       next if $currently_selected_languages->{$language};
-                       push @options, { option => $language, counter => 
$counter };
+            next if 
$currently_selected_languages->{$language->{'language_code'}};
+                       #FIXME: could add language_name and 
language_locale_name for better display
+            push @options, { option => $language->{'language_code'}, counter 
=> $counter };
                        $counter++;
                }
        } else {
@@ -416,9 +458,7 @@
                my $nextpage =$offset+$pagesize;
                $template->param("a href=$script_name?offset=".$nextpage.'Next 
&gt;&gt;</a>');
        }
-} #---- END $OP eq DEFAULT
-$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
-               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
-               IntranetNav => C4::Context->preference("IntranetNav"),
+    $template->param(        tab => $tab,
                );
+} #---- END $OP eq DEFAULT
 output_html_with_http_headers $input, $cookie, $template->output;

Index: thesaurus.pl
===================================================================
RCS file: /sources/koha/koha/admin/thesaurus.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- thesaurus.pl        1 Sep 2006 22:03:00 -0000       1.14
+++ thesaurus.pl        9 Mar 2007 14:30:55 -0000       1.15
@@ -23,8 +23,8 @@
 use C4::Interface::CGI::Output;
 use C4::Context;
 use C4::Output;
-use C4::Search;
-use C4::Authorities;
+
+use C4::AuthoritiesMarc;
 
 my $input = new CGI;
 my $search_category=$input->param('search_category');
@@ -152,6 +152,7 @@
                        -values=> address@hidden,
                        -default=>"$search_category",
                        -size=>1,
+                       -tabindex=>'',
                        -multiple=>0,
                        );
        if (!$search_category) {
@@ -200,6 +201,7 @@
                        -values=> address@hidden,
                        -default=>"$search_category",
                        -size=>1,
+                       -tabindex=>'',
                        -multiple=>0,
                        );
        if (!$search_category) {
@@ -262,5 +264,8 @@
                $template->param(next => 
"$script_name?branch=$branch&search_category=$search_category&searchstring=$searchstring&offset=$nextpage");
        }
 } #---- END $OP eq DEFAULT
-
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
 output_html_with_http_headers $input, $cookie, $template->output;

Index: z3950servers.pl
===================================================================
RCS file: /sources/koha/koha/admin/z3950servers.pl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- z3950servers.pl     15 Nov 2006 01:41:51 -0000      1.14
+++ z3950servers.pl     9 Mar 2007 14:30:55 -0000       1.15
@@ -22,8 +22,9 @@
 use strict;
 use C4::Output;
 use CGI;
-use C4::Search;
+
 use C4::Context;
+
 use C4::Auth;
 use C4::Interface::CGI::Output;
 
@@ -33,7 +34,7 @@
        $searchstring=~ s/\'/\\\'/g;
        my @data=split(' ',$searchstring);
        my address@hidden;
-       my $sth=$dbh->prepare("Select * from z3950servers where (name like ?) 
order by rank,name");
+       my $sth=$dbh->prepare("Select 
host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers 
where (name like ?) order by rank,name");
        $sth->execute("$data[0]\%");
        my @results;
        while (my $data=$sth->fetchrow_hashref) {
@@ -52,7 +53,6 @@
 
 my $pagesize=20;
 my $op = $input->param('op');
-$searchfield=~ s/\,//g;
 
 my ($template, $loggedinuser, $cookie) 
     = get_template_and_user({template_name => "admin/z3950servers.tmpl",
@@ -76,7 +76,7 @@
        my $data;
        if ($searchfield) {
                my $dbh = C4::Context->dbh;
-               my $sth=$dbh->prepare("select * from z3950servers where (name = 
?) order by rank,name");
+               my $sth=$dbh->prepare("select 
host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers 
where (name = ?) order by rank,name");
                $sth->execute($searchfield);
                $data=$sth->fetchrow_hashref;
                $sth->finish;
@@ -87,17 +87,7 @@
                         db   => $data->{'db'},
                         userid => $data->{'userid'},
                         password => $data->{'password'},
-               
-                       opacshow => CGI::checkbox(-name=>'opacshow',
-                                               -checked=> 
$data->{'opacshow'}?'checked':'',
-                                               -value=> 1,
-                                               -label => '',
-                                               -id=> 'opacshow'),
-                       checked => CGI::checkbox(-name=>'checked',
-                                               -checked=> 
$data->{'checked'}?'checked':'',
-                                               -value=> 1,
-                                               -label => '',
-                                               -id=> 'checked'),
+                        checked => $data->{'checked'},
                         rank => $data->{'rank'});
                                                                                
                        # END $OP eq ADD_FORM
 ################## ADD_VALIDATE ##################################
@@ -108,24 +98,30 @@
        my $sth=$dbh->prepare("select * from z3950servers where name=?");
        $sth->execute($input->param('searchfield'));
        if ($sth->rows) {
-               $sth=$dbh->prepare("update z3950servers set host=?, port=?, 
db=?, userid=?, password=?, name=?, checked=?, rank=?,opacshow=?,syntax=? where 
name=?");
+               $sth=$dbh->prepare("update z3950servers set host=?, port=?, 
db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=? where name=?");
                $sth->execute($input->param('host'),
                      $input->param('port'),
                      $input->param('db'),
                      $input->param('userid'),
                      $input->param('password'),
                      $input->param('searchfield'),
-                     $input->param('checked')?1:0,
+                     $input->param('checked'),
                      $input->param('rank'),
-                  $input->param('opacshow')?1:0,
                         $input->param('syntax'),
                      $input->param('searchfield'),
                      );
        } else {
-               $sth=$dbh->prepare("insert into z3950servers 
(host,port,db,userid,password,name,checked,rank,opacshow,syntax) values (?, ?, 
?, ?, ?, ?, ?, ?, ?, ? )");
-               $sth->execute($input->param('host'), $input->param('port'), 
$input->param('db'), $input->param('userid'),
-                     $input->param('password'), 
$input->param('searchfield'),$input->param('checked')?1:0, 
$input->param('rank'),
-                     $input->param('opacshow')?1:0,$input->param('syntax') );
+               $sth=$dbh->prepare("insert into z3950servers 
(host,port,db,userid,password,name,checked,rank,syntax) values (?, ?, ?, ?, ?, 
?, ?, ?,?)");
+               $sth->execute($input->param('host'),
+                     $input->param('port'),
+                     $input->param('db'),
+                     $input->param('userid'),
+                     $input->param('password'),
+                     $input->param('searchfield'),
+                     $input->param('checked'),
+                     $input->param('rank'),
+                        $input->param('syntax'),
+                     );
        }
        $sth->finish;
                                                                                
                        # END $OP eq ADD_VALIDATE
@@ -135,7 +131,7 @@
        $template->param(delete_confirm => 1);
        my $dbh = C4::Context->dbh;
 
-       my $sth2=$dbh->prepare("select * from z3950servers where (name = ?) 
order by rank,name");
+       my $sth2=$dbh->prepare("select 
host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers 
where (name = ?) order by rank,name");
        $sth2->execute($searchfield);
        my $data=$sth2->fetchrow_hashref;
        $sth2->finish;
@@ -145,16 +141,7 @@
                          db   => $data->{'db'},
                          userid => $data->{'userid'},
                          password => $data->{'password'},
-                      checked => CGI::checkbox(-name=>'checked',
-                                               -checked=> 
$data->{'checked'}?'checked':'',
-                                               -value=> 1,
-                                               -label => '',
-                                               -id=> 'checked'),
-               opacshow => CGI::checkbox(-name=>'opacshow',
-                                               -checked=> 
$data->{'opacshow'}?'checked':'',
-                                               -value=> 1,
-                                               -label => '',
-                                               -id=> 'opacshow'),
+                         checked => $data->{'checked'},
                          rank => $data->{'rank'});
 
                                                                                
                        # END $OP eq DELETE_CONFIRM
@@ -186,7 +173,6 @@
                        userid =>$results->[$i]{'userid'},
                        password => ($results->[$i]{'password'}) ? ('#######') 
: ('&nbsp;'),
                        checked => $results->[$i]{'checked'},
-                       opacshow => $results->[$i]{'opacshow'},
                        rank => $results->[$i]{'rank'},
                        syntax => $results->[$i]{'syntax'},
                        toggle => $toggle);
@@ -212,5 +198,8 @@
                                 nextpage => $offset+$pagesize);
        }
 } #---- END $OP eq DEFAULT
-
+$template->param(intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+               intranetstylesheet => 
C4::Context->preference("intranetstylesheet"),
+               IntranetNav => C4::Context->preference("IntranetNav"),
+               );
 output_html_with_http_headers $input, $cookie, $template->output;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]