towards an opac hold editor
[evergreen-equinox.git] / Open-ILS / web / templates / default / opac / myopac / holds / edit.tt2
1 [%  PROCESS "default/opac/parts/header.tt2";
2     PROCESS "default/opac/parts/misc_util.tt2";
3     PROCESS "default/opac/parts/org_selector.tt2";
4     WRAPPER "default/opac/parts/base.tt2" +
5         "default/opac/parts/myopac/base.tt2";
6     myopac_page = "holds"; # in this case, just for tab coloring.
7
8     hold = 0;
9     FOR h IN ctx.holds;
10         IF h.hold.hold.id == CGI.param('id');
11             hold = h;
12             ahr = hold.hold.hold;
13             attrs = {marc_xml => hold.marc_xml};
14             PROCESS get_marc_attrs args=attrs;
15             hold.human_status = PROCESS get_hold_status hold=hold;
16
17             # Do this up front to avoid verbosity later
18             expire_time = ahr.expire_time ? date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT) : '';
19             thaw_date = ahr.thaw_date ? date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT) : '';
20             LAST;
21         END;
22     END;
23 %]
24 <div class="pad-bottom-five">
25     <div class="header_middle">
26         <span id="acct_holds_header float-left">[% l('Editing Hold') %]</span>
27     </div>
28     <div id="hold_editor">
29         [% IF hold %]
30             <h1>[% attrs.title %]</h1>
31             <h2>[% attrs.author %]</h2>
32             [% IF attrs.format_icon %]<p>
33                 <strong>[% l('Format:') %]</strong>
34                 <img src="[% ctx.media_prefix %]/images/[% attrs.format_icon %]" alt="[% attrs.format %]" title="[% attrs.title %]" />
35             </p>[% END %]
36             <p>
37                 <strong>[% l('Status') %]</strong>: [% hold.human_status %]
38             </p>
39             <form>
40                 <table id="hold_editor_table">
41                     <tr>
42                         <th>
43                             <input type="hidden" name="hold"
44                                 value="[% ahr.id %]" />
45                             [% l('Pickup library') %]
46                         </th>
47                         <td>
48                             [% PROCESS build_org_selector
49                                 name='pickup_lib' value=ahr.pickup_lib %]
50                         </td>
51                     </tr>
52                     <tr>
53                         <th>
54                             [% l('Cancel unless filled by') %]
55                         </th>
56                         <td>
57                             <input type="text" name="expire_time"
58                                 value="[% expire_time | html %]" />
59                         </td>
60                     </tr>
61                     <tr>
62                         <th>
63                             [% l('Activate on') %]
64                         </th>
65                         <td>
66                             <input type="text" name="thaw_date"
67                                 value="[% thaw_date | html %]" />
68                         </td>
69                     </tr>
70                 </table>
71             </form>
72         [% ELSE;
73             l('Hold not found');
74         END %]
75     </div>
76 </div>
77 [% END %]