Clear out some unused code, which in some cases was causing "command bleed"
authordbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 26 Jan 2011 14:54:18 +0000 (14:54 +0000)
committerdbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 26 Jan 2011 14:54:18 +0000 (14:54 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19301 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/serial/manage_dists.js

index 9008d50..c1a5df0 100644 (file)
@@ -169,44 +169,6 @@ serial.manage_dists.prototype = {
                                 obj.list.clear();
                             }
                         ],
-                        'cmd_add_siss' : [
-                            ['command'],
-                            function() {
-                                try {
-                                    var list = obj.ids_from_sel_list('sdist');
-                                    if (list.length == 0) list = obj.ids_from_sel_list('siss-group');
-                                    if (list.length == 0) return;
-
-                                    /*TODO: permission check?
-                                    //populate 'list' with owning_libs of subs, TODO
-                                    var edit = 0;
-                                    try {
-                                        edit = obj.network.request(
-                                            api.PERM_MULTI_ORG_CHECK.app,
-                                            api.PERM_MULTI_ORG_CHECK.method,
-                                            [ 
-                                                ses(), 
-                                                obj.data.list.au[0].id(), 
-                                                list,
-                                                [ 'CREATE_COPY' ]
-                                            ]
-                                        ).length == 0 ? 1 : 0;
-                                    } catch(E) {
-                                        obj.error.sdump('D_ERROR','batch permission check: ' + E);
-                                    }
-
-                                    if (edit==0) return; // no read-only view for this interface */
-                                    var new_siss = new siss();
-                                    new_siss.subscription(list[0]);//TODO: add multiple at once support?
-                                    new_siss.isnew(1);
-                                    var params = {};
-                                    params.sisses = [new_siss];
-                                    obj.editor_init('siss', 'add', params);
-                                } catch(E) {
-                                    obj.error.standard_unexpected_error_alert(document.getElementById('serialStrings').getString('staff.serial.manage_dists.add.error'),E);
-                                }
-                            }
-                        ],
                         'cmd_add_sstr' : [
                             ['command'],
                             function() {
@@ -253,23 +215,6 @@ serial.manage_dists.prototype = {
                                 obj.do_delete('sstr', 'open-ils.serial.stream.batch.update', overridable_events);
                             }
                         ],
-                        'cmd_delete_siss' : [
-                            ['command'],
-                            function() {
-                                var overridable_events = [ //TODO: proper overrides
-                                ];
-                                obj.do_delete('siss', 'open-ils.serial.issuance.fleshed.batch.update', overridable_events);
-                            }
-                        ],
-                        'cmd_delete_sdist' : [
-                            ['command'],
-                            function() {
-                                var overridable_events = [
-                                    11000 // SERIAL_SUBSCRIPTION_NOT_EMPTY
-                                ];
-                                obj.do_delete('sdist', 'open-ils.serial.subscription.fleshed.batch.update', overridable_events);
-                            }
-                        ],
                         'cmd_mark_library' : [
                             ['command'],
                             function() {
@@ -319,45 +264,6 @@ serial.manage_dists.prototype = {
                                 }
                             }
                         ],
-                        'cmd_add_distributions' : [
-                            ['command'],
-                            function() {
-                                try {
-                                    var list = obj.ids_from_sel_list('aou');
-                                    if (list.length == 0) return;
-                                    //TODO: permission check?
-                                    /*var edit = 0;
-                                    try {
-                                        edit = obj.network.request(
-                                            api.PERM_MULTI_ORG_CHECK.app,
-                                            api.PERM_MULTI_ORG_CHECK.method,
-                                            [ 
-                                                ses(), 
-                                                obj.data.list.au[0].id(), 
-                                                list,
-                                                [ 'CREATE_VOLUME', 'CREATE_COPY' ]
-                                            ]
-                                        ).length == 0 ? 1 : 0;
-                                    } catch(E) {
-                                        obj.error.sdump('D_ERROR','batch permission check: ' + E);
-                                    }
-
-                                    if (edit==0) {
-                                        alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.add_volume.permission_error'));
-                                        return; // no read-only view for this interface
-                                    } */
-                                    var new_sdist = new sdist();
-                                    new_sdist.owning_lib(list[0]);//TODO: add multiple at once support?
-                                    new_sdist.isnew(1);
-                                    new_sdist.record_entry(obj.docid);
-                                    var params = {};
-                                    params.sdists = [new_sdist];
-                                    obj.editor_init('sdist', 'add', params);
-                                } catch(E) {
-                                    obj.error.standard_unexpected_error_alert(document.getElementById('serialStrings').getString('staff.serial.manage_dists.add.error'),E);
-                                }
-                            }
-                        ],
                         'cmd_transfer_distribution' : [
                             ['command'],
                             function() {
@@ -1292,12 +1198,12 @@ serial.manage_dists.prototype = {
             obj.controller.view.cmd_add_sstr.setAttribute('disabled','true');
             obj.controller.view.cmd_delete_sstr.setAttribute('disabled','true');
             obj.controller.view.cmd_mark_library.setAttribute('disabled','true');
-            obj.controller.view.cmd_delete_sdist.setAttribute('disabled','true');
+            //obj.controller.view.cmd_delete_sdist.setAttribute('disabled','true');
             if (found_aou) {
                 obj.controller.view.cmd_mark_library.setAttribute('disabled','false');
             }
             if (found_sdist) {
-                obj.controller.view.cmd_delete_sdist.setAttribute('disabled','false');
+                //obj.controller.view.cmd_delete_sdist.setAttribute('disabled','false');
                 obj.controller.view.cmd_add_sstr.setAttribute('disabled','false');
             }
             if (found_sstr_group) {