[open-ils-commits] [GIT] Evergreen ILS branch master updated. 408a4e4106b62c328c3b558d536810bd0c9b12f8

Evergreen Git git at git.evergreen-ils.org
Wed Mar 13 17:29:08 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  408a4e4106b62c328c3b558d536810bd0c9b12f8 (commit)
       via  43bc9c66ada9f8c14d071f2991f7e7949b226962 (commit)
       via  fc949080686b869bf120709bb1476d3cf8c36b7a (commit)
       via  0f6caa757861945f4ced5bb95608aabffed9316b (commit)
      from  3e9df23281892408c62fd610dfa124385eba2685 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 408a4e4106b62c328c3b558d536810bd0c9b12f8
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Wed Mar 13 17:05:43 2013 -0400

    Preserve serial interface context, if present
    
    If the new 'context' URL parameter is present, we need to make sure
    it sticks around for a couple of the "deeper" views (streams and
    items).
    
    Also, preserve the tab when coming out of said views in 'scv'
    context.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/web/js/ui/default/serial/list_item.js b/Open-ILS/web/js/ui/default/serial/list_item.js
index c4c7654..21fcc59 100644
--- a/Open-ILS/web/js/ui/default/serial/list_item.js
+++ b/Open-ILS/web/js/ui/default/serial/list_item.js
@@ -11,6 +11,7 @@ dojo.require("openils.CGI");
 
 var pcrud, cgi, issuance_id;
 var sitem_cache = {};
