[open-ils-commits] r17616 - in branches/rel_2_0/Open-ILS: examples web/css/skin web/css/skin/default web/js/dojo/openils web/js/ui/default web/opac/locale/en-US web/templates/default xul/staff_client/chrome/content/cat xul/staff_client/chrome/locale/en-US xul/staff_client/server/serial (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Sep 12 15:04:53 EDT 2010


Author: senator
Date: 2010-09-12 15:04:48 -0400 (Sun, 12 Sep 2010)
New Revision: 17616

Added:
   branches/rel_2_0/Open-ILS/web/css/skin/default/serial.css
   branches/rel_2_0/Open-ILS/web/js/ui/default/serial/
   branches/rel_2_0/Open-ILS/web/templates/default/serial/
Modified:
   branches/rel_2_0/Open-ILS/examples/fm_IDL.xml
   branches/rel_2_0/Open-ILS/web/css/skin/default.css
   branches/rel_2_0/Open-ILS/web/js/dojo/openils/XUL.js
   branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
   branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/batch_receive.js
   branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/pattern_wizard_overlay.xul
Log:
Backport r17615 from trunk: serials quick-and-dirty admin interfaces


Modified: branches/rel_2_0/Open-ILS/examples/fm_IDL.xml
===================================================================
--- branches/rel_2_0/Open-ILS/examples/fm_IDL.xml	2010-09-12 19:03:01 UTC (rev 17615)
+++ branches/rel_2_0/Open-ILS/examples/fm_IDL.xml	2010-09-12 19:04:48 UTC (rev 17616)
@@ -3170,12 +3170,24 @@
 			<link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
 		</links>
 		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+			<actions>
+				<create permission="ADMIN_SERIAL_CAPTION_PATTERN">
+					<context link="subscription" field="owning_lib" />
+				</create>
+				<retrieve />
+				<update permission="ADMIN_SERIAL_CAPTION_PATTERN">
+					<context link="subscription" field="owning_lib" />
+				</update>
+				<delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
+					<context link="subscription" field="owning_lib" />
+				</delete>
+			</actions>
 		</permacrud>
 	</class>
 
 	<class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
 		<fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
-			<field reporter:label="Id" name="id" reporter:datatype="id"/>
+			<field reporter:label="ID" name="id" reporter:datatype="id"/>
 			<field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
 			<field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
 			<field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
@@ -3197,7 +3209,7 @@
 		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
 			<actions>
 				<create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
-				<retrieve permission="VIEW_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
+				<retrieve />
 				<update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
 				<delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
 			</actions>
@@ -3227,7 +3239,7 @@
 			<field reporter:label="ID" name="id" reporter:datatype="id"/>
 			<field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
 			<field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
-			<field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="link"/>
+			<field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
 			<field reporter:label="Label" name="label" reporter:datatype="text"/>
 			<field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
 			<field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
@@ -3257,10 +3269,10 @@
 		</links>
 		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
 			<actions>
-				<create/>
-				<retrieve/>
-				<update/>
-				<delete/>
+				<create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
+				<retrieve />
+				<update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
+				<delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
 			</actions>
 		</permacrud>
 	</class>
@@ -3299,6 +3311,18 @@
 			<link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
 		</links>
 		<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+			<actions>
+				<create permission="ADMIN_SERIAL_STREAM">
+					<context link="distribution" field="holding_lib" />
+				</create>
+				<retrieve />
+				<update permission="ADMIN_SERIAL_STREAM">
+					<context link="distribution" field="holding_lib" />
+				</update>
+				<delete permission="ADMIN_SERIAL_STREAM">
+					<context link="distribution" field="holding_lib" />
+				</delete>
+			</actions>
 		</permacrud>
 	</class>
 

Copied: branches/rel_2_0/Open-ILS/web/css/skin/default/serial.css (from rev 17615, trunk/Open-ILS/web/css/skin/default/serial.css)
===================================================================
--- branches/rel_2_0/Open-ILS/web/css/skin/default/serial.css	                        (rev 0)
+++ branches/rel_2_0/Open-ILS/web/css/skin/default/serial.css	2010-09-12 19:04:48 UTC (rev 17616)
@@ -0,0 +1,23 @@
+.oils-serial-header { margin-bottom: 20px; }
+.oils-serial-tab-container { height: 600px; }
+.lesser { margin-top: 2px !important }
+.lesser div:first-child { font-size: 110% !important; }
+.lesser div:last-child { margin-right: 16px; }
+#scap_editor th {
+    font-weight: bold;
+    background-color: #ccc;
+    padding: 2px 8px;
+}
+#scap_editor td { padding: 2px 8px; }
+#scap_editor tr[changed="true"] td { background-color: #fc9; }
+#scap_editor [name="remover"] button { color: red; font-weight: bold; }
+#scap_editor tfoot td { text-align: center; padding-top: 24px; }
+#scap_editor td[name] { text-align: center; }
+.serial-dialog-table tr > * { padding-bottom: 1em; }
+.serial-dialog-table th { text-align: left; padding-right: 1em; }
+.serial-dialog-table tr:last-child td { text-align: center; }
+.serial-additional-controls {
+    text-align: right;
+    margin-right: 16px;
+    padding: 8px 0;
+}

