|
Lines 25-31
use C4::Auth;
Link Here
|
| 25 |
use C4::Context; |
25 |
use C4::Context; |
| 26 |
use C4::Output; |
26 |
use C4::Output; |
| 27 |
use C4::Koha; |
27 |
use C4::Koha; |
| 28 |
use C4::Circulation qw{ IsBranchTransferAllowed DeleteBranchTransferLimits CreateBranchTransferLimit }; |
28 |
use C4::Circulation qw{ DeleteBranchTransferLimits CreateBranchTransferLimit }; |
|
|
29 |
use Koha::Item::Transfer::Limits; |
| 29 |
|
30 |
|
| 30 |
my $input = new CGI; |
31 |
my $input = new CGI; |
| 31 |
|
32 |
|
|
Lines 75-81
while ( my $row = $sth->fetchrow_hashref ) {
Link Here
|
| 75 |
if ( $input->param('updateLimits') ) { |
76 |
if ( $input->param('updateLimits') ) { |
| 76 |
DeleteBranchTransferLimits($branchcode); |
77 |
DeleteBranchTransferLimits($branchcode); |
| 77 |
|
78 |
|
| 78 |
|
|
|
| 79 |
foreach my $code ( @codes ) { |
79 |
foreach my $code ( @codes ) { |
| 80 |
foreach my $toBranch ( @branchcodes ) { |
80 |
foreach my $toBranch ( @branchcodes ) { |
| 81 |
my $isSet = not $input->param( $code . "_" . $toBranch); |
81 |
my $isSet = not $input->param( $code . "_" . $toBranch); |
|
Lines 95-100
foreach my $branchcode ( @branchcodes ) {
Link Here
|
| 95 |
} |
95 |
} |
| 96 |
my $branchcount = scalar(@branchcode_loop); |
96 |
my $branchcount = scalar(@branchcode_loop); |
| 97 |
|
97 |
|
|
|
98 |
my $limits_rs = Koha::Item::Transfer::Limits->search( { fromBranch => $branchcode } ); |
| 99 |
my $limits = {}; |
| 100 |
while ( my $l = $limits_rs->next ) { |
| 101 |
$limits->{ $l->toBranch } = $l->$limitType; |
| 102 |
} |
| 103 |
|
| 98 |
## Build the default data |
104 |
## Build the default data |
| 99 |
my @codes_loop; |
105 |
my @codes_loop; |
| 100 |
foreach my $code ( @codes ) { |
106 |
foreach my $code ( @codes ) { |
|
Lines 104-120
foreach my $code ( @codes ) {
Link Here
|
| 104 |
$row_data{ to_branch_loop } = \@to_branch_loop; |
110 |
$row_data{ to_branch_loop } = \@to_branch_loop; |
| 105 |
foreach my $toBranch ( @branchcodes ) { |
111 |
foreach my $toBranch ( @branchcodes ) { |
| 106 |
my %row_data; |
112 |
my %row_data; |
| 107 |
my $isChecked = IsBranchTransferAllowed( $toBranch, $branchcode, $code ); |
|
|
| 108 |
$row_data{ code } = $code; |
113 |
$row_data{ code } = $code; |
| 109 |
$row_data{ toBranch } = $toBranch; |
114 |
$row_data{ toBranch } = $toBranch; |
| 110 |
$row_data{ isChecked } = $isChecked; |
115 |
$row_data{ isChecked } = $limits->{ $toBranch } ? 0 : 1; |
| 111 |
push( @to_branch_loop, \%row_data ); |
116 |
push( @to_branch_loop, \%row_data ); |
| 112 |
} |
117 |
} |
| 113 |
|
118 |
|
| 114 |
push( @codes_loop, \%row_data ); |
119 |
push( @codes_loop, \%row_data ); |
| 115 |
} |
120 |
} |
| 116 |
|
121 |
|
| 117 |
|
|
|
| 118 |
$template->param( |
122 |
$template->param( |
| 119 |
branchcount => $branchcount, |
123 |
branchcount => $branchcount, |
| 120 |
codes_loop => \@codes_loop, |
124 |
codes_loop => \@codes_loop, |
| 121 |
- |
|
|