Bug 16522: (follow-up) MARC display templates and get_marc_host fixes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / recalls.inc
1 [% USE Branches %]
2 <div id="recalls">
3 [% IF recalls.count %]
4     <table id="recalls-table">
5         <thead>
6             <tr>
7                 [% IF checkboxes %]<th class="recall-checkbox nosort">&nbsp;</th>[% END %]
8                 <th class="recall-title anti-the">Title</th>
9                 [% UNLESS specific_patron %]<th class="recall-patron">Requested by</th>[% END %]
10                 <th class="recall-date">Placed on</th>
11                 <th class="recall-expiry">Expires on</th>
12                 <th class="recall-branch">Pickup location</th>
13                 <th class="recall-status">Status</th>
14                 [% UNLESS viewing_old %]<th class="recall-duedate">Due date</th>[% END %]
15                 [% UNLESS viewing_old %]<th class="recall-actions nosort">&nbsp;</th>[% END %]
16             </tr>
17         </thead>
18
19         <tbody>
20             [% FOREACH recall IN recalls %]
21                 [% IF recall.completed %]<tr class="old">[% ELSE %]<tr>[% END %]
22
23                     [% IF checkboxes %]
24                         <td class="recall-checkbox">
25                             [% IF recall.completed %]
26                                 &nbsp;
27                             [% ELSE %]
28                                 <input type="checkbox" value="[% recall.id | html %]" name="recall_ids">
29                             [% END %]
30                         </td>
31                     [% END %]
32
33                     <td class="recall-title">
34                         <b><a class="recall-title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblio_id | html %]">
35                             [% recall.biblio.title | html %]
36                             [% FOREACH s IN recall.biblio.subtitle %]
37                                 [% s | html %]
38                             [% END %]
39                         </a></b>
40                         [% IF recall.item %][% recall.item.barcode | html %][% END %]
41                         [% recall.biblio.author | html %]
42                     </td>
43
44                     [% UNLESS specific_patron %]
45                         <td class="recall-patron">
46                             [% INCLUDE 'patron-title.inc' patron=recall.patron hide_patron_infos_if_needed=1 link_to="circulation_recalls" %]
47                         </td>
48                     [% END %]
49
50                     <td class="recall-date">
51                         [% recall.created_date | $KohaDates %]
52                     </td>
53
54                     <td class="recall-expiry">
55                         [% IF ( recall.expiration_date ) %]
56                             [% recall.expiration_date | $KohaDates %]
57                         [% ELSIF ( !recall.completed ) %]
58                             <span>Never expires</span>
59                         [% ELSE %]
60                             -
61                         [% END %]
62                     </td>
63
64                     <td class="recall-branch">
65                         [% recall.library.branchname | html %]
66                     </td>
67
68                     <td class="recall-status">
69                         [% IF ( recall.in_transit ) %]
70                             <span>In transit to [% recall.library.branchname | html %]</span>
71                         [% ELSIF ( recall.waiting ) %]
72                             <span>Ready for pickup</span>
73                         [% ELSIF ( recall.expired ) %]
74                             <span>Expired on [% recall.expiration_date | $KohaDates %]</span>
75                         [% ELSIF ( recall.cancelled ) %]
76                             <span>Cancelled on [% recall.completed_date | $KohaDates %]</span>
77                         [% ELSIF ( recall.overdue ) %]
78                             <span>Overdue to be returned</span>
79                         [% ELSIF ( recall.fulfilled ) %]
80                             <span>Fulfilled</span>
81                         [% ELSE %]
82                             <span>Requested</span>
83                         [% END %]
84                     </td>
85
86                     [% UNLESS viewing_old %]
87                     <td class="recall-duedate">
88                         [% IF recall.requested and recall.checkout %]
89                             <span>Due to be returned by [% recall.checkout.date_due | $KohaDates %]</span>
90                         [% ELSIF recall.waiting and RECALL.expiration_date %]
91                             <span>Pick up by [% RECALL.expiration_date | $KohaDates %]</span>
92                         [% ELSE %]
93                             -
94                         [% END %]
95                     </td>
96                     [% END %]
97
98                     [% UNLESS viewing_old %]
99                     <td class="recall-cancel actions">
100                         [% IF recall.completed %]
101                             &nbsp;
102                         [% ELSE %]
103                             <div class="btn-group">
104                                 <a class="btn btn-sm dropdown-toggle" data-toggle="dropdown" href="#"> Actions <span class="caret"></span></a>
105                                 <ul class="dropdown-menu pull-right">
106                                     [% IF ( recall.requested or recall.overdue ) %]
107                                         <li><a class="cancel_recall" data-id="[% recall.id | html %]" data-action="cancel"><i class="fa fa-times"></i> Cancel</a></li>
108                                         [% IF ( recall.should_be_overdue ) %]
109                                             <li><a class="overdue_recall" data-id="[% recall.id | html %]" data-action="overdue"><i class="fa fa-hourglass-end"></i> Mark as overdue</a></li>
110                                         [% END %]
111                                     [% ELSIF ( recall.waiting ) %]
112                                         <li><a class="revert_recall" data-id="[% recall.id | html %]" data-action="revert"><i class="fa fa-undo"></i> Revert waiting</a></li>
113                                         <li><a class="expire_recall" data-id="[% recall.id | html %]" data-action="expire"><i class="fa fa-times"></i> Expire</a></li>
114                                     [% ELSIF ( recall.in_transit ) %]
115                                         <li><a class="transit_recall" data-id="[% recall.id | html %]" data-action="transit"><i class="fa fa-times"></i> Cancel recall and return to: [% Branches.GetName(recall.item.homebranch) | html %]</a></li>
116                                     [% END %]
117                                 </ul>
118                             </div>
119                         [% END %]
120                     </td>
121                     [% END %]
122
123                 </tr>
124             [% END %]
125         </tbody>
126     </table>
127     [% ELSE %]
128         [% IF patron.borrowernumber %]
129             <div class="dialog message">Patron has no recalls.</div>
130         [% ELSE %]
131             <div class="dialog message">There are no recalls to show.</div>
132         [% END %]
133     [% END %]
134 </div>