Modified: branches/rel_2_0/Open-ILS/web/css/skin/default.css
===================================================================
--- branches/rel_2_0/Open-ILS/web/css/skin/default.css	2010-09-12 19:03:01 UTC (rev 17615)
+++ branches/rel_2_0/Open-ILS/web/css/skin/default.css	2010-09-12 19:04:48 UTC (rev 17616)
@@ -1,6 +1,7 @@
 /* import the default css for the install applications */
 @import "default/acq.css";
 @import "default/admin.css";
+ at import "default/serial.css";
 /* import the dojo CSS */
 @import "/js/dojo/dojo/resources/dojo.css";
 @import "/js/dojo/dijit/themes/tundra/tundra.css";

Modified: branches/rel_2_0/Open-ILS/web/js/dojo/openils/XUL.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/XUL.js	2010-09-12 19:03:01 UTC (rev 17615)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/XUL.js	2010-09-12 19:04:48 UTC (rev 17616)
@@ -33,6 +33,27 @@
         xulG.new_tab(path, tabInfo, options);
     }
 
+    openils.XUL.newTabEasy = function(url, tab_name, extra_content_params) {
+        var content_params = {
+            "session": openils.User.authtoken,
+            "authtime": openils.User.authtime
+        };
+
+        ["url_prefix", "new_tab", "set_tab", "close_tab", "new_patron_tab",
+            "set_patron_tab", "volume_item_creator", "get_new_session",
+            "holdings_maintenance_tab", "set_tab_name", "open_chrome_window",
+            "url_prefix", "network_meter", "page_meter", "set_statusbar",
+            "set_help_context"
+        ].forEach(function(k) { content_params[k] = xulG[k]; });
+
+        if (extra_content_params)
+            dojo.mixin(content_params, extra_content_params);
+
+        xulG.new_tab(
+            xulG.url_prefix(url), {"tab_name": tab_name}, content_params
+        );
+    };
+
     /**
      * @return bool True if a new session was successfully created, false otherwise.
      */

Copied: branches/rel_2_0/Open-ILS/web/js/ui/default/serial (from rev 17615, trunk/Open-ILS/web/js/ui/default/serial)

Modified: branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-09-12 19:03:01 UTC (rev 17615)
+++ branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-09-12 19:04:48 UTC (rev 17616)
@@ -316,6 +316,8 @@
 <!ENTITY staff.cat.opac.view_holds.label "View Holds">
 <!ENTITY staff.cat.opac.view_orders.accesskey "r">
 <!ENTITY staff.cat.opac.view_orders.label "View/Place Orders">
