X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=admin%2Fbranches.pl;h=d172ea681948c336f8bc232392de7a69ea256c79;hb=b2a649cfd8172f97958837b40e9894c7a6cdd30c;hp=803d250cf5c2e63870fe6ed113ac2a7b9822ce21;hpb=363ea5ce08c6e7c729a3d407b498bf89ea8a9d25;p=koha.git diff --git a/admin/branches.pl b/admin/branches.pl index 803d250cf5..d172ea6819 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -63,7 +63,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => { parameters => 1}, + flagsrequired => { parameters => 'parameters_remaining_permissions'}, debug => 1, } ); @@ -189,12 +189,10 @@ elsif ( $op eq 'addcategory_validate' ) { elsif ( $op eq 'delete_category' ) { # if the user has pressed the "delete branch" button. - my $message = "MESSAGE8" if CheckBranchCategorycode($categorycode); - if ($message) { + if ( CheckBranchCategorycode($categorycode) ) { $template->param( else => 1 ); - default($message,$template); - } - else { + default( 'MESSAGE8', $template ); + } else { $template->param( delete_category => 1 ); $template->param( categorycode => $categorycode ); } @@ -256,15 +254,15 @@ sub editbranchform { # # We export a "categoryloop" array to the template, each element of which # contains separate 'categoryname', 'categorycode', 'codedescription', and - # 'checked' fields. The $checked field is either '' or 'checked="checked"' + # 'checked' fields. The $checked field is either empty or 1' my $catinfo = GetBranchCategory(); my @categoryloop = (); foreach my $cat (@$catinfo) { - my $checked = ""; + my $checked; my $tmp = quotemeta( $cat->{'categorycode'} ); if ( grep { /^$tmp$/ } @{ $data->{'categories'} } ) { - $checked = "checked=\"checked\""; + $checked = 1; } push @categoryloop, { categoryname => $cat->{'categoryname'}, @@ -330,6 +328,7 @@ sub branchinfotable { # - branchfax | # - branchemail / # - branchurl / + # - opac_info (can contain HTML) # - address-empty-p (1 if no address information, 0 otherwise) # - categories (containing a static error message) # - category_list (loop containing "categoryname") @@ -343,9 +342,9 @@ sub branchinfotable { for my $field ( 'branchaddress1', 'branchaddress2', 'branchaddress3', 'branchzip', - 'branchcity', 'branchcountry', + 'branchcity', 'branchstate', 'branchcountry', 'branchphone', 'branchfax', - 'branchemail', 'branchurl', + 'branchemail', 'branchurl', 'opac_info', 'branchip', 'branchprinter', 'branchnotes' ) { @@ -402,11 +401,13 @@ sub _branch_to_template { branchaddress3 => $data->{'branchaddress3'}, branchzip => $data->{'branchzip'}, branchcity => $data->{'branchcity'}, + branchstate => $data->{'branchstate'}, branchcountry => $data->{'branchcountry'}, branchphone => $data->{'branchphone'}, branchfax => $data->{'branchfax'}, branchemail => $data->{'branchemail'}, branchurl => $data->{'branchurl'}, + opac_info => $data->{'opac_info'}, branchip => $data->{'branchip'}, branchnotes => $data->{'branchnotes'}, );