From e40728f4d50d019873d8cbc90fbdbc35688a489b Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 10 Mar 2010 22:26:36 +0100 Subject: [PATCH] MT2464 : branch_transfer_limit.pl usability change Adds branchnames along with branchcodes for display Signed-off-by: Henri-Damien LAURENT Signed-off-by: Galen Charlton --- admin/branch_transfer_limits.pl | 48 ++++++------ .../modules/admin/branch_transfer_limits.tmpl | 74 +++++++++---------- 2 files changed, 59 insertions(+), 63 deletions(-) diff --git a/admin/branch_transfer_limits.pl b/admin/branch_transfer_limits.pl index cef7537390..1b89efb8ce 100755 --- a/admin/branch_transfer_limits.pl +++ b/admin/branch_transfer_limits.pl @@ -40,6 +40,20 @@ my ($template, $loggedinuser, $cookie) my $dbh = C4::Context->dbh; +my $branchcode = $input->param('branchcode'); +my $branchname = GetBranchName($branchcode); + +# Getting the branches for user selection +my $branches = GetBranches(); +my @branch_loop; +for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { + my %row =(value => $thisbranch, + branchname => $branches->{$thisbranch}->{'branchname'}, + ); + push @branch_loop, \%row; +} + + # Set the template language for the correct limit type my $limit_phrase = 'Collection Code'; my $limitType = C4::Context->preference("BranchTransferLimitsType"); @@ -69,15 +83,13 @@ while ( my $row = $sth->fetchrow_hashref ) { ## If Form Data Passed, Update the Database if ( $input->param('updateLimits') ) { - DeleteBranchTransferLimits(); + DeleteBranchTransferLimits(); foreach my $code ( @codes ) { foreach my $toBranch ( @branchcodes ) { - foreach my $fromBranch ( @branchcodes ) { - my $isSet = $input->param( $code . "_" . $toBranch . "_" . $fromBranch ); - if ( $isSet ) { - CreateBranchTransferLimit( $toBranch, $fromBranch, $code ); - } + my $isSet = not $input->param( $code . "_" . $toBranch); + if ( $isSet ) { + CreateBranchTransferLimit( $toBranch, $branchcode, $code ); } } } @@ -100,23 +112,12 @@ foreach my $code ( @codes ) { $row_data{ code } = $code; $row_data{ to_branch_loop } = \@to_branch_loop; foreach my $toBranch ( @branchcodes ) { - my @from_branch_loop; my %row_data; - $row_data{ code } = $code; - $row_data{ toBranch } = $toBranch; - $row_data{ from_branch_loop } = \@from_branch_loop; - - foreach my $fromBranch ( @branchcodes ) { - my %row_data; - my $isChecked = ! IsBranchTransferAllowed( $toBranch, $fromBranch, $code ); - $row_data{ code } = $code; - $row_data{ toBranch } = $toBranch; - $row_data{ fromBranch } = $fromBranch; - $row_data{ isChecked } = $isChecked; - - push( @from_branch_loop, \%row_data ); - } - + my $isChecked = IsBranchTransferAllowed( $toBranch, $branchcode, $code ); + $row_data{ code } = $code; + $row_data{ toBranch } = $toBranch; + $row_data{ isChecked } = $isChecked; + $row_data{ toBranchname } = GetBranchName($toBranch); push( @to_branch_loop, \%row_data ); } @@ -127,7 +128,10 @@ foreach my $code ( @codes ) { $template->param( branchcount => $branchcount, codes_loop => \@codes_loop, + branch_loop => \@branch_loop, branchcode_loop => \@branchcode_loop, + branchcode => $branchcode, + branchname => $branchname, limit_phrase => $limit_phrase, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tmpl index 4d46b4223f..fa13d1a103 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tmpl @@ -1,5 +1,5 @@ -Koha › Administration › Library Transfer Limits +Koha › Administration › Library Checkin and Transfer Policy @@ -58,7 +56,7 @@ - +
@@ -66,9 +64,19 @@
-

Library Transfer Limits

-

Check the boxes for the items that should not be transferable.

-
For all s: Check All | Uncheck All | Toggle All
+

Library - Checkin and Transfer Policy

+
+ + + +
+ +

Check the boxes for the libraries you accept to checkin items from.

+
For all s: Check All | Uncheck All
@@ -80,20 +88,13 @@
set"> -

Limits for :

-

table" class="checkall" href="#">Check All | table" class="uncheckall" href="#">Uncheck All | table" class="swapall" href="#">Toggle All

+

Policy for :

+

table" class="checkall" href="#">Check All | table" class="uncheckall" href="#">Uncheck All

table"> - - - - - - - - - + + @@ -101,22 +102,8 @@ - - - - - + + @@ -125,9 +112,14 @@ -
- Cancel
+
+ + " /> + + Cancel +
+
-- 2.39.5
 To:
From:LibraryAllow transfer?
row" class="checkrow" /> - - __" - type="checkbox" value="1" checked="checked" /> - - __" - type="checkbox" value="1" /> - - - row" name="_" checked="checked" />