]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/holds.tt2
LP#1268636 My account various repairs
[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 class="table_no_border_space table_no_cell_pad opac-auto-097"
57             title="[% l('Actions for Items on Hold') %]">
58             <tr>
59                 <td>
60                     <select name="action" id="acct_holds_actions" 
61                       aria-label="[% l('Select your action for the selected holds') %]"
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 < 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                             [% IF attrs.format_icon %]
153                             <img title="[% attrs.format_label | html %]" alt="[% attrs.format_label | html %]" src="[% attrs.format_icon %]" />
154                             [% END %]
155                         </div>
156                     </td>
157                     <td>
158                         [% ctx.get_aou(ahr.pickup_lib).name | html %]
159                     </td>
160                     <td>
161                         [% IF ahr.frozen == 't' AND ahr.thaw_date;
162                             date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT);
163                         END %]
164                     </td>
165                     <td>
166                         [% IF ahr.expire_time;
167                             date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT);
168                         END %]
169                     </td>
170                     <td>
171                         [% l(ahr.frozen == 'f' ? 'Active' : 'Suspended') %]
172                     </td>
173                     <td>
174                         <div name="acct_holds_status">
175                             [% PROCESS get_hold_status hold=hold; %]
176                         </div>
177                     </td>
178                     <td class="hold_notes">
179                     [%- FOREACH pubnote IN ahr.notes;
180                         IF pubnote.pub == 't';
181                     %]
182                         <div class="hold_note">
183                             <span class="hold_note_title">[% pubnote.title | html %]</span>
184                             <br />
185                             <span class="hold_note_body">[% pubnote.body | html %]</span>
186                         </div>
187                     [%- END; END; %]
188                     </td>
189                     <td class="opac-auto-161">
190                         <a href="[% mkurl(ctx.opac_root _ '/myopac/holds/edit', {id => ahr.id}) %]"
191                             [% html_text_attr('title', l('Edit hold for item [_1]', attrs.title)) %]>
192                             [% l('Edit') %]
193                         ]</a>
194                     </td>
195                 </tr>
196                 [% END %]
197             </tbody>
198         </table>
199         [% END %]
200         </form>
201     </div>
202 </div>
203 [% END %]