Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt
Aleisha 573f1ac474 Bug 3669: Moving 'Add a new message' into a pop up box and adding to patron toolbar
This patch moves all the code into an include which can be accessed from the 'Add a new message' link or the patron toolbar.

EDIT: Ensuring modal opens on all pages
EDIT2: Once the form has been submitted the page will redirect to where you submitted the form from.
EDIT3: Fixing indentation of member-add-message.inc
       Ensuring messages save on every page
       Fill branch
       Ensure predefined notes appear
       Form redirects to where it was submitted from, or just the circulation page.
EDIT4: Removing the new include file and moving it all into the modal in the toolbar
EDIT5: Removing swp file and unnecessary code duplication by utilising plugins
EDIT6: Batch checkout fixes
EDIT7: Ensure you do not get JS error from Comment 24 (Batch checkout syspref must be turned on)

To test:
1) Go to a patron circ page (circ/circulation.pl?borrowernumber=X)
2) Click 'Add a new message' under Messages
3) Confirm this brings up the modal to add a message. Confirm clicking Save saves your message. If it is an OPAC message (for the user), confirm it shows as expected on the OPAC.
4) Click Cancel. Confirm this closes the modal.
5) Click 'Add message' button in toolbar. Complete steps 3 and 4.
6) Confirm the modal opens from all other pages with the members toolbar. Confirm predefined notes shows.
	circ/circulation.pl
	members/moremember.pl
	members/routing-lists.pl
	members/statistics.pl
	members/boraccount.pl
	members/pay.pl
	members/maninvoice.pl
	members/mancredit.pl
	members/readingrec.pl
	members/notices.pl
	members/member-flags.pl
	members/member-password.pl
	members/paycollect.pl
	members/files.pl
        turn on BatchCheckouts syspref and put in appropriate patron category
        circ/circulation.pl?borrowernumber=X&batch=1
7) Confirm that the page redirects to where you submitted the form from once you have submitted it.
8) Go to Check Out tab and confirm your message saved (or OPAC, wherever you saved it)

Sponsored-by: Catalyst IT

