[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 92daa8b59738a70e4ec13280b1693e5b3fdba5df

Evergreen Git git at git.evergreen-ils.org
Wed Aug 3 13:44:31 EDT 2011


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, rel_2_1 has been updated
       via  92daa8b59738a70e4ec13280b1693e5b3fdba5df (commit)
       via  a1d1d5bf845fb42a4b9341357505d23baa89e8a3 (commit)
      from  8dc4efabe721f0fadcf4163130c72be351c5d78e (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 92daa8b59738a70e4ec13280b1693e5b3fdba5df
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Mon Aug 1 02:10:15 2011 -0400

    Fix overzealous template application
    
    The idea was that we'd track templates if they were applied prior to copies
    actually being specified in the unified interface, and then apply them "for
    real" once copies were entered.  But these remembered templates kept applying
    themselves whenever changes were made in the volume/copy creator portion of
    the interface (possibly overriding tweaks made by staff).  So now we delete
    the list of tracked templates once they're applied to actual copies.
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js
index 749c689..25ee3ef 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js
+++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js
@@ -188,6 +188,11 @@ function my_init() {
                     for (var i = 0; i < g.applied_templates.length; i++) {
                         g._apply_template( g.applied_templates[i], false);
                     }
+                    if (g.copies.length > 0) {
+                        // Stop tracking these templates once they're applied
+                        // to actual copies
+                        g.applied_templates = [];
+                    }
                     g.summarize( g.copies );
                     g.render();
                     g.check_for_unmet_required_fields();
@@ -285,7 +290,12 @@ g.apply_template = function(apply_volume_editor_template_changes) {
     try {
         var name = g.template_menu.value;
         if (g.templates[ name ] != 'undefined') {
-            g.applied_templates.push( name );
+            if (g.copies == 0) {
+                // We're only tracking these applied templates temporarily,
+                // specifically when they're used prior to copies being
+                // created in the unified interface.
+                g.applied_templates.push( name );
+            }
             g._apply_template(name,apply_volume_editor_template_changes);
             g.summarize( g.copies );
             g.render();

commit a1d1d5bf845fb42a4b9341357505d23baa89e8a3
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Mon Aug 1 01:40:22 2011 -0400

    robustify (and klunkify) unified volume copy creator
    
    Disable/style the Item Editor while changes in the volume/item pane are being
    considered, and require an explicit press of a Ready Item Editor button to
    enable the interface.  This reduces the chance of editing widgets in the item
    editor from being ripped out from under you (for example, if you try to go
    straight from editing a call number to editing an item attribute).
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd
index 1430b5d..aec871a 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -2833,6 +2833,8 @@
 <!ENTITY staff.cat.volume_copy_creator.batch_bar.call_number.label.label "Call Number:">
 <!ENTITY staff.cat.volume_copy_creator.batch_bar.call_number.label.accesskey "L">
 <!ENTITY staff.cat.volume_copy_creator.batch_bar.call_number.suffix "Suffix:">
+<!ENTITY staff.cat.volume_copy_creator.ready_item_editor.label "Ready Item Editor">
+<!ENTITY staff.cat.volume_copy_creator.ready_item_editor.accesskey "R">
 <!ENTITY staff.cat.volume_editor.title "Volumes">
 <!ENTITY staff.cat.volume_editor.caption.label "Volume Editor">
 <!ENTITY staff.cat.volume_editor.modify.label "Modify">
diff --git a/Open-ILS/xul/staff_client/chrome/content/util/widgets.js b/Open-ILS/xul/staff_client/chrome/content/util/widgets.js
index 2bad0b0..4867256 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/widgets.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/widgets.js
@@ -232,7 +232,19 @@ util.widgets.apply_vertical_tab_on_enter_handler = function(node,onfailure,no_en
                     }
                 } else {
                     if (typeof no_enter_func == 'function') {
-                        no_enter_func(ev);
+                        if ([
+                                35 /* end */,
+                                36 /* home */,
+                                37 /* left */,
+                                38 /* up */,
+                                39 /* right */,
+                                40 /* down */,
+                                9 /* tab */
+                            ].indexOf(ev.keyCode) == -1
+                        ) {
+                            // really the no_enter, no_arrow_key, no_tab, etc. func :)
+                            no_enter_func(ev);
+                        }
                     }
                 }
             },
diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js
index b3155b7..749c689 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js
+++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js
@@ -1,5 +1,5 @@
 // vim:et:sw=4:ts=4
-var g = {};
+var g = { 'disabled' : false };
 g.map_acn = {};
 
 function $(id) { return document.getElementById(id); }
@@ -164,8 +164,20 @@ function my_init() {
         g.check_for_unmet_required_fields();
 
         if (xulG.unified_interface) {
+            xulG.disable_copy_editor = function(c) {
+                addCSSClass(document.documentElement,'red_bg');
+                g.disabled = true;
+            }
+            xulG.enable_copy_editor = function(c) {
+                removeCSSClass(document.documentElement,'red_bg');
+                g.disabled = false;
+                xulG.refresh_copy_editor();
+            }
             xulG.refresh_copy_editor = function() {
+                dump('refresh_copy_editor\n');
+                addCSSClass(document.documentElement,'blue_bg');
                 try {
+                    xulG.clear_update_copy_editor_timeout();
                     g.copies = xulG.copies;
                     g.edit = g.copies.length > 0;
                     if (g.edit) {
@@ -179,6 +191,11 @@ function my_init() {
                     g.summarize( g.copies );
                     g.render();
                     g.check_for_unmet_required_fields();
+                    setTimeout(
+                        function() {
+                            removeCSSClass(document.documentElement,'blue_bg');
+                        }, 1000
+                    );
                 } catch(E) {
                     alert('Error in copy_editor.js, xulG.refresh_copy_editor(): ' + E);
                 }
@@ -1275,7 +1292,10 @@ g.render_input = function(node,blob) {
 
         function on_click(ev){
             try {
-                if (block) return; block = true;
+                if (block || g.disabled || !g.edit) {
+                    return;
+                }
+                block = true;
 
                 oils_lock_page();
 
diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
index 303cea0..48b87c5 100644
--- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
+++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
@@ -62,8 +62,29 @@ function my_init() {
                 g.save_button_locked = false;
                 document.getElementById("Create").disabled = false;
             }
+            xulG.clear_update_copy_editor_timeout = function() {
+                if (g.update_copy_editor_timeoutID) {
+                    clearTimeout(g.update_copy_editor_timeoutID);
+                    g.gather_copies();
+                }
+            }
+            $('Sync').addEventListener(
+                'command',
+                function() {
+                    // give gather_copies_soon fired off directly/indirectly by
+                    // onchange a chance to go first
+                    setTimeout(
+                        function() {
+                            xulG.enable_copy_editor();
+                        },
+                        0
+                    );
+                },
+                false
+            );
         } else {
             $('Create').hidden = true;
+            $('Sync').hidden = true;
         }
 
         /***********************************************************************************************************/
@@ -268,8 +289,8 @@ g.render_volume_count_entry = function(row,ou_id) {
     }
     util.widgets.apply_vertical_tab_on_enter_handler(
         tb,
-        function() { render_copy_count_entry({'target':tb}); setTimeout(function(){util.widgets.vertical_tab(tb);},0); },
-        g.delay_gather_copies_soon
+        function() { render_copy_count_entry({'target':tb}); setTimeout(function(){util.widgets.vertical_tab(tb);},0); }
+        ,function() { $('Sync').disabled = true; }
     );
     tb.addEventListener( 'change', render_copy_count_entry, false);
     tb.addEventListener( 'change', g.gather_copies_soon, false);
@@ -460,11 +481,11 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) {
                                     util.widgets.vertical_tab(call_number_column_textbox);
                                 },0
                             );
-                        },
-                        g.delay_gather_copies_soon
+                        }
+                        ,function() { $('Sync').disabled = true; }
                     );
                     call_number_column_textbox.addEventListener( 'change', handle_change_to_callnumber_data, false);
-                    call_number_column_textbox.addEventListener( 'change', g.gather_copies_soon, false);
+                    //call_number_column_textbox.addEventListener( 'change', g.gather_copies_soon, false);
                     call_number_column_textbox.addEventListener( 'focus', function(ev) { g.last_focus = ev.target; }, false );
 
                     /**** CLASSIFICATION COLUMN revisited ****/
@@ -528,8 +549,8 @@ g.render_callnumber_copy_count_entry = function(row,ou_id,count) {
                                     util.widgets.vertical_tab(number_of_copies_column_textbox);
                                 },0
                             );
-                        },
-                        g.delay_gather_copies_soon
+                        }
+                        ,function() { $('Sync').disabled = true; }
                     );
                     number_of_copies_column_textbox.addEventListener( 'change', handle_change_number_of_copies_column_textbox, false);
                     number_of_copies_column_textbox.addEventListener( 'change', g.gather_copies_soon, false);
@@ -752,7 +773,7 @@ g.render_barcode_entry = function(node,callnumber_composite_key,count,ou_id) {
                         setTimeout( function() { ev.target.select(); ev.target.focus(); }, 0);
                     }
                 }, false);
