Bug 15503 [QA Followup] - Remove the use of GetBranchesLoop
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 16 Sep 2016 13:05:41 +0000 (13:05 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 14 Feb 2017 14:56:02 +0000 (14:56 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Benjamin Daeuber <bdaeuber@cityoffargo.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
acqui/addorderiso2709.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt

index a590d00..ea5fa0f 100755 (executable)
@@ -43,6 +43,7 @@ use C4::Suggestions;    # GetSuggestion
 use C4::Members;
 
 use Koha::Number::Price;
+use Koha::Libraries;
 use Koha::Acquisition::Currencies;
 use Koha::Acquisition::Order;
 use Koha::Acquisition::Booksellers;
@@ -593,7 +594,7 @@ sub import_biblios_list {
                         "item_action_${item_action}" => 1,
                         item_action => $item_action,
                         item_error => $item_error,
-                        branchloop => GetBranchesLoop(),
+                        libraries => scalar Koha::Libraries->search(),
                         locationloop => \@locations,
                         itypeloop => \@itypes,
                         ccodeloop => \@ccodes,
index 2f1485e..b7ef10a 100644 (file)
@@ -1,4 +1,5 @@
 [% USE KohaDates %]
+[% USE Branches %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; Order staged MARC records
 [% IF ( batch_details ) %]
                         <ol>
                         <li>
                         <label for="homebranch_item_[% item.item_id %]">homebranch</label><select id="homebranch_item_[% item.item_id %]" name="homebranch_[% item.biblio_count %]">
-                        [% FOREACH branchloo IN branchloop %]
-                          [% IF ( branchloo.value ) == ( item.homebranch )  %]
-                            <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
+                        [% FOREACH l IN libraries %]
+                          [% IF l.branchcode == item.homebranch %]
+                            <option value="[% l.branchcode %]" selected="selected">[% l.branchname %]</option>
                           [% ELSE %]
-                            <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
+                            <option value="[% l.branchcode %]">[% l.branchname %]</option>
                           [% END %]
                         [% END %]
                         </select>
                         </li>
 
                         <li><label for="holdingbranch_item_[% item.item_id %]">holdingbranch</label><select id="holdingbranch_item_[% item.item_id %]" name="holdingbranch_[% item.biblio_count %]">
-                        [% FOREACH branchloo IN branchloop %]
-                          [% IF ( branchloo.value ) == ( item.holdingbranch ) %]
-                            <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
+                        [% FOREACH l IN libraries %]
+                          [% IF l.branchcode == item.holdingbranch %]
+                            <option value="[% l.branchcode %]" selected="selected">[% l.branchname %]</option>
                           [% ELSE %]
-                            <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
+                            <option value="[% l.branchcode %]">[% l.branchname %]</option>
                           [% END %]
                         [% END %]
                         </select>