]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/holds.tt2
TPac: Holds Paging
[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="#">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="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<br/>the item is at (or en route to) the pickup library.');
82                         END;
83                     %]
84                 </td>
85                 <td align="right">
86                     [% l("Show") %] &nbsp; &nbsp;
87                     [% IF CGI.param("available") %]
88                     <a href="[% mkurl('holds', {},['limit','offset','available']) %]">[% l('all') %]</a> |
89                     <strong>[% l("only available") %]</strong>
90                     [% ELSE %]
91                     <strong>[% l("all") %]</strong> |
92                     <a href="[% mkurl('holds', {available => 1}, ['limit','offset']) %]">[% l("only available") %]</a>
93                     [% END %] &nbsp; &nbsp;
94                     [% l("holds") %]
95                     <select class="hide_me" id="holds_sort">
96                         <option value="">-- Sort By --</option>
97                         <option value="title">Title</option>
98                         <option value="pickup">PickUp Location</option>
99                         <option value="status">Status</option>
100                     </select>
101                 </td>
102             </tr>
103         </table>
104         [% IF ctx.holds.size < 1 %]
105         <div class="warning_box">
106             <big><strong>[% l('No holds found.') %]</strong></big>
107         </div>
108         [% ELSE %]
109         <table id="acct_holds_main_header" cellpadding='0' cellspacing='0'
110             border='0' width="100%">
111             <tr>
112                 <td width="36" 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                 </td>
115                 <td width="138">
116                     <span title="Click to sort"
117                         style="cursor:pointer;">
118                         Title
119                     </span>
120                 </td>
121                 <td width="123">
122                     <span title="Click to sort" style="cursor:pointer;">Author</span>
123                 </td>
124                 <td width="64">
125                     <span title="Click to sort"
126                         style="cursor:pointer;">Format</span>
127                 </td>
128                 <td width="136">
129                     <span title="Click to sort"
130                         style="cursor:pointer;">Pickup Location</span>
131                 </td>
132                 <td width="104">Activate</td>
133                 <td width="106">Cancel if not<br />filled by</td>
134                 <td width="95">Active</td>
135                 <td width="172">
136                     <span title="Click to sort"
137                         style="cursor:pointer;">Status</span>
138                 </td>
139             </tr>
140         </table>
141         <div class="hide_me">
142             <select id="hold_pickup_lib_temp" name="hold_pickup_lib_sel"
143                 class="hide_me" style="width:125px;height:21px;"></select>
144         </div>
145
146         <table cellpadding='0' cellspacing='0' border='0' width="100%">
147             <tbody id="holds_temp_parent">
148                 [% FOR hold IN ctx.holds;
149                     attrs = {marc_xml => hold.marc_xml};
150                     PROCESS get_marc_attrs args=attrs;
151                     ahr = hold.hold.hold %]
152                 <tr id="acct_holds_temp" name="acct_holds_temp"
153                     class="acct_holds_temp[% ahr.frozen == 't' ? ' inactive-hold' : '' %]">
154                     <td width="36" align="center" style="text-align:center;">
155                         <input type="checkbox" name="hold_id" value="[% ahr.id %]" />
156                     </td>
157                     <td width="138">
158                         <div style="margin-top:10px;margin-bottom:10px;">
159                             [% 
160                                 title = attrs.title;
161                                 IF ahr.hold_type == 'P';
162                                     title = l('[_1] ([_2])', title, hold.hold.part.label);
163                                 END;
164                             %]
165                             <a href="[% mkurl(ctx.opac_root _ '/record/' _ hold.hold.bre_id) %]">[% title | html %]</a>
166                         </div>
167                     </td>
168                     <td width="123">
169                         <div style="margin-top:10px;margin-bottom:10px;">
170                             <a href="[% mkurl(ctx.opac_root _ '/results',
171                                 {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
172                             ) %]">[% attrs.author | html %]</a>
173                         </div>
174                     </td>
175                     <td width="64">
176                         <div style="width:26px;height:23px;margin-top:6px;margin-bottom:6px;">
177                             [% IF attrs.format_icon %]
178                             <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
179                             [% END %]
180                         </div>
181                     </td>
182                     <td width="136">
183                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
184                     </td>
185                     <td width="104">
186                         <!-- <input
187                             title="Enter a date (e.g. 10/21/2010)"
188                             class="hide_me" style="width:91px;"
189                             name="activate_box" type="text" /> -->
190                         [% IF ahr.frozen == 't' AND
191                                 ahr.thaw_date;
192                             date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
193                         END %]
194                     </td>
195                     <td width="106">
196                         <!-- <input title="[% l('Enter a date (e.g. 10/21/2010)') %]"
197                             class="hide_me" style="width:91px;"
198                             name="hold_expires_box" type="text" />-->
199                         [% IF ahr.expire_time;
200                             date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT);
201                         END %]
202                     </td>
203                     <td width="95">
204                         <!-- <select name="hold_active_sel"
205                             style="width:90px;" class="hide_me">
206                             <option value="f">Active</option>
207                             <option value="t">Suspended</option>
208                         </select> -->
209                         [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %]
210                     </td>
211                     <td width="110">
212                         <div name="acct_holds_status"
213                             style="margin-top:10px;margin-bottom:10px;">
214                             [% PROCESS get_hold_status hold=hold; %]
215                         </div>
216                     </td>
217                     <td class="opac-auto-161">
218                         <a href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {id => ahr.id}) %]">Edit</a>
219                     </td>
220                 </tr>
221                 [% END %]
222             </tbody>
223         </table>
224         [% END %]
225         </form>
226     </div>
227
228     <span id='myopac.holds.cancel.confirm' class='hide_me'>[% l("Are you sure you wish to cancel the selected holds?") %]</span>
229     <span id='myopac.holds.freeze.confirm' class='hide_me'>[% l("Are you sure you wish to suspend the selected holds?  If an item has already been selected to fulfill the hold, it will not be suspended") %]</span>
230     <span id='myopac.holds.thaw.confirm' class='hide_me'>[% l("Are you sure you wish to activate the selected holds?") %]</span>
231     <span id='myopac.holds.thaw_date.confirm' class='hide_me'>[% l("Are you sure you wish to change the activate date for the selected holds?") %]</span>
232     <span id='myopac.holds.freeze.select_thaw' class='hide_me'>[% l("Select an automatic activation date.  If no date is chosen, the holds will remain suspended until they are manually activated.") %]</span>
233
234     <table width='100%' id='myopac_holds_processing' class='hide_me'>
235         <tr><td>[% l("Processing holds... This may take a moment.") %]</td></tr>
236     </table>
237    
238     <span class='hide_me' id='myopac_holds_cancel_verify'>
239         [% l("If you wish to cancel the selected hold, click OK, otherwise click Cancel.") %]
240     </span>
241 </div>
242 <div id='myopac_holds_thaw_date_form' class='hide_me'>
243     <div id='myopac_holds_freeze_select_thaw'>
244         [% l("Select an automatic activation date.  If no date is chosen, the holds will remain suspended until they are manually activated.") %]
245     </div>
246     <p>
247         <input size='10' maxlength='10'
248             type='text' id='myopac_holds_thaw_date_input' />
249     </p>
250     <p>
251         <button>[% l("Submit") %]</button>
252     </p>
253 </div>
254 [% END %]