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