Bug 22284: New hold group options in smart-rules
authorAgustin Moyano <agustinmoyano@theke.io>
Mon, 25 Mar 2019 03:43:05 +0000 (00:43 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 3 Jan 2020 12:58:03 +0000 (12:58 +0000)
This patch adds new options for 'Default checkout, hold and return policy'
and 'Default holds policy by item type', both in 'Hold policy' and 'Hold
pickup library match' columns

To test:
1) Go to 'Circulation and fines rules' in admin
2) Check that there are no options for hold group in 'Hold policy' and 'Hold
pickup library match' columns
3) Apply this patch
SUCCESS => in 'Hold policy' you should see 'From local hold group' option, and in
'Hold pickup library match' you should see "Item's hold group"
4) Select any of those options and save
SUCCESS => options should be selected when page reloads
5) Sign off

Sponsored-by: VOKAL
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt

index 79b002c..4f04428 100644 (file)
                                 From any library
                             </option>
 
+                           [% IF holdallowed == 3 %]
+                            <option value="3" selected="selected">
+                            [% ELSE %]
+                            <option value="3">
+                            [% END %]
+                                From local hold group
+                            </option>
+
                             [% IF holdallowed == 1 %]
                                 <option value="1" selected="selected">
                             [% ELSE %]
                                 </option>
                             [% END %]
 
+                           [% IF hold_fulfillment_policy == 'holdgroup' %]
+                                <option value="holdgroup" selected="selected">
+                                    item's hold group
+                                </option>
+                            [% ELSE %]
+                                <option value="holdgroup">
+                                    item's hold group
+                                </option>
+                            [% END %]
+
                             [% IF hold_fulfillment_policy == 'homebranch' %]
                                 <option value="homebranch" selected="selected">
                                     item's home library
     [% END %]
 
     <div id="refund-lost-item-fee-on-return" class="container">
-  [% IF current_branch == '*' %]
-    <h3>Default lost item fee refund on return policy</h3>
-  [% ELSE %]
-    <h3>Lost item fee refund on return policy for [% Branches.GetName(current_branch) | html %]</h3>
-  [% END %]
+        [% IF current_branch == '*' %]
+            <h3>Default lost item fee refund on return policy</h3>
+        [% ELSE %]
+            <h3>Lost item fee refund on return policy for [% Branches.GetName(current_branch) | html %]</h3>
+        [% END %]
         <p>Specify the default policy for lost item fees on return.
         </p>
         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
         </p>
         <ul>
             <li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
+            <li><strong>From local hold group:</strong> Only patrons from libraries in the same item's home library hold groups may put this book on hold.</li>
             <li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li>
             <li><strong>No holds allowed:</strong> No patron may put this book on hold.</li>
         </ul>
                             <td>
                                 [% IF holdallowed == 2 %]
                                     <span>From any library</span>
+                               [% ELSIF holdallowed == 3 %]
+                                    <span>From local hold group</span>
                                 [% ELSIF holdallowed == 1 %]
                                     <span>From home library</span>
                                 [% ELSE %]
                                     <span>any library</span>
                                 [% ELSIF hold_fulfillment_policy == 'homebranch' %]
                                     <span>item's home library</span>
+                                [% ELSIF hold_fulfillment_policy == 'holdgroup' %]
+                                    <span>item's hold group</span>
                                 [% ELSIF hold_fulfillment_policy == 'holdingbranch' %]
                                     <span>item's holding library</span>
                                 [% END %]
                     <td>
                         <select name="holdallowed">
                             <option value="2">From any library</option>
+                            <option value="3">From local hold group</option>
                             <option value="1">From home library</option>
                             <option value="0">No holds allowed</option>
                         </select>
                                 any library
                             </option>
 
+                            <option value="holdgroup">
+                                item's hold group
+                            </option>
+
                             <option value="homebranch">
                                 item's home library
                             </option>