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() {
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() {
}
}
],
- '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() {
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) {