]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/holds/edit.tt2
TPac: repaired hold status display bug
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / holds / edit.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     PROCESS "opac/parts/hold_status.tt2";
4     PROCESS "opac/parts/org_selector.tt2";
5     WRAPPER "opac/parts/base.tt2" + "opac/parts/myopac/base.tt2";
6     myopac_page = "holds"; # in this case, just for tab coloring.
7
8     hold = ctx.holds.0;
9     ahr = hold.hold.hold;
10     attrs = {marc_xml => hold.marc_xml};
11     PROCESS get_marc_attrs args=attrs;
12     hold.human_status = PROCESS get_hold_status hold=hold;
13
14     # Do this up front to avoid verbosity later
15     expire_time = ahr.expire_time ? date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT) : '';
16     thaw_date = ahr.thaw_date ? date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT) : '';
17 %]
18 <div class="pad-bottom-five">
19     <div class="header_middle">
20         <span id="acct_holds_header float-left">[% l('Editing Hold') %]</span>
21         &nbsp; &nbsp; &nbsp; &nbsp;
22         <a href="[% ctx.opac_root %]/myopac/holds">[% l('List all holds') %]</a>
23     </div>
24     <div id="hold_editor">
25         [% IF hold %]
26             <h1>[% attrs.title | html %]</h1>
27             <h2>[% attrs.author | html %]</h2>
28             [% IF attrs.format_icon %]<p>
29                 <strong>[% l('Format:') %]</strong>
30                 <img src="[% ctx.media_prefix %]/images/[% attrs.format_icon %]" alt="[% attrs.format %]" title="[% attrs.title | html %]" />
31             </p>[% END %]
32             <p>
33                 <strong>[% l('Status') %]</strong>: [% hold.human_status %]
34             </p>
35             <form method="POST">
36                 <table id="hold_editor_table">
37                     <tr>
38                         <th>
39                             <input type="hidden" name="action" value="edit" />
40                             <input type="hidden" name="hold_id"
41                                 value="[% ahr.id %]" />
42                             [% l('Pickup library') %]
43                         </th>
44                         <td>
45                             [% PROCESS build_org_selector
46                                 name='pickup_lib' value=ahr.pickup_lib %]
47                         </td>
48                     </tr>
49                     <tr>
50                         <th>
51                             [% l('Cancel unless filled by') %]
52                         </th>
53                         <td>
54                             <input type="text" name="expire_time"
55                                 value="[% expire_time | html %]" />
56                         </td>
57                         <td class="fmt-note">
58                             <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
59                             <!-- XXX TODO pick out a minimal, simple, reliable
60                             calendar widget that's not part of some giant,
61                             bloated framework and doesn't do anything at onload.
62                             -->
63                         </td>
64                     </tr>
65                     <tr>
66                         <th>
67                             [% l('Active?') %]
68                         </th>
69                         <td>
70                             <select name="frozen">
71                                 <option value="f"[% ahr.frozen == 't' ? '' :' selected="selected"' %]>
72                                     [% l('Yes, this hold is active now') %]
73                                 </option>
74                                 <option value="t"[% ahr.frozen == 't' ? ' selected="selected"' : '' %]>
75                                     [% l('No, this hold is suspended') %]
76                                 </option>
77                             </select>
78                         </td>
79                     </tr>
80                     <tr>
81                         <th>
82                             [% l('If suspended, activate on') %]
83                         </th>
84                         <td>
85                             <input type="text" name="thaw_date"
86                                 value="[% thaw_date | html %]" />
87                         </td>
88                         <td class="fmt-note">
89                             <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
90                         </td>
91                     </tr>
92                     <tr>
93                         <td colspan="2" class="hold-editor-controls">
94                             <input type="image"
95                                 src="[% ctx.media_prefix %]/images/btnSubmit.png"
96                                 alt="[% l('Submit') %]"
97                                 title="[% l('Submit') %]" />
98                             <a href="[% ctx.opac_root %]/myopac/holds"><img
99                                 src="[% ctx.media_prefix %]/images/btnCancel.png"
100                                 alt="[% l('Cancel') %]"
101                                 title="[% l('Cancel') %]" /></a>
102                         </td>
103                     </tr>
104                 </table>
105             </form>
106         [% ELSE;
107             l('Hold not found');
108         END %]
109     </div>
110 </div>
111 [% END %]