towards an opac hold editor
authorsenator <lebbeous@esilibrary.com>
Thu, 24 Mar 2011 22:51:09 +0000 (18:51 -0400)
committersenator <lebbeous@esilibrary.com>
Wed, 30 Mar 2011 21:43:50 +0000 (17:43 -0400)
12 files changed:
Open-ILS/web/css/skin/default/opac/style.css
Open-ILS/web/templates/default/opac/mylist.tt2
Open-ILS/web/templates/default/opac/myopac/circs.tt2
Open-ILS/web/templates/default/opac/myopac/holds.tt2
Open-ILS/web/templates/default/opac/myopac/holds/edit.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/opac/myopac/lists.tt2
Open-ILS/web/templates/default/opac/myopac/main.tt2
Open-ILS/web/templates/default/opac/myopac/update_email.tt2
Open-ILS/web/templates/default/opac/parts/misc_util.tt2 [moved from Open-ILS/web/templates/default/opac/parts/marc_misc.tt2 with 70% similarity]
Open-ILS/web/templates/default/opac/parts/place_hold.tt2
Open-ILS/web/templates/default/opac/parts/record/body.tt2
Open-ILS/web/templates/default/opac/parts/result/table.tt2

index 5d402f9..6b40404 100644 (file)
@@ -968,3 +968,7 @@ a.dash-link:hover { text-decoration: underline !important; }
 }
 .list-create-table-buttons input[type=image] { margin-top: 2px; }
 .result_table_format_cell { padding: 0px 10px; text-align: center; }
+#hold_editor h1 { font-size: 120%; font-weight: bold; }
+#hold_editor h2 { font-size: 111%; font-weight: normal; text-indent: 2em; font-style: italic; }
+#hold_editor h1, #hold_editor h2 { margin: 2px 0; }
+#hold_editor_table th { text-align: right; padding-right: 1em; }
index daccdb7..2152b52 100644 (file)
@@ -1,5 +1,5 @@
 [%  PROCESS "default/opac/parts/header.tt2";
-    PROCESS "default/opac/parts/marc_misc.tt2";
+    PROCESS "default/opac/parts/misc_util.tt2";
     WRAPPER "default/opac/parts/base.tt2";
     INCLUDE "default/opac/parts/topnav.tt2";
     ctx.page_title = l("Record Detail") %]
index 8846bdf..9ef034d 100644 (file)
@@ -1,5 +1,5 @@
 [%  PROCESS "default/opac/parts/header.tt2";
-    PROCESS "default/opac/parts/marc_misc.tt2";
+    PROCESS "default/opac/parts/misc_util.tt2";
     WRAPPER "default/opac/parts/base.tt2" +
         "default/opac/parts/myopac/base.tt2";
     myopac_page = "circs"  %]
index cd4ce31..7000f30 100644 (file)
@@ -1,5 +1,5 @@
 [%  PROCESS "default/opac/parts/header.tt2";
-    PROCESS "default/opac/parts/marc_misc.tt2";
+    PROCESS "default/opac/parts/misc_util.tt2";
     WRAPPER "default/opac/parts/base.tt2" +
         "default/opac/parts/myopac/base.tt2";
     myopac_page = "holds"  %]
                     <td width="110">
                         <div name="acct_holds_status"
                             style="margin-top:10px;margin-bottom:10px;">
-                            [%
-                                IF hold.hold.status == 4;
-                                    l("Available");
-                                    IF ahr.shelf_expire_time;
-                                        l('<br/>Expires [_1]', 
-                                            date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT));
-                                    END;
-                                ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0;
-                                    # estimated wait is delivered as seconds.
-                                    SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400);
-                                    l("Estimated wait: [quant,_1,day,days]", hwait);
-                                ELSIF hold.hold.status == 3;
-                                    l("In Transit");
-                                ELSIF hold.hold.status < 3;
-                                    l("Waiting for copy");
-                                END;
-                            %]
+                            [% PROCESS get_hold_status hold=hold; %]
                         </div>
                     </td>
                     <td class="opac-auto-161">
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 %]
index 1fa28f9..f661726 100644 (file)
@@ -1,5 +1,5 @@
 [%  PROCESS "default/opac/parts/header.tt2";
-    PROCESS "default/opac/parts/marc_misc.tt2";
+    PROCESS "default/opac/parts/misc_util.tt2";
     WRAPPER "default/opac/parts/base.tt2" +
         "default/opac/parts/myopac/base.tt2";
     myopac_page = "lists"  %]
index e92e17c..8f756e4 100644 (file)
@@ -1,5 +1,5 @@
 [%  PROCESS "default/opac/parts/header.tt2";
-    PROCESS "default/opac/parts/marc_misc.tt2";
+    PROCESS "default/opac/parts/misc_util.tt2";
     WRAPPER "default/opac/parts/base.tt2" +
         "default/opac/parts/myopac/base.tt2";
     myopac_page = "main"  %]
index 22b089a..7a9c014 100644 (file)
@@ -1,5 +1,5 @@
 [%  PROCESS "default/opac/parts/header.tt2";
-    PROCESS "default/opac/parts/marc_misc.tt2";
+    PROCESS "default/opac/parts/misc_util.tt2";
     WRAPPER "default/opac/parts/base.tt2" +
         "default/opac/parts/myopac/base.tt2";
     myopac_page = "update_email"  %]
         args.format = ctx.find_citm(mattype).value;
         args.format_icon = icon_by_format.$mattype;
     END;
+
+    BLOCK get_hold_status;
+        IF hold.hold.status == 4;
+            l("Available");
+            IF ahr.shelf_expire_time;
+                l('<br/>Expires [_1]', 
+                    date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT));
+            END;
+        ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0;
+            # estimated wait is delivered as seconds.
+            SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400);
+            l("Estimated wait: [quant,_1,day,days]", hwait);
+        ELSIF hold.hold.status == 3;
+            l("In Transit");
+        ELSIF hold.hold.status < 3;
+            l("Waiting for copy");
+        END;
+    END;
 %]
index f3d8ef3..1c2f8b5 100644 (file)
@@ -1,4 +1,4 @@
-[%  PROCESS "default/opac/parts/marc_misc.tt2";
+[%  PROCESS "default/opac/parts/misc_util.tt2";
     attrs = {marc_xml => ctx.marc_xml};
     PROCESS get_marc_attrs args=attrs;
 %]
index 93d2bf7..f36182a 100644 (file)
@@ -1,7 +1,7 @@
 <!-- ****************** page_rdetail.xml ***************************** -->
 [%  record = ctx.record;
     attrs = {marc_xml => ctx.marc_xml};
-    PROCESS "default/opac/parts/marc_misc.tt2";
+    PROCESS "default/opac/parts/misc_util.tt2";
     PROCESS get_marc_attrs args=attrs %]
 <div id='canvas_main' class='canvas'>
     <div id="rdetail_header" class="hide_me">[%#
index 6dfb7b8..ddafce5 100644 (file)
@@ -1,4 +1,4 @@
-[%  PROCESS "default/opac/parts/marc_misc.tt2";
+[%  PROCESS "default/opac/parts/misc_util.tt2";
 
     ctx.result_start = 1 + ctx.page_size * page;
     ctx.result_stop = 1 + ctx.page_size * (page + 1);