[HEAD](bug #3318) Granular renew permissions
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / smart-rules.tmpl
index 0080efd..4f9aa99 100644 (file)
@@ -35,52 +35,205 @@ $(document).ready(function() {
     <div class="help">
         <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
         <ul>
-            <li>same branch, same borrower type, same item type</li>
-            <li>same branch, same borrower type, default item type</li>
-            <li>same branch, default borrower type, same item type</li>
-            <li>default branch, same borrower type, same item type</li>
-            <li>anything else</li>
+            <li>same library, same patron type, same item type</li>
+            <li>same library, same patron type, default item type</li>
+            <li>same library, default patron type, same item type</li>
+            <li>same library, default patron type, default item type</li>
+            <li>default library, same patron type, same item type</li>
+            <li>default library, same patron type, default item type</li>
+            <li>default library, default patron type, same item type</li>
+            <li>default library, default patron type, default item type</li>
         </ul>
-        <p>To modify a rule, create a new one with the same borrower type and item type.</p>
+        <p>To modify a rule, create a new one with the same patron type and item type.</p>
     </div>
     <div id="bloc100">
         <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
-        Select a branch :
-            <select name="branch" id="branch">
-                <option value="">Default</option>
+        Select a library :
+            <select name="branch" id="branch" style="width:20em;">
+                <option value="*">Default</option>
             <!-- TMPL_LOOP NAME="branchloop" -->
-                <option value="<!-- TMPL_VAR NAME="value" -->" <!-- TMPL_IF NAME="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR NAME="branchname" --></option>
+                               <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option><!-- /TMPL_IF -->
             <!-- /TMPL_LOOP -->
             </select>
         </form>
+               <br />
+               <br />
         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
             <input type="hidden" name="op" value="add" />
             <table>
             <tr>
-                <th>Item Type</th><th>Borrower Type</th><th>Amount</th><th>Grace Period</th><th>Charging Interval</th><th>Amount Loanable</th><th>Loan time</th><th>&nbsp;</th>
+                <th>Patron Category</th>
+                <th>Item Type</th>
+                <th>Fine Amount</th>
+                <th>Fine Days</th>
+                <th>Fine Grace Period</th>
+                <th>Fine Charging Interval</th>
+                <th>Current Checkouts Allowed</th>
+                <th>Renewals Allowed</th>
+                <th>Loan Period</th><th>&nbsp;</th>
             </tr>
             <!-- TMPL_LOOP NAME="rules" -->
+                <!-- TMPL_UNLESS NAME="__odd__" -->
+                <tr class="highlight">
+                <!-- TMPL_ELSE -->
                 <tr>
-                    <td><!-- TMPL_VAR NAME="humanitemtype" --></td>
-                    <td><!-- TMPL_VAR NAME="humancategorycode" --></td>
-                    <td>$<!-- TMPL_VAR NAME="fine" --></td>
-                    <td><!-- TMPL_VAR NAME="firstremind" --> day(s)</td>
-                    <td><!-- TMPL_VAR NAME="chargeperiod" --> day(s)</td>
-                    <td><!-- TMPL_VAR NAME="maxissueqty" --></td>
-                    <td><!-- TMPL_VAR NAME="issuelength" --> day(s)</td>
+                <!-- /TMPL_UNLESS -->
+                    <td><!-- TMPL_IF NAME="default_humancategorycode" -->
+                            <em>Default</em>
+                        <!-- TMPL_ELSE -->
+                            <!-- TMPL_VAR NAME="humancategorycode" -->
+                        <!-- /TMPL_IF -->
+                    </td>
+                    <td><!-- TMPL_IF NAME="default_humanitemtype" -->
+                            <em>Default</em>
+                        <!-- TMPL_ELSE -->
+                            <!-- TMPL_VAR NAME="humanitemtype" -->
+                        <!-- /TMPL_IF -->
+                    </td>
+                    <td><!-- TMPL_VAR NAME="fine" --></td>
+                    <td>
+                        <!-- TMPL_IF NAME="finedays" -->
+                            <!-- TMPL_VAR NAME="finedays" --> day(s)
+                        <!-- /TMPL_IF -->
+                    </td>
+                    <td><!-- TMPL_IF NAME="firstremind" --><!-- TMPL_VAR NAME="firstremind" --> day(s)<!-- /TMPL_IF --></td>
+                    <td><!-- TMPL_IF NAME="chargeperiod" --><!-- TMPL_VAR NAME="chargeperiod" --> day(s)<!-- /TMPL_IF --></td>
+                    <td><!-- TMPL_IF NAME="unlimited_maxissueqty" -->
+                            Unlimited
+                        <!-- TMPL_ELSE -->
+                            <!-- TMPL_VAR NAME="maxissueqty" -->
+                        <!-- /TMPL_IF -->
+                    </td>
+                                       <td><!-- TMPL_IF NAME="renewalsallowed" --><!-- TMPL_VAR NAME="renewalsallowed" --> time(s)<!-- /TMPL_IF --></td>
+                    <td><!-- TMPL_IF NAME="issuelength" --><!-- TMPL_VAR NAME="issuelength" --> day(s)<!-- /TMPL_IF --></td>
                     <td>
-                        <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-<!-- TMPL_VAR NAME="itemtype" -->-<!-- TMPL_VAR NAME="categorycode" -->&amp;branch=<!-- TMPL_VAR NAME="branch" -->">Delete</a>
+                        <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=<!-- TMPL_VAR NAME="itemtype" -->&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" -->&amp;branch=<!-- TMPL_VAR NAME="branch" -->">Delete</a>
                     </td>
                 </tr>
             <!-- /TMPL_LOOP -->
                 <tr>
                     <td>
-                        <select name="itemtype">
+                        <select name="categorycode">
+                            <option value="*">Default</option>
+                        <!-- TMPL_LOOP NAME="categoryloop" -->
+                            <option value="<!-- TMPL_VAR NAME="categorycode" -->"><!-- TMPL_VAR NAME="description" --></option>
+                        <!-- /TMPL_LOOP -->
+                        </select>
+                    </td>
+                    <td>
+                        <select name="itemtype" style="width:13em;">
+                            <option value="*">Default</option>
                         <!-- TMPL_LOOP NAME="itemtypeloop" -->
                             <option value="<!-- TMPL_VAR NAME="itemtype" -->"><!-- TMPL_VAR NAME="description" --></option>
                         <!-- /TMPL_LOOP -->
                         </select>
                     </td>
+                    <td><input name="fine" size="4" /></td>
+                    <td><input name="finedays" size="2" /> day(s)</td>
+                    <td><input name="firstremind" size="2" /> day(s)</td>
+                    <td><input name="chargeperiod" size="2" /> day(s)</td>
+                    <td><input name="maxissueqty" size="3" /></td>
+                    <td><input name="renewalsallowed" size="3" /></td>
+                    <td><input name="issuelength" size="3" /> day(s)</td>
+                    <td><input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/><input type="submit" value="Add" class="submit" /></td>
+                </tr>
+            </table>
+        </form>
+    </div>
+    <div class="help">
+        <h4>Defaults for this library</h4>
+        <p>You can set a default maximum number of checkouts and hold policy that will be used if none is defined below for a particular item type or category.</p>
+    </div>
+    <div>
+        <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
+            <input type="hidden" name="op" value="set-branch-defaults" />
+            <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/>
+            <table>
+                <tr>
+                    <th>&nbsp;</th>
+                    <th>Total Current Checkouts Allowed</th>
+                    <th>Hold Policy</th>
+                    <th>&nbsp;</th>
+                </tr>
+                <tr>
+                    <td><em>Defaults<!-- TMPL_UNLESS NAME="default_rules" --> (not set)<!-- /TMPL_IF --></em></td>
+                    <td><input name="maxissueqty" size="3" value="<!-- TMPL_VAR NAME="default_maxissueqty" -->"/></td>
+                    <td>
+                        <select name="holdallowed">
+                            <!-- TMPL_IF NAME="default_holdallowed_any" -->
+                            <option value="2" selected="selected">
+                            <!-- TMPL_ELSE -->
+                            <option value="2">
+                            <!-- /TMPL_IF -->
+                                From Any Library
+                            </option>
+                            <!-- TMPL_IF NAME="default_holdallowed_same" -->
+                            <option value="1" selected="selected">
+                            <!-- TMPL_ELSE -->
+                            <option value="1">
+                            <!-- /TMPL_IF -->
+                                From Home Library
+                            </option>
+                            <!-- TMPL_IF NAME="default_holdallowed_none" -->
+                            <option value="0" selected="selected">
+                            <!-- TMPL_ELSE -->
+                            <option value="0">
+                            <!-- /TMPL_IF -->
+                                No Holds Allowed
+                            </option>
+                        </select>
+                    </td>
+                    <td><input type="submit" value="Save" class="submit" /></td>
+                    <td>
+                        <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=*&amp;branch=<!-- TMPL_VAR NAME="branch" -->">Unset</a>
+                    </td>
+                </tr>
+            </table>
+        </form>
+    </div>
+    <!-- TMPL_IF NAME="show_branch_cat_rule_form" -->
+    <div class="help">
+        <p>For this library, you can specify the maximum number of loans that 
+            a patron of a given category can make, regardless of the item type.
+        </p>
+        <p>If the total amount loanable for a given patron category is left blank,
+           no limit applies, except possibly for a limit you define for a specific item type.
+        </p>
+    </div>
+    <div>
+        <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
+            <input type="hidden" name="op" value="add-branch-cat" />
+            <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/>
+            <table>
+                <tr>
+                    <th>Patron Category</th>
+                    <th>Total Current Checkouts Allowed</th>
+                    <th>&nbsp;</th>
+                </tr>
+                <!-- TMPL_LOOP NAME="branch_cat_rule_loop" -->
+                    <!-- TMPL_UNLESS NAME="__odd__" -->
+                    <tr class="highlight">
+                    <!-- TMPL_ELSE -->
+                    <tr>
+                    <!-- /TMPL_UNLESS -->
+                        <td><!-- TMPL_IF NAME="default_humancategorycode" -->
+                                <em>Default</em>
+                            <!-- TMPL_ELSE -->
+                                <!-- TMPL_VAR NAME="humancategorycode" -->
+                            <!-- /TMPL_IF -->
+                        </td>
+                        <td><!-- TMPL_IF NAME="unlimited_maxissueqty" -->
+                                Unlimited
+                            <!-- TMPL_ELSE -->
+                                <!-- TMPL_VAR NAME="maxissueqty" -->
+                            <!-- /TMPL_IF -->
+                        </td>
+                        <td>
+                            <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" -->&amp;branch=<!-- TMPL_VAR NAME="branch" -->">Delete</a>
+                        </td>
+                    </tr>
+                <!-- /TMPL_LOOP -->
+                <tr>
                     <td>
                         <select name="categorycode">
                         <!-- TMPL_LOOP NAME="categoryloop" -->
@@ -88,12 +241,86 @@ $(document).ready(function() {
                         <!-- /TMPL_LOOP -->
                         </select>
                     </td>
-                    <td>$<input name="fine" size="4" /></td>
-                    <td><input name="firstremind" size="2" /> day(s)</td>
-                    <td><input name="chargeperiod" size="2" /> day(s)</td>
                     <td><input name="maxissueqty" size="3" /></td>
-                    <td><input name="issuelength" size="3" /> day(s)</td>
-                    <td><input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/><input type="submit" value="Add" class="submit" /></td>
+                    <td><input type="submit" value="Add" class="submit" /></td>
+                </tr>
+            </table>
+        </form>
+    </div>
+    <!-- /TMPL_IF -->
+    <div class="help">
+        <p>
+            For this library, you can edit rules for given itemtypes, regardless
+            of the patron's category.
+        </p>
+        <p>
+            Currently, this means hold policies.
+            The various policies have the following effects:
+        </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 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>
+        <p>
+            Note that if the system preference
+            <code>AllowHoldPolicyOverride</code> is enabled, these policies can
+            be overridden by your circulation staff. Also, these policies are
+            based on the patron's home branch, <em>not</em> the branch that
+            the reserving staff member is from.
+        </p>
+    </div>
+    <div>
+        <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
+            <input type="hidden" name="op" value="add-branch-item" />
+            <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/>
+            <table>
+                <tr>
+                    <th>Item Type</th>
+                    <th>Hold Policy</th>
+                    <th>&nbsp;</th>
+                </tr>
+                <!-- TMPL_LOOP NAME="branch_item_rule_loop" -->
+                    <!-- TMPL_UNLESS NAME="__odd__" -->
+                    <tr class="highlight">
+                    <!-- TMPL_ELSE -->
+                    <tr>
+                    <!-- /TMPL_UNLESS -->
+                        <td><!-- TMPL_IF NAME="default_humanitemtype" -->
+                                <em>Default</em>
+                            <!-- TMPL_ELSE -->
+                                <!-- TMPL_VAR NAME="humanitemtype" -->
+                            <!-- /TMPL_IF -->
+                        </td>
+                        <td><!-- TMPL_IF NAME="holdallowed_any" -->
+                                From Any Library
+                            <!-- TMPL_ELSIF NAME="holdallowed_same" -->
+                                From Home Library
+                            <!-- TMPL_ELSE -->
+                                No Holds Allowed
+                            <!-- /TMPL_IF -->
+                        </td>
+                        <td>
+                            <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&amp;itemtype=<!-- TMPL_VAR NAME="itemtype" -->&amp;branch=<!-- TMPL_VAR NAME="branch" -->">Delete</a>
+                        </td>
+                    </tr>
+                <!-- /TMPL_LOOP -->
+                <tr>
+                    <td>
+                        <select name="itemtype">
+                        <!-- TMPL_LOOP NAME="itemtypeloop" -->
+                            <option value="<!-- TMPL_VAR NAME="itemtype" -->"><!-- TMPL_VAR NAME="description" --></option>
+                        <!-- /TMPL_LOOP -->
+                        </select>
+                    </td>
+                    <td>
+                        <select name="holdallowed">
+                            <option value="2">From Any Library</option>
+                            <option value="1">From Home Library</option>
+                            <option value="0">No Holds Allowed</option>
+                        </select>
+                    </td>
+                    <td><input type="submit" value="Add" class="submit" /></td>
                 </tr>
             </table>
         </form>