[open-ils-commits] [GIT] Evergreen ILS branch master updated. 54a691aa0206e9f4d4d9cba24bd4c1e49e774b83

Evergreen Git git at git.evergreen-ils.org
Tue Sep 27 16:10:21 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, master has been updated
       via  54a691aa0206e9f4d4d9cba24bd4c1e49e774b83 (commit)
      from  250ec72283a24e4aec4f672f4bbc51dfa2b7e211 (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 54a691aa0206e9f4d4d9cba24bd4c1e49e774b83
Author: Dan Scott <dscott at laurentian.ca>
Date:   Fri Sep 23 10:55:28 2011 -0400

    LP857460: Get the generic class scheme when adding vols
    
    In a default Evergreen instance, in the "Add Volumes" interface for a
    bib record with both LC and Dewey call numbers, the list of call numbers
    from which you can select appears to be limited to Dewey, even though
    the "Bib Call #" field is populated with an LC call number.
    
    The problem is that here we're grabbing the first entry from the
    asset.call_number_classification table, and you might expect that to be
    the "Generic" entry - however, it turns out to be the "Dewey" entry
    because the entries are ordered alphabetically by .name(), not by
    database ID. (You can test this be changing the name of "Dewey" to
    "Vicious" and see that the "Generic" entry is chosen instead).
    
    This commit changes the process to first search the acnc array for a
    name() = "Generic"; and then if we don't find that, fall back to the
    first entry in the classification scheme.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

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 1ec3d0e..107ce19 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
@@ -110,15 +110,30 @@ function my_init() {
         var ou_ids = xul_param('ou_ids',{'concat' : true}) || [];
 
         // Get the default callnumber classification scheme from OU settings
-        dojo.require('fieldmapper.OrgUtils');
-        //fieldmapper.aou.fetchOrgSettingDefault(ses('ws_ou'), 'cat.default_classification_scheme');
-        g.label_class = g.data.hash.aous['cat.default_classification_scheme'];
-
-        // Assign a default value if none was returned
-        if (!g.label_class) {
-            g.label_class = g.data.list.acnc[0].id();
+        // or a reasonable fall-back
+        function get_default_label_class() {
+            g.label_class = g.data.hash.aous['cat.default_classification_scheme'];
+
+            // Assign a default value if none was returned
+            // Begin by looking for the "Generic" label class by name
+            if (!g.label_class) {
+                for (var i = 0; i < g.data.list.acnc.length; i++) {
+                    if (g.data.list.acnc[i].name() == 'Generic') {
+                        g.label_class = g.data.list.acnc[i].id();
+                        break;
+                    }
+                }
+            }
+            // Maybe this database has renamed or removed their Generic
+            // entry; in that case, just return the first one that we
+            // know exists
+            if (!g.label_class) {
+                g.label_class = g.data.list.acnc[0].id();
+            }
         }
 
+        get_default_label_class();
+
         /***********************************************************************************************************/
         /* If we're passed existing_copies, rig up a copy_shortcut object to leverage existing code for rendering the volume labels, etc.
          * Also make a lookup object for existing copies keyed on org id and callnumber composite key, and another keyed on copy id. */

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

Summary of changes:
 .../staff_client/server/cat/volume_copy_creator.js |   29 +++++++++++++++-----
 1 files changed, 22 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list