[open-ils-commits] [GIT] Evergreen ILS branch master updated. 5a0beda6173e6d7715ed3f454e787297d96d29d2

Evergreen Git git at git.evergreen-ils.org
Tue Nov 15 15:02:31 EST 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, master has been updated
       via  5a0beda6173e6d7715ed3f454e787297d96d29d2 (commit)
      from  a56df6fc6a4146c104e069a3c81fbb4b72283e94 (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 5a0beda6173e6d7715ed3f454e787297d96d29d2
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Tue Sep 13 08:48:52 2011 -0400

    LP#848945 - Hide Empty Libs checkbox
    
    The "Show Libraries With Items" button in Holdings Maintenance shows all the
    libs with items regardless of the library/depth filters. One problem is that
    when the list refreshes (whenever an item/volume is edited, deleted, or added),
    staff using this feature have to re-press the button, which can take a while for
    some bibs. This branch removes this button and replaces it with a "sticky"
    checkbox labelled "Hide Empty Libs".
    
    This allows you to do almost the same thing; you can set the context library to
    Consortium and the depth filter to the lowest depth, which would normally show
    all libs, but then use the checkbox to prune out the ones that have no children
    and no volumes(*). One possible use case that we'd lose is the ability to show a
    specific set of libs that don't already have volumes in addition to all the libs
    that do.
    
    * - Also, the test for whether to hide an org or not is very simplistic, but
    easy to implement. A more aggressive test would hide a library and all its
    descendants if none of the descendants have volumes.
    
    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 f352a1f..2ba73f7 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -2620,9 +2620,8 @@
 <!ENTITY staff.cat.copy_browser.holdings_maintenance.consortial_available "Available:">
 <!ENTITY staff.cat.copy_browser.holdings_maintenance.show_acns "Show Volumes">
 <!ENTITY staff.cat.copy_browser.holdings_maintenance.show_acps "Show Items">
+<!ENTITY staff.cat.copy_browser.holdings_maintenance.hide_aous "Hide Empty Libs">
 <!ENTITY staff.cat.copy_browser.holdings_maintenance.refresh_button.label "Refresh">
-<!ENTITY staff.cat.copy_browser.holdings_maintenance.show_libs.label "Show Libraries With Items">
-<!ENTITY staff.cat.copy_browser.holdings_maintenance.show_libs.accesskey "L">
 <!ENTITY staff.cat.copy_browser.holdings_maintenance.actions.label "Actions for Selected Rows">
 <!ENTITY staff.cat.copy_browser.holdings_maintenance.actions.accesskey "f">
 <!ENTITY staff.cat.copy_browser.holdings_maintenance.sel_clip.label "Copy to Clipboard">
diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js
index bb9b632..d234f37 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js
+++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js
@@ -42,8 +42,15 @@ cat.copy_browser.prototype = {
             document.getElementById('show_acns').addEventListener(
                 'command',
                 function(ev) {
-                    JSAN.use('util.file'); var file = new util.file('copy_browser_prefs.'+obj.data.server_unadorned);
-                    util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_acns' : [ 'checked' ], 'show_acps' : [ 'checked' ] });
+                    JSAN.use('util.file');
+                    var file = new util.file(
+                        'copy_browser_prefs.'+obj.data.server_unadorned);
+                    util.widgets.save_attributes(file, {
+                        'lib_menu' : [ 'value' ],
+                        'depth_menu' : [ 'value' ],
+                        'show_acns' : [ 'checked' ],
+                        'show_acps' : [ 'checked' ],
+                        'hide_aous' : [ 'checked' ] });
                 },
                 false
             );
@@ -51,8 +58,31 @@ cat.copy_browser.prototype = {
             document.getElementById('show_acps').addEventListener(
                 'command',
                 function(ev) {
-                    JSAN.use('util.file'); var file = new util.file('copy_browser_prefs.'+obj.data.server_unadorned);
-                    util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_acns' : [ 'checked' ], 'show_acps' : [ 'checked' ] });
+                    JSAN.use('util.file');
+                    var file = new util.file(
+                        'copy_browser_prefs.'+obj.data.server_unadorned);
+                    util.widgets.save_attributes(file, {
+                        'lib_menu' : [ 'value' ],
+                        'depth_menu' : [ 'value' ],
+                        'show_acns' : [ 'checked' ],
+                        'show_acps' : [ 'checked' ],
+                        'hide_aous' : [ 'checked' ] });
+                },
+                false
+            );
+
+            document.getElementById('hide_aous').addEventListener(
+                'command',
+                function(ev) {
+                    JSAN.use('util.file');
+                    var file = new util.file(
+                        'copy_browser_prefs.'+obj.data.server_unadorned);
+                    util.widgets.save_attributes(file, {
+                        'lib_menu' : [ 'value' ],
+                        'depth_menu' : [ 'value' ],
+                        'show_acns' : [ 'checked' ],
+                        'show_acps' : [ 'checked' ],
+                        'hide_aous' : [ 'checked' ] });
                 },
                 false
             );
@@ -1058,7 +1088,8 @@ cat.copy_browser.prototype = {
                         'lib_menu' : [ 'value' ],
                         'depth_menu' : [ 'value' ],
                         'show_acns' : [ 'checked' ],
-                        'show_acps' : [ 'checked' ]
+                        'show_acps' : [ 'checked' ],
+                        'hide_aous' : [ 'checked' ]
                     });
                 },
                 false
@@ -1128,7 +1159,8 @@ cat.copy_browser.prototype = {
                             'lib_menu' : [ 'value' ],
                             'depth_menu' : [ 'value' ],
                             'show_acns' : [ 'checked' ],
-                            'show_acps' : [ 'checked' ]
+                            'show_acps' : [ 'checked' ],
+                            'hide_aous' : [ 'checked' ]
                         });
                         obj.refresh_list();
                     },