+var context_url_param;
 
 function load_sitem_grid() {
     sitem_grid.overrideEditWidgets.status = status_selector;
@@ -29,7 +30,8 @@ function load_siss_display() {
                     link.onclick = function() {
                         location.href = oilsBasePath +
                             "/serial/subscription?id=" +
-                            r.subscription() + "&tab=issuances";
+                            r.subscription() + "&tab=issuances" +
+                            context_url_param;
                     }
                     link.innerHTML = r.label();
                     prepare_create_dialog(r.subscription());
@@ -167,5 +169,12 @@ openils.Util.addOnLoad(
         issuance_id = cgi.param("issuance");
         load_siss_display();
         load_sitem_grid();
+
+        var context = cgi.param('context');
+        if (context) {
+            context_url_param = '&context=' + context;
+        } else {
+            context_url_param = '';
+        }
     }
 );
diff --git a/Open-ILS/web/js/ui/default/serial/list_stream.js b/Open-ILS/web/js/ui/default/serial/list_stream.js
index 79bf05d..a989e96 100644
--- a/Open-ILS/web/js/ui/default/serial/list_stream.js
+++ b/Open-ILS/web/js/ui/default/serial/list_stream.js
@@ -12,6 +12,7 @@ var pcrud;
 var dist_id;
 var rlu_editor;
 var cgi;
+var context_url_param;
 
 function format_routing_label(routing_label) {
     return routing_label ? routing_label : "[None]";
@@ -37,7 +38,8 @@ function load_sdist_display() {
                     link.onclick = function() {
                         location.href = oilsBasePath +
                             "/serial/subscription?id=" +
-                            r.subscription() + "&tab=distributions";
+                            r.subscription() + "&tab=distributions" +
+                            context_url_param;
                     }
                     link.innerHTML = r.label();
                     load_sdist_org_unit_display(r);
@@ -296,5 +298,12 @@ openils.Util.addOnLoad(
         dist_id = cgi.param("distribution");
         load_sdist_display();
         load_sstr_grid();
+
+        var context = cgi.param('context');
+        if (context) {
+            context_url_param = '&context=' + context;
+        } else {
+            context_url_param = '';
+        }
     }
 );
diff --git a/Open-ILS/web/js/ui/default/serial/subscription.js b/Open-ILS/web/js/ui/default/serial/subscription.js
index c1dded3..575b33d 100644
--- a/Open-ILS/web/js/ui/default/serial/subscription.js
+++ b/Open-ILS/web/js/ui/default/serial/subscription.js
@@ -18,6 +18,7 @@ var pcrud;
 var cgi;
 var sub;
 var sub_id;
+var context_url_param;
 
 function node_by_name(name, ctx) {
     return dojo.query("[name='" + name + "']", ctx)[0];
@@ -118,14 +119,16 @@ function format_siss_label(blob) {
     if (!blob.id) return "";
     return "<a href='" +
         oilsBasePath + "/serial/list_item?issuance=" + blob.id +
-        "'>" + (blob.label ? blob.label : "[None]") + "</a>"; /* XXX i18n */
+        context_url_param + "'>" + (blob.label ? blob.label : "[None]") +
+        "</a>"; /* XXX i18n */
 }
 
 function format_sdist_label(blob) {
     if (!blob.id) return "";
     var link = "<a href='" +
         oilsBasePath + "/serial/list_stream?distribution=" + blob.id +
-        "'>" + (blob.label ? blob.label : "[None]") + "</a>"; /* XXX i18n */
+        context_url_param + "'>" + (blob.label ? blob.label : "[None]") +
+        "</a>"; /* XXX i18n */
 
     var sstr_list = pcrud.search(
         "sstr",{"distribution":blob.id},{"id_list":true}
@@ -268,6 +271,12 @@ openils.Util.addOnLoad(
         owning_lib = cgi.param("owning_lib");
         record_entry = cgi.param("record_entry");
 
+        if (context) {
+            context_url_param = '&context=' + context;
+        } else {
+            context_url_param = '';
+        }
+
         if (context != 'scv') {
             load_sub_grid(
                 sub_id,
@@ -307,6 +316,9 @@ openils.Util.addOnLoad(
 
                 ssub_grid.showCreateDialog();
             }
+            if (cgi.param("tab") in tab_dispatch) {
+                tab_container.selectChild(tab_dispatch[cgi.param("tab")]);
+            }
         }
     }
 );

commit 43bc9c66ada9f8c14d071f2991f7e7949b226962
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Wed Mar 13 16:35:20 2013 -0400

    Translation file entries for serial note editors
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/web/js/dojo/openils/serial/nls/serial.js b/Open-ILS/web/js/dojo/openils/serial/nls/serial.js
index 482e914..c9a5653 100644
--- a/Open-ILS/web/js/dojo/openils/serial/nls/serial.js
+++ b/Open-ILS/web/js/dojo/openils/serial/nls/serial.js
@@ -1,5 +1,8 @@
 {
     "CREATE_ISSUANCE": "Create Issuance",
     "MODIFY_ISSUANCE": "Modify Issuance",
-    "SAVE_SUCCESSFUL": "Save Successful"
+    "SAVE_SUCCESSFUL": "Save Successful",
+    "NOTES_SSUB": "Subscription Notes (ID: ${0})",
+    "NOTES_SDIST": "Distribution Notes (ID: ${0})",
+    "REQUIRE_ONE_ROW": "Use the checkboxes to select exactly one row for this operation."
 }

commit fc949080686b869bf120709bb1476d3cf8c36b7a
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Tue Mar 12 14:03:44 2013 -0400

    Release notes for Serial Control with embedded Alt. Interface
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/docs/RELEASE_NOTES_NEXT/serial_control_embedded_alt_interfaces.txt b/docs/RELEASE_NOTES_NEXT/serial_control_embedded_alt_interfaces.txt
new file mode 100644
index 0000000..f0986fe
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/serial_control_embedded_alt_interfaces.txt
@@ -0,0 +1,13 @@
+Serial Control: Embed Alternate Interfaces
+==========================================
+As another step toward a unified interface, the serial control subscription
+editor now consists of an embedded version of the alternate control. This
+reduces duplication of both code and documentation, and smoothes the eventual
+transition to a single interface.
+
+In order to not lose any essential features, the following additions were made
+to the new combination editor:
+
+* note editors on subscriptions and distributions
+* labeled dropdown for distribution summary options ("Add to record entry", "Use record entry only", etc.)
+* legacy record entry linkage setup (Allows one to tie a distribution's information to a particular serial record entry (i.e. a MFHD record))

commit 0f6caa757861945f4ced5bb95608aabffed9316b
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Fri Mar 8 17:55:52 2013 -0500

    Move serials interfaces closer together
    
    Back in (I believe) 2.2, we brought the dijit issuance editor into the
    serial control interface with two goals: having less code in more places,
    and easing the transition to an eventual unified interface which would
    likely be more widget-based.
    
    That experiment was well received, so this commit takes things a large
    step further in that direction.  Basically, we are embedding the
    alternate subscription editing interface into the serial control
    scaffolding, which ultimately amounts to giving you some of the
    benefits of both.  You get the more modern and maintainable code from
    the alternate interfaces, but keep the context-awareness and familiar
    navigation of the non-alternate serial control.
    
    That said, this change is not meant to be the last word in serials,
    but rather a way to at least come closer together while we still
    continue to learn what structures provide the best experience.
    
    Finally, some feature additions were necessary to the alternate serials
    code in order to make this change as seamless as possible.  In some
    cases, the new feature only works in the embedded version, but a new
    'context' variable makes that simple to adjust as we move forward.
    Changes include:
      - note editors on subscriptions and distributions
      - labeled dropdown for distribution summary options
      - and legacy record entry linkages
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>

diff --git a/Open-ILS/src/templates/serial/subscription.tt2 b/Open-ILS/src/templates/serial/subscription.tt2
index bfe0f08..5d91795 100644
--- a/Open-ILS/src/templates/serial/subscription.tt2
+++ b/Open-ILS/src/templates/serial/subscription.tt2
@@ -1,5 +1,12 @@
+[% USE CGI; %]
 [% WRAPPER "base.tt2" %]
 <script>
+    [%- IF CGI.param('context') == 'scv' %]
+    xulG = parent.xulG;
+    [%- END %]
+    [%- IF CGI.param('id') != 'new' %]
+    sub_id = [% CGI.param('id') %];
+    [%- END %]
     var cap_editor;
     var cap_importer;
 </script>
@@ -7,6 +14,7 @@
 </script>
 <script src="[% ctx.media_prefix %]/js/ui/default/serial/subscription.js">
 </script>
+<script src="[% ctx.media_prefix %]/js/ui/default/serial/subscription/distribution.js"></script>
 <script src="[% ctx.media_prefix %]/js/ui/default/serial/subscription/caption_and_pattern.js">
 </script>
 <script src="[% ctx.media_prefix %]/js/ui/default/serial/subscription/issuance.js">
@@ -28,6 +36,42 @@
     class="oils-serial-tab-container">
 
     <!-- Subscription Summary -->
+    [%- IF CGI.param('context') == 'scv' -%]
+    <div dojoType="dijit.layout.ContentPane" title="[% l('View/Edit') %]" selected="true">
+        <div dojoType="dijit.layout.ContentPane" layout="top"
+            class="oils-header-panel lesser">
+            <div>[% l('Subscriptions') %]</div>
+            <div style="margin-right: 16px;">
+                <span dojoType="dijit.form.Button"
+                    onClick="open_notes('sub', ssub_grid);">[% l('View/Edit Notes') %]</span>
+            </div>
+        </div>
+
+        <script type="dojo/connect" event="onShow">
+            if(ssub_grid.store && !ssub_grid._fresh) { // onShow fires twice on initial page load; we only want to run the second time (and subsequent times)
+                ssub_grid.resetStore();
+                if (sub_id) {
+                    ssub_grid.loadAll(
+                        {"order_by": {"ssub": "start_date DESC"}},
+                        {"id": sub_id}
+                    );
+                }
+                ssub_grid._fresh = true;
+            }
+        </script>
+        <table jsId="ssub_grid"
+            dojoType="openils.widget.AutoGrid"
+            query="{id: '*'}"
+            fieldOrder="['id','owning_lib','start_date','end_date']"
+            suppressFields="['record_entry']"
+            fmClass="ssub"
+            showPaginator="true"
+            onPostSubmit="attempt_reload_opac"
+            showSequenceFields="true"
+            editOnEnter="true">
+        </table>
+    </div>
+    [%- ELSE -%]
     <div dojoType="dijit.layout.ContentPane" title="[% l('Summary') %]" selected="true">
         <script type="dojo/connect" event="onShow">
             load_sub_grid(sub_id);
@@ -46,16 +90,19 @@
                     <th field="end_date" formatter="format_date">
                         [% l('End Date') %]
                     </th>
+                    [%- IF CGI.param('context') != 'scv' -%]
                     <th field="record_entry" width="20em"
                         formatter="format_bib">
                         [% l('Bibliographic Record') %]
                     </th>
+                    [%- END -%]
                     <th field="expected_date_offset">[% l('Expected Date Offset') %]</th>
                     <th field="num_dist">[% l('Number of Distributions') %]</th>
                 </tr>
             </thead>
         </table>
     </div>
+    [%- END -%]
 
     <!-- Distributions -->
     <div dojoType="dijit.layout.ContentPane" jsId="distributions_tab"
@@ -76,6 +123,8 @@
                         "disabled": true, "value": sub_id
                     });
 
+                // attach the holding_lib selector to the record_entry selector
+                dist_grid.overrideWidgetArgs.holding_lib = {'dijitArgs' : {'onChange' : function(value) { populate_sre_selector(dist_grid, value); } }};
                 var _display_grouping_store = new dojo.data.ItemFileReadStore({
                     "data": {
                         "identifier": "display_grouping",
@@ -109,6 +158,35 @@
                     dist_grid.overrideEditWidgets.display_grouping.shove = {
                         "create": default_display_grouping
                     };
+
+                var _summary_method_store = new dojo.data.ItemFileReadStore({
+                    "data": {
+                        "identifier": "summary_method",
+                        "label": "label",
+                        "items": [
+                            {"summary_method": "add_to_sre",
+                                "label": "[% l('Add to record entry') %]"},
+                            {"summary_method": "merge_with_sre",
+                                "label": "[% l('Merge with record entry') %]"},
+                            {"summary_method": "use_sre_only",
+                                "label": "[% l('Use record entry only') %]"},
+                            {"summary_method": "use_sdist_only",
+                                "label": "[% l('Do not use record entry') %]"}
+                        ]
+                    }
+                });
+
+                dist_grid.overrideEditWidgets.summary_method =
+                    new dijit.form.FilteringSelect({
+                        "store": _summary_method_store,
+                        "searchAttr": "label",
+                        "name": "summary_method"
+                    });
+                    // TODO: add setting for default selection?
+                    dist_grid.overrideEditWidgets.summary_method.shove = {
+                        "create": "add_to_sre"
+                    };
+
             }
         </script>
         [% INCLUDE "serial/subscription/distribution.tt2" %]
diff --git a/Open-ILS/src/templates/serial/subscription/distribution.tt2 b/Open-ILS/src/templates/serial/subscription/distribution.tt2
index 8a3c886..f20a9d3 100644
--- a/Open-ILS/src/templates/serial/subscription/distribution.tt2
+++ b/Open-ILS/src/templates/serial/subscription/distribution.tt2
@@ -3,13 +3,15 @@
     <div>[% l('Distributions') %]</div>
     <div style="margin-right: 16px;">
         <span dojoType="dijit.form.Button"
+            onClick="open_notes('dist', dist_grid);">[% l('View/Edit Notes') %]</span>
+        <span dojoType="dijit.form.Button"
             onClick="dist_grid.refresh();">[% l('Refresh Grid') %]</span>
         <span dojoType="dijit.form.Button"
-            onClick="sub_grid._fresh = false; dist_grid.showCreateDialog();">
+            onClick="if (cgi.param('context') != 'scv') sub_grid._fresh = false; dist_grid.showCreateDialog();">
             [% l('New Distribution') %]
         </span>
         <span dojoType="dijit.form.Button"
-            onClick="sub_grid._fresh = false; dist_grid.deleteSelected();">
+            onClick="if (cgi.param('context') != 'scv') sub_grid._fresh = false; dist_grid.deleteSelected();">
             [% l('Delete Selected') %]
         </span>
     </div>
@@ -20,8 +22,8 @@
         dojoType="openils.widget.AutoGrid"
         style="height: 550px;"
         fieldOrder="['subscription','label','holding_lib']"
-        suppressFields="['record_entry','subscription','receive_call_number','bind_call_number','bind_unit_template']"
-        suppressEditFields="['record_entry','receive_call_number','bind_call_number','bind_unit_template']"
+        suppressFields="['subscription','receive_call_number','bind_call_number','bind_unit_template']"
+        suppressEditFields="['receive_call_number','bind_call_number','bind_unit_template']"
         onPostSubmit="attempt_reload_opac"
         fmClass="sdist"
         query="{id: '*'}"
diff --git a/Open-ILS/src/templates/serial/subscription/issuance.tt2 b/Open-ILS/src/templates/serial/subscription/issuance.tt2
index 1519c12..aaa0ee8 100644
--- a/Open-ILS/src/templates/serial/subscription/issuance.tt2
+++ b/Open-ILS/src/templates/serial/subscription/issuance.tt2
@@ -10,10 +10,12 @@
             onclick="iss_grid.deleteSelected();">[% l('Delete Selected') %]</span>
     </div>
 </div>
+[%- IF CGI.param('context') != 'scv' -%]
 <div class="serial-additional-controls">
     <span dojoType="dijit.form.Button"
         onclick="prediction_dialog.show();">[% l('Generate Predictions') %]</span>
 </div>
+[%- END -%]
 <div dojoType="dijit.layout.ContentPane" layout="top">
     <table jsId="iss_grid"
         dojoType="openils.widget.AutoGrid"
diff --git a/Open-ILS/web/js/ui/default/serial/subscription.js b/Open-ILS/web/js/ui/default/serial/subscription.js
index 2cfac2f..c1dded3 100644
--- a/Open-ILS/web/js/ui/default/serial/subscription.js
+++ b/Open-ILS/web/js/ui/default/serial/subscription.js
@@ -11,6 +11,8 @@ dojo.require("openils.widget.ProgressDialog");
 dojo.require("openils.widget.HoldingCode");
 dojo.require("openils.PermaCrud");
 dojo.require("openils.CGI");
+dojo.requireLocalization('openils.serial', 'serial');
+var localeStrings = dojo.i18n.getLocalization('openils.serial', 'serial');
 
 var pcrud;
 var cgi;
@@ -129,7 +131,7 @@ function format_sdist_label(blob) {
         "sstr",{"distribution":blob.id},{"id_list":true}
     );
     count = sstr_list ? sstr_list.length : 0;
-    link += "&nbsp;&nbsp; " + count + " stream(s)";
+    link += "&nbsp;&nbsp; " + count + " stream(s)"; //XXX i18n
     return link;
 }
 
@@ -226,6 +228,31 @@ function _clone_subscription(bre_id) {
     );
 }
 
+function open_notes(obj_type, grid) {
+    if (grid.getSelectedRows().length != 1) {
+        alert( localeStrings.REQUIRE_ONE_ROW );
+        return;
+    }
+
+    var id = grid.getSelectedItems()[0].id[0];
+    var args_by_obj_type = {
+        'sub' : { 'function_type' : 'SSUBN', 'object_type' : 'subscription', 'constructor' : ssubn, 'title' : dojo.string.substitute(localeStrings.NOTES_SSUB, [id]) },
+        'dist' : { 'function_type' : 'SDISTN', 'object_type' : 'distribution', 'constructor' : sdistn, 'title' : dojo.string.substitute(localeStrings.NOTES_SDIST, [id]) }
+    };
+    args_by_obj_type[obj_type].object_id = id;
+
+    try {
+        window.openDialog(
+            xulG.url_prefix('XUL_SERIAL_NOTES'),
+            obj_type+'_notes',
+            'chrome,resizable,modal',
+            args_by_obj_type[obj_type]
+        );
+    } catch (E) {
+        alert(E); /* XXX */
+    }
+}
+
 openils.Util.addOnLoad(
     function() {
         var tab_dispatch = {
@@ -236,15 +263,50 @@ openils.Util.addOnLoad(
         cgi = new openils.CGI();
         pcrud = new openils.PermaCrud();
 
+        context = cgi.param("context");
         sub_id = cgi.param("id");
-        load_sub_grid(
-            sub_id,
-            (cgi.param("tab") in tab_dispatch) ?
-                function() {
-                    tab_container.selectChild(
-                        tab_dispatch[cgi.param("tab")]
-                    );
-                } : null
-        );
+        owning_lib = cgi.param("owning_lib");
+        record_entry = cgi.param("record_entry");
+
+        if (context != 'scv') {
+            load_sub_grid(
+                sub_id,
+                (cgi.param("tab") in tab_dispatch) ?
+                    function() {
+                        tab_container.selectChild(
+                            tab_dispatch[cgi.param("tab")]
+                        );
+                    } : null
+            );
+        } else {
+            build_sre_maps(dist_grid);
+            dist_grid.empty_store = new dojo.data.ItemFileReadStore({
+                "data": {
+                    "identifier": "record_entry",
+                    "label": "label",
+                    "items": []
+                }
+            })
+            dist_grid.overrideEditWidgets.record_entry =
+                new dijit.form.FilteringSelect({
+                    "store" : dist_grid.empty_store,
+                    "searchAttr" : "label",
+                    "name" : "record_entry"
+                });
+            dist_grid.overrideEditWidgets.record_entry.shove = {};
+            if (sub_id == 'new') {
+                ssub_grid.overrideEditWidgets.record_entry =
+                        new dijit.form.TextBox({
+                            "disabled": true, "value": record_entry
+                        });
+                ssub_grid.overrideWidgetArgs.owning_lib = {widgetValue : owning_lib, dijitArgs : {disabled : true}};
+
+                ssub_grid.onPostCreate = function(fmObject) {
+                    sub_id = fmObject.id();
+                }
+
+                ssub_grid.showCreateDialog();
+            }
+        }
     }
 );
diff --git a/Open-ILS/web/js/ui/default/serial/subscription/distribution.js b/Open-ILS/web/js/ui/default/serial/subscription/distribution.js
new file mode 100644
index 0000000..dd8a478
--- /dev/null
+++ b/Open-ILS/web/js/ui/default/serial/subscription/distribution.js
@@ -0,0 +1,60 @@
+/* Build maps of sre details for both display and selection purposes */
+
+function build_sre_maps(grid) {
+    try {
+        //grid.sre_id_map = {};
+        grid.sres_ou_map = {};
+        var parent_g = window.parent.parent.g;
+        if (parent_g.mfhd) {
+            var mfhd_details = parent_g.mfhd.details;
+            for (var i = 0; i < mfhd_details.length; i++) {
+                var mfhd_detail = {};
+                for (j in mfhd_details[i]) {
+                    mfhd_detail[j] = mfhd_details[i][j];
+                }
+                var entry = {};
+                entry.label = mfhd_detail.label + ' (' + (mfhd_detail.entryNum + 1) + ')';
+                entry.record_entry = mfhd_detail.id;
+                var org_unit_id = mfhd_detail.owning_lib;
+                //grid.sre_id_map[sre_id] = mfhd_detail;
+                if (!grid.sres_ou_map[org_unit_id]) {
+                    grid.sres_ou_map[org_unit_id] = 
+                        {
+                            "identifier": "record_entry",
+                            "label": "label",
+                            "items": []
+                        };
+                }
+                grid.sres_ou_map[org_unit_id].items.push(entry);
+            }
+
+            for (i in grid.sres_ou_map) {
+                grid.sres_ou_map[i] = new dojo.data.ItemFileReadStore({
+                    "data": grid.sres_ou_map[i]
+                });
+            }
+        }
+    } catch(E) {
+        alert(E); //XXX
+    }
+}
+
+
+function populate_sre_selector(grid, holding_lib_id, temp) {
+    if (grid.sres_ou_map[holding_lib_id]) {
+        grid.overrideEditWidgets.record_entry.attr
+            ("store", grid.sres_ou_map[holding_lib_id]);
+        grid.overrideEditWidgets.record_entry.shove = {};
+        grid.overrideEditWidgets.record_entry.attr("disabled", false);
+        // this is needed to reload the value after we change the store
+        // XXX is there a better way to do this?
+        grid.overrideEditWidgets.record_entry.setValue
+            (grid.overrideEditWidgets.record_entry._lastQuery);
+    } else {
+        grid.overrideEditWidgets.record_entry.attr
+            ("store", grid.empty_store);
+        grid.overrideEditWidgets.record_entry.attr("disabled", true);
+        grid.overrideEditWidgets.record_entry.attr("value", "");
+    }
+}
+
diff --git a/Open-ILS/xul/staff_client/server/serial/manage_subs.js b/Open-ILS/xul/staff_client/server/serial/manage_subs.js
index 7607964..0f724ba 100644
--- a/Open-ILS/xul/staff_client/server/serial/manage_subs.js
+++ b/Open-ILS/xul/staff_client/server/serial/manage_subs.js
@@ -56,6 +56,17 @@ serial.manage_subs.prototype = {
                     iframe.refresh_command = function () { /* TODO: redraw tree node */ };
                 }
                 iframe.setAttribute("src", src);
+            } else if (type == "ssub") {
+                var iframe = dojo.byId('alt_ssub_editor');
+                var src;
+                if (mode == "add") {
+                    src = '/eg/serial/subscription?id=new&owning_lib='+params.owning_lib+'&record_entry='+params.record_entry+'&context=scv';
+                    iframe.refresh_command = function () {obj.refresh_list();};
+                } else {
+                    src = '/eg/serial/subscription?id=' + params.ssub_ids[0] + '&context=scv';
+                    iframe.refresh_command = function () {}; //TODO: redraw tree node
+                }
+                iframe.setAttribute("src", src);
             } else {
                 var editor_type = type + '_editor';
                 if (typeof obj[editor_type] == 'undefined') {
@@ -508,12 +519,9 @@ serial.manage_subs.prototype = {
                                         alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.add_volume.permission_error'));
                                         return; // no read-only view for this interface
                                     } */
-                                    var new_ssub = new ssub();
-                                    new_ssub.owning_lib(list[0]);//TODO: add multiple at once support?
-                                    new_ssub.isnew(1);
-                                    new_ssub.record_entry(obj.docid);
                                     var params = {};
-                                    params.ssubs = [new_ssub];
+                                    params.owning_lib = list[0];
+                                    params.record_entry = obj.docid;
                                     obj.editor_init('ssub', 'add', params);
                                 } catch(E) {
                                     obj.error.standard_unexpected_error_alert(document.getElementById('serialStrings').getString('staff.serial.manage_subs.add.error'),E);
diff --git a/Open-ILS/xul/staff_client/server/serial/ssub_editor.xul b/Open-ILS/xul/staff_client/server/serial/ssub_editor.xul
index 10fabbc..1b2bf33 100644
--- a/Open-ILS/xul/staff_client/server/serial/ssub_editor.xul
+++ b/Open-ILS/xul/staff_client/server/serial/ssub_editor.xul
@@ -10,30 +10,9 @@
 <overlay id="serial_ssub_editor_panel_overlay" 
 	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-	<vbox flex="1" id="serial_ssub_editor_panel" class="my_overflow">
-        <vbox id="brief_display_box"/>
-
-		<hbox flex="1" style="overflow: auto">
-			<vbox flex="1" id="before_splitter" oils_persist="width">
-				<label value="Subscription" style="font-weight: bold; font-size: large"/>
-				<vbox id="left_pane" flex="1"/>
-			</vbox>
-			<splitter id="splitter" oils_persist="state hidden" oils_persist_peers="before_splitter after_splitter"><grippy /></splitter>
-			<vbox flex="1" id="after_splitter" oils_persist="width">
-				<label value=" " style="font-weight: bold; font-size: large"/>
-				<vbox id="right_pane" flex="1"/>
-			</vbox>
-		</hbox>
-
-		<hbox id="nav">
-			<spacer flex="1"/>
-			<button id="ssub_notes" label="&staff.serial.ssub_editor.notes.label;" accesskey="&staff.serial.ssub_editor.notes.accesskey;" oncommand="g.manage_subs.ssub_editor.notes()" />
-			<button id="ssub_save" label="&staff.serial.ssub_editor.modify.label;" hidden="true" accesskey="&staff.serial.ssub_editor.modify.accesskey;" oncommand="g.manage_subs.ssub_editor.save()" />
-			<!--<button id="cancel" label="&staff.cat.copy_editor.cancel.label;" accesskey="&staff.cat.copy_editor.cancel.accesskey;" oncommand="window.close();"/>-->
-		</hbox>
-
-		<spacer/>
-	</vbox>
+    <vbox flex="1" id="serial_ssub_editor_panel" class="my_overflow">
+        <iframe flex="1" id="alt_ssub_editor" name="alt_ssub_editor"/>
+    </vbox>
 
 </overlay>
 

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/serial/subscription.tt2     |   78 ++++++++++++++++
 .../templates/serial/subscription/distribution.tt2 |   10 +-
 .../src/templates/serial/subscription/issuance.tt2 |    2 +
 Open-ILS/web/js/dojo/openils/serial/nls/serial.js  |    5 +-
 Open-ILS/web/js/ui/default/serial/list_item.js     |   11 ++-
 Open-ILS/web/js/ui/default/serial/list_stream.js   |   11 ++-
 Open-ILS/web/js/ui/default/serial/subscription.js  |   98 +++++++++++++++++---
 .../ui/default/serial/subscription/distribution.js |   60 ++++++++++++
 .../xul/staff_client/server/serial/manage_subs.js  |   18 +++-
 .../xul/staff_client/server/serial/ssub_editor.xul |   27 +-----
 .../serial_control_embedded_alt_interfaces.txt     |   13 +++
 11 files changed, 285 insertions(+), 48 deletions(-)
 create mode 100644 Open-ILS/web/js/ui/default/serial/subscription/distribution.js
 create mode 100644 docs/RELEASE_NOTES_NEXT/serial_control_embedded_alt_interfaces.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list