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