]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/holds/edit.tt2
Fix issues with org selectors leaking variables
[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/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                 title = attrs.title;
27                 IF ahr.hold_type == 'P';
28                     title = l('[_1] ([_2])', title, hold.hold.part.label);
29                 END 
30         %]
31             <h1>[% title | html %]</h1>
32             <h2>[% attrs.author | html %]</h2>
33             [% IF attrs.format_icon %]<p>
34                 <strong>[% l('Format:') %]</strong>
35                 <img src="[% attrs.format_icon %]" alt="[% attrs.format_label | html %]" title="[% attrs.format_label | html %]" />
36             </p>[% END %]
37             <p>
38                 <strong>[% l('Status') %]</strong>: [% hold.human_status %]
39             </p>
40             <form method="POST">
41                 <table id="hold_editor_table">
42                     <tr>
43                         <th>
44                             <input type="hidden" name="action" value="edit" />
45                             <input type="hidden" name="hold_id"
46                                 value="[% ahr.id %]" />
47                             [% l('Pickup library') %]
48                         </th>
49                         <td>
50                             [% INCLUDE build_org_selector
51                                 name='pickup_lib' value=ahr.pickup_lib %]
52                         </td>
53                     </tr>
54                     [% IF hold.hold.status < 3 %]
55                     [%# The following actions cannot be performed on holds that 
56                         have already been captured... %]
57                     <tr>
58                         <th>
59                             [% l('Cancel unless filled by') %]
60                         </th>
61                         <td>
62                             <input type="text" name="expire_time"
63                                 value="[% expire_time | html %]" />
64                         </td>
65                         <td class="fmt-note">
66                             <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
67                             <!-- XXX TODO pick out a minimal, simple, reliable
68                             calendar widget that's not part of some giant,
69                             bloated framework and doesn't do anything at onload.
70                             -->
71                         </td>
72                     </tr>
73                     <tr>
74                         <th>
75                             [% l('Active?') %]
76                         </th>
77                         <td>
78                             <select name="frozen">
79                                 <option value="f"[% ahr.frozen == 't' ? '' :' selected="selected"' %]>
80                                     [% l('Yes, this hold is active now') %]
81                                 </option>
82                                 <option value="t"[% ahr.frozen == 't' ? ' selected="selected"' : '' %]>
83                                     [% l('No, this hold is suspended') %]
84                                 </option>
85                             </select>
86                         </td>
87                     </tr>
88                     <tr>
89                         <th>
90                             [% l('If suspended, activate on') %]
91                         </th>
92                         <td>
93                             <input type="text" name="thaw_date"
94                                 value="[% thaw_date | html %]" />
95                         </td>
96                         <td class="fmt-note">
97                             <em>[% l('Enter date in MM/DD/YYYY format') %]</em>
98                         </td>
99                     </tr>
100                     [% END %]
101                     <tr>
102                         <td colspan="2" class="hold-editor-controls">
103                             <a href="[% ctx.opac_root %]/myopac/holds"><button 
104                                 class="opac-button">[% l('Go Back') %]</button></a>
105                             <input type="submit" value="[% l('Submit') %]" class="opac-button" />
106                         </td>
107                     </tr>
108                 </table>
109             </form>
110         [% ELSE;
111             l('Hold not found');
112         END %]
113     </div>
114 </div>
115 [% END %]