Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl
Ian Walls e57dadf762 Bug 5548: Hard Due Dates Circ Rule
Implements the RFC found at http://wiki.koha-community.org/wiki/Hard_Due_Dates_Circ_Rule_RFC.  See squashed commits
messages below for details of implementation.

Squashed commit of the following:

commit 871b91af00871146eb1216ebf5ce673dda2c5925
Author: Ian Walls <ian.walls@bywatersolutions.com>
Date:   Tue Dec 28 15:09:49 2010 -0500

    Hard Due Dates dev part 3: implementing the due dates in circ

    CalcDateDue now calls GetLoanLength, rather than each invocation running separately one after another.  Therefore, instead of
    the 'loanlength' param, CalcDateDue now takes 'itype', and uses the info to get both the issuelength and the hardduedate info (if it exists)

    Global Due Date no longer populates in the sticky due date field in Circ, since it can't be determined before the item is scanned.  Any specified
    due date still overrides the circulation rules, if allowed.

    Hard Due Dates in the past will return an error message, but can be manually specified if truly desired.

    Also, a small fix to updatedatabase.pl to allow the old data to populate if possible.

commit 14d5505f3c01287a2464a759f0076c1d4b665c49
Author: Ian Walls <ian.walls@bywatersolutions.com>
Date:   Mon Dec 27 18:28:11 2010 -0500

    HardDueDates dev part 2:  adding admin interface

    Adds columns to Smart Rules page, including calendar for easy date selection.

    Removes globalDueDate and ceilingDueDates from system preferences editors

commit 76e3e3d86a7a54c6ce4253e7f68278b4dc75a0bb
Author: Ian Walls <ian.walls@bywatersolutions.com>
Date:   Mon Dec 27 15:58:05 2010 -0500

    HardDueDates dev part 1: database changes

    Adds two new columns to issuingrules, a hardduedate and a hardduedatecompare.  If globalduedate is set, use that as the universal value
    for all circ rules.  Else, if ceilingduedate is set, use that as the universal value.  Adjust the comparison accordingly (-1 before, 0
    exact, 1 after).  the old system preferences globalDueDate and ceilingDueDate are then removed.

    Rebased onto 3.03.00.032

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-30 20:35:45 +13:00

