[open-ils-commits] [GIT] Evergreen ILS branch master updated. 46b7ae0a3a8f1d5e415f184295412c5579ade926

Evergreen Git git at git.evergreen-ils.org
Tue Apr 3 12:54:03 EDT 2012


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  46b7ae0a3a8f1d5e415f184295412c5579ade926 (commit)
       via  65ee98232d80d90463df3fc562f5aebab484c5c9 (commit)
       via  83f5fe8c14856189bc7cacd46750524779d0539f (commit)
       via  34979fe10c23a470cefc400946a7101d274fab68 (commit)
       via  ad794951d358e809047b0992a7e3283aca8f6308 (commit)
       via  2a257b27b2a2553023c07fddf5aa3abf95a19f66 (commit)
      from  a30dcca536acc833d6323763485e3d63b1c37574 (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 46b7ae0a3a8f1d5e415f184295412c5579ade926
Merge: 65ee982 a30dcca
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Tue Apr 3 12:53:04 2012 -0400

    Merge branch 'master' of git://git.evergreen-ils.org/Evergreen


commit 65ee98232d80d90463df3fc562f5aebab484c5c9
Merge: 83f5fe8 34979fe
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Tue Apr 3 12:49:28 2012 -0400

    Merge remote branch 'working/user/dbwells/shared_siss_editor'
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>


commit 83f5fe8c14856189bc7cacd46750524779d0539f
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Tue Apr 3 12:20:50 2012 -0400

    Revert "Serial Control: Use Dijit-based issuance editor"
    
    This reverts commit 37b324f53adb4fb90fe17ada72d44fca1d606e9f.
    
    This commit was regrettably merged without other commits from its
    branch on which it depends.

diff --git a/Open-ILS/src/templates/serial/edit_siss.tt2 b/Open-ILS/src/templates/serial/edit_siss.tt2
deleted file mode 100644
index 5573289..0000000
--- a/Open-ILS/src/templates/serial/edit_siss.tt2
+++ /dev/null
@@ -1,17 +0,0 @@
-[% WRAPPER 'base.tt2' %]
-<script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/serial/edit_siss.js'></script>
-<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/serial/subscription/caption_and_pattern.js"></script>
-<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/serial/subscription/issuance.js"></script>
-<script type="text/javascript">
-    dojo.require('openils.Util');
-    [% ctx.page_args = ctx.page_args.reverse %]
-    var siss_id = '[% ctx.page_args.0 %]';
-    var ssub_id = '[% ctx.page_args.1 %]';
-    openils.Util.addOnLoad(function() { drawSiss(siss_id, ssub_id) });
-</script>
-
-<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
-    <div id='edit-pane'> </div>
-</div>
-
-[% END %]
diff --git a/Open-ILS/web/js/dojo/openils/serial/nls/serial.js b/Open-ILS/web/js/dojo/openils/serial/nls/serial.js
deleted file mode 100644
index 482e914..0000000
--- a/Open-ILS/web/js/dojo/openils/serial/nls/serial.js
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-    "CREATE_ISSUANCE": "Create Issuance",
-    "MODIFY_ISSUANCE": "Modify Issuance",
-    "SAVE_SUCCESSFUL": "Save Successful"
-}
diff --git a/Open-ILS/web/js/ui/default/serial/edit_siss.js b/Open-ILS/web/js/ui/default/serial/edit_siss.js
deleted file mode 100644
index 2fd8495..0000000
--- a/Open-ILS/web/js/ui/default/serial/edit_siss.js
+++ /dev/null
@@ -1,84 +0,0 @@
-dojo.require('dijit.form.TextBox');
-dojo.require('dijit.form.Button');
-dojo.require('dijit.form.FilteringSelect');
-dojo.require('openils.PermaCrud');
-dojo.require('openils.widget.EditPane');
-dojo.require("openils.widget.HoldingCode");
-
-dojo.requireLocalization('openils.serial', 'serial');
-var localeStrings = dojo.i18n.getLocalization('openils.serial', 'serial');
-
-// fresh_scap_selector needs these defined as globals XXX rework?
-var pcrud;
-var sub_id;
-
-function drawSiss(siss_id, ssub_id) {
-    var iss_grid = { overrideEditWidgets : {} };
-
-    iss_grid.overrideEditWidgets.creator =
-        new dijit.form.TextBox({"disabled": true});
-    iss_grid.overrideEditWidgets.creator.shove = {
-        "create": openils.User.user.id()
-    };
-
-    iss_grid.overrideEditWidgets.editor =
-        new dijit.form.TextBox({
-            "disabled": true, "value": openils.User.user.id()
-        });
-
-    iss_grid.overrideEditWidgets.holding_type =
-        new dijit.form.TextBox({"disabled": true});
-
-    var pane_args = {
-        hideActionButtons : true,
-        overrideWidgets : iss_grid.overrideEditWidgets
-    }
-
-    var button_label;
-    pcrud = new openils.PermaCrud();
-    if (siss_id == 'new') {
-        sub_id = ssub_id;
-        pane_args.fmClass = 'siss';
-        pane_args.mode = 'create';
-        pane_args.onPostSubmit = function(req, cudResults){
-            //TODO: better success check
-            alert(localeStrings.SAVE_SUCCESSFUL);
-            //location.href = location.href.replace(/new\/.*/, cudResults[0].id());
-            parent.document.getElementById(window.name).refresh_command();
-        }
-        button_label = localeStrings.CREATE_ISSUANCE;
-    } else {
-        pane_args.fmObject = pcrud.retrieve('siss', siss_id);
-        pane_args.onPostSubmit = function(req, cudResults){
-            //alert('req: '+req.toSource());
-            //alert('cudResults: '+cudResults);
-            //TODO: better success check
-            alert(localeStrings.SAVE_SUCCESSFUL);
-            parent.document.getElementById(window.name).refresh_command();
-        }
-        sub_id = pane_args.fmObject.subscription();
-        button_label = localeStrings.MODIFY_ISSUANCE;
-    }
-    iss_grid.overrideEditWidgets.subscription =
-        new dijit.form.TextBox({
-            "disabled": true, "value": sub_id
-        });
-    fresh_scap_selector(iss_grid); // embed scap wizard into generated form
-
-    var pane = new openils.widget.EditPane(
-        pane_args, dojo.byId('edit-pane')
-    );
-
-    pane.fieldOrder = ['subscription','creator','editor','label','date_published','caption_and_pattern','holding_type'];
-    pane.suppressFields = ['id', 'holding_link_id','create_date','edit_date'];
-    pane.startup();
-
-    var tbody = pane.table.getElementsByTagName('tbody')[0];
-    var applySpan = document.createElement('span');
-    tbody.appendChild(document.createElement('tr').appendChild(document.createElement('td').appendChild(applySpan)));
-    new dijit.form.Button({
-        label: button_label,
-        onClick: function() {pane.performAutoEditAction();}
-    }, applySpan);
-
-}
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 5c7f83f..74ca397 100644
--- a/Open-ILS/xul/staff_client/server/serial/manage_subs.js
+++ b/Open-ILS/xul/staff_client/server/serial/manage_subs.js
@@ -45,36 +45,19 @@ serial.manage_subs.prototype = {
         var obj = this;
         try {
             $('serial_manage_subs_editor_deck').selectedIndex = obj.editor_indexes[type];
+            var editor_type = type + '_editor';
+            if (typeof obj[editor_type] == 'undefined') {
+                JSAN.use('serial.' + editor_type);
+                obj[editor_type] = new serial[editor_type](); 
+            }
 
-            if (type == "siss") { // begin transition from xul to dojo editors
-                var iframe = dojo.byId('alt_siss_editor');
-                var src;
-                if (mode == "add") {
-                    src = '/eg/serial/edit_siss/new/' + params.sisses[0].subscription();
-                    iframe.refresh_command = function () {obj.refresh_list();};
-                } else {
-                    src = '/eg/serial/edit_siss/' + params.siss_ids[0];
-                    iframe.refresh_command = function () { /* TODO: redraw tree node */ };
-                }
-                iframe.setAttribute("src", src);
-            } else {
-                var editor_type = type + '_editor';
-                if (typeof obj[editor_type] == 'undefined') {
-                    JSAN.use('serial.' + editor_type);
-                    obj[editor_type] = new serial[editor_type]();
-                }
-
-                params.do_edit = true;
-                params.handle_update = true;
+            params.do_edit = true;
+            params.handle_update = true;
+            if (mode == 'add') {
                 params.trigger_refresh = true;
-                if (mode == 'add') {
-                    params.refresh_command = function () {obj.refresh_list();};
-                } else {
-                    params.refresh_command = function () {obj.remap_node(type, this);};
-                }
-
-                obj[editor_type].init(params);
+                params.refresh_command = function () {obj.refresh_list();};
             }
+            obj[editor_type].init(params);
         } catch(E) {
             obj.error.standard_unexpected_error_alert('editor_init() error',E);
         }
diff --git a/Open-ILS/xul/staff_client/server/serial/siss_editor.xul b/Open-ILS/xul/staff_client/server/serial/siss_editor.xul
index 85dd84d..3e80105 100644
--- a/Open-ILS/xul/staff_client/server/serial/siss_editor.xul
+++ b/Open-ILS/xul/staff_client/server/serial/siss_editor.xul
@@ -11,7 +11,30 @@
 	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 	<vbox flex="1" id="serial_siss_editor_panel" class="my_overflow">
-		<iframe flex="1" id="alt_siss_editor" name="alt_siss_editor"/>
+        <vbox id="brief_display_box"/>
+
+		<hbox flex="1" style="overflow: auto">
+			<vbox flex="1" id="before_splitter1" oils_persist="width">
+				<label value="Issuance" style="font-weight: bold; font-size: large"/>
+				<vbox id="siss_editor_left_pane" flex="1"/>
+			</vbox>
+			<splitter id="splitter1" oils_persist="state hidden" oils_persist_peers="before_splitter1 after_splitter1"><grippy /></splitter>
+			<vbox flex="1" id="after_splitter1" oils_persist="width">
+				<vbox id="siss_editor_middle_pane"/>
+			</vbox>
+			<splitter id="splitter2" oils_persist="state hidden" oils_persist_peers="after_splitter1 after_splitter2"><grippy /></splitter>
+			<vbox flex="1" id="after_splitter2" oils_persist="width">
+				<vbox id="siss_editor_right_pane"/>
+			</vbox>
+		</hbox>
+
+		<hbox id="siss_editor_nav">
+			<spacer flex="1"/>
+			<button id="siss_save" label="&staff.serial.siss_editor.modify.label;" hidden="true" accesskey="&staff.cat.copy_editor.save.accesskey;" oncommand="g.manage_subs.siss_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>
 
 </overlay>

commit 34979fe10c23a470cefc400946a7101d274fab68
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Mon Mar 26 16:28:04 2012 -0400

    Serial Control: Use Dijit-based issuance editor
    
    The serial control interfaces use editors derived from the XUL
    copy editor, while the alternate control uses Dijit editors.  This
    commit takes a small step toward unification by using the Dijit
    issuance editor within the serial control interface, with the
    following benefits:
    
    1) Both controls will have a very similar editor look and feel
    2) Takes advantage of custom holding code wizard widget
    3) Future fixes and enhancements to the editors will apply easily
    to both controls
    4) Begin deprecating XUL serial editors
    
    This commit doesn't yet rip out the old issuance editor code, as
    that should wait until the transition is more complete.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/templates/serial/edit_siss.tt2 b/Open-ILS/src/templates/serial/edit_siss.tt2
new file mode 100644
index 0000000..5573289
--- /dev/null
+++ b/Open-ILS/src/templates/serial/edit_siss.tt2
@@ -0,0 +1,17 @@
+[% WRAPPER 'base.tt2' %]
+<script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/serial/edit_siss.js'></script>
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/serial/subscription/caption_and_pattern.js"></script>
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/serial/subscription/issuance.js"></script>
+<script type="text/javascript">
+    dojo.require('openils.Util');
+    [% ctx.page_args = ctx.page_args.reverse %]
+    var siss_id = '[% ctx.page_args.0 %]';
+    var ssub_id = '[% ctx.page_args.1 %]';
+    openils.Util.addOnLoad(function() { drawSiss(siss_id, ssub_id) });
+</script>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div id='edit-pane'> </div>
+</div>
+
+[% END %]
diff --git a/Open-ILS/web/js/dojo/openils/serial/nls/serial.js b/Open-ILS/web/js/dojo/openils/serial/nls/serial.js
new file mode 100644
index 0000000..482e914
--- /dev/null
+++ b/Open-ILS/web/js/dojo/openils/serial/nls/serial.js
@@ -0,0 +1,5 @@
+{
+    "CREATE_ISSUANCE": "Create Issuance",
+    "MODIFY_ISSUANCE": "Modify Issuance",
+    "SAVE_SUCCESSFUL": "Save Successful"
+}
diff --git a/Open-ILS/web/js/ui/default/serial/edit_siss.js b/Open-ILS/web/js/ui/default/serial/edit_siss.js
new file mode 100644
index 0000000..2fd8495
--- /dev/null
+++ b/Open-ILS/web/js/ui/default/serial/edit_siss.js
@@ -0,0 +1,84 @@
+dojo.require('dijit.form.TextBox');
+dojo.require('dijit.form.Button');
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('openils.PermaCrud');
+dojo.require('openils.widget.EditPane');
+dojo.require("openils.widget.HoldingCode");
+
+dojo.requireLocalization('openils.serial', 'serial');
+var localeStrings = dojo.i18n.getLocalization('openils.serial', 'serial');
+
+// fresh_scap_selector needs these defined as globals XXX rework?
+var pcrud;
+var sub_id;
+
+function drawSiss(siss_id, ssub_id) {
+    var iss_grid = { overrideEditWidgets : {} };
+
+    iss_grid.overrideEditWidgets.creator =
+        new dijit.form.TextBox({"disabled": true});
+    iss_grid.overrideEditWidgets.creator.shove = {
+        "create": openils.User.user.id()
+    };
+
+    iss_grid.overrideEditWidgets.editor =
+        new dijit.form.TextBox({
+            "disabled": true, "value": openils.User.user.id()
+        });
+
+    iss_grid.overrideEditWidgets.holding_type =
+        new dijit.form.TextBox({"disabled": true});
+
+    var pane_args = {
+        hideActionButtons : true,
+        overrideWidgets : iss_grid.overrideEditWidgets
+    }
+
+    var button_label;
+    pcrud = new openils.PermaCrud();
+    if (siss_id == 'new') {
+        sub_id = ssub_id;
+        pane_args.fmClass = 'siss';
+        pane_args.mode = 'create';
+        pane_args.onPostSubmit = function(req, cudResults){
+            //TODO: better success check
+            alert(localeStrings.SAVE_SUCCESSFUL);
+            //location.href = location.href.replace(/new\/.*/, cudResults[0].id());
+            parent.document.getElementById(window.name).refresh_command();
+        }
+        button_label = localeStrings.CREATE_ISSUANCE;
+    } else {
+        pane_args.fmObject = pcrud.retrieve('siss', siss_id);
+        pane_args.onPostSubmit = function(req, cudResults){
+            //alert('req: '+req.toSource());
+            //alert('cudResults: '+cudResults);
+            //TODO: better success check
+            alert(localeStrings.SAVE_SUCCESSFUL);
+            parent.document.getElementById(window.name).refresh_command();
+        }
+        sub_id = pane_args.fmObject.subscription();
+        button_label = localeStrings.MODIFY_ISSUANCE;
+    }
+    iss_grid.overrideEditWidgets.subscription =
+        new dijit.form.TextBox({
+            "disabled": true, "value": sub_id
+        });
+    fresh_scap_selector(iss_grid); // embed scap wizard into generated form
+
+    var pane = new openils.widget.EditPane(
+        pane_args, dojo.byId('edit-pane')
+    );
+
+    pane.fieldOrder = ['subscription','creator','editor','label','date_published','caption_and_pattern','holding_type'];
+    pane.suppressFields = ['id', 'holding_link_id','create_date','edit_date'];
+    pane.startup();
+
+    var tbody = pane.table.getElementsByTagName('tbody')[0];
+    var applySpan = document.createElement('span');
+    tbody.appendChild(document.createElement('tr').appendChild(document.createElement('td').appendChild(applySpan)));
+    new dijit.form.Button({
+        label: button_label,
+        onClick: function() {pane.performAutoEditAction();}
+    }, applySpan);
+
+}
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 9b1a85b..e973eb7 100644
--- a/Open-ILS/xul/staff_client/server/serial/manage_subs.js
+++ b/Open-ILS/xul/staff_client/server/serial/manage_subs.js
@@ -45,22 +45,36 @@ serial.manage_subs.prototype = {
         var obj = this;
         try {
             $('serial_manage_subs_editor_deck').selectedIndex = obj.editor_indexes[type];
-            var editor_type = type + '_editor';
-            if (typeof obj[editor_type] == 'undefined') {
-                JSAN.use('serial.' + editor_type);
-                obj[editor_type] = new serial[editor_type](); 
-            }
 
-            params.do_edit = true;
-            params.handle_update = true;
-            params.trigger_refresh = true;
-            if (mode == 'add') {
-                params.refresh_command = function () {obj.refresh_list();};
+            if (type == "siss") { // begin transition from xul to dojo editors
+                var iframe = dojo.byId('alt_siss_editor');
+                var src;
+                if (mode == "add") {
+                    src = '/eg/serial/edit_siss/new/' + params.sisses[0].subscription();
+                    iframe.refresh_command = function () {obj.refresh_list();};
+                } else {
+                    src = '/eg/serial/edit_siss/' + params.siss_ids[0];
+                    iframe.refresh_command = function () { /* TODO: redraw tree node */ };
+                }
+                iframe.setAttribute("src", src);
             } else {
-                params.refresh_command = function () {obj.remap_node(type, this);};
+                var editor_type = type + '_editor';
+                if (typeof obj[editor_type] == 'undefined') {
+                    JSAN.use('serial.' + editor_type);
+                    obj[editor_type] = new serial[editor_type]();
+                }
+
+                params.do_edit = true;
+                params.handle_update = true;
+                params.trigger_refresh = true;
+                if (mode == 'add') {
+                    params.refresh_command = function () {obj.refresh_list();};
+                } else {
+                    params.refresh_command = function () {obj.remap_node(type, this);};
+                }
+
+                obj[editor_type].init(params);
             }
-   
-            obj[editor_type].init(params);
         } catch(E) {
             obj.error.standard_unexpected_error_alert('editor_init() error',E);
         }
diff --git a/Open-ILS/xul/staff_client/server/serial/siss_editor.xul b/Open-ILS/xul/staff_client/server/serial/siss_editor.xul
index 3e80105..85dd84d 100644
--- a/Open-ILS/xul/staff_client/server/serial/siss_editor.xul
+++ b/Open-ILS/xul/staff_client/server/serial/siss_editor.xul
@@ -11,30 +11,7 @@
 	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 	<vbox flex="1" id="serial_siss_editor_panel" class="my_overflow">
-        <vbox id="brief_display_box"/>
-
-		<hbox flex="1" style="overflow: auto">
-			<vbox flex="1" id="before_splitter1" oils_persist="width">
-				<label value="Issuance" style="font-weight: bold; font-size: large"/>
-				<vbox id="siss_editor_left_pane" flex="1"/>
-			</vbox>
-			<splitter id="splitter1" oils_persist="state hidden" oils_persist_peers="before_splitter1 after_splitter1"><grippy /></splitter>
-			<vbox flex="1" id="after_splitter1" oils_persist="width">
-				<vbox id="siss_editor_middle_pane"/>
-			</vbox>
-			<splitter id="splitter2" oils_persist="state hidden" oils_persist_peers="after_splitter1 after_splitter2"><grippy /></splitter>
-			<vbox flex="1" id="after_splitter2" oils_persist="width">
-				<vbox id="siss_editor_right_pane"/>
-			</vbox>
-		</hbox>
-
-		<hbox id="siss_editor_nav">
-			<spacer flex="1"/>
-			<button id="siss_save" label="&staff.serial.siss_editor.modify.label;" hidden="true" accesskey="&staff.cat.copy_editor.save.accesskey;" oncommand="g.manage_subs.siss_editor.save()" />
-			<!--<button id="cancel" label="&staff.cat.copy_editor.cancel.label;" accesskey="&staff.cat.copy_editor.cancel.accesskey;" oncommand="window.close();"/>-->
-		</hbox>
-
-		<spacer/>
+		<iframe flex="1" id="alt_siss_editor" name="alt_siss_editor"/>
 	</vbox>
 
 </overlay>

commit ad794951d358e809047b0992a7e3283aca8f6308
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Mon Mar 26 16:17:03 2012 -0400

    Small fix to Holding Code wizard widget
    
    The issuance editor has a wizard widget for the holding code field
    which expected a 'grid' as an argument, but then referenced a global
    'iss_grid' variable.  This hurt reusability of this widget.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/web/js/ui/default/serial/subscription/issuance.js b/Open-ILS/web/js/ui/default/serial/subscription/issuance.js
index eb4fae4..3f4dfcf 100644
--- a/Open-ILS/web/js/ui/default/serial/subscription/issuance.js
+++ b/Open-ILS/web/js/ui/default/serial/subscription/issuance.js
@@ -21,7 +21,7 @@ function fresh_scap_selector(grid) {
                     selector, "onChange", null, function() {
                         if (this.item) {
                             var widget =
-                                iss_grid.overrideEditWidgets.holding_type;
+                                grid.overrideEditWidgets.holding_type;
                             widget.attr("value", this.item.type);
                             widget.attr("disabled", true);
                         }

commit 2a257b27b2a2553023c07fddf5aa3abf95a19f66
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Mon Mar 26 16:07:58 2012 -0400

    Serial Control: Refresh node map on edit
    
    While it would be nice to redraw any affected tree nodes when
    editing, we should at least replace the map data in case it is
    used in other functions.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

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 74ca397..9b1a85b 100644
--- a/Open-ILS/xul/staff_client/server/serial/manage_subs.js
+++ b/Open-ILS/xul/staff_client/server/serial/manage_subs.js
@@ -53,16 +53,40 @@ serial.manage_subs.prototype = {
 
             params.do_edit = true;
             params.handle_update = true;
+            params.trigger_refresh = true;
             if (mode == 'add') {
-                params.trigger_refresh = true;
                 params.refresh_command = function () {obj.refresh_list();};
+            } else {
+                params.refresh_command = function () {obj.remap_node(type, this);};
             }
+   
             obj[editor_type].init(params);
         } catch(E) {
             obj.error.standard_unexpected_error_alert('editor_init() error',E);
         }
     },
 
+    // while not a true tree node repace, this should at least prevent
+    // non-display side-effects.  True node replace is TODO
+    'remap_node' : function(type, editor_obj) {
+        var obj = this;
+        try {
+            for (i = 0; i < editor_obj[editor_obj.fm_type_plural].length; i++) {
+                var new_obj = editor_obj[editor_obj.fm_type_plural][i];
+                var old_obj = obj['map_' + type][type + '_' + new_obj.id()];
+                if (type == 'ssub') { // add children back on
+                    new_obj.distributions(old_obj.distributions());
+                    new_obj.issuances(old_obj.issuances());
+                    new_obj.scaps(old_obj.scaps());
+                }
+                obj['map_' + type][type + '_' + new_obj.id()] = new_obj;
+            }
+            editor_obj.render();
+        } catch(E) {
+            obj.error.standard_unexpected_error_alert('remap_node() error',E);
+        }
+    },
+
     'do_delete' : function(type, method, overridable_events) {
         var obj = this;
         try {

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

Summary of changes:
 .../js/ui/default/serial/subscription/issuance.js  |    2 +-
 .../xul/staff_client/server/serial/manage_subs.js  |   21 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list