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