+<!ENTITY staff.cat.opac.alt_serial.accesskey "a">
+<!ENTITY staff.cat.opac.alt_serial.label "Alternate Serial Control">
 <!ENTITY staff.cat.opac.batch_receive.accesskey "i">
 <!ENTITY staff.cat.opac.batch_receive.label "Serials Batch Receive">
 <!ENTITY staff.cat.popup.add_to_bucket "Add to Bucket">

Copied: branches/rel_2_0/Open-ILS/web/templates/default/serial (from rev 17615, trunk/Open-ILS/web/templates/default/serial)

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.js	2010-09-12 19:03:01 UTC (rev 17615)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.js	2010-09-12 19:04:48 UTC (rev 17616)
@@ -303,6 +303,39 @@
     }
 }
 
+function open_alt_serial_mgmt() {
+    try {
+        var content_params = {
+            "session": ses(),
+            "authtime": ses("authtime"),
+            "show_nav_buttons": true,
+            "no_xulG": false,
+            "show_print_button": false
+        };
+
+        ["url_prefix", "new_tab", "set_tab", "close_tab", "new_patron_tab",
+            "set_patron_tab", "volume_item_creator", "get_new_session",
+            "holdings_maintenance_tab", "set_tab_name", "open_chrome_window",
+            "url_prefix", "network_meter", "page_meter", "set_statusbar",
+            "set_help_context"
+        ].forEach(function(k) { content_params[k] = xulG[k]; });
+
+        var loc = urls.XUL_BROWSER + "?url=" + window.escape(
+            xulG.url_prefix("/eg/serial/list_subscription/") + docid
+        );
+        xulG.new_tab(
+            loc, {
+                "tab_name": $("offlineStrings").getString(
+                    "staff.cat.opac.serial_alt_mgmt"
+                ),
+                "browser": false
+            }, content_params
+        );
+    } catch (E) {
+        g.error.sdump("D_ERROR", E);
+    }
+}
+
 function set_opac() {
     g.view = 'opac';
     try {
@@ -539,28 +572,6 @@
     };
 }
 