373 lines
19 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Administration &rsaquo; Circulation and Fine Rules</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$('#selectlibrary').find("input:submit").hide();
$('#branch').change(function() {
$('#selectlibrary').submit();
});
});
//]]>
</script>
<!-- Enable Calendar system -->
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-system.css" />
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar.js"></script>
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-en.js"></script>
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/calendar/calendar-setup.js"></script>
<!-- End Calendar system additions -->
</head>
<body>
<!-- TMPL_INCLUDE NAME="header.inc" -->
<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; Circulation and Fine Rules</div>
<div id="doc3" class="yui-t1">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1 class="parameters">
<!-- TMPL_IF NAME="humanbranch" -->
Defining circulation and fine rules for "<!-- TMPL_VAR NAME="humanbranch" -->"
<!-- TMPL_ELSE -->
Defining circulation and fine rules for all libraries
<!-- /TMPL_IF -->
</h1>
<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 library, same patron type, same item type</li>
<li>same library, same patron type, all item types</li>
<li>same library, all patron types, same item type</li>
<li>same library, all patron types, all item types</li>
<li>all libraries, same patron type, same item type</li>
<li>all libraries, same patron type, all item types</li>
<li>all libraries, all patron types, same item type</li>
<li>all libraries, all patron types, all item types</li>
</ul>
<p>To modify a rule, create a new one with the same patron type and item type.</p>
</div>
<div>
<form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
Select a library :
<select name="branch" id="branch" style="width:20em;">
<option value="*">All libraries</option>
<!-- TMPL_LOOP NAME="branchloop" -->
<!-- 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>
<!-- TMPL_IF Name="definedbranch" --><form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"><label
for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidden" name="frombranch" value="<!-- TMPL_VAR NAME="current_branch" -->" />
<select name="tobranch" id="tobranch"><!-- TMPL_LOOP NAME="branchloop" --><option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option><!-- /TMPL_LOOP --></select> <input type="submit" value="Clone" /></form><!-- /TMPL_IF --></fieldset>
<form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
<input type="hidden" name="op" value="add" />
<table>
<tr>
<th>Patron Category</th>
<th>Item Type</th>
<th>Current Checkouts Allowed</th>
<th>Loan Period (day)</th>
<th>Hard Due Date</th>
<th>Fine Amount</th>
<th>Fine Charging Interval</th>
<th>Fine Grace period (day)</th>
<th>Suspension in Days (day)</th>
<th>Renewals Allowed (count)</th>
<th>Holds Allowed (count)</th>
<th>Rental Discount (%)</th>
<th>&nbsp;</th>
</tr>
<!-- TMPL_LOOP NAME="rules" -->
<!-- TMPL_UNLESS NAME="__odd__" -->
<tr class="highlight">
<!-- TMPL_ELSE -->
<tr>
<!-- /TMPL_UNLESS -->
<td><!-- TMPL_IF NAME="default_humancategorycode" -->
<em>All</em>
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="humancategorycode" -->
<!-- /TMPL_IF -->
</td>
<td><!-- TMPL_IF NAME="default_humanitemtype" -->
<em>All</em>
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="humanitemtype" -->
<!-- /TMPL_IF -->
</td>
<td><!-- TMPL_IF NAME="unlimited_maxissueqty" -->
Unlimited
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="maxissueqty" -->
<!-- /TMPL_IF -->
</td>
<td><!-- TMPL_VAR NAME="issuelength" --></td>
<td><!-- TMPL_IF NAME="hardduedate" -->
<!-- TMPL_IF NAME="hardduedatebefore" -->before <!-- TMPL_VAR NAME="hardduedate" --></td>
<!-- TMPL_ELSE --><!-- TMPL_IF NAME="hardduedateexact" -->on <!-- TMPL_VAR NAME="hardduedate" --></td>
<!-- TMPL_ELSE --><!-- TMPL_IF NAME="hardduedateafter" -->after <!-- TMPL_VAR NAME="hardduedate" --></td><!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<!-- TMPL_ELSE -->None defined<!-- /TMPL_IF -->
<td><!-- TMPL_VAR NAME="fine" --></td>
<td><!-- TMPL_VAR NAME="chargeperiod" --></td>
<td><!-- TMPL_VAR NAME="firstremind" --></td>
<td><!-- TMPL_VAR NAME="finedays" --></td>
<td><!-- TMPL_VAR NAME="renewalsallowed" --></td>
<td><!-- TMPL_VAR NAME="reservesallowed" --></td>
<td><!-- TMPL_VAR NAME="rentaldiscount" --></td>
<td>
<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="current_branch" -->">Delete</a>
</td>
</tr>
<!-- /TMPL_LOOP -->
<tr>
<td>
<select name="categorycode">
<option value="*">All</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="*">All</option>
<!-- TMPL_LOOP NAME="itemtypeloop" -->
<option value="<!-- TMPL_VAR NAME="itemtype" -->"><!-- TMPL_VAR NAME="description" --></option>
<!-- /TMPL_LOOP -->
</select>
</td>
<td><input name="maxissueqty" size="3" /></td>
<td><input name="issuelength" size="3" /> </td>
<td><select name="hardduedatecompare">
<option value="-1">Before</option>
<option value="0">Exactly on</option>
<option value="1">After</option>
</select>
<input type="text" size="10" id="hardduedate" name="hardduedate" value="<!-- TMPL_VAR NAME="hardduedate" -->" />
<!-- TMPL_INCLUDE NAME="date-format.inc" -->
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarDueDate" style="cursor: pointer;"/>
<script language="JavaScript" type="text/javascript">
function refocus(calendar) {
document.getElementById('hardduedate').focus();
calendar.hide();
};
Calendar.setup(
{
inputField : "hardduedate",
ifFormat : "%m/%d/%Y",
button : "CalendarDueDate",
onClose: refocus
}
);
</script>
</td>
<td><input name="fine" size="4" /></td>
<td><input name="chargeperiod" size="2" /></td>
<td><input name="firstremind" size="2" /> </td>
<td><input name="finedays" size="3" /> </td>
<td><input name="renewalsallowed" size="2" /></td>
<td><input name="reservesallowed" size="2" /></td>
<td><input name="rentaldiscount" size="2" /></td>
<td><input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="current_branch" -->"/><input type="submit" value="Add" class="submit" /></td>
</tr>
</table>
</form>
</div>
<div id="defaults-for-this-library" class="container">
<h3>Default checkout and hold policy for <!-- TMPL_IF NAME="humanbranch" --><!-- TMPL_VAR NAME="humanbranch" --><!-- TMPL_ELSE -->all libraries<!-- /TMPL_IF --></h3>
<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>
<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="current_branch" -->"/>
<table>
<tr>
<th>&nbsp;</th>
<th>Total Current Checkouts Allowed</th>
<th>Hold Policy</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
<tr>
<td><em>Defaults<!-- TMPL_UNLESS NAME="default_rules" --> (not set)<!-- /TMPL_IF --></em></td>
<td><input type="text" 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="current_branch" -->">Unset</a>
</td>
</tr>
</table>
</form>
</div>
<!-- TMPL_IF NAME="show_branch_cat_rule_form" -->
<div id="holds-policy-by-patron-category" class="container">
<h3>Checkout limit by patron category for <!-- TMPL_IF NAME="humanbranch" --><!-- TMPL_VAR NAME="humanbranch" --><!-- TMPL_ELSE -->all libraries<!-- /TMPL_IF --></h3>
<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>
<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="current_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="current_branch" -->">Delete</a>
</td>
</tr>
<!-- /TMPL_LOOP -->
<tr>
<td>
<select name="categorycode">
<!-- TMPL_LOOP NAME="categoryloop" -->
<option value="<!-- TMPL_VAR NAME="categorycode" -->"><!-- TMPL_VAR NAME="description" --></option>
<!-- /TMPL_LOOP -->
</select>
</td>
<td><input name="maxissueqty" size="3" /></td>
<td><input type="submit" value="Add" class="submit" /></td>
</tr>
</table>
</form>
</div>
<!-- /TMPL_IF -->
<div id="holds-policy-by-item-type" class="container">
<h3>Holds policy by item type for <!-- TMPL_IF NAME="humanbranch" --><!-- TMPL_VAR NAME="humanbranch" --><!-- TMPL_ELSE -->all libraries<!-- /TMPL_IF --></h3>
<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 library, <em>not</em> the library where the hold is being placed..
</p>
<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="current_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="current_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>
</div>
</div>
</div>
<div class="yui-b">
<!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->