2da8cef5d69ca9e8826ceb564e481fec5bd954fa
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / holds.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.holds_limit;
7     offset = ctx.holds_offset;
8     count = ctx.holds_ids.size;
9 %]
10 <div id='myopac_holds_div'>
11
12     <div id="acct_holds_tabs">
13         <div class="align selected">
14             <a href='#'>[% l("Items on Hold") %]</a>
15         </div>
16         <div class="align">
17             <a href='[% mkurl('hold_history', {}, ['limit','offset','available']) %]'>[% l("Holds History") %]</a>
18         </div>
19     </div>
20
21     <div class="header_middle">
22         <span id="acct_holds_header" style="float:left;">
23             [%  IF CGI.param("available");
24                     l("Items Ready for Pickup");
25                 ELSE;
26                     l("Current Items on Hold");
27                 END
28             %]
29         </span>
30         <span class='float-left' style='padding-left: 10px;'>
31             <a href='[% mkurl('holds', {limit => limit,offset => (offset - limit)}) %]'
32                 [% IF offset <= 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
33             [% IF offset > 0 || count > limit;
34                 curpage = 0;
35                 WHILE curpage * limit < count;
36                     IF curpage * limit == offset;
37             %]
38             [% curpage + 1 %]
39                     [%- ELSE %]
40             <a href='[% mkurl('holds', {limit => limit, offset => (curpage * limit)}) %]'>[% curpage + 1 %]</a>
41                     [%- END;
42                     curpage = curpage + 1;
43                 END;
44             END %]
45             <a href='[% mkurl('holds', {limit => limit, offset => (offset + limit)}) %]'
46                [% IF count <= limit + offset %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
47         </span>
48
49         <span style="float:right;">
50             <a class="hide_me" href="#">[% l('Export List') %]</a>
51         </span>
52     </div>
53     <div class="clear-both"></div>
54     <div id='holds_main'>
55         <form method="post">
56         <table cellpadding='0' cellspacing='0' class="opac-auto-097">
57             <tr>
58                 <td width="1">
59                     <select name="action" id="acct_holds_actions">
60                         <option id='myopac_holds_actions_none' value=''>
61                         -- [% l("Actions for selected holds") %] --
62                         </option>
63                         <option value='suspend'>[% l("Suspend") %]</option>
64                         <option value='activate'>[% l("Activate") %]</option>
65                         <!-- XXX maybe later <option value='thaw_date'>[% l("Set Active Date") %]</option> -->
66                         <option value='cancel'>[% l("Cancel") %]</option>
67                     </select>
68                 </td>
69                 <td width="1" style="padding-left:9px;">
70                     <input type="submit" value="[% l('Go') %]"
71                         alt="[% l('Go') %]" title="[% l('Go') %]"
72                         class="opac-button" />
73                 </td>
74                 <td width="1" style="padding-left:5px;">
75                     <a href="#"><img
76                         alt="[% l('Holds Help') %]"
77                         src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
78                 </td>
79                 <td style="padding-left:5px;" class='error'>
80                     [%  IF ctx.hold_suspend_post_capture;
81                             l('One or more holds could not be suspended because the item is at (or en route to) the pickup library.');
82                         END;
83                     %]
84                 </td>
85                 <td align="right">
86                     [% IF CGI.param("available") %]
87                     <a href="[% mkurl('holds', {}, ['limit','offset','available']) %]">[% l('Show all') %]</a> |
88                     <strong>[% l("Show only available") %]</strong>
89                     [% ELSE %]
90                     <strong>[% l("Show all") %]</strong> |
91                     <a href="[% mkurl('holds',{available => 1},['limit','offset']) %]">[% l("Show only available") %]</a>
92                     [% END %] &nbsp; &nbsp;
93                     [% l("holds") %]
94                     <select class="hide_me" id="holds_sort">
95                         <option value="">[% l('-- Sort By --') %]</option>
96                         <option value="title">[% l('Title') %]</option>
97                         <option value="pickup">[% l('PickUp Location') %]</option>
98                         <option value="status">[% l('Status') %]</option>
99                     </select>
100                 </td>
101             </tr>
102         </table>
103         [% IF ctx.holds.size < 1 %]
104         <div class="warning_box">[% l('No holds found.') %]</div>
105         [% ELSE %]
106         <div class="hide_me">
107             <select id="hold_pickup_lib_temp" name="hold_pickup_lib_sel" class="hide_me"></select>
108         </div>
109         <table id="acct_holds_main_header" cellpadding='0' cellspacing='0' border='0'>
110             <thead>
111             <tr>
112                 <th align="center">
113                     <input type="checkbox" onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'hold_id' && !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
114                 </th>
115                 <th>[% l('Title') %]</th>
116                 <th>[% l('Author') %]</th>
117                 <th>[% l('Format') %]</th>
118                 <th>[% l('Pickup Location') %]</th>
119                 <th>[% l('Activate') %]</th>
120                 <th>[% l('Cancel if not filled by') %]</th>
121                 <th>[% l('Active') %]</th>
122                 <th>[% l('Status') %]</th>
123             </tr>
124             </thead>
125             <tbody id="holds_temp_parent">
126                 [% FOR hold IN ctx.holds;
127                     attrs = {marc_xml => hold.marc_xml};
128                     PROCESS get_marc_attrs args=attrs;
129                     ahr = hold.hold.hold %]
130                 <tr id="acct_holds_temp" name="acct_holds_temp"
131                     class="acct_holds_temp[% ahr.frozen == 't' ? ' inactive-hold' : '' %]">
132                     <td align="center" style="text-align:center;">
133                         <input type="checkbox" name="hold_id" value="[% ahr.id %]" />
134                     </td>
135                     <td>
136                         <div>
137                             [% 
138                                 title = attrs.title;
139                                 IF ahr.hold_type == 'P';
140                                     title = l('[_1] ([_2])', title, hold.hold.part.label);
141                                 END;
142                             %]
143                             <a href="[% mkurl(ctx.opac_root _ '/record/' _ hold.hold.bre_id) %]">[% title | html %]</a>
144                         </div>
145                     </td>
146                     <td>
147                         <div>
148                             <a href="[% mkurl(ctx.opac_root _ '/results',
149                                 {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
150                             ) %]">[% attrs.author | html %]</a>
151                         </div>
152                     </td>
153                     <td>
154                         <div class="format_icon">
155                             [% IF attrs.format_icon %]
156                             <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
157                             [% END %]
158                         </div>
159                     </td>
160                     <td>
161                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
162                     </td>
163                     <td>
164                         [% IF ahr.frozen == 't' AND ahr.thaw_date;
165                             date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
166                         END %]
167                     </td>
168                     <td>
169                         [% IF ahr.expire_time;
170                             date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT);
171                         END %]
172                     </td>
173                     <td>
174                         [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %]
175                     </td>
176                     <td>
177                         <div name="acct_holds_status">
178                             [% PROCESS get_hold_status hold=hold; %]
179                         </div>
180                     </td>
181                     <td class="opac-auto-161">
182                         <a href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {id => ahr.id}) %]">Edit</a>
183                     </td>
184                 </tr>
185                 [% END %]
186             </tbody>
187         </table>
188         [% END %]
189         </form>
190     </div>
191 </div>
192 [% END %]