-function serials_mgmt_new_tab() {
-    try {
-        /* XXX should the following be put into a function somewhere? the gist
-         * of this setting up of content_params seems to be duplicated all
-         * over the place.
-         */
-        var content_params = {"session": ses(), "authtime": ses("authtime")};
-        ["url_prefix", "new_tab", "set_tab", "close_tab", "new_patron_tab",
-            "set_patron_tab", "volume_item_creator", "get_new_session",
-            "holdings_maintenance_tab", "set_tab_name", "open_chrome_window",
-            "url_prefix", "network_meter", "page_meter", "set_statusbar",
-            "set_help_context"
-        ].forEach(function(k) { content_params[k] = xulG[k]; });
-
-        xulG.new_tab(
-            xulG.url_prefix(urls.XUL_SERIAL_RECORD_ENTRY), {}, content_params
-        );
-    } catch (E) {
-        g.error.sdump('D_ERROR', E);
-    }
-}
-
 function bib_in_new_tab() {
     try {
         var url = browser_frame.contentWindow.g.browser.controller.view.browser_browser.contentWindow.wrappedJSObject.location.href;

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul	2010-09-12 19:03:01 UTC (rev 17615)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul	2010-09-12 19:04:48 UTC (rev 17616)
@@ -73,7 +73,8 @@
                         <menu id="mfhd_delete" label="&staff.serial.mfhd_menu.delete.label;"/>
                     </menupopup>
                 </menu>
-                <menuitem id="serctrl_view" label="&staff.serial.serctrl_view.label;" oncommand="set_serctrl_view();"/>
+                <menuitem id="serctrl_view" label="&staff.serial.serctrl_view.label;" oncommand="set_serctrl_view();" />
+                <menuitem label="&staff.cat.opac.alt_serial.label;" accesskey="&staff.cat.opac.alt_serial.accesskey;" id="alt_serial" oncommand="open_alt_serial_mgmt();" />
                 <menuitem label="&staff.cat.opac.batch_receive.label;" accesskey="&staff.cat.opac.batch_receive.accesskey;" id="batch_receive" oncommand="batch_receive_in_new_tab();"/>
                 </menupopup>
                 </menu>

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties	2010-09-12 19:03:01 UTC (rev 17615)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties	2010-09-12 19:04:48 UTC (rev 17616)
@@ -261,6 +261,7 @@
 staff.cat.opac.title_for_hold_transfer.success.label=Holds transferred.
 staff.cat.opac.title_for_hold_transfer.failure.label=Holds not transferred.
 staff.cat.opac.related_items=Related Lineitems
+staff.cat.opac.serial_alt_mgmt=Subscriptions
 staff.cat.create_or_rebarcode_items=Create or Re-barcode Items
 printing.nothing_to_reprint=Nothing to re-print
 printing.prompt_for_external_print_cmd=Enter external print command and parameters (use %receipt.txt% or %receipt.html% as the file containing the print data. Those values will be substituted with the proper path.):

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/batch_receive.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/batch_receive.js	2010-09-12 19:03:01 UTC (rev 17615)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/batch_receive.js	2010-09-12 19:04:48 UTC (rev 17616)
@@ -21,7 +21,7 @@
 function BatchReceiver() {
     var self = this;
 
-    this.init = function(authtoken, bib_id) {
+    this.init = function(authtoken, bib_id, sub_id) {
         if (authtoken) {
             this.user = new openils.User({"authtoken": authtoken});
             this.pcrud = new openils.PermaCrud({"authtoken": authtoken});
@@ -73,7 +73,7 @@
         this.item_cache = {};
 
         if (bib_id)
-            this.bib_lookup(bib_id, null, true);
+            this.bib_lookup(bib_id, null, true, sub_id);
 
         busy(false);
     };
@@ -454,7 +454,7 @@
         }
     };
 
-    this.bib_lookup = function(bib_search_term, evt, is_actual_id) {
+    this.bib_lookup = function(bib_search_term, evt, is_actual_id, sub_id) {
         if (evt && evt.keyCode != 13) return;
 
         if (!bib_search_term) {
@@ -498,7 +498,7 @@
                         } else {
                             self.bibdata = list[0];
                             self._show_bibdata_bits();
-                            self.choose_subscription();
+                            self.choose_subscription(sub_id);
                         }
                     } else {
                         alert(S("bib_lookup.not_found"));
@@ -514,7 +514,7 @@
         );
     };
 
-    this.choose_subscription = function() {
+    this.choose_subscription = function(sub_id) {
         hide("batch_receive_bib");
         hide("batch_receive_entry");
         hide("batch_receive_sub_bits");
@@ -522,7 +522,11 @@
 
         var subs = this.bibdata.bre.subscriptions();
 
-        if (subs.length > 1) {
+        if (sub_id) {
+            this.choose_issuance(
+                subs.filter(function(o) { return o.id() == sub_id; })[0]
+            );
+        } else if (subs.length > 1) {
             var menulist = dojo.create("menulist", {"id": "sub_chooser"});
             var menupopup = dojo.create("menupopup", {}, menulist, "only");
 
@@ -913,6 +917,6 @@
     batch_receiver = new BatchReceiver(
         (typeof ses == "function" ? ses() : 0) ||
             cgi.param("ses") || dojo.cookie("ses"),
-        cgi.param("docid") || null
+        cgi.param("docid") || null, cgi.param("subid") || null
     );
 }

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/pattern_wizard_overlay.xul
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/pattern_wizard_overlay.xul	2010-09-12 19:03:01 UTC (rev 17615)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/serial/pattern_wizard_overlay.xul	2010-09-12 19:04:48 UTC (rev 17616)
@@ -157,8 +157,8 @@
                     label="Use chronology captions?" />
                 <vbox id="chron_editor_here" class="hideme">
                     <description class="step">
-                        Generally, each caption should be a smaller unit of
-                        time than the preceding caption.
+                        Each caption must be a smaller unit of
+                        time than the preceding caption.<!-- XXX TODO enforce -->
                     </description>
                     <grid>
                         <columns>



More information about the open-ils-commits mailing list