Followed test plan, works as expected. (Re-tested for comment #24)
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2016-06-24 13:20:13 +00:00

309 lines
15 KiB
Text

[% USE Branches %]
[% USE KohaDates %]
[% USE Price %]
[% IF ( export_remove_fields OR export_with_csv_profile ) %]
[% SET exports_enabled = 1 %]
[% END %]
[% USE AuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
[% SET destination = "circ" %]
<title>Koha &rsaquo; Circulation
[% IF borrowernumber and borrower %]
&rsaquo; Batch check out &rsaquo; Issuing items to [% INCLUDE 'patron-title.inc' invert_name = 1 %]
[% END %]
</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
if($('#barcodelist').length) {
$('#barcodelist').focus();
} else if ($('#checkoutrenew').length) {
$('#checkoutrenew').focus();
}
$("#checkout_infos").dataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": 't',
"aaSorting": [],
"aoColumnDefs": [
{ "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] }
],
"bPaginate": false
}));
});
//]]>
</script>
</head>
<body id="circ_circulation_batch_checkouts" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo;
[% IF borrower and borrowernumber %]
<a href="/cgi-bin/koha/circ/circulation.pl">Batch check out</a> &rsaquo; [% INCLUDE 'patron-title.inc' %]
[% ELSE %]
Batch check out
[% END %]
</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-g">
[% IF borrowernumber and borrower %]
[% INCLUDE 'members-toolbar.inc' %]
[% END %]
[% IF borrower and not batch_allowed %]
<div class="dialog alert">You are not allowed to use batch checkout for this patron</div>
[% ELSIF borrower and noissues and not checkout_infos %]
<div class="dialog alert">
Cannot check out!
[% IF charges_is_blocker %]
<span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
[% END %]
[% IF charges_guarantees_is_blocker %]
<li>
<span class="circ-hlt">Fees &amp; Charges:</span> Patron's guarantees collectively owe [% chargesamount_guarantees | $Price %].
</li>
<li>
<span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
</li>
[% END %]
</div>
[% ELSIF borrower and not checkout_infos %]
<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]&batch=1">
<fieldset id="circ_circulation_issue">
<label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
<fieldset class="rows">
<legend>Use a file</legend>
<ol>
<li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
</ol>
</fieldset>
<fieldset class="rows">
<legend>Or list barcodes one by one</legend>
<ol>
<li>
<label for="barcodelist">Barcode list (one barcode per line): </label>
<textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
</li>
</ol>
</fieldset>
<input type="hidden" name="op" value="show" />
<fieldset class="action">
<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
<input type="hidden" name="branch" value="[% branch %]" />
<input type="hidden" name="batch" value="1" />
<input type="submit" value="Check out" class="button" />
</fieldset>
</fieldset>
</form>
[% ELSIF borrower %]
[% IF confirmation_needed && CAN_user_circulate_force_checkout %]
<h3>Batch checkout confirmation [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3>
<form method="post" action="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]" id="mainform" name="mainform" autocomplete="off">
[% ELSE %]
<h3>Batch checkout information [% IF borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3>
[% END %]
<table id="checkout_infos">
<thead>
<tr>
[% IF confirmation_needed && CAN_user_circulate_force_checkout %]
<th class="NoSort"></th>
[% END %]
<th>Barcode</th>
<th class="anti-the">Title</th>
<th>Information</th>
</tr>
</thead>
<tbody>
[% FOR checkout_info IN checkout_infos %]
<tr>
[% IF confirmation_needed && CAN_user_circulate_force_checkout %]
<td>
[% IF checkout_info.NEEDSCONFIRMATION %]
<input type="checkbox" name="barcodes" value="[% checkout_info.barcode %]" checked="checked" />
[% END %]
</td>
[% END %]
<td>[% checkout_info.barcode %]</td>
<td>
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout_info.item.biblionumber %]&amp;type=intra"><strong>[% checkout_info.item.title |html %][% FOREACH subtitl IN checkout_info.item.subtitle %] [% subtitl.subfield %][% END %]</strong></a>[% IF checkout_info.item.author %], by [% checkout_info.item.author %][% END %][% IF ( checkout_info.itme.itemnotes ) %]- <span class="circ-hlt">[% checkout_info.item.itemnotes %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout_info.item.biblionumber %]&amp;itemnumber=[% checkout_info.item.itemnumber %]#item[% checkout_info.item.itemnumber %]">[% checkout_info.item.barcode %]</a>
</td>
<td>
[% IF checkout_info.NEEDSCONFIRMATION %]
<ul class="fa-ul warn">
[% IF checkout_info.AGE_RESTRICTION %]
<li><i class="fa fa-li fa-warning"></i>Age restriction [% checkout_info.AGE_RESTRICTION %].</li>
[% END %]
[% IF checkout_info.RENEW_ISSUE %]
<li><i class="fa fa-li fa-warning"></i>This item is currently checked out to this patron. Renew?</li>
[% END %]
[% IF checkout_info.RESERVE_WAITING %]
<li><i class="fa fa-li fa-warning"></i>This item is waiting for another patron.</li>
[% END %]
[% IF checkout_info.RESERVED %]
<li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron.</li>
[% END %]
[% IF checkout_info.ISSUED_TO_ANOTHER %]
<li><i class="fa fa-li fa-warning"></i>This item is checked out to another patron.
[% IF CAN_user_circulate_force_checkout %]
Check in and check out?
[% END %]</li>
[% END %]
[% IF checkout_info.TOO_MANY %]
<li><i class="fa fa-li fa-warning"></i>Too many checked out.</li>
[% END %]
[% IF checkout_info.BORRNOTSAMEBRANCH %]
<li><i class="fa fa-li fa-warning"></i>This patron is from a different library ([% checkout_info.BORRNOTSAMEBRANCH %]).</li>
[% END %]
[% IF checkout_ino.PATRON_CANT %]
<li><i class="fa fa-li fa-warning"></i>This patron can't check out this item per library circulation policy.</li>
[% END %]
[% IF checkout_info.NOT_FOR_LOAN_FORCING %]
[% IF checkout_info.itemtype_notforloan %]
<li><i class="fa fa-li fa-warning"></i>Item type is normally not for loan.</li>
[% ELSIF checkout_info.item_notforloan %]
[% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
<li><i class="fa fa-li fa-warning"></i>Item is normally not for loan [% IF item_notforloan_lib %]([% item_notforloan_lib %])[% END %].</li>
[% END %]
[% END %]
[% IF checkout_info.USERBLOCKEDOVERDUE %]
<li><i class="fa fa-li fa-warning"></i>Patron has [% checkout_info.USERBLOCKEDOVERDUE %] overdue item(s).</li>
[% END %]
[% IF checkout_info.ITEM_LOST %]
<li><i class="fa fa-li fa-warning"></i>This item has been lost with a status of "[% checkout_info.ITEM_LOST %]."</li>
[% END %]
[% IF checkout_info.HIGHHOLDS %]
<li><i class="fa fa-li fa-warning"></i>High demand item. Loan period shortened to [% checkout_info.HIGHHOLDS.duration %] days (due [% checkout_info.HIGHHOLDS.returndate %]).</li>
[% END %]
[% IF checkout_info.HIGHHOLDS %] <!-- FIXME -->
<script type="text/javascript">
$(document).ready(function() {
$("input[name=duedatespec]:hidden").val('[% checkout_info.HIGHHOLDS.returndate %]');
});
</script>
[% END %]
[% IF NOT checkout_info.IMPOSSIBLE && ( CAN_user_circulate_force_checkout or checkout_info.HIGHHOLDS ) %]
[% IF checkout_info.RESERVED || checkout_info.RESERVE_WAITING %] <!-- arbitrary choice, revert the reserve is not possible-->
<li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron. The hold will be overridden, but not cancelled.</li>
[% END %]
[% END %]
</ul>
[% END %]
[% IF checkout_info.alert.ITEM_LOST || checkout_info.alert.OTHER_CHARGES %]
<ul class="info">
[% IF checkout_info.alert.ITEM_LOST %]
<li>This item has been lost with a status of "[% checkout_info.alert.ITEM_LOST %]."</li>
[% END %]
[% IF checkout_info.alert.OTHER_CHARGES %]
<li>The patron has unpaid charges for holds, rentals etc of [% checkout_info.alert.OTHER_CHARGES %].</li>
[% END %]
</ul>
[% END %]
[% IF checkout_info.IMPOSSIBLE %]
<ul class="fa-ul error">
[% IF checkout_info.STATS %]
<li><i class="fa fa-li fa-exclamation"></i>Local use recorded.</li>
[% END %]
[% IF checkout_info.NOT_FOR_LOAN %]
[% IF checkout_info.itemtype_notforloan %]
<li><i class="fa fa-li fa-exclamation"></i>Item type not for loan.</li>
[% ELSIF checkout_info.item_notforloan %]
[% item_notforloan_lib = AuthorisedValues.GetByCode( checkout_info.authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
<li><i class="fa fa-li fa-exclamation"></i>Item not for loan [% IF checkout_info.item_notforloan_lib %]([% checkout_info.item_notforloan_lib %])[% END %].</li>
[% END %]
[% END %]
[% IF checkout_info.WTHDRAWN %]
<li><i class="fa fa-li fa-exclamation"></i>Item has been withdrawn.</li>
[% END %]
[% IF checkout_info.RESTRICTED %]
<li><i class="fa fa-li fa-exclamation"></i>Item is restricted.</li>
[% END %]
[% IF checkout_info.GNA %]
<li><i class="fa fa-li fa-exclamation"></i>Patron's address is in doubt.</li>
[% END %]
[% IF checkout_info.CARD_LOST %]
<li><i class="fa fa-li fa-exclamation"></i>Patron's card is lost.</li>
[% END %]
[% IF checkout_info.DEBARRED %]
<li><i class="fa fa-li fa-exclamation"></i>Patron is restricted.</li>
[% END %]
[% IF checkout_info.NO_MORE_RENEWALS %]
<li><i class="fa fa-li fa-exclamation"></i>No more renewals possible.</li>
[% END %]
[% IF checkout_info.EXPIRED %]
<li><i class="fa fa-li fa-exclamation"></i>Patron's card is expired.</li>
[% END %]
[% IF checkout_info.ITEMNOTSAMEBRANCH %]
<li><i class="fa fa-li fa-exclamation"></i>This item belongs to [% Branches.GetName( checkout_info.itemhomebranch ) %] and cannot be checked out from this location.</li>
[% END %]
[% IF checkout_info.USERBLOCKEDREMAINING %]
<li><i class="fa fa-li fa-exclamation"></i>Patron has had overdue items and is blocked for [% checkout_info.USERBLOCKEDREMAINING %] day(s).</li>
[% END %]
[% IF checkout_info.USERBLOCKEDOVERDUE %]
<li><i class="fa fa-li fa-exclamation"></i>Checkouts are BLOCKED because patron has overdue items.</li>
[% END %]
[% IF checkout_info.TOO_MANY %]
<li><i class="fa fa-li fa-exclamation"></i>Too many checked out.</li>
[% END %]
[% IF checkout_info.UNKNOWN_BARCODE %]
<li><i class="fa fa-li fa-exclamation"></i>The barcode was not found [% checkout_info.barcode |html %].</li>
[% END %]
[% IF checkout_info.DEBT %]
<li><i class="fa fa-li fa-exclamation"></i>The patron has a debt of [% checkout_info.DEBT %].</li> <!-- Need debt_confirmed -->
[% END %]
</p>
[% END %]
[% IF checkout_info.issue.date_due %]
<li>Due on [% checkout_info.issue.date_due | $KohaDates %]</li>
[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
[% IF confirmation_needed && CAN_user_circulate_force_checkout %]
<fieldset>
<legend>Please confirm checkout</legend>
<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
<input type="hidden" name="issueconfirmed" value="1" />
<input type="hidden" name="debt_confirmed" value="1" />
<input type="hidden" name="branch" value="[% branch %]" />
<input type="hidden" name="batch" value="1" />
<input type="submit" id="checkoutrenew" class="approve" value="Checkout or renew" />
</fieldset>
</form>
[% END %]
[% ELSE %]
<div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
[% END %]
</div>
</div>
</div>
[% IF borrower %]
<div class="yui-b">
[% INCLUDE 'circ-menu.inc' %]
</div>
[% END %]
</div>
[% INCLUDE 'intranet-bottom.inc' %]