Bug 21772: Move OPAC holds and account tables into .inc

This patch moves the code to render the account and holds information
for the patron into include files. They are loaded in the opac-user.tt
and opac-account.tt templates respectively.

To test:
1) Have a patron with account lines and holds
2) Notice they are displayed in the patron's detail section in the OPAC
3) Apply this patch
4) Reload the patron's detail page
=> SUCESS: Everything looks the same, no behaviuor or layout change.
5) Sign off

Sponsored-by: City of Portsmouth Public Library

Signed-off-by: Sarah Cornell <sbcornell@cityofportsmouth.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Agustin Moyano 2019-03-07 15:51:46 -03:00 committed by Nick Clemens
parent 0b1809bb93
commit 6a7d4b19c7
4 changed files with 336 additions and 316 deletions

View file

@ -0,0 +1,112 @@
<h3>Fines and charges</h3>
[% IF ( ACCOUNT_LINES ) %]
<form method="post" action="opac-account-pay.pl" class="form-horizontal">
<table class="table table-bordered table-striped" id="finestable">
<thead>
<tr>
[% IF ENABLE_OPAC_PAYMENTS %]<th>&nbsp;</th>[% END %]
<th class="title-string">Date</th>
<th>Description</th>
<th>Fine amount</th>
<th>Amount outstanding</th>
</tr>
</thead>
<tfoot>
<tr>
[%- IF ENABLE_OPAC_PAYMENTS -%]
[%- SET COLSPAN = 4 -%]
[%- ELSE -%]
[%- SET COLSPAN = 3 -%]
[%- END -%]
<th class="sum" colspan="[% COLSPAN | html %]">Total due</th>
<td class="sum">[% total | $Price %]</td>
</tr>
</tfoot>
<tbody>
[% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
[% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
[% IF ENABLE_OPAC_PAYMENTS %]
<td>
[% IF ACCOUNT_LINE.amountoutstanding > 0 %]
[% SET DISPLAY_PAYMENT_BLOCK = 1 %]
<input class="checkbox-pay pay-online hidden" name="accountline" type="checkbox" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id | html %]" value="[% ACCOUNT_LINE.accountlines_id | html %]">
<input type="hidden" id="amount-[% ACCOUNT_LINE.accountlines_id | html %]" value="[% ACCOUNT_LINE.amountoutstanding | html %]" />
[% END %]
</td>
[% END %]
<td><span title="[% ACCOUNT_LINE.date | html %]">[% ACCOUNT_LINE.date | $KohaDates %]</span></td>
<td>
[% SWITCH ACCOUNT_LINE.accounttype %]
[% CASE 'Pay' %]Payment, thanks
[% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
[% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
[% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
[% CASE 'N' %]New card
[% CASE 'F' %]Fine
[% CASE 'A' %]Account management fee
[% CASE 'M' %]Sundry
[% CASE 'L' %]Lost item
[% CASE 'W' %]Writeoff
[% CASE 'FU' %]Accruing fine
[% CASE 'HE' %]Hold waiting too long
[% CASE 'Rent' %]Rental fee
[% CASE 'FOR' %]Forgiven
[% CASE 'LR' %]Lost item fee refund
[% CASE 'PF' %]Processing fee
[% CASE 'PAY' %]Payment
[% CASE 'WO' %]Writeoff
[% CASE 'C' %]Credit
[% CASE 'CR' %]Credit
[% CASE %][% ACCOUNT_LINE.accounttype | html %]
[%- END -%]
[%- IF ACCOUNT_LINE.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) | html %][% END %]
[%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description | html %][% END %]
[% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title | html %])[% END %]
</td>
[% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount | $Price %]</td>
[% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding | $Price %]</td>
</tr>
[% END %]
</tbody>
</table>
[% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
<fieldset class="pay-online hidden">
<legend>Pay selected fines and charges</legend>
<span class="help-block"><h3>Payment method</h3></span>
[% IF Koha.Preference('EnablePayPalOpacPayments') %]
<div class="control-group">
<label class="radio">
<input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
<!-- PayPal Logo --><a href="https://www.paypal.com/webapps/mpp/paypal-popup" title="How PayPal Works" class="paypal"><img src="https://www.paypalobjects.com/webstatic/mktg/logo/AM_SbyPP_mc_vs_dc_ae.jpg" border="0" alt="PayPal Acceptance Mark"></a><!-- PayPal Logo -->
</label>
</div>
[% END %]
[% FOREACH p IN plugins %]
<div class="control-group">
<label class="radio">
<input type="radio" name="payment_method" id="payment_method-[% p.class | html %]" value="[% p.class | html %]" checked="checked">
[% p.get_metadata.name | html %]
</label>
</div>
[% END %]
<div class="control-group">
<input type="hidden" id="payment-amount" name="payment_amount" value="0" />
<button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
<span id="amount-to-pay-label">
Amount to pay: <span id="amount-to-pay">0.00</span>
</span>
</div>
</fieldset>
[% END %]
</form>
[% ELSE %]
<h4>You have no fines or charges</h4>
[% END %]

View file

@ -0,0 +1,222 @@
[% USE Branches %]
[% USE ItemTypes %]
[% USE KohaDates %]
[% IF ( HOLDS.count ) %]
<div id="opac-user-holds">
<table id="holdst" class="table table-bordered table-striped">
<caption>Holds <span class="count">([% HOLDS.count | html %] total)</span></caption>
<!-- HOLDS TABLE ROWS -->
<thead>
<tr>
<th class="anti-the">Title</th>
[% IF ( showpriority ) %]
<th class="title-string">Placed on</th>
[% ELSE %]
<th class="psort title-string">Placed on</th>
[% END %]
<th class="title-string">Expires on</th>
[% UNLESS( singleBranchMode) %]
<th>Pick up location</th>
[% END %]
[% IF ( showpriority ) %]
<th class="psort">Priority</th>
[% END %]
<th>Status</th>
[% IF SuspendHoldsOpac and ! onlyinfo %]
<th class="nosort" >Suspend</th>
[% END %]
[% IF ! onlyinfo %]
<th class="nosort">Modify</th>
[% END %]
</tr>
</thead>
<tbody>
[% FOREACH HOLD IN HOLDS %]
[% IF ( HOLD.is_waiting ) %]
[% IF ( HOLD.is_at_destination ) %]
[% IF ( HOLD.is_found ) %]
<tr class="reserved">
[% ELSE %]
<tr>
[% END %]
[% ELSE %]
<tr class="transfered">
[% END %]
[% ELSE %]
<tr>
[% END %]
<td class="title">
[% IF ! onlyinfo %]
<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% HOLD.biblionumber | html %]">
[% HOLD.biblio.title | html %]
[% FOREACH s IN HOLD.biblio.subtitles %]
[% s | html %]
[% END %]
[% HOLD.item.enumchron | html %]
</a>
[% ELSE %]
<strong>
[% HOLD.biblio.title | html %]
[% FOREACH s IN HOLD.biblio.subtitles %]
[% s | html %]
[% END %]
[% HOLD.item.enumchron | html %]
</strong>
[% END %]
[% HOLD.biblio.author | html %]
</td>
<td class="reservedate">
<span title="[% HOLD.reservedate | html %]">
<span class="tdlabel">Hold date:</span>
[% HOLD.reservedate | $KohaDates %]
</span>
</td>
<td class="expirationdate">
[% IF ! HOLD.found %]
[% IF ( HOLD.expirationdate ) %]
<span title="[% HOLD.expirationdate | html %]">
<span class="tdlabel">Expiration:</span>
[% HOLD.expirationdate | $KohaDates %]
</span>
[% ELSE %]
<span title="0000-00-00">
<span class="tdlabel">Expiration:</span>
Never expires
</span>
[% END %]
[% ELSE %]
<span title="0000-00-00">-</span>
[% END %]
</td>
[% UNLESS( singleBranchMode) %]
<td class="branch">
<span class="tdlabel">Pick up location:</span>
[% HOLD.branch.branchname | html %]
</td>
[% END %]
[% IF ( showpriority ) %]
<td data-order="[% HOLD.priority | html %]" class="priority">
<span class="tdlabel">Priority:</span>
[% HOLD.priority | html %]
</td>
[% END %]
<td class="status">
<span class="tdlabel">Status:</span>
[% IF ( HOLD.is_waiting ) %]
[% IF ( HOLD.is_at_destination ) %]
[% IF ( HOLD.found ) %]
Item waiting at <b> [% HOLD.branch.branchname | html %]</b>
[% IF ( HOLD.waitingdate ) %]
since [% HOLD.waitingdate | $KohaDates %]
[% IF HOLD.expirationdate %]
until [% HOLD.expirationdate | $KohaDates %]
[% END %]
[% END %]
<input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
[% ELSE %]
Item waiting to be pulled from <b> [% Branches.GetName( HOLD.branchcode ) | html %]</b>
[% END %]
[% ELSE %]
Item in transit to <b> [% Branches.GetName( HOLD.branchcode ) | html %]</b> <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
[% END %]
[% ELSE %]
[% IF ( HOLD.is_in_transit ) %]
[% SET transfer = HOLD.item.get_transfer %]
Item in transit from <b> [% Branches.GetName( transfer.frombranch ) | html %]</b> since
[% transfer.datesent | $KohaDates %]
[% ELSIF ( HOLD.suspend ) %]
Suspended [% IF ( HOLD.suspend_until ) %] until [% HOLD.suspend_until | html %] [% END %]
[% ELSE %]
[% IF HOLD.itemtype %]
Pending for next available item of item type '[% ItemTypes.GetDescription( HOLD.itemtype ) | html %]'
[% ELSE %]
Pending
[% END %]
[% END %]
[% END %]
</td>
[% IF SuspendHoldsOpac and ! onlyinfo %]
<td>
[% IF ( HOLD.is_cancelable_from_opac ) %]
[% IF HOLD.suspend %]
<form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
<input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
<button class="btn btn-link" type="submit" name="submit"><i class="fa fa-play"></i> Resume</button>
</form>
[% ELSE %]
[% IF AutoResumeSuspendedHolds %]
<a class="btn btn-link js-show" href="#suspendModal[% HOLD.reserve_id | html %]" role="button" data-toggle="modal"><i class="fa fa-pause"></i> Suspend</a>
[% # hold suspend modal form %]
<div id="suspendModal[% HOLD.reserve_id | html %]" class="modal-nojs" tabindex="-1" role="dialog" aria-labelledby="suspendModal[% HOLD.reserve_id | html %]Label" aria-hidden="true">
<form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
[% IF HOLD.suspend %]
<h3 id="suspendModal[% HOLD.reserve_id | html %]Label">Resume your hold on <i>[% HOLD.biblio.title | html %]</i></h3>
[% ELSE %]
<h3 id="suspendModal[% HOLD.reserve_id | html %]Label">Suspend your hold on <i>[% HOLD.biblio.title | html %]</i></h3>
[% END %]
</div>
<div class="modal-body">
<input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
<label for="suspend_until_[% HOLD.reserve_id | html %]">Suspend until:</label>
<input type="text" name="suspend_until" id="suspend_until_[% HOLD.reserve_id | html %]" class="suspend-until" size="10" />
[% INCLUDE 'date-format.inc' %]
<p class="js-show"><a href="#" onclick="document.getElementById('suspend_until_[% HOLD.reserve_id | html %]').value='';return false;">Clear date to suspend indefinitely</a></p>
<button class="btn btn-mini js-hide" type="submit" name="submit">Suspend</button>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="submit" name="submit">Suspend</button>
<a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
</div>
</form>
</div> <!-- /#suspendModal[% HOLD.reserve_id | html %] -->
[% ELSE %]
<form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
<input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
<button class="btn btn-link" type="submit" name="submit"><i class="fa fa-pause"></i> Suspend</button>
</form>
[% END # / IF AutoResumeSuspendedHolds %]
[% END # / IF HOLD.suspend %]
[% END # / IF ( HOLD.is_cancelable_from_opac )%]
</td>
[% END # / IF SuspendHoldsOpac %]
[% IF ! onlyinfo %]
<td class="modify">
[% IF ( HOLD.is_cancelable_from_opac ) %]
<form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
<input type="hidden" name="biblionumber" value="[% HOLD.biblionumber | html %]" />
<input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
<button type="submit" name="submit" class="btn btn-xs btn-danger" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);"><i class="fa fa-remove"></i> Cancel</button></form>
[% END %]
</td>
[% END # / IF onlyinfo %]
</tr>
[% END # /FOREACH HOLDS %]
</tbody>
</table>
[% IF SuspendHoldsOpac and ! onlyinfo %]
<div>
<form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
<button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_SUSPEND_HOLDS);"><i class="fa fa-pause"></i> Suspend all holds</button>
<input type="hidden" name="suspend" value="1" />
[% IF AutoResumeSuspendedHolds %]
<label for="suspend_until"> until </label>
<input type="text" name="suspend_until" id="suspend_until" class="suspend-until" readonly="readonly" size="10" />
<a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('suspend_until').value='';return false;">Clear date to suspend indefinitely</a>
[% END %]
</form>
</div>
<br/>
<div>
<form action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
<button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_RESUME_HOLDS);"><i class="fa fa-play"></i> Resume all suspended holds</button>
<input type="hidden" name="suspend" value="0" />
</form>
</div>
[% END %]
</div> <!-- / #opac-user-holds -->
[% END # / #HOLDS.count %]

View file

@ -66,118 +66,8 @@
</div>
[% END %]
<h3>Fines and charges</h3>
[% PROCESS 'account-table.inc' ACCOUNT_LINES = ACCOUNT_LINES, ENABLE_OPAC_PAYMENTS = ENABLE_OPAC_PAYMENTS, plugins = plugins %]
[% IF ( ACCOUNT_LINES ) %]
<form method="post" action="opac-account-pay.pl" class="form-horizontal">
<table class="table table-bordered table-striped" id="finestable">
<thead>
<tr>
[% IF ENABLE_OPAC_PAYMENTS %]<th>&nbsp;</th>[% END %]
<th class="title-string">Date</th>
<th>Description</th>
<th>Fine amount</th>
<th>Amount outstanding</th>
</tr>
</thead>
<tfoot>
<tr>
[%- IF ENABLE_OPAC_PAYMENTS -%]
[%- SET COLSPAN = 4 -%]
[%- ELSE -%]
[%- SET COLSPAN = 3 -%]
[%- END -%]
<th class="sum" colspan="[% COLSPAN | html %]">Total due</th>
<td class="sum">[% total | $Price %]</td>
</tr>
</tfoot>
<tbody>
[% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
[% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
[% IF ENABLE_OPAC_PAYMENTS %]
<td>
[% IF ACCOUNT_LINE.amountoutstanding > 0 %]
[% SET DISPLAY_PAYMENT_BLOCK = 1 %]
<input class="checkbox-pay pay-online hidden" name="accountline" type="checkbox" id="checkbox-pay-[% ACCOUNT_LINE.accountlines_id | html %]" value="[% ACCOUNT_LINE.accountlines_id | html %]">
<input type="hidden" id="amount-[% ACCOUNT_LINE.accountlines_id | html %]" value="[% ACCOUNT_LINE.amountoutstanding | html %]" />
[% END %]
</td>
[% END %]
<td><span title="[% ACCOUNT_LINE.date | html %]">[% ACCOUNT_LINE.date | $KohaDates %]</span></td>
<td>
[% SWITCH ACCOUNT_LINE.accounttype %]
[% CASE 'Pay' %]Payment, thanks
[% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
[% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
[% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
[% CASE 'N' %]New card
[% CASE 'F' %]Fine
[% CASE 'A' %]Account management fee
[% CASE 'M' %]Sundry
[% CASE 'L' %]Lost item
[% CASE 'W' %]Writeoff
[% CASE 'FU' %]Accruing fine
[% CASE 'HE' %]Hold waiting too long
[% CASE 'Rent' %]Rental fee
[% CASE 'FOR' %]Forgiven
[% CASE 'LR' %]Lost item fee refund
[% CASE 'PF' %]Processing fee
[% CASE 'PAY' %]Payment
[% CASE 'WO' %]Writeoff
[% CASE 'C' %]Credit
[% CASE 'CR' %]Credit
[% CASE %][% ACCOUNT_LINE.accounttype | html %]
[%- END -%]
[%- IF ACCOUNT_LINE.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', ACCOUNT_LINE.payment_type, 1) | html %][% END %]
[%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description | html %][% END %]
[% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title | html %])[% END %]
</td>
[% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount | $Price %]</td>
[% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding | $Price %]</td>
</tr>
[% END %]
</tbody>
</table>
[% IF ENABLE_OPAC_PAYMENTS && DISPLAY_PAYMENT_BLOCK %]
<fieldset class="pay-online hidden">
<legend>Pay selected fines and charges</legend>
<span class="help-block"><h3>Payment method</h3></span>
[% IF Koha.Preference('EnablePayPalOpacPayments') %]
<div class="control-group">
<label class="radio">
<input type="radio" name="payment_method" id="payment_method-paypal" value="paypal" checked="checked">
<!-- PayPal Logo --><a href="https://www.paypal.com/webapps/mpp/paypal-popup" title="How PayPal Works" class="paypal"><img src="https://www.paypalobjects.com/webstatic/mktg/logo/AM_SbyPP_mc_vs_dc_ae.jpg" border="0" alt="PayPal Acceptance Mark"></a><!-- PayPal Logo -->
</label>
</div>
[% END %]
[% FOREACH p IN plugins %]
<div class="control-group">
<label class="radio">
<input type="radio" name="payment_method" id="payment_method-[% p.class | html %]" value="[% p.class | html %]" checked="checked">
[% p.get_metadata.name | html %]
</label>
</div>
[% END %]
<div class="control-group">
<input type="hidden" id="payment-amount" name="payment_amount" value="0" />
<button id="submit-pay" type="submit" class="btn" disabled="disabled">Make payment</button>
<span id="amount-to-pay-label">
Amount to pay: <span id="amount-to-pay">0.00</span>
</span>
</div>
</fieldset>
[% END %]
</form>
[% ELSE %]
<h4>You have no fines or charges</h4>
[% END %]
</div> <!-- / #useraccount -->
</div> <!-- / .span10 -->
</div> <!-- / .row-fluid -->

View file

@ -597,211 +597,7 @@
</div> <!-- / #opac-user-overdues -->
[% END # /overdues_count %]
[% IF ( RESERVES.count ) %]
<div id="opac-user-holds">
<table id="holdst" class="table table-bordered table-striped">
<caption>Holds <span class="count">([% RESERVES.count | html %] total)</span></caption>
<!-- RESERVES TABLE ROWS -->
<thead>
<tr>
<th class="anti-the">Title</th>
[% IF ( showpriority ) %]
<th class="title-string">Placed on</th>
[% ELSE %]
<th class="psort title-string">Placed on</th>
[% END %]
<th class="title-string">Expires on</th>
[% UNLESS( singleBranchMode) %]
<th>Pick up location</th>
[% END %]
[% IF ( showpriority ) %]
<th class="psort">Priority</th>
[% END %]
<th>Status</th>
[% IF SuspendHoldsOpac %]
<th class="nosort" >Suspend</th>
[% END %]
<th class="nosort">Modify</th>
</tr>
</thead>
<tbody>
[% FOREACH RESERVE IN RESERVES %]
[% IF ( RESERVE.is_waiting ) %]
[% IF ( RESERVE.is_at_destination ) %]
[% IF ( RESERVE.is_found ) %]
<tr class="reserved">
[% ELSE %]
<tr>
[% END %]
[% ELSE %]
<tr class="transfered">
[% END %]
[% ELSE %]
<tr>
[% END %]
<td class="title">
<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RESERVE.biblionumber | html %]">
[% RESERVE.biblio.title | html %]
[% FOREACH s IN RESERVE.biblio.subtitles %]
[% s | html %]
[% END %]
[% RESERVE.item.enumchron | html %]
</a>
[% RESERVE.biblio.author | html %]
</td>
<td class="reservedate">
<span title="[% RESERVE.reservedate | html %]">
<span class="tdlabel">Hold date:</span>
[% RESERVE.reservedate | $KohaDates %]
</span>
</td>
<td class="expirationdate">
[% IF ! RESERVE.found %]
[% IF ( RESERVE.expirationdate ) %]
<span title="[% RESERVE.expirationdate | html %]">
<span class="tdlabel">Expiration:</span>
[% RESERVE.expirationdate | $KohaDates %]
</span>
[% ELSE %]
<span title="0000-00-00">
<span class="tdlabel">Expiration:</span>
Never expires
</span>
[% END %]
[% ELSE %]
<span title="0000-00-00">-</span>
[% END %]
</td>
[% UNLESS( singleBranchMode) %]
<td class="branch">
<span class="tdlabel">Pick up location:</span>
[% RESERVE.branch.branchname | html %]
</td>
[% END %]
[% IF ( showpriority ) %]
<td data-order="[% RESERVE.priority | html %]" class="priority">
<span class="tdlabel">Priority:</span>
[% RESERVE.priority | html %]
</td>
[% END %]
<td class="status">
<span class="tdlabel">Status:</span>
[% IF ( RESERVE.is_waiting ) %]
[% IF ( RESERVE.is_at_destination ) %]
[% IF ( RESERVE.found ) %]
Item waiting at <b> [% RESERVE.branch.branchname | html %]</b>
[% IF ( RESERVE.waitingdate ) %]
since [% RESERVE.waitingdate | $KohaDates %]
[% IF RESERVE.expirationdate %]
until [% RESERVE.expirationdate | $KohaDates %]
[% END %]
[% END %]
<input type="hidden" name="pickup" value="[% RESERVE.branchcode | html %]" />
[% ELSE %]
Item waiting to be pulled from <b> [% Branches.GetName( RESERVE.branchcode ) | html %]</b>
[% END %]
[% ELSE %]
Item in transit to <b> [% Branches.GetName( RESERVE.branchcode ) | html %]</b> <input type="hidden" name="pickup" value="[% RESERVE.branchcode | html %]" />
[% END %]
[% ELSE %]
[% IF ( RESERVE.is_in_transit ) %]
[% SET transfer = RESERVE.item.get_transfer %]
Item in transit from <b> [% Branches.GetName( transfer.frombranch ) | html %]</b> since
[% transfer.datesent | $KohaDates %]
[% ELSIF ( RESERVE.suspend ) %]
Suspended [% IF ( RESERVE.suspend_until ) %] until [% RESERVE.suspend_until | html %] [% END %]
[% ELSE %]
[% IF RESERVE.itemtype %]
Pending for next available item of item type '[% ItemTypes.GetDescription( RESERVE.itemtype ) | html %]'
[% ELSE %]
Pending
[% END %]
[% END %]
[% END %]
</td>
[% IF SuspendHoldsOpac %]
<td>
[% IF ( RESERVE.is_cancelable_from_opac ) %]
[% IF RESERVE.suspend %]
<form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
<input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id | html %]" />
<button class="btn btn-link" type="submit" name="submit"><i class="fa fa-play"></i> Resume</button>
</form>
[% ELSE %]
[% IF AutoResumeSuspendedHolds %]
<a class="btn btn-link js-show" href="#suspendModal[% RESERVE.reserve_id | html %]" role="button" data-toggle="modal"><i class="fa fa-pause"></i> Suspend</a>
[% # hold suspend modal form %]
<div id="suspendModal[% RESERVE.reserve_id | html %]" class="modal-nojs" tabindex="-1" role="dialog" aria-labelledby="suspendModal[% RESERVE.reserve_id | html %]Label" aria-hidden="true">
<form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
[% IF RESERVE.suspend %]
<h3 id="suspendModal[% RESERVE.reserve_id | html %]Label">Resume your hold on <i>[% RESERVE.biblio.title | html %]</i></h3>
[% ELSE %]
<h3 id="suspendModal[% RESERVE.reserve_id | html %]Label">Suspend your hold on <i>[% RESERVE.biblio.title | html %]</i></h3>
[% END %]
</div>
<div class="modal-body">
<input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id | html %]" />
<label for="suspend_until_[% RESERVE.reserve_id | html %]">Suspend until:</label>
<input type="text" name="suspend_until" id="suspend_until_[% RESERVE.reserve_id | html %]" class="suspend-until" size="10" />
[% INCLUDE 'date-format.inc' %]
<p class="js-show"><a href="#" onclick="document.getElementById('suspend_until_[% RESERVE.reserve_id | html %]').value='';return false;">Clear date to suspend indefinitely</a></p>
<button class="btn btn-mini js-hide" type="submit" name="submit">Suspend</button>
</div>
<div class="modal-footer">
<button class="btn btn-primary" type="submit" name="submit">Suspend</button>
<a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
</div>
</form>
</div> <!-- /#suspendModal[% RESERVE.reserve_id | html %] -->
[% ELSE %]
<form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
<input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id | html %]" />
<button class="btn btn-link" type="submit" name="submit"><i class="fa fa-pause"></i> Suspend</button>
</form>
[% END # / IF AutoResumeSuspendedHolds %]
[% END # / IF RESERVE.suspend %]
[% END # / IF ( RESERVE.is_cancelable_from_opac )%]
</td>
[% END # / IF SuspendHoldsOpac %]
<td class="modify">
[% IF ( RESERVE.is_cancelable_from_opac ) %]
<form id="delete_hold_[% RESERVE.reserve_id | html %]" action="/cgi-bin/koha/opac-modrequest.pl" method="post">
<input type="hidden" name="biblionumber" value="[% RESERVE.biblionumber | html %]" />
<input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id | html %]" />
<button data-title="[% RESERVE.biblio.title | html %] [% FOREACH s IN RESERVE.biblio.subtitles %] [% s | html %] [% END %] [% RESERVE.item.enumchron | html %]" data-reserve_id="[% RESERVE.reserve_id | html %]" type="submit" class="btn btn-sm btn-danger btn-delete-hold"><i class="fa fa-remove"></i> Cancel</button></form>
[% END %]
</td>
</tr>
[% END # /FOREACH RESERVES %]
</tbody>
</table>
[% IF SuspendHoldsOpac %]
<div>
<form class="form-inline" id="suspend_all_holds" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
<button type="submit" id="suspend_all_submit" class="btn"><i class="fa fa-pause"></i> Suspend all holds</button>
<input type="hidden" name="suspend" value="1" />
[% IF AutoResumeSuspendedHolds %]
<label for="suspend_until"> until </label>
<input type="text" name="suspend_until" id="suspend_until" class="suspend-until" readonly="readonly" size="10" />
<a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('suspend_until').value='';return false;">Clear date to suspend indefinitely</a>
[% END %]
</form>
</div>
<br/>
<div>
<form id="resume_all_holds" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
<button type="submit" id="resume_all_submit" class="btn"><i class="fa fa-play"></i> Resume all suspended holds</button>
<input type="hidden" name="suspend" value="0" />
</form>
</div>
[% END %]
</div> <!-- / #opac-user-holds -->
[% END # / #RESERVES.count %]
[% PROCESS 'holds-table.inc' HOLDS => RESERVES, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds %]
[% IF Koha.Preference('ArticleRequests') %]
<div id="opac-user-article-requests">