[open-ils-commits] r18669 - in branches/serials-integration/Open-ILS: web/opac/locale/en-US xul/staff_client/chrome/content/main xul/staff_client/server/locale/en-US xul/staff_client/server/serial (dbwells)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 8 16:38:03 EST 2010
Author: dbwells
Date: 2010-11-08 16:37:58 -0500 (Mon, 08 Nov 2010)
New Revision: 18669
Added:
branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sbsum_editor.js
branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sbsum_editor.xul
branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sisum_editor.js
branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sisum_editor.xul
branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sssum_editor.js
branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sssum_editor.xul
Modified:
branches/serials-integration/Open-ILS/web/opac/locale/en-US/lang.dtd
branches/serials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js
branches/serials-integration/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties
branches/serials-integration/Open-ILS/xul/staff_client/server/serial/editor_base.js
branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_dists.js
branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_dists.xul
branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_subs.js
Log:
Cleaner, more functional distributions tab.
Modified: branches/serials-integration/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- branches/serials-integration/Open-ILS/web/opac/locale/en-US/lang.dtd 2010-11-08 21:37:42 UTC (rev 18668)
+++ branches/serials-integration/Open-ILS/web/opac/locale/en-US/lang.dtd 2010-11-08 21:37:58 UTC (rev 18669)
@@ -1589,6 +1589,14 @@
<!ENTITY staff.serial.scap_editor.modify.accesskey "M">
<!ENTITY staff.serial.scap_editor.create "Create Caption and Pattern(s)">
<!ENTITY staff.serial.scap_editor.create.accesskey "C">
+<!ENTITY staff.serial.scap_editor.notes "Caption and Pattern Notes">
+<!ENTITY staff.serial.scap_editor.notes.accesskey "N">
+<!ENTITY staff.serial.sbsum_editor.modify "Modify Basic Summary">
+<!ENTITY staff.serial.sbsum_editor.modify.accesskey "M">
+<!ENTITY staff.serial.sisum_editor.modify "Modify Index Summary">
+<!ENTITY staff.serial.sisum_editor.modify.accesskey "M">
+<!ENTITY staff.serial.sssum_editor.modify "Modify Supplement Summary">
+<!ENTITY staff.serial.sssum_editor.modify.accesskey "M">
<!ENTITY staff.serial.sdist_editor.modify "Modify Distribution(s)">
<!ENTITY staff.serial.sdist_editor.modify.accesskey "M">
<!ENTITY staff.serial.sdist_editor.create "Create Distribution(s)">
Modified: branches/serials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2010-11-08 21:37:42 UTC (rev 18668)
+++ branches/serials-integration/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2010-11-08 21:37:58 UTC (rev 18669)
@@ -280,15 +280,19 @@
'MARC_HTML_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.record.html', 'secure' : false },
'FM_BLOB_RETRIEVE_VIA_Z3950_SEARCH' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.search_class' },
'FM_BLOB_RETRIEVE_VIA_Z3950_RAW_SEARCH' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.search_service' },
+ 'FM_SBSUM_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.basic_summary.batch.retrieve', 'secure' : false },
+ 'FM_SBSUM_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.basic_summary.batch.retrieve.authoritative', 'secure' : false },
'FM_SCAP_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.caption_and_pattern.batch.retrieve', 'secure' : false },
'FM_SCAP_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.caption_and_pattern.batch.retrieve', 'secure' : false },
+ 'FM_SDIST_AOU_IDS_RETRIEVE_VIA_RECORD_ID' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution.retrieve_orgs_by_title', 'secure' : false },
+ 'FM_SDIST_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution.retrieve_orgs_by_title.authoritative', 'secure' : false },
'FM_SDIST_FLESHED_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution.fleshed.batch.retrieve', 'secure' : false },
'FM_SDIST_FLESHED_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution.fleshed.batch.retrieve.authoritative', 'secure' : false },
'FM_SDIST_ID_LIST' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.id_list.sdist'},
'FM_SDIST_RETRIEVE' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.retrieve.sdist'},
+ 'FM_SDIST_SEARCH' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.sdist'},
'FM_SDIST_TREE_LIST_RETRIEVE_VIA_RECORD_ID_AND_ORG_IDS' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution_tree.retrieve', 'secure' : false },
'FM_SDIST_TREE_LIST_RETRIEVE_VIA_RECORD_ID_AND_ORG_IDS.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution_tree.retrieve.authoritative', 'secure' : false },
- 'FM_SDIST_SEARCH' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.sdist'},
'FM_SDISTN_CREATE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution_note.create' },
'FM_SDISTN_DELETE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution_note.delete', 'secure' : false },
'FM_SDISTN_RETRIEVE_ALL' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.distribution_note.retrieve.all', 'secure' : false },
@@ -297,6 +301,8 @@
'FM_SIN_RETRIEVE_ALL' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.item_note.retrieve.all', 'secure' : false },
'FM_SISS_FLESHED_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.issuance.fleshed.batch.retrieve', 'secure' : false },
'FM_SISS_FLESHED_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.issuance.fleshed.batch.retrieve.authoritative', 'secure' : false },
+ 'FM_SISUM_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.index_summary.batch.retrieve', 'secure' : false },
+ 'FM_SISUM_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.index_summary.batch.retrieve.authoritative', 'secure' : false },
'FM_SITEM_FLESHED_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.item.fleshed.batch.retrieve', 'secure' : false },
'FM_SITEM_FLESHED_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.item.fleshed.batch.retrieve.authoritative', 'secure' : false },
'FM_SITEM_ID_LIST' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.id_list.sitem'},
@@ -304,8 +310,10 @@
'FM_SITEM_SEARCH' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.sitem'},
'FM_SRE_RETRIEVE' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.retrieve.sre'},
'FM_SRE_SEARCH' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.sre'},
+ 'FM_SSSUM_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.supplement_summary.batch.retrieve', 'secure' : false },
+ 'FM_SSSUM_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.supplement_summary.batch.retrieve.authoritative', 'secure' : false },
'FM_SSTR_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.stream.batch.retrieve', 'secure' : false },
- 'FM_SSTR_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.stream.batch.retrieve', 'secure' : false },
+ 'FM_SSTR_BATCH_RETRIEVE.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.stream.batch.retrieve.authoritative', 'secure' : false },
'FM_SSUB_AOU_IDS_RETRIEVE_VIA_RECORD_ID' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription.retrieve_orgs_by_title', 'secure' : false },
'FM_SSUB_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription.retrieve_orgs_by_title.authoritative', 'secure' : false },
'FM_SSUB_FLESHED_BATCH_RETRIEVE' : { 'app' : 'open-ils.serial', 'method' : 'open-ils.serial.subscription.fleshed.batch.retrieve', 'secure' : false },
Modified: branches/serials-integration/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties 2010-11-08 21:37:42 UTC (rev 18668)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/locale/en-US/serial.properties 2010-11-08 21:37:58 UTC (rev 18669)
@@ -1,5 +1,17 @@
staff.serial.editor_base.handle_update.error=serial update error:
staff.serial.editor_base.handle_update.success=Save Successful
+staff.serial.sbsum_editor.count=1 summary
+staff.serial.sbsum_editor.count.plural=%1$s summaries
+staff.serial.sbsum_editor.modify=Modify Basic Summary
+staff.serial.sbsum_editor.modify.accesskey=M
+staff.serial.sisum_editor.count=1 summary
+staff.serial.sisum_editor.count.plural=%1$s summaries
+staff.serial.sisum_editor.modify=Modify Index Summary
+staff.serial.sisum_editor.modify.accesskey=M
+staff.serial.sssum_editor.count=1 summary
+staff.serial.sssum_editor.count.plural=%1$s summaries
+staff.serial.sssum_editor.modify=Modify Supplement Summary
+staff.serial.sssum_editor.modify.accesskey=M
staff.serial.scap_editor.count=1 caption and pattern
staff.serial.scap_editor.count.plural=%1$s caption and patterns
staff.serial.scap_editor.create=Create Caption and Pattern(s)
@@ -34,7 +46,6 @@
staff.serial.sstr_editor.create.accesskey=C
staff.serial.sstr_editor.modify=Modify Stream(s)
staff.serial.sstr_editor.modify.accesskey=M
-staff.serial.sstr_editor.notes=Stream Notes
staff.serial.ssub_editor.count=1 subscription
staff.serial.ssub_editor.count.plural=%1$s subscriptions
staff.serial.ssub_editor.create=Create Subscription(s)
Modified: branches/serials-integration/Open-ILS/xul/staff_client/server/serial/editor_base.js
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/serial/editor_base.js 2010-11-08 21:37:42 UTC (rev 18668)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/serial/editor_base.js 2010-11-08 21:37:58 UTC (rev 18669)
@@ -176,7 +176,7 @@
}*/
if (obj[fm_type_plural].length != 1) {
- document.getElementById(fm_type + '_notes').setAttribute('hidden','true');
+ if (obj.can_have_notes) $(obj.xul_id_prefix + '_notes').setAttribute('hidden','true');
}
// clear change markers
Modified: branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_dists.js
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_dists.js 2010-11-08 21:37:42 UTC (rev 18668)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_dists.js 2010-11-08 21:37:58 UTC (rev 18669)
@@ -18,7 +18,7 @@
//'map_sstr' : {},
'sel_list' : [],
'funcs' : [],
- 'editor_indexes' : { 'sdist' : 1, 'sstr' : 2, 'summary' : 3, 'act' : 4 },
+ 'editor_indexes' : { 'sdist' : 1, 'sstr' : 2, 'sbsum' : 3, 'sssum' : 4, 'sisum' : 5 },
'ids_from_sel_list' : function(type) {
var obj = this;
@@ -162,18 +162,6 @@
obj.show_my_libs();
}
],
- 'cmd_show_all_libs' : [
- ['command'],
- function() {
- obj.show_all_libs();
- }
- ],
- 'cmd_show_libs_with_distributions' : [
- ['command'],
- function() {
- obj.show_libs_with_distributions();
- }
- ],
'cmd_clear' : [
['command'],
function() {
@@ -181,44 +169,6 @@
obj.list.clear();
}
],
- 'cmd_add_act' : [
- ['command'],
- function() {
- try {
- var list = obj.ids_from_sel_list('sdist');
- if (list.length == 0) list = obj.ids_from_sel_list('act-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_act = new act();
- new_act.subscription(list[0]);//TODO: add multiple at once support?
- new_act.isnew(1);
- var params = {};
- params.acts = [new_act];
- obj.editor_init('act', 'add', params);
- } catch(E) {
- obj.error.standard_unexpected_error_alert(document.getElementById('serialStrings').getString('staff.serial.manage_subs.add.error'),E);
- }
- }
- ],
'cmd_add_siss' : [
['command'],
function() {
@@ -297,15 +247,6 @@
}
}
],
- 'cmd_delete_act' : [
- ['command'],
- function() {
- var overridable_events = [
- 11001 // SERIAL_CAPTION_AND_PATTERN_HAS_ISSUANCES
- ];
- obj.do_delete('act', 'open-ils.serial.caption_and_pattern.batch.update', overridable_events);
- }
- ],
'cmd_delete_sstr' : [
['command'],
function() {
@@ -331,75 +272,6 @@
obj.do_delete('sdist', 'open-ils.serial.subscription.fleshed.batch.update', overridable_events);
}
],
- /*dbw2 'cmd_delete_sdist' : [
- ['command'],
- function() {
- try {
- JSAN.use('util.functional');
-
- var list = util.functional.filter_list(
- obj.sel_list,
- function (o) {
- return o.split(/_/)[0] == 'sdist';
- }
- );
-
- list = util.functional.map_list(
- list,
- function (o) {
- return JSON2js( js2JSON( obj.map_sdist[ 'sdist_' + o.split(/_/)[1] ] ) );
- }
- );
-
- var del_prompt;
- if (list.length == 1) {
- //TODO: correct prompts
- del_prompt = document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.prompt');
- } else {
- del_prompt = document.getElementById('catStrings').getFormattedString('staff.cat.copy_browser.delete_volume.prompt.plural', [list.length]);
- }
-
- var r = obj.error.yns_alert(
- del_prompt,
- document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.title'),
- document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.delete'),
- document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.cancel'),
- null,
- document.getElementById('commonStrings').getString('common.confirm')
- );
-
- if (r == 0) {
- for (var i = 0; i < list.length; i++) {
- list[i].isdeleted('1');
- }
- var robj = obj.network.simple_request(
- 'FM_ACN_TREE_UPDATE',
- [ ses(), list, true ],
- null,
- {
- 'title' : document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.override'),
- 'overridable_events' : [
- ]
- }
- );
- if (robj == null) throw(robj);
- if (typeof robj.ilsevent != 'undefined') {
- if (robj.ilsevent == 1206 ) { // VOLUME_NOT_EMPTY
- alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.copies_remain'));
- return;
- }
- if (robj.ilsevent != 0) throw(robj);
- }
- alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.success'));
- obj.refresh_list();
- }
- } catch(E) {
- obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.delete_volume.exception'),E);
- obj.refresh_list();
- }
-
- }
- ], dbw2*/
'cmd_mark_library' : [
['command'],
function() {
@@ -607,62 +479,6 @@
obj.refresh_list();
}
],
- 'cmd_make_predictions' : [
- ['command'],
- function() {
- try {
- var list = obj.ids_from_sel_list('sdist');
- if (list.length == 0) {
- alert('You must select a subscription before predicting issuances.'); //TODO: better error
- return;
- }
-
- var num_to_predict = prompt('How many items would you like to predict?',
- '12',
- 'Number of Predicted Items');
- num_to_predict = String( num_to_predict ).replace(/\D/g,'');
- if (num_to_predict == '') {
- alert('Invalid number entered!'); //TODO: better error
- return;
- }
-
- for (i = 0; i < list.length; i++) {
- var robj = obj.network.request(
- 'open-ils.serial',
- 'open-ils.serial.make_predictions',
- [ ses(), {"sdist_id":list[i], "num_to_predict":num_to_predict, "last_rec_date":"2010-07-07"}]
- );
- util.functional.map_list(
- robj,
- function(o) {
- alert('debug: ' + o.date_expected());
- }
- );
- }
- return;
-
- /*JSAN.use('util.functional');
- var list = util.functional.map_list(
- robj,
- function (o) {
- o.distribution(obj.sstr_id);
- return o;
- }
- );*/
-
- var robj = obj.network.request(
- 'open-ils.serial',
- 'open-ils.serial.item.fleshed.batch.update',
- [ ses(), list ]
- );
-
- //obj.refresh_list('main');
-
- } catch(E) {
- obj.error.standard_unexpected_error_alert('cmd_make_predictions failed!',E);
- }
- }
- ],
/*dbw2 'sel_distribution_details' : [
['command'],
function() {
@@ -748,132 +564,15 @@
obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.print_spine.error'),E);
}
}
- ],
- 'cmd_edit_subscriptions' : [
- ['command'],
- function() {
- try {
- JSAN.use('util.functional');
- var list = util.functional.map_list(
- util.functional.filter_list(
- obj.sel_list,
- function (o) {
- return o.split(/_/)[0] == 'sdist';
- }
- ),
- function (o) {
- return o.split(/_/)[1];
- }
- );
- if (list.length == 0) return;
-
- 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(),
- util.functional.map_list(
- list,
- function (o) {
- return obj.map_sdist[ 'sdist_' + o ].owning_lib();
- }
- ),
- [ 'UPDATE_VOLUME' ]
- ]
- ).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.edit_volume.permission_error'));
- return; // no read-only view for this interface
- }
-
- list = util.functional.map_list(
- list,
- function (o) {
- var my_sdist = obj.map_sdist['sdist_' + o];
- return function(r){return r;}(my_sdist);
- }
- );
-
- var title;
- if (list.length == 1) {
- title = document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.title');
- } else {
- title = document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.title.plural');
- }
-
- JSAN.use('util.window'); var win = new util.window();
- //obj.data.volumes_temp = js2JSON( list );
- //obj.data.stash('volumes_temp');
- var my_xulG = win.open(
- window.xulG.url_prefix(urls.XUL_VOLUME_EDITOR),
- title,
- 'chrome,modal,resizable',
- { 'subscriptions' : JSON2js(js2JSON(list)) }
- );
-
- // FIXME -- need to unique the temp space, and not rely on modalness of window
- //obj.data.stash_retrieve();
- if (typeof my_xulG.update_these_subscriptions == 'undefined') { return; }
- var subscriptions = my_xulG.subscriptions;
- if (!subscriptions) return;
-
- subscriptions = util.functional.filter_list(
- subscriptions,
- function (o) {
- return o.ischanged() == '1';
- }
- );
-
- subscriptions = util.functional.map_list(
- subscriptions,
- function (o) {
- o.record( obj.docid ); // staff client 2 did not do this. Does it matter?
- return o;
- }
- );
-
- if (subscriptions.length == 0) return;
-
- try {
- var r = obj.network.request(
- api.FM_ACN_TREE_UPDATE.app,
- api.FM_ACN_TREE_UPDATE.method,
- [ ses(), subscriptions, true ]
- );
- if (typeof r.ilsevent != 'undefined') {
- switch(Number(r.ilsevent)) {
- case 1705 : // VOLUME_LABEL_EXISTS
- alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.failed'));
- break;
- default: throw(r);
- }
- } else {
- alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.success'));
- }
- } catch(E) {
- obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.error'),E);
- }
- obj.refresh_list();
-
- } catch(E) {
- obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.edit_volume.exception'),E);
- }
- }
- ], dbw2*/
+ ]
+ dbw2*/
}
}
);
obj.list_init(params);
- obj.org_ids = obj.network.simple_request('FM_SSUB_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative',[ obj.docid ]);
+ obj.org_ids = obj.network.simple_request('FM_SDIST_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative',[ obj.docid ]);
if (typeof obj.org_ids.ilsevent != 'undefined') throw(obj.org_ids);
JSAN.use('util.functional');
obj.org_ids = util.functional.map_list( obj.org_ids, function (o) { return Number(o); });
@@ -890,6 +589,9 @@
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','sdist_lib_menu'); document.getElementById('serial_dist_lib_menu').appendChild(ml);
//TODO: class this menu properly
@@ -926,10 +628,12 @@
file = new util.file('manage_dists_prefs.'+obj.data.server_unadorned);
util.widgets.load_attributes(file);
- ml.value = ml.getAttribute('value');
- if (! ml.value) {
- ml.value = org.id();
- ml.setAttribute('value',ml.value);
+ obj.default_lib = ml.getAttribute('value');
+ ml.value = obj.default_lib;
+ if (! obj.default_lib) {
+ obj.default_lib = org.id();
+ ml.setAttribute('value',obj.default_lib);
+ ml.value = obj.default_lib;
}
document.getElementById('show_sdists').addEventListener(
@@ -950,7 +654,7 @@
false
);
- obj.show_my_libs( ml.value );
+ obj.show_my_libs( obj.default_lib );
JSAN.use('util.exec'); var exec = new util.exec(20); exec.timer(obj.funcs,100);
@@ -970,108 +674,11 @@
if (typeof org != 'object') org = obj.data.hash.aou[ org ];
}
obj.show_libs( org, false );
-
- var p_org = obj.data.hash.aou[ org.parent_ou() ];
- if (p_org) {
- obj.funcs.push( function() {
- document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
- document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true');
- document.getElementById('sdist_lib_menu').setAttribute('disabled','true');
- } );
- for (var i = 0; i < p_org.children().length; i++) {
- obj.funcs.push(
- function(o) {
- return function() {
- obj.show_libs( o, false );
- }
- }( p_org.children()[i] )
- );
- }
- obj.funcs.push( function() {
- document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
- document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','false');
- document.getElementById('sdist_lib_menu').setAttribute('disabled','false');
- } );
- }
} catch(E) {
alert(E);
}
},
- 'show_all_libs' : function() {
- var obj = this;
- try {
- obj.show_my_libs();
-
- obj.show_libs( obj.data.tree.aou );
-
- obj.funcs.push( function() {
- document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
- document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true');
- document.getElementById('sdist_lib_menu').setAttribute('disabled','true');
- } );
-
- for (var i = 0; i < obj.data.tree.aou.children().length; i++) {
- obj.funcs.push(
- function(o) {
- return function() {
- obj.show_libs( o );
- }
- }( obj.data.tree.aou.children()[i] )
- );
- }
- obj.funcs.push( function() {
- document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
- document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','false');
- document.getElementById('sdist_lib_menu').setAttribute('disabled','false');
- } );
-
- } catch(E) {
- alert(E);
- }
- },
-
- 'show_libs_with_distributions' : function() {
- var obj = this;
- try {
- JSAN.use('util.functional');
-
- var orgs = util.functional.map_list(
- obj.org_ids,
- function(id) { return obj.data.hash.aou[id]; }
- ).sort(
- function( a, b ) {
- if (a.shortname() < b.shortname()) return -1;
- if (a.shortname() > b.shortname()) return 1;
- return 0;
- }
- );
- obj.funcs.push( function() {
- document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
- document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true');
- document.getElementById('sdist_lib_menu').setAttribute('disabled','true');
- } );
-
- for (var i = 0; i < orgs.length; i++) {
- obj.funcs.push(
- function(o) {
- return function() {
- obj.show_libs(o,false);
- }
- }( orgs[i] )
- );
- }
- obj.funcs.push( function() {
- document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
- document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','false');
- document.getElementById('sdist_lib_menu').setAttribute('disabled','false');
- } );
-
- } catch(E) {
- alert(E);
- }
- },
-
'show_libs' : function(start_aou,show_open) {
var obj = this;
try {
@@ -1164,9 +771,35 @@
var sdist_tree = obj.map_sdist[ 'sdist_' + sdist_id ];
obj.funcs.push( function() {
document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
- document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true');
document.getElementById('sdist_lib_menu').setAttribute('disabled','true');
} );
+ if (sdist_tree.basic_summary()) {
+ obj.funcs.push(
+ function(c,a) {
+ return function() {
+ obj.append_member(c,a,[],'sbsum', false);
+ }
+ }( sdist_tree.basic_summary(), sdist_tree )
+ );
+ }
+ if (sdist_tree.supplement_summary()) {
+ obj.funcs.push(
+ function(c,a) {
+ return function() {
+ obj.append_member(c,a,[],'sssum', false);
+ }
+ }( sdist_tree.supplement_summary(), sdist_tree )
+ );
+ }
+ if (sdist_tree.index_summary()) {
+ obj.funcs.push(
+ function(c,a) {
+ return function() {
+ obj.append_member(c,a,[],'sisum', false);
+ }
+ }( sdist_tree.index_summary(), sdist_tree )
+ );
+ }
if (sdist_tree.streams()) {
for (var i = 0; i < sdist_tree.streams().length; i++) {
obj.funcs.push(
@@ -1217,33 +850,8 @@
)
}
*/
- /* DISTS_TAB
- if (sdist_tree.issuances()) {
- for (var i = 0; i < sdist_tree.issuances().length; i++) {
- obj.funcs.push(
- function(c,a) {
- return function() {
- obj.append_member(c,a,[],'summary');
- }
- }( sdist_tree.issuances()[i], sdist_tree )
- )
- }
- }
- if (sdist_tree.scaps()) {
- for (var i = 0; i < sdist_tree.scaps().length; i++) {
- obj.funcs.push(
- function(c,a) {
- return function() {
- obj.append_member(c,a,[],'scap');
- }
- }( sdist_tree.scaps()[i], sdist_tree )
- )
- }
- }
- */
obj.funcs.push( function() {
document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
- document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','false');
document.getElementById('sdist_lib_menu').setAttribute('disabled','false');
} );
} catch(E) {
@@ -1254,7 +862,7 @@
'on_click_sdist' : function(sdist_ids,twisty) {
var obj = this;
try {
- // draw sstr editor
+ // draw sdist editor
if (typeof twisty == 'undefined') {
var params = {};
params.sdist_ids = sdist_ids;
@@ -1280,51 +888,68 @@
}
},
- 'on_click_summary' : function(summary_ids,twisty) {
+ 'on_click_sbsum' : function(sbsum_ids,twisty) {
var obj = this;
try {
- // draw summary editor
+ // draw sbsum editor
if (typeof twisty == 'undefined') {
var params = {};
- params.summary_ids = summary_ids;
- obj.editor_init('summary', 'edit', params);
+ params.sbsum_ids = sbsum_ids;
+ obj.editor_init('sbsum', 'edit', params);
}
} catch(E) {
alert(E);
}
},
- 'on_click_act' : function(act_ids,twisty) {
+ 'on_click_sssum' : function(sssum_ids,twisty) {
var obj = this;
try {
- // draw act editor
+ // draw sssum editor
if (typeof twisty == 'undefined') {
var params = {};
- params.act_ids = act_ids;
- obj.editor_init('act', 'edit', params);
+ params.sssum_ids = sssum_ids;
+ obj.editor_init('sssum', 'edit', params);
}
} catch(E) {
alert(E);
}
},
+ 'on_click_sisum' : function(sisum_ids,twisty) {
+ var obj = this;
+ try {
+ // draw sisum editor
+ if (typeof twisty == 'undefined') {
+ var params = {};
+ params.sisum_ids = sisum_ids;
+ obj.editor_init('sisum', 'edit', params);
+ }
+ } catch(E) {
+ alert(E);
+ }
+ },
+
'on_click_aou' : function(org_id,twisty) {
var obj = this;
var org = obj.data.hash.aou[ org_id ];
+ var default_aou = obj.data.hash.aou[obj.default_lib];
obj.funcs.push( function() {
document.getElementById('cmd_refresh_list').setAttribute('disabled','true');
- document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','true');
document.getElementById('sdist_lib_menu').setAttribute('disabled','true');
} );
if (org.children()) {
for (var i = 0; i < org.children().length; i++) {
- obj.funcs.push(
- function(o,p) {
- return function() {
- obj.append_org(o,p)
- }
- }(org.children()[i],org)
- );
+ var child = org.children()[i];
+ if (orgIsMine(default_aou,child)) {
+ obj.funcs.push(
+ function(o,p) {
+ return function() {
+ obj.append_org(o,p)
+ }
+ }(child,org)
+ );
+ }
}
}
if (obj.map_sdist[ 'aou_' + org_id ]) {
@@ -1340,7 +965,6 @@
}
obj.funcs.push( function() {
document.getElementById('cmd_refresh_list').setAttribute('disabled','false');
- document.getElementById('cmd_show_libs_with_distributions').setAttribute('disabled','false');
document.getElementById('sdist_lib_menu').setAttribute('disabled','false');
} );
@@ -1492,36 +1116,6 @@
};
nparams = obj.list.append(sstr_group_node_data);
obj.map_tree[ 'sdist_sstr_group_' + sdist_tree.id() ] = nparams.my_node;
-
-/* DIST_TAB
- var summary_group_node_data = {
- 'row' : {
- 'my' : {
- 'label' : 'Issuances',
- }
- },
- 'retrieve_id' : 'summary-group_' + sdist_tree.id(),
- 'node' : node,
- 'to_bottom' : true,
- 'no_auto_select' : true,
- };
- nparams = obj.list.append(summary_group_node_data);
- obj.map_tree[ 'sdist_summary_group_' + sdist_tree.id() ] = nparams.my_node;
-
- var scap_group_node_data = {
- 'row' : {
- 'my' : {
- 'label' : 'Captions/Patterns',
- }
- },
- 'retrieve_id' : 'scap-group_' + sdist_tree.id(),
- 'node' : node,
- 'to_bottom' : true,
- 'no_auto_select' : true,
- };
- nparams = obj.list.append(scap_group_node_data);
- obj.map_tree[ 'sdist_scap_group_' + sdist_tree.id() ] = nparams.my_node;
-*/
} catch(E) {
dump(E+'\n');
alert(E);
@@ -1589,13 +1183,13 @@
var columns = [
{
'id' : 'tree_location',
- 'label' : document.getElementById('catStrings').getString('staff.cat.copy_browser.list_init.tree_location'),
+ 'label' : 'Location',
'flex' : 1, 'primary' : true, 'hidden' : false,
- 'render' : function(my) { return my.label ? my.label : my.sstr ? 'Stream : #' + my.sstr.id() : my.sdist ? 'Distribution : #' + my.sdist.id() : my.aou ? my.aou.shortname() + " : " + my.aou.name() : "???"; },
+ 'render' : function(my) { return my.label ? my.label : my.sstr ? 'Stream : #' + my.sstr.id() : my.sbsum ? 'Basic Summary' : my.sssum ? 'Supplement Summary' : my.sisum ? 'Index Summary' : my.sdist ? my.sdist.label() : my.aou ? my.aou.shortname() + " : " + my.aou.name() : "???"; },
},
{
'id' : 'distribution_count',
- 'label' : 'Subscriptions',
+ 'label' : 'Distributions',
'flex' : 0, 'primary' : false, 'hidden' : false,
'render' : function(my) { return my.distribution_count; },
}
@@ -1673,7 +1267,7 @@
'toggle_actions' : function() {
var obj = this;
try {
- var found_aou = false; var found_sdist = false; var found_sstr = false; var found_summary = false; var found_act = false; var found_sstr_group = false; var found_summary_group = false; var found_act_group = false;
+ var found_aou = false; var found_sdist = false; var found_sstr = false; var found_sbsum = false; var found_sssum = false; var found_sisum = false; var found_sstr_group = false;
for (var i = 0; i < obj.sel_list.length; i++) {
var type = obj.sel_list[i].split(/_/)[0];
switch(type) {
@@ -1682,15 +1276,13 @@
break;
case 'sdist' : found_sdist = true; break;
case 'sstr' : found_sstr = true; break;
- case 'summary' : found_summary = true; break;
- case 'act' : found_act = true; break;
+ case 'sbsum' : found_sbsum = true; break;
+ case 'sssum' : found_sssum = true; break;
+ case 'sisum' : found_sisum = true; break;
case 'sstr-group' : found_sstr_group = true; break;
- case 'summary-group' : found_summary_group = true; break;
- case 'act-group' : found_act_group = true; break;
}
}
obj.controller.view.cmd_add_sstr.setAttribute('disabled','true');
- obj.controller.view.cmd_make_predictions.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');
@@ -1704,14 +1296,16 @@
if (found_sstr_group) {
obj.controller.view.cmd_add_sstr.setAttribute('disabled','false');
}
- if (found_summary_group) {
- }
if (found_sstr) {
obj.controller.view.cmd_delete_sstr.setAttribute('disabled','false');
obj.controller.view.cmd_transfer_sstrs.setAttribute('disabled','false');
}
- if (found_summary) {
+ if (found_sbsum) {
}
+ if (found_sssum) {
+ }
+ if (found_sisum) {
+ }
} catch(E) {
obj.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.actions.error'),E);
}
@@ -1724,7 +1318,7 @@
obj.map_tree = {};
obj.map_sdist = {};
//obj.map_sstr = {};
- obj.org_ids = obj.network.simple_request('FM_SSUB_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative',[ obj.docid ]);
+ obj.org_ids = obj.network.simple_request('FM_SDIST_AOU_IDS_RETRIEVE_VIA_RECORD_ID.authoritative',[ obj.docid ]);
if (typeof obj.org_ids.ilsevent != 'undefined') throw(obj.org_ids);
JSAN.use('util.functional');
obj.org_ids = util.functional.map_list( obj.org_ids, function (o) { return Number(o); });
@@ -1732,7 +1326,8 @@
var org = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
obj.show_libs( org );
*/
- obj.show_my_libs( document.getElementById('sdist_lib_menu').value );
+ obj.default_lib = document.getElementById('sdist_lib_menu').value;
+ obj.show_my_libs( obj.default_lib );
} catch(E) {
this.error.standard_unexpected_error_alert(document.getElementById('catStrings').getString('staff.cat.copy_browser.refresh_list.error'),E);
}
Modified: branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_dists.xul
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_dists.xul 2010-11-08 21:37:42 UTC (rev 18668)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_dists.xul 2010-11-08 21:37:58 UTC (rev 18669)
@@ -10,7 +10,9 @@
<?xul-overlay href="/xul/server/serial/sdist2_editor.xul"?>
<?xul-overlay href="/xul/server/serial/sstr_editor.xul"?>
-<?xul-overlay href="/xul/server/serial/act_editor.xul"?>
+<?xul-overlay href="/xul/server/serial/sbsum_editor.xul"?>
+<?xul-overlay href="/xul/server/serial/sisum_editor.xul"?>
+<?xul-overlay href="/xul/server/serial/sssum_editor.xul"?>
<overlay id="serial_manage_dists_overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -92,8 +94,9 @@
<description value="Please select an object to edit"/>
<vbox id="serial_sdist2_editor_panel" />
<vbox id="serial_sstr_editor_panel" />
- <vbox id="serial_summary_editor_panel" />
- <vbox id="serial_act_editor_panel" />
+ <vbox id="serial_sbsum_editor_panel" />
+ <vbox id="serial_sssum_editor_panel" />
+ <vbox id="serial_sisum_editor_panel" />
</deck>
</hbox>
</tabpanel>
Modified: branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_subs.js
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_subs.js 2010-11-08 21:37:42 UTC (rev 18668)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/serial/manage_subs.js 2010-11-08 21:37:58 UTC (rev 18669)
@@ -1557,7 +1557,7 @@
var columns = [
{
'id' : 'tree_location',
- 'label' : document.getElementById('catStrings').getString('staff.cat.copy_browser.list_init.tree_location'),
+ 'label' : 'Location',
'flex' : 1, 'primary' : true, 'hidden' : false,
'render' : function(my) { return my.sdist ? my.sdist.label() : my.siss ? my.siss.label() : my.scap ? 'C/P : #' + my.scap.id() : my.ssub ? 'Subscription : #' + my.ssub.id() : my.aou ? my.aou.shortname() + " : " + my.aou.name() : my.label ? my.label : "???"; },
},
Added: branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sbsum_editor.js
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sbsum_editor.js (rev 0)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sbsum_editor.js 2010-11-08 21:37:58 UTC (rev 18669)
@@ -0,0 +1,121 @@
+dump('entering serial/sbsum_editor.js\n');
+// vim:noet:sw=4:ts=4:
+
+JSAN.use('serial.editor_base');
+
+if (typeof serial == 'undefined') serial = {};
+serial.sbsum_editor = function (params) {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ JSAN.use('util.error'); this.error = new util.error();
+ JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'});
+ JSAN.use('util.network'); this.network = new util.network();
+ } catch(E) {
+ dump('serial/sbsum_editor: ' + E + '\n');
+ }
+
+ /* This keeps track of what fields have been edited for styling purposes */
+ this.changed = {};
+
+ /* This holds the original values for prepopulating the field editors */
+ this.editor_values = {};
+
+};
+
+serial.sbsum_editor.prototype = {
+ // we could do this with non-standard '__proto__' property instead
+ 'editor_base_init' : serial.editor_base.editor_base_init,
+ 'editor_base_apply' : serial.editor_base.editor_base_apply,
+ 'editor_base_save' : serial.editor_base.editor_base_save,
+
+ 'fm_type' : 'sbsum',
+ 'fm_type_plural' : 'sbsums',
+
+ 'init' : function (params) {
+ var obj = this;
+
+ params.retrieve_function = 'FM_SBSUM_BATCH_RETRIEVE.authoritative';
+
+ obj.editor_base_init(params);
+
+ /* Do it */
+ obj.summarize( obj.sbsums );
+ obj.render();
+ },
+
+ /******************************************************************************************************/
+ /* Restore backup copies */
+
+ 'reset' : serial.editor_base.editor_base_reset,
+
+ /******************************************************************************************************/
+ /* Apply a value to a specific field on all the copies being edited */
+
+ 'apply' : function(field,value) {
+ var obj = this;
+
+ obj.editor_base_apply(field, value);
+ },
+
+ /******************************************************************************************************/
+
+ 'init_panes' : function () {
+ var obj = this;
+ obj.panes_and_field_names = {
+
+ /* These get shown in the left panel */
+ 'sbsum_editor_left_pane' :
+ [
+ [
+ 'ID',
+ {
+ render: '"ID : " + fm.id();',
+ //input: 'c = function(v){ obj.apply("distribution",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+
+ }
+ ],
+ [
+ 'Textual Holdings',
+ {
+ render: 'fm.textual_holdings() == null ? "" : fm.textual_holdings();',
+ input: 'c = function(v){ obj.apply("textual_holdings",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("size", 85); x.setAttribute("value",obj.editor_values.textual_holdings); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+ value_key: 'textual_holdings'
+ }
+ ],
+ [
+ 'Generated Coverage',
+ {
+ render: 'fm.generated_coverage() == null ? "" : fm.generated_coverage();'
+ }
+ ]
+ ]
+ };
+ },
+
+ /******************************************************************************************************/
+ /* This loops through all our fieldnames and all the copies, tallying up counts for the different values */
+
+ 'summarize' : serial.editor_base.editor_base_summarize,
+
+ /******************************************************************************************************/
+ /* Display the summarized data and inputs for editing */
+
+ 'render' : serial.editor_base.editor_base_render,
+
+ /******************************************************************************************************/
+ /* This actually draws the change button and input widget for a given field */
+ 'render_input' : serial.editor_base.editor_base_render_input,
+
+ /******************************************************************************************************/
+ /* save the streams */
+
+ 'save' : function() {
+ var obj = this;
+ obj.editor_base_save('open-ils.serial.basic_summary.batch.update');
+ },
+
+ /******************************************************************************************************/
+ 'save_attributes' : serial.editor_base.editor_base_save_attributes
+};
+
+dump('exiting serial/sbsum_editor.js\n');
Added: branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sbsum_editor.xul
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sbsum_editor.xul (rev 0)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sbsum_editor.xul 2010-11-08 21:37:58 UTC (rev 18669)
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Stream Editor Overlay -->
+
+<!-- LOCALIZATION -->
+<!DOCTYPE overlay PUBLIC "" ""[
+ <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
+]>
+
+<overlay id="serial_sbsum_editor_panel_overlay"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <vbox flex="1" id="serial_sbsum_editor_panel" class="my_overflow">
+ <vbox id="brief_display_box"/>
+
+ <hbox flex="1" style="overflow: auto">
+ <vbox flex="1">
+ <label value="Basic Summary" style="font-weight: bold; font-size: large"/>
+ <vbox id="sbsum_editor_left_pane" flex="1"/>
+ </vbox>
+ </hbox>
+
+ <hbox id="sbsum_editor_nav">
+ <spacer flex="1"/>
+ <button id="sbsum_save" label="&staff.serial.sbsum_editor.modify;" hidden="true" accesskey="&staff.serial.sbsum_editor.modify.accesskey;" oncommand="g.manage_dists.sbsum_editor.save()" />
+ <!--<button id="cancel" label="&staff.cat.copy_editor.cancel.label;" accesskey="&staff.cat.copy_editor.cancel.accesskey;" oncommand="window.close();"/>-->
+ </hbox>
+
+ <spacer/>
+ </vbox>
+
+</overlay>
+
Added: branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sisum_editor.js
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sisum_editor.js (rev 0)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sisum_editor.js 2010-11-08 21:37:58 UTC (rev 18669)
@@ -0,0 +1,121 @@
+dump('entering serial/sisum_editor.js\n');
+// vim:noet:sw=4:ts=4:
+
+JSAN.use('serial.editor_base');
+
+if (typeof serial == 'undefined') serial = {};
+serial.sisum_editor = function (params) {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ JSAN.use('util.error'); this.error = new util.error();
+ JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'});
+ JSAN.use('util.network'); this.network = new util.network();
+ } catch(E) {
+ dump('serial/sisum_editor: ' + E + '\n');
+ }
+
+ /* This keeps track of what fields have been edited for styling purposes */
+ this.changed = {};
+
+ /* This holds the original values for prepopulating the field editors */
+ this.editor_values = {};
+
+};
+
+serial.sisum_editor.prototype = {
+ // we could do this with non-standard '__proto__' property instead
+ 'editor_base_init' : serial.editor_base.editor_base_init,
+ 'editor_base_apply' : serial.editor_base.editor_base_apply,
+ 'editor_base_save' : serial.editor_base.editor_base_save,
+
+ 'fm_type' : 'sisum',
+ 'fm_type_plural' : 'sisums',
+
+ 'init' : function (params) {
+ var obj = this;
+
+ params.retrieve_function = 'FM_SISUM_BATCH_RETRIEVE.authoritative';
+
+ obj.editor_base_init(params);
+
+ /* Do it */
+ obj.summarize( obj.sisums );
+ obj.render();
+ },
+
+ /******************************************************************************************************/
+ /* Restore backup copies */
+
+ 'reset' : serial.editor_base.editor_base_reset,
+
+ /******************************************************************************************************/
+ /* Apply a value to a specific field on all the copies being edited */
+
+ 'apply' : function(field,value) {
+ var obj = this;
+
+ obj.editor_base_apply(field, value);
+ },
+
+ /******************************************************************************************************/
+
+ 'init_panes' : function () {
+ var obj = this;
+ obj.panes_and_field_names = {
+
+ /* These get shown in the left panel */
+ 'sisum_editor_left_pane' :
+ [
+ [
+ 'ID',
+ {
+ render: '"ID : " + fm.id();'
+ //input: 'c = function(v){ obj.apply("distribution",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+
+ }
+ ],
+ [
+ 'Textual Holdings',
+ {
+ render: 'fm.textual_holdings() == null ? "" : fm.textual_holdings();',
+ input: 'c = function(v){ obj.apply("textual_holdings",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("size", 85); x.setAttribute("value",obj.editor_values.textual_holdings); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+ value_key: 'textual_holdings'
+ }
+ ],
+ [
+ 'Generated Coverage',
+ {
+ render: 'fm.generated_coverage() == null ? "" : fm.generated_coverage();'
+ }
+ ]
+ ]
+ };
+ },
+
+ /******************************************************************************************************/
+ /* This loops through all our fieldnames and all the copies, tallying up counts for the different values */
+
+ 'summarize' : serial.editor_base.editor_base_summarize,
+
+ /******************************************************************************************************/
+ /* Display the summarized data and inputs for editing */
+
+ 'render' : serial.editor_base.editor_base_render,
+
+ /******************************************************************************************************/
+ /* This actually draws the change button and input widget for a given field */
+ 'render_input' : serial.editor_base.editor_base_render_input,
+
+ /******************************************************************************************************/
+ /* save the streams */
+
+ 'save' : function() {
+ var obj = this;
+ obj.editor_base_save('open-ils.serial.index_summary.batch.update');
+ },
+
+ /******************************************************************************************************/
+ 'save_attributes' : serial.editor_base.editor_base_save_attributes
+};
+
+dump('exiting serial/sisum_editor.js\n');
Added: branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sisum_editor.xul
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sisum_editor.xul (rev 0)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sisum_editor.xul 2010-11-08 21:37:58 UTC (rev 18669)
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Index Summary Editor Overlay -->
+
+<!-- LOCALIZATION -->
+<!DOCTYPE overlay PUBLIC "" ""[
+ <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
+]>
+
+<overlay id="serial_sisum_editor_panel_overlay"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <vbox flex="1" id="serial_sisum_editor_panel" class="my_overflow">
+ <vbox id="brief_display_box"/>
+
+ <hbox flex="1" style="overflow: auto">
+ <vbox flex="1">
+ <label value="Index Summary" style="font-weight: bold; font-size: large"/>
+ <vbox id="sisum_editor_left_pane" flex="1"/>
+ </vbox>
+ </hbox>
+
+ <hbox id="sisum_editor_nav">
+ <spacer flex="1"/>
+ <button id="sisum_save" label="&staff.serial.sisum_editor.modify;" hidden="true" accesskey="&staff.serial.sisum_editor.modify.accesskey;" oncommand="g.manage_dists.sisum_editor.save()" />
+ <!--<button id="cancel" label="&staff.cat.copy_editor.cancel.label;" accesskey="&staff.cat.copy_editor.cancel.accesskey;" oncommand="window.close();"/>-->
+ </hbox>
+
+ <spacer/>
+ </vbox>
+
+</overlay>
+
Added: branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sssum_editor.js
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sssum_editor.js (rev 0)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sssum_editor.js 2010-11-08 21:37:58 UTC (rev 18669)
@@ -0,0 +1,121 @@
+dump('entering serial/sssum_editor.js\n');
+// vim:noet:sw=4:ts=4:
+
+JSAN.use('serial.editor_base');
+
+if (typeof serial == 'undefined') serial = {};
+serial.sssum_editor = function (params) {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ JSAN.use('util.error'); this.error = new util.error();
+ JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'});
+ JSAN.use('util.network'); this.network = new util.network();
+ } catch(E) {
+ dump('serial/sssum_editor: ' + E + '\n');
+ }
+
+ /* This keeps track of what fields have been edited for styling purposes */
+ this.changed = {};
+
+ /* This holds the original values for prepopulating the field editors */
+ this.editor_values = {};
+
+};
+
+serial.sssum_editor.prototype = {
+ // we could do this with non-standard '__proto__' property instead
+ 'editor_base_init' : serial.editor_base.editor_base_init,
+ 'editor_base_apply' : serial.editor_base.editor_base_apply,
+ 'editor_base_save' : serial.editor_base.editor_base_save,
+
+ 'fm_type' : 'sssum',
+ 'fm_type_plural' : 'sssums',
+
+ 'init' : function (params) {
+ var obj = this;
+
+ params.retrieve_function = 'FM_SSSUM_BATCH_RETRIEVE.authoritative';
+
+ obj.editor_base_init(params);
+
+ /* Do it */
+ obj.summarize( obj.sssums );
+ obj.render();
+ },
+
+ /******************************************************************************************************/
+ /* Restore backup copies */
+
+ 'reset' : serial.editor_base.editor_base_reset,
+
+ /******************************************************************************************************/
+ /* Apply a value to a specific field on all the copies being edited */
+
+ 'apply' : function(field,value) {
+ var obj = this;
+
+ obj.editor_base_apply(field, value);
+ },
+
+ /******************************************************************************************************/
+
+ 'init_panes' : function () {
+ var obj = this;
+ obj.panes_and_field_names = {
+
+ /* These get shown in the left panel */
+ 'sssum_editor_left_pane' :
+ [
+ [
+ 'ID',
+ {
+ render: '"ID : " + fm.id();',
+ //input: 'c = function(v){ obj.apply("distribution",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+
+ }
+ ],
+ [
+ 'Textual Holdings',
+ {
+ render: 'fm.textual_holdings() == null ? "" : fm.textual_holdings();',
+ input: 'c = function(v){ obj.apply("textual_holdings",v); if (typeof post_c == "function") post_c(v); }; x = document.createElement("textbox"); x.setAttribute("size", 85); x.setAttribute("value",obj.editor_values.textual_holdings); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
+ value_key: 'textual_holdings'
+ }
+ ],
+ [
+ 'Generated Coverage',
+ {
+ render: 'fm.generated_coverage() == null ? "" : fm.generated_coverage();'
+ }
+ ]
+ ]
+ };
+ },
+
+ /******************************************************************************************************/
+ /* This loops through all our fieldnames and all the copies, tallying up counts for the different values */
+
+ 'summarize' : serial.editor_base.editor_base_summarize,
+
+ /******************************************************************************************************/
+ /* Display the summarized data and inputs for editing */
+
+ 'render' : serial.editor_base.editor_base_render,
+
+ /******************************************************************************************************/
+ /* This actually draws the change button and input widget for a given field */
+ 'render_input' : serial.editor_base.editor_base_render_input,
+
+ /******************************************************************************************************/
+ /* save the streams */
+
+ 'save' : function() {
+ var obj = this;
+ obj.editor_base_save('open-ils.serial.supplement_summary.batch.update');
+ },
+
+ /******************************************************************************************************/
+ 'save_attributes' : serial.editor_base.editor_base_save_attributes
+};
+
+dump('exiting serial/sssum_editor.js\n');
Added: branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sssum_editor.xul
===================================================================
--- branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sssum_editor.xul (rev 0)
+++ branches/serials-integration/Open-ILS/xul/staff_client/server/serial/sssum_editor.xul 2010-11-08 21:37:58 UTC (rev 18669)
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Supplement Summary Editor Overlay -->
+
+<!-- LOCALIZATION -->
+<!DOCTYPE overlay PUBLIC "" ""[
+ <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
+]>
+
+<overlay id="serial_sssum_editor_panel_overlay"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <vbox flex="1" id="serial_sssum_editor_panel" class="my_overflow">
+ <vbox id="brief_display_box"/>
+
+ <hbox flex="1" style="overflow: auto">
+ <vbox flex="1">
+ <label value="Supplement Summary" style="font-weight: bold; font-size: large"/>
+ <vbox id="sssum_editor_left_pane" flex="1"/>
+ </vbox>
+ </hbox>
+
+ <hbox id="sssum_editor_nav">
+ <spacer flex="1"/>
+ <button id="sssum_save" label="&staff.serial.sssum_editor.modify;" hidden="true" accesskey="&staff.serial.sssum_editor.modify.accesskey;" oncommand="g.manage_dists.sssum_editor.save()" />
+ <!--<button id="cancel" label="&staff.cat.copy_editor.cancel.label;" accesskey="&staff.cat.copy_editor.cancel.accesskey;" oncommand="window.close();"/>-->
+ </hbox>
+
+ <spacer/>
+ </vbox>
+
+</overlay>
+
More information about the open-ils-commits
mailing list