]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/hold_history.tt2
Template Toolkit OPAC
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / hold_history.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     WRAPPER "opac/parts/myopac/base.tt2";
4     myopac_page = "holds"  
5     limit = ctx.hold_history_limit;
6     offset = ctx.hold_history_offset;
7 %]
8
9 <div id='myopac_holds_div'>
10
11     <div id="acct_holds_tabs">
12         <div class="align">
13             <a href='holds'>[% l("Items on Hold") %]</a>
14         </div>
15         <div class="align selected">
16             <a href="#">[% l("Holds History") %]</a>
17         </div>
18     </div>
19
20     <div class="header_middle">
21         <span style="float:left;">[% l("Previously Held Items") %]</span>
22         <span class='float-left' style='padding-left: 10px;'>
23             <a href='hold_history?limit=[% limit %]&amp;offset=[% offset - limit %]'
24                 [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
25             [%# TODO: get total to prevent paging off then end of the list.. %]
26             <a href='hold_history?limit=[% limit %]&amp;offset=[% offset + limit %]'
27                [% IF ctx.holds.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
28         </span>
29         <span style="float:right;">
30             <a class="hide_me" href="#">Export List</a>
31         </span>
32     </div>
33     <div class="clear-both"></div>
34
35     <div id='holds_main'>
36         [% IF ctx.holds.size < 1 %]
37         <div class="warning_box">
38             <big><strong>[% l('No holds found.') %]</strong></big>
39         </div>
40         [% ELSE %]
41         <table style='border-collapse:collapse; width: 100%;'>
42             <thead id='acct_holds_main_header'>
43                 <tr>
44                     <td width="138"><span>[% l('Title') %]</span></td>
45                     <td width="123"><span>[% l('Author') %]</span></td>
46                     <td width="64"> <span>[% l('Format') %]</span></td>
47                     <td width="136"><span>[% l('Pickup Location') %]</span> </td>
48                     <td width="104">[% l('Active On') %]</td>
49                     <td width="95">[% l('Active') %]</td>
50                     <td width="106">[% l('Date Fulfilled') %]</td>
51                     <td width="172"><span>[% l('Status') %]</span></td>
52                 </tr>
53             </thead>
54             <tbody>
55                 [% FOR hold IN ctx.holds;
56                     attrs = {marc_xml => hold.marc_xml};
57                     PROCESS get_marc_attrs args=attrs;
58                     ahr = hold.hold.hold %]
59
60                 <tr id="acct_holds_temp" name="acct_holds_temp" class="acct_holds_temp">
61
62                     <td width="138">
63                         <div style="margin-top:10px;margin-bottom:10px;">
64                             <a href="[% ctx.opac_root %]/record/[% hold.hold.bre.id %]">[% attrs.title | html %]</a>
65                         </div>
66                     </td>
67                     <td width="123">
68                         <div style="margin-top:10px;margin-bottom:10px;">
69                             <a href="[% ctx.opac_root %]/results?qtype=author&amp;query=[% attrs.author | replace('[,\.:;]', '') | url %]">[% attrs.author | html %]</a>
70                         </div>
71                     </td>
72                     <td width="64">
73                         <div style="width:26px;height:23px;margin-top:6px;margin-bottom:6px;">
74                             [% IF attrs.format_icon %]
75                             <img src="[% ctx.media_prefix %]/images/[% attrs.form_icon %]"
76                                 title="[% attrs.format %]" alt="[% attrs.format %]" />
77                             [% ELSE;
78                                 attrs.format;
79                                END %]
80                         </div>
81                     </td>
82                     <td width="136">
83                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
84                     </td>
85                     <td width="104">
86                         [% IF ahr.frozen == 't' AND ahr.thaw_date;
87                             date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
88                         END %]
89                     </td>
90                     <td width="95">
91                         [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %]
92                     </td>
93                     <td width="106">
94                         [% IF ahr.fulfillment_time;
95                             date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT);
96                         END %]
97                     </td>
98                     <td width="110">
99                         <div name="acct_holds_status"
100                             style="margin-top:10px;margin-bottom:10px;">
101                             [%
102                                 IF hold.hold.status == 4;
103                                     l("Available");
104                                     IF ahr.shelf_expire_time;
105                                         l('<br/>Expires [_1]', 
106                                             date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT));
107                                     END;
108                                 ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0;
109                                     # estimated wait is delivered as seconds.
110                                     SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400);
111                                     l("Estimated wait: [quant,_1,day,days]", hwait);
112                                 ELSIF hold.hold.status == 3;
113                                     l("In Transit");
114                                 ELSIF hold.hold.status < 3;
115                                     l("Waiting for copy");
116                                 END;
117                             %]
118                         </div>
119                     </td>
120                 </tr>
121                 [% END %]
122             </tbody>
123         </table>
124         [% END %]
125     </div>
126 [% END %]