Allow subscriptions at org units without volumes
authorDan Wells <dbw2@calvin.edu>
Wed, 25 Apr 2012 19:56:20 +0000 (15:56 -0400)
committerDan Wells <dbw2@calvin.edu>
Wed, 25 Apr 2012 19:56:20 +0000 (15:56 -0400)
Subscriptions are sometimes owned at the consortium or system
level, so forcing can_have_vols() to be true was incorrect.

This commit removes those checks.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/xul/staff_client/server/serial/manage_items.js
Open-ILS/xul/staff_client/server/serial/manage_subs.js
Open-ILS/xul/staff_client/server/serial/ssub_editor.js

index ec56204..ff6b999 100644 (file)
@@ -63,6 +63,9 @@ serial.manage_items.prototype = {
         file = new util.file('offline_ou_list');
         if (file._file.exists()) {
             list_data = file.get_object(); file.close();
+            for (var i = 0; i < list_data[0].length; i++) { // make sure all entries are enabled
+                    list_data[0][i][2] = false;
+            }
             ml = util.widgets.make_menulist( list_data[0], list_data[1] );
             ml.setAttribute('id','serial_item_lib_menu'); document.getElementById('serial_item_lib_menu_box').appendChild(ml);
             //TODO: class this menu properly
index e973eb7..b7875b3 100644 (file)
@@ -1353,13 +1353,8 @@ serial.manage_subs.prototype = {
         
             var ssub_tree_list;
             if ( obj.org_ids.indexOf( Number( org.id() ) ) == -1 ) {
-                if ( get_bool( obj.data.hash.aout[ org.ou_type() ].can_have_vols() ) ) {
-                    data.row.my.subscription_count = '0';
-                    //data.row.my.distribution_count = '<0>';
-                } else {
-                    data.row.my.subscription_count = '';
-                    //data.row.my.distribution_count = '';
-                }
+                data.row.my.subscription_count = '0';
+                //data.row.my.distribution_count = '<0>';
             } else {
                 var v_count = 0; var d_count = 0;
                 ssub_tree_list = obj.network.simple_request(
index 20a0597..ccf999a 100644 (file)
@@ -112,7 +112,7 @@ serial.ssub_editor.prototype = {
                 'owning_lib',
                 {
                     render: 'typeof fm.owning_lib() == "object" ? fm.owning_lib().shortname() : obj.data.hash.aou[ fm.owning_lib() ].shortname()',
-                    input: 'c = function(v){ obj.apply("owning_lib",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( obj.data.list.aou, function(myobj) { var sname = myobj.shortname(); for (i = sname.length; i < 20; i++) sname += " "; return [ myobj.name() ? sname + " " + myobj.name() : myobj.shortname(), myobj.id(), ( ! get_bool( obj.data.hash.aout[ myobj.ou_type() ].can_have_vols() ) ), ( obj.data.hash.aout[ myobj.ou_type() ].depth() * 2), ]; }), obj.data.list.au[0].ws_ou()); x.setAttribute("value",obj.editor_values.owning_lib); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+                    input: 'c = function(v){ obj.apply("owning_lib",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( obj.data.list.aou, function(myobj) { var sname = myobj.shortname(); for (i = sname.length; i < 20; i++) sname += " "; return [ myobj.name() ? sname + " " + myobj.name() : myobj.shortname(), myobj.id(), false, ( obj.data.hash.aout[ myobj.ou_type() ].depth() * 2), ]; }), obj.data.list.au[0].ws_ou()); x.setAttribute("value",obj.editor_values.owning_lib); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                     value_key: 'owning_lib',
                     dropdown_key: 'fm.owning_lib() == null ? null : typeof fm.owning_lib() == "object" ? fm.owning_lib().id() : fm.owning_lib()',
                 }