towards an opac hold editor
[evergreen-equinox.git] / Open-ILS / web / templates / default / opac / myopac / holds / edit.tt2
diff --git a/Open-ILS/web/templates/default/opac/myopac/holds/edit.tt2 b/Open-ILS/web/templates/default/opac/myopac/holds/edit.tt2
new file mode 100644 (file)
index 0000000..bf30913
--- /dev/null
@@ -0,0 +1,77 @@
+[%  PROCESS "default/opac/parts/header.tt2";
+    PROCESS "default/opac/parts/misc_util.tt2";
+    PROCESS "default/opac/parts/org_selector.tt2";
+    WRAPPER "default/opac/parts/base.tt2" +
+        "default/opac/parts/myopac/base.tt2";
+    myopac_page = "holds"; # in this case, just for tab coloring.
+
+    hold = 0;
+    FOR h IN ctx.holds;
+        IF h.hold.hold.id == CGI.param('id');
+            hold = h;
+            ahr = hold.hold.hold;
+            attrs = {marc_xml => hold.marc_xml};
+            PROCESS get_marc_attrs args=attrs;
+            hold.human_status = PROCESS get_hold_status hold=hold;
+
+            # Do this up front to avoid verbosity later
+            expire_time = ahr.expire_time ? date.format(ctx.parse_datetime(ahr.expire_time), DATE_FORMAT) : '';
+            thaw_date = ahr.thaw_date ? date.format(ctx.parse_datetime(ahr.thaw_date), DATE_FORMAT) : '';
+            LAST;
+        END;
+    END;
+%]
+<div class="pad-bottom-five">
+    <div class="header_middle">
+        <span id="acct_holds_header float-left">[% l('Editing Hold') %]</span>
+    </div>
+    <div id="hold_editor">
+        [% IF hold %]
+            <h1>[% attrs.title %]</h1>
+            <h2>[% attrs.author %]</h2>
+            [% IF attrs.format_icon %]<p>
+                <strong>[% l('Format:') %]</strong>
+                <img src="[% ctx.media_prefix %]/images/[% attrs.format_icon %]" alt="[% attrs.format %]" title="[% attrs.title %]" />
+            </p>[% END %]
+            <p>
+                <strong>[% l('Status') %]</strong>: [% hold.human_status %]
+            </p>
+            <form>
+                <table id="hold_editor_table">
+                    <tr>
+                        <th>
+                            <input type="hidden" name="hold"
+                                value="[% ahr.id %]" />
+                            [% l('Pickup library') %]
+                        </th>
+                        <td>
+                            [% PROCESS build_org_selector
+                                name='pickup_lib' value=ahr.pickup_lib %]
+                        </td>
+                    </tr>
+                    <tr>
+                        <th>
+                            [% l('Cancel unless filled by') %]
+                        </th>
+                        <td>
+                            <input type="text" name="expire_time"
+                                value="[% expire_time | html %]" />
+                        </td>
+                    </tr>
+                    <tr>
+                        <th>
+                            [% l('Activate on') %]
+                        </th>
+                        <td>
+                            <input type="text" name="thaw_date"
+                                value="[% thaw_date | html %]" />
+                        </td>
+                    </tr>
+                </table>
+            </form>
+        [% ELSE;
+            l('Hold not found');
+        END %]
+    </div>
+</div>
+[% END %]