Fix bug and typo in stat cat editor
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 May 2011 14:05:56 +0000 (14:05 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 May 2011 14:05:56 +0000 (14:05 +0000)
Specifically, disabling the ability to select a stat cat type on no permissions on current type.

If you don't have permissions on ASSET you could never get to ACTOR.

If you picked ACTOR without rights you couldn't get back to ASSET.

Also, re-enable the library selector and new buttons when you do change to one you can add for.

Author: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>

git-svn-id: svn://svn.open-ils.org/ILS/trunk@20371 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js

index ae896a7..55bad58 100644 (file)
@@ -52,7 +52,7 @@ function scSetPerms() {
     PERMS[ASSET].update_stat_cat_entry =  OILS_WORK_PERMS.UPDATE_COPY_STAT_CAT_ENTRY;
     PERMS[ASSET].delete_stat_cat_entry =  OILS_WORK_PERMS.DELETE_COPY_STAT_CAT_ENTRY;
 
-    // set up the fitler select
+    // set up the filter select
     var fselector = $('sc_org_filter');
     var org_list = PERMS[currentlyVisible].update_stat_cat;
     buildMergedOrgSel(fselector, org_list, 0, 'shortname');
@@ -296,10 +296,13 @@ function scBuildNew() {
     var org_list = PERMS[type].create_stat_cat;
     if(org_list.length == 0) { /* no create perms */
         $('sc_new').disabled = true;
-        typeSel.disabled = true;
         libSel.disabled = true;
         return;
     }
+    else {
+        $('sc_new').disabled = false;
+        libSel.disabled = false;
+    }
     buildMergedOrgSel(libSel, org_list, 0, 'shortname');
 }