@@ -1485,9 +1517,20 @@ cat.copy_browser.prototype = {
                         obj.map_acp[ 'acp_' + copies[j].id() ] = function(r){return r;}(copies[j]);
                     }
                 }
-                data.row.my.volume_count = v_count;
+                data.row.my.volume_count = String(v_count);
                 data.row.my.copy_count = '<' + c_count + '>';
             }
+            if (document.getElementById('hide_aous').checked) {
+                if (org.children().length == 0
+                        && data.row.my.volume_count == '0') {
+                    if (!params) {
+                        params = { 'hidden' : true };
+                    } else {
+                        params['hidden'] = true;
+                    }
+                    dump('hiding org.id() = ' + org.id() + '\n');
+                }
+            }
             if (parent_org) {
                 data.node = obj.map_tree[ 'aou_' + parent_org.id() ];
             }
diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.xul b/Open-ILS/xul/staff_client/server/cat/copy_browser.xul
index 359dd12..ba64563 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_browser.xul
+++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.xul
@@ -152,8 +152,9 @@ vim:noet:sw=4:ts=4:
         <hbox>
             <checkbox id="show_acns" label="&staff.cat.copy_browser.holdings_maintenance.show_acns;" />
             <checkbox id="show_acps" label="&staff.cat.copy_browser.holdings_maintenance.show_acps;" />
+            <checkbox id="hide_aous" label="&staff.cat.copy_browser.holdings_maintenance.hide_aous;" />
             <button id="refresh_button" label="&staff.cat.copy_browser.holdings_maintenance.refresh_button.label;" command="cmd_refresh_list" />
-            <button label="&staff.cat.copy_browser.holdings_maintenance.show_libs.label;" command="cmd_show_libs_with_copies" accesskey="&staff.cat.copy_browser.holdings_maintenance.show_libs.accesskey;"/>
+            <!-- <button label="Show Libraries With Items" command="cmd_show_libs_with_copies" accesskey="L"/> -->
             <!-- <button label="Show My Libs" command="cmd_show_my_libs" accesskey="M"/>-->
             <!--
             <button label="Show All Libs" command="cmd_show_all_libs" accesskey=""/>

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

Summary of changes:
 Open-ILS/web/opac/locale/en-US/lang.dtd            |    3 +-
 .../xul/staff_client/server/cat/copy_browser.js    |   57 +++++++++++++++++---
 .../xul/staff_client/server/cat/copy_browser.xul   |    3 +-
 3 files changed, 53 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list