]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/holds.tt2
18eadc2fe40fa150833e3b353ca28339f9ca4eb6
[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" aria-label="[%
60                         l('Select your action for the selected holds')
61                     %]">
62                         <option id='myopac_holds_actions_none' value=''>
63                         -- [% l("Actions for selected holds") %] --
64                         </option>
65                         <option value='suspend'>[% l("Suspend") %]</option>
66                         <option value='activate'>[% l("Activate") %]</option>
67                         <!-- XXX maybe later <option value='thaw_date'>[% l("Set Active Date") %]</option> -->
68                         <option value='cancel'>[% l("Cancel") %]</option>
69                     </select>
70                 </td>
71                 <td width="1" style="padding-left:9px;">
72                     <input type="submit" value="[% l('Go') %]"
73                         alt="[% l('Go') %]" title="[% l('Go') %]"
74                         class="opac-button" />
75                 </td>
76                 <td width="1" style="padding-left:5px;">
77                     <a href="#"><img
78                         alt="[% l('Holds Help') %]"
79                         src="[% ctx.media_prefix %]/images/question-mark.png" /></a>
80                 </td>
81                 <td style="padding-left:5px;" class='error'>
82                     [%  IF ctx.hold_suspend_post_capture;
83                             l('One or more holds could not be suspended because the item is at (or en route to) the pickup library.');
84                         END;
85                     %]
86                 </td>
87                 <td align="right">
88                     [% IF CGI.param("available") -%]
89                     <a href="[% mkurl('holds', {}, ['limit','offset','available']) %]">[% l('Show all holds') %]</a> |
90                     <strong>[% l("Show only available holds") %]</strong>
91                     [% ELSE -%]
92                     <strong>[% l("Show all holds") %]</strong> |
93                     <a href="[% mkurl('holds',{available => 1},['limit','offset']) %]">[% l("Show only available holds") %]</a>
94                     [% END -%]
95                     <select class="hide_me" id="holds_sort">
96                         <option value="">[% l('-- Sort By --') %]</option>
97                         <option value="title">[% l('Title') %]</option>
98                         <option value="pickup">[% l('Pickup Location') %]</option>
99                         <option value="status">[% l('Status') %]</option>
100                     </select>
101                 </td>
102             </tr>
103         </table>
104         [% IF ctx.holds.size < 1 %]
105         <div class="warning_box">[% l('No holds found.') %]</div>
106         [% ELSE %]
107         <div class="hide_me">
108             <select id="hold_pickup_lib_temp" name="hold_pickup_lib_sel" class="hide_me"></select>
109         </div>
110         <table id="acct_holds_main_header" cellpadding='0' cellspacing='0' border='0'>
111             <thead>
112             <tr>
113                 <th align="center">
114                     <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;}"/>
115                 </th>
116                 <th>[% l('Title') %]</th>
117                 <th>[% l('Author') %]</th>
118                 <th>[% l('Format') %]</th>
119                 <th>[% l('Pickup Location') %]</th>
120                 <th>[% l('Activate') %]</th>
121                 <th>[% l('Cancel if not filled by') %]</th>
122                 <th>[% l('Active') %]</th>
123                 <th>[% l('Status') %]</th>
124                 <th>[% l('Notes') %]</th>
125             </tr>
126             </thead>
127             <tbody id="holds_temp_parent">
128                 [% FOR hold IN ctx.holds;
129                     attrs = {marc_xml => hold.marc_xml};
130                     PROCESS get_marc_attrs args=attrs;
131                     ahr = hold.hold.hold %]
132                 <tr id="acct_holds_temp" name="acct_holds_temp"
133                     class="acct_holds_temp[% ahr.frozen == 't' ? ' inactive-hold' : '' %]">
134                     <td align="center" style="text-align:center;">
135                         <input type="checkbox" name="hold_id" value="[% ahr.id %]" />
136                     </td>
137                     <td>
138                         <div>
139                             [% 
140                                 title = attrs.title;
141                                 IF ahr.hold_type == 'P';
142                                     title = l('[_1] ([_2])', title, hold.hold.part.label);
143                                 END;
144                             %]
145                             <a href="[% mkurl(ctx.opac_root _ '/record/' _ hold.hold.bre_id) %]">[% title | html %]</a>
146                         </div>
147                     </td>
148                     <td>
149                         <div>
150                             <a href="[% mkurl(ctx.opac_root _ '/results',
151                                 {qtype => 'author', query => attrs.author.replace('[,\.:;]', '')}
152                             ) %]">[% attrs.author | html %]</a>
153                         </div>
154                     </td>
155                     <td>
156                         <div class="format_icon">
157                             [% IF attrs.format_icon %]
158                             <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
159                             [% END %]
160                         </div>
161                     </td>
162                     <td>
163                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
164                     </td>
165                     <td>
166                         [% IF ahr.frozen == 't' AND ahr.thaw_date;
167                             date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
168                         END %]
169                     </td>
170                     <td>
171                         [% IF ahr.expire_time;
172                             date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT);
173                         END %]
174                     </td>
175                     <td>
176                         [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %]
177                     </td>
178                     <td>
179                         <div name="acct_holds_status">
180                             [% PROCESS get_hold_status hold=hold; %]
181                         </div>
182                     </td>
183                     <td class="hold_notes">
184                     [%- FOREACH pubnote IN ahr.notes;
185                         IF pubnote.pub == 't';
186                     %]
187                         <div class="hold_note">
188                             <span class="hold_note_title">[% pubnote.title | html %]</span>
189                             <br />
190                             <span class="hold_note_body">[% pubnote.body | html %]</span>
191                         </div>
192                     [%- END; END; %]
193                     </td>
194                     <td class="opac-auto-161">
195                         <a href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {id => ahr.id}) %]">Edit</a>
196                     </td>
197                 </tr>
198                 [% END %]
199             </tbody>
200         </table>
201         [% END %]
202         </form>
203     </div>
204 </div>
205 [% END %]