]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/hold_history.tt2
TPac: Holds Paging
[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     PROCESS "opac/parts/hold_status.tt2";
4     WRAPPER "opac/parts/myopac/base.tt2";
5     myopac_page = "holds";
6     limit = ctx.hold_history_limit;
7     offset = ctx.hold_history_offset;
8     count = ctx.hold_history_ids.size;
9 %]
10
11 <div id='myopac_holds_div'>
12
13     <div id="acct_holds_tabs">
14         <div class="align">
15             <a href='[% mkurl('holds',{},['limit','offset']) %]'>[% l("Items on Hold") %]</a>
16         </div>
17         <div class="align selected">
18             <a href="#">[% l("Holds History") %]</a>
19         </div>
20     </div>
21
22     <div class="header_middle">
23         <span style="float:left;">[% l("Previously Held Items") %]</span>
24         <span class='float-left' style='padding-left: 10px;'>
25             <a href='[% mkurl('hold_history', {limit => limit,offset => (offset - limit)}) %]'
26                 [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
27             [% IF offset > 0 || count > limit;
28                 curpage = 0;
29                 WHILE curpage * limit < count;
30                     IF curpage * limit == offset;
31             %]
32             [% curpage + 1 %]
33                     [%- ELSE %]
34             <a href='[% mkurl('holds_history', {limit => limit, offset => (curpage * limit)}) %]'>[% curpage + 1 %]</a>
35                     [%- END;
36                     curpage = curpage + 1;
37                 END;
38             END %]
39             <a href='[% mkurl('hold_history', {limit => limit, offset => (offset + limit)}) %]'
40                [% IF count <= limit + offset %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
41         </span>
42         <span style="float:right;">
43             <a class="hide_me" href="#">Export List</a>
44         </span>
45     </div>
46     <div class="clear-both"></div>
47
48     <div id='holds_main'>
49         [% IF ctx.holds.size < 1 %]
50         <div class="warning_box">
51             <big><strong>[% l('No holds found.') %]</strong></big>
52         </div>
53         [% ELSE %]
54         <table style='border-collapse:collapse; width: 100%;'>
55             <thead id='acct_holds_main_header'>
56                 <tr>
57                     <td width="138"><span>[% l('Title') %]</span></td>
58                     <td width="123"><span>[% l('Author') %]</span></td>
59                     <td width="64"> <span>[% l('Format') %]</span></td>
60                     <td width="136"><span>[% l('Pickup Location') %]</span> </td>
61                     <td width="104">[% l('Active On') %]</td>
62                     <td width="95">[% l('Active') %]</td>
63                     <td width="106">[% l('Date Fulfilled') %]</td>
64                     <td width="172"><span>[% l('Status') %]</span></td>
65                 </tr>
66             </thead>
67             <tbody>
68                 [% FOR hold IN ctx.holds;
69                     attrs = {marc_xml => hold.marc_xml};
70                     PROCESS get_marc_attrs args=attrs;
71                     ahr = hold.hold.hold %]
72
73                 <tr id="acct_holds_temp" name="acct_holds_temp" class="acct_holds_temp">
74
75                     <td width="138">
76                         <div style="margin-top:10px;margin-bottom:10px;">
77                             <a href="[% mkurl(ctx.opac_root _ '/record/' _ hold.hold.bre_id) %]">[% attrs.title | html %]</a>
78                         </div>
79                     </td>
80                     <td width="123">
81                         <div style="margin-top:10px;margin-bottom:10px;">
82                             <a href="[% mkurl(ctx.opac_root _ '/results',
83                                 {qtype => author, query => attrs.author.replace('[,\.:;]', '')}
84                             ) %]">[% attrs.author | html %]</a>
85                         </div>
86                     </td>
87                     <td width="64">
88                         <div style="width:26px;height:23px;margin-top:6px;margin-bottom:6px;">
89                             [% IF attrs.format_icon %]
90                             <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
91                             [% END %]
92                         </div>
93                     </td>
94                     <td width="136">
95                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
96                     </td>
97                     <td width="104">
98                         [% IF ahr.frozen == 't' AND ahr.thaw_date;
99                             date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
100                         END %]
101                     </td>
102                     <td width="95">
103                         [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %]
104                     </td>
105                     <td width="106">
106                         [% IF ahr.fulfillment_time;
107                             date.format(ctx.parse_datetime(ahr.fulfillment_time), DATE_FORMAT);
108                         END %]
109                     </td>
110                     <td width="110">
111                         <div name="acct_holds_status"
112                             style="margin-top:10px;margin-bottom:10px;">
113                             [% PROCESS get_hold_status hold=hold; %]
114                         </div>
115                     </td>
116                 </tr>
117                 [% END %]
118             </tbody>
119         </table>
120         [% END %]
121     </div>
122 </div>
123 [% END %]