Bug 24155: Fix parameter order to fix search_utf8.t
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / holds-table.inc
1 [% USE Branches %]
2 [% USE ItemTypes %]
3 [% USE KohaDates %]
4
5 [% IF ( HOLDS.count ) %]
6     <div id="opac-user-holds">
7         <table id="holdst" class="table table-bordered table-striped">
8             <caption>Holds <span class="count">([% HOLDS.count | html %] total)</span></caption>
9             <!-- HOLDS TABLE ROWS -->
10             <thead>
11                 <tr>
12                     <th class="anti-the">Title</th>
13                     [% IF ( showpriority ) %]
14                         <th class="title-string">Placed on</th>
15                     [% ELSE %]
16                         <th class="psort title-string">Placed on</th>
17                     [% END %]
18                     <th class="title-string">Expires on</th>
19                     [% UNLESS( singleBranchMode) %]
20                         <th>Pick up location</th>
21                     [% END %]
22                     [% IF ( showpriority ) %]
23                         <th class="psort">Priority</th>
24                     [% END %]
25                     <th>Status</th>
26                     [% IF SuspendHoldsOpac and ! onlyinfo %]
27                             <th class="nosort" >Suspend</th>
28                     [% END %]
29                     [% IF ! onlyinfo %]
30                         <th class="nosort">Modify</th>
31                     [% END %]
32                 </tr>
33             </thead>
34             <tbody>
35                 [% SET all_holds_waiting = 1 %]
36                 [% FOREACH HOLD IN HOLDS %]
37                     [% UNLESS ( HOLD.is_waiting || HOLD.is_in_transit ) %]
38                         [% SET all_holds_waiting = 0 %]
39                     [% END %]
40                     [% IF ( HOLD.is_waiting ) %]
41                         [% IF ( HOLD.is_at_destination ) %]
42                             [% IF ( HOLD.is_found ) %]
43                                 <tr class="reserved">
44                             [% ELSE %]
45                                 <tr>
46                             [% END %]
47                         [% ELSE %]
48                             <tr class="transfered">
49                         [% END %]
50                     [% ELSE %]
51                         <tr>
52                     [% END %]
53                         <td class="title">
54                             [% IF ! onlyinfo %]
55                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% HOLD.biblionumber | html %]">
56                                     [% INCLUDE 'biblio-title.inc' biblio=HOLD.biblio %]
57                                     [% HOLD.item.enumchron | html %]
58                                 </a>
59                             [% ELSE %]
60                                 <strong>
61                                     [% INCLUDE 'biblio-title.inc' biblio=HOLD.biblio %]
62                                     [% HOLD.item.enumchron | html %]
63                                 </strong>
64                             [% END %]
65                             [% HOLD.biblio.author | html %]
66                         </td>
67                         <td class="reservedate">
68                             <span title="[% HOLD.reservedate | html %]">
69                                 <span class="tdlabel">Hold date:</span>
70                                 [% HOLD.reservedate | $KohaDates %]
71                             </span>
72                         </td>
73                         <td class="expirationdate">
74                             [% IF ! HOLD.found %]
75                                 [% IF ( HOLD.expirationdate ) %]
76                                     <span title="[% HOLD.expirationdate | html %]">
77                                         <span class="tdlabel">Expiration:</span>
78                                             [% HOLD.expirationdate | $KohaDates %]
79                                     </span>
80                                 [% ELSE %]
81                                     <span title="0000-00-00">
82                                         <span class="tdlabel">Expiration:</span>
83                                         Never expires
84                                     </span>
85                                 [% END %]
86                             [% ELSE %]
87                                 <span title="0000-00-00">-</span>
88                             [% END %]
89                         </td>
90                         [% UNLESS( singleBranchMode) %]
91                             <td class="branch">
92                                 <span class="tdlabel">Pick up location:</span>
93                                 [% HOLD.branch.branchname | html %]
94                             </td>
95                         [% END %]
96                         [% IF ( showpriority ) %]
97                                 <td data-order="[% HOLD.priority | html %]" class="priority">
98                                 <span class="tdlabel">Priority:</span>
99                                 [% HOLD.priority | html %]
100                             </td>
101                         [% END %]
102                         <td class="status">
103                             <span class="tdlabel">Status:</span>
104                             [% IF ( HOLD.is_waiting ) %]
105                                 <i class="fa fa-exclamation-circle text-warning" aria-hidden="true"></i>
106                                 [% IF ( HOLD.is_at_destination ) %]
107                                     [% IF ( HOLD.found ) %]
108                                         Item waiting at <strong> [% HOLD.branch.branchname | html %]</strong>
109                                         [% IF ( HOLD.waitingdate ) %]
110                                             since [% HOLD.waitingdate | $KohaDates %]
111                                             [% IF HOLD.expirationdate %]
112                                                 until [% HOLD.expirationdate | $KohaDates %]
113                                             [% END %]
114                                         [% END %]
115                                         <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
116                                     [% ELSE %]
117                                         Item waiting to be pulled from <strong> [% Branches.GetName( HOLD.branchcode ) | html %]</strong>
118                                     [% END %]
119                                 [% ELSE %]
120                                     Item in transit to <strong> [% Branches.GetName( HOLD.branchcode ) | html %]</strong> <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
121                                 [% END %]
122                             [% ELSE %]
123                                 [% IF ( HOLD.is_in_transit ) %]
124                                     [% SET transfer = HOLD.item.get_transfer %]
125                                     Item in transit from <strong> [% Branches.GetName( transfer.frombranch ) | html %]</strong> since
126                                     [% transfer.datesent | $KohaDates %]
127                                 [% ELSIF ( HOLD.suspend ) %]
128                                     Suspended [% IF ( HOLD.suspend_until ) %] until [% HOLD.suspend_until | $KohaDates %] [% END %]
129                                 [% ELSE %]
130                                     [% IF HOLD.itemtype %]
131                                         Pending for next available item of item type '[% ItemTypes.GetDescription( HOLD.itemtype ) | html %]'
132                                     [% ELSE %]
133                                         Pending
134                                     [% END %]
135                                 [% END %]
136                             [% END %]
137                         </td>
138                         [% IF SuspendHoldsOpac and ! onlyinfo %]
139                             <td>
140                                 [% IF ( HOLD.is_cancelable_from_opac ) %]
141                                     [% IF HOLD.suspend %]
142                                         <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
143                                             <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
144                                             <button class="btn btn-link" type="submit" name="submit"><i class="fa fa-play" aria-hidden="true"></i> Resume</button>
145                                         </form>
146                                     [% ELSE %]
147                                         [% IF AutoResumeSuspendedHolds %]
148                                             <a class="btn btn-link js-show" href="#suspendModal[% HOLD.reserve_id | html %]" role="button" data-toggle="modal"><i class="fa fa-pause" aria-hidden="true"></i> Suspend</a>
149                                             [% # hold suspend modal form %]
150                                             <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">
151                                                 <div class="modal-dialog">
152                                                     <div class="modal-content">
153                                                         <form action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
154                                                             <div class="modal-header">
155                                                                 [% IF HOLD.suspend %]
156                                                                     <h3 class="modal-title" id="suspendModal[% HOLD.reserve_id | html %]Label">Resume your hold on <em>[% HOLD.biblio.title | html %]</em></h3>
157                                                                 [% ELSE %]
158                                                                     <h3 class="modal-title" id="suspendModal[% HOLD.reserve_id | html %]Label">Suspend your hold on <em>[% HOLD.biblio.title | html %]</em></h3>
159                                                                 [% END %]
160                                                                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
161                                                                     <span aria-hidden="true">x</span>
162                                                                 </button>
163                                                             </div>
164                                                             <div class="modal-body">
165                                                                 <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
166                                                                 <label for="suspend_until_[% HOLD.reserve_id | html %]">Suspend until:</label>
167                                                                 <input type="text" name="suspend_until" id="suspend_until_[% HOLD.reserve_id | html %]" class="suspend-until" size="10" />
168                                                                 [% INCLUDE 'date-format.inc' %]
169                                                                 <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>
170                                                                 <button class="btn btn-primary btn-sm js-hide" type="submit" name="submit">Suspend</button>
171                                                             </div>
172                                                             <div class="modal-footer">
173                                                                 <button class="btn btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Suspend</button>
174                                                                 <button data-dismiss="modal" class="btn btn-secondary"><i class="fa fa-remove" aria-hidden="true"></i> Do not suspend</button>
175                                                             </div>
176                                                         </form>
177                                                     </div> <!-- /.modal-content -->
178                                                 </div> <!-- /.modal-dialog -->
179                                             </div>  <!-- /#suspendModal[% HOLD.reserve_id | html %] -->
180                                         [% ELSE %]
181                                             <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
182                                                 <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
183                                                 <button class="btn btn-link" type="submit" name="submit"><i class="fa fa-pause" aria-hidden="true"></i> Suspend</button>
184                                             </form>
185                                         [% END # / IF AutoResumeSuspendedHolds %]
186                                     [% END # / IF HOLD.suspend %]
187                                 [% END # / IF ( HOLD.is_cancelable_from_opac )%]
188                             </td>
189                         [% END # / IF SuspendHoldsOpac %]
190                         [% IF ! onlyinfo %]
191                             <td class="modify">
192                                 [% IF ( HOLD.is_cancelable_from_opac ) %]
193                                     <form id="delete_hold_[% HOLD.reserve_id | html %]" action="/cgi-bin/koha/opac-modrequest.pl" method="post">
194                                     <input type="hidden" name="biblionumber" value="[% HOLD.biblionumber | html %]" />
195                                     <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
196                                     <button data-title="[% INCLUDE 'biblio-title-head.inc' biblio=HOLD.biblio %]" data-reserve_id="[% HOLD.reserve_id | html %]" type="submit" class="btn btn-sm btn-danger btn-delete-hold"><i class="fa fa-remove" aria-hidden="true"></i> Cancel</button>
197                                 </form>
198                                 [% END %]
199                             </td>
200                         [% END # / IF onlyinfo %]
201                     </tr>
202                 [% END # /FOREACH HOLDS %]
203             </tbody>
204         </table>
205
206         [% IF SuspendHoldsOpac and ! onlyinfo %]
207             [% UNLESS ( all_holds_waiting ) %]
208                 <div>
209                     <form class="form-inline" id="suspend_all_holds" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
210                         <button type="submit" id="suspend_all_submit" class="btn btn-primary"><i class="fa fa-pause" aria-hidden="true"></i> Suspend all holds</button>
211                         <input type="hidden" name="suspend" value="1" />
212
213                         [% IF AutoResumeSuspendedHolds %]
214                             <label for="suspend_until"> until </label>
215                             <input type="text" name="suspend_until" id="suspend_until" class="suspend-until" readonly="readonly" size="10" />
216                             <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('suspend_until').value='';return false;">Clear date to suspend indefinitely</a>
217                         [% END %]
218                     </form>
219                 </div>
220                 <br/>
221                 <div>
222                     <form id="resume_all_holds" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
223                         <button type="submit" id="resume_all_submit" class="btn btn-primary"><i class="fa fa-play" aria-hidden="true"></i> Resume all suspended holds</button>
224                         <input type="hidden" name="suspend" value="0" />
225                     </form>
226                 </div>
227             [% END %]
228         [% END %]
229     </div> <!-- / #opac-user-holds -->
230 [% END # / #HOLDS.count %]