X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=admin%2Fsmart-rules.pl;h=f29093411b89f17ec4ea648daf59e3cdc4e377f3;hb=2177562ecf64a76bb069009358a843bb80e78a41;hp=3c77f9389315b7f3b9278076b775b5be2f9b83e7;hpb=8e00f55216feb6b160d281b7020639cc27928dd2;p=koha.git diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 3c77f93893..f29093411b 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -339,12 +339,11 @@ elsif ($op eq "add-branch-item") { my $branches = GetBranches(); my @branchloop; for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { - my $selected = 1 if $thisbranch eq $branch; - my %row =(value => $thisbranch, - selected => $selected, - branchname => $branches->{$thisbranch}->{'branchname'}, - ); - push @branchloop, \%row; + push @branchloop, { + value => $thisbranch, + selected => $thisbranch eq $branch, + branchname => $branches->{$thisbranch}->{'branchname'}, + }; } my $sth=$dbh->prepare("SELECT description,categorycode FROM categories ORDER BY description"); @@ -376,6 +375,7 @@ my $sth2 = $dbh->prepare(" $sth2->execute($branch); while (my $row = $sth2->fetchrow_hashref) { + $row->{'current_branch'} ||= $row->{'branchcode'}; $row->{'humanitemtype'} ||= $row->{'itemtype'}; $row->{'default_humanitemtype'} = 1 if $row->{'humanitemtype'} eq '*'; $row->{'humancategorycode'} ||= $row->{'categorycode'}; @@ -425,7 +425,7 @@ foreach my $entry (@sorted_branch_cat_rules, @sorted_row_loop) { $entry->{unlimited_maxissueqty} = 1 unless defined($entry->{maxissueqty}); } -my @sorted_row_loop = sort by_category_and_itemtype @row_loop; +@sorted_row_loop = sort by_category_and_itemtype @row_loop; my $sth_branch_item; if ($branch eq "*") {