-                tb.addEventListener('change', g.gather_copies_soon, false);
+                //tb.addEventListener('change', g.gather_copies_soon, false);
                 tb.addEventListener( 'focus', function(ev) { g.last_focus = ev.target; }, false );
             }
         }
@@ -815,6 +836,10 @@ g.gather_copies_soon = function(ev) {
     try {
         if (!xulG.unified_interface) { return; }
         dump('g.gather_copies_soon()\n');
+        if (typeof xulG.disable_copy_editor == 'function') {
+            xulG.disable_copy_editor();
+        }
+        $('Sync').disabled = true;
         if (g.update_copy_editor_timeoutID) {
             clearTimeout(g.update_copy_editor_timeoutID);
         }
@@ -824,6 +849,8 @@ g.gather_copies_soon = function(ev) {
             function() {
                 try {
                     g.gather_copies();
+                    //xulG.enable_copy_editor();
+                    $('Sync').disabled = false;
                     xulG.refresh_copy_editor();
                 } catch(E) {
                     dump('Error in volume_copy_editor.js with g.gather_copies_soon setTimeout func(): ' + E + '\n');
diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul
index 5cfc111..00a846f 100644
--- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul
+++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul
@@ -121,6 +121,11 @@
                 <button id="CreateWithDefaults" disabled="true" oncommand="g.stash_and_close('noedit');"/>
                 <button id="EditThenCreate" disabled="true" oncommand="g.stash_and_close('edit');"/>
             </hbox>
+            <button id="Sync"
+                label="&staff.cat.volume_copy_creator.ready_item_editor.label;"
+                accesskey="&staff.cat.volume_copy_creator.ready_item_editor.accesskey;"
+                disabled="true"
+                image="/xul/server/skin/media/images/down_arrow.gif"/>
             <button id="Create" disabled="true" oncommand="g.stash_and_close('unified_interface');"/>
         </hbox>
     </vbox>
diff --git a/Open-ILS/xul/staff_client/server/skin/global.css b/Open-ILS/xul/staff_client/server/skin/global.css
index bca48dc..d089ced 100644
--- a/Open-ILS/xul/staff_client/server/skin/global.css
+++ b/Open-ILS/xul/staff_client/server/skin/global.css
@@ -149,4 +149,5 @@ listitem { border-bottom: solid thin black; }
 
 .oils_event { color: red; }
 
-
+.blue_bg { background-color: blue; }
+.red_bg { background-color: red; }

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

Summary of changes:
 Open-ILS/web/opac/locale/en-US/lang.dtd            |    2 +
 .../staff_client/chrome/content/util/widgets.js    |   14 ++++++-
 .../xul/staff_client/server/cat/copy_editor.js     |   36 +++++++++++++++-
 .../staff_client/server/cat/volume_copy_creator.js |   43 ++++++++++++++++----
 .../server/cat/volume_copy_creator.xul             |    5 ++
 Open-ILS/xul/staff_client/server/skin/global.css   |    3 +-
 6 files changed, 90 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list