From 3050c14ddef8219bf38fa8163959bac2ba90b5f9 Mon Sep 17 00:00:00 2001
From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Mon, 2 May 2011 14:06:19 +0000
Subject: [PATCH] Fix bug and typo in stat cat editor

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/branches/rel_2_1@20372 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js b/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js
index ae896a73c0..55bad5853c 100644
--- a/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js
+++ b/Open-ILS/xul/staff_client/server/admin/stat_cat_editor.js
@@ -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');
 }
 
-- 
2.11.0