[open-ils-commits] r15183 - in trunk/Open-ILS: src/sql/Pg src/sql/Pg/upgrade xul/staff_client/server/cat xul/staff_client/server/locale/en-US xul/staff_client/server/patron (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Dec 17 02:40:11 EST 2009
Author: phasefx
Date: 2009-12-17 02:40:06 -0500 (Thu, 17 Dec 2009)
New Revision: 15183
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0117.data.org-setting-notes-require-initials.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
trunk/Open-ILS/xul/staff_client/server/cat/copy_notes.xul
trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties
trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
trunk/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js
trunk/Open-ILS/xul/staff_client/server/patron/info_notes.xul
trunk/Open-ILS/xul/staff_client/server/patron/new_standing_penalty.js
Log:
Org unit setting for requiring staff initials with copy/patron notes, and I18N for similar setting for standing penalties.
Implemented the initial fields for copy/patron notes.
Localizable format for staff initials, and option for an initials date (though it's %F format for saving space and not localized).
Removed the "Note added." speedbump alerts.
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-12-17 07:35:22 UTC (rev 15182)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-12-17 07:40:06 UTC (rev 15183)
@@ -51,7 +51,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0116'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0117'); -- phasefx
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2009-12-17 07:35:22 UTC (rev 15182)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2009-12-17 07:40:06 UTC (rev 15183)
@@ -1719,10 +1719,15 @@
'bool' ),
( 'ui.circ.standing_penalty.require_initials',
- 'Require staff initials for entry/edit of standing penalties.',
- null,
+ oils_i18n_gettext('ui.circ.standing_penalty.require_initials', 'GUI: Require staff initials for entry/edit of standing penalties.', 'coust', 'label'),
+ oils_i18n_gettext('ui.circ.standing_penalty.require_initials', 'Appends staff initials and edit date into penalty note.', 'coust', 'description'),
'bool' ),
+( 'ui.circ_and_cat.notes.require_initials',
+ oils_i18n_gettext('ui.circ_and_cat.notes.require_initials', 'GUI: Require staff initials for entry/edit of item and patron notes.', 'coust', 'label'),
+ oils_i18n_gettext('ui.circ_and_cat.notes.require_initials', 'Appends staff initials and edit date into note content.', 'coust', 'description'),
+ 'bool' ),
+
( 'ui.general.button_bar',
'Button bar',
null,
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0117.data.org-setting-notes-require-initials.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0117.data.org-setting-notes-require-initials.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0117.data.org-setting-notes-require-initials.sql 2009-12-17 07:40:06 UTC (rev 15183)
@@ -0,0 +1,11 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0117'); -- phasefx
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES
+( 'ui.circ_and_cat.notes.require_initials',
+ oils_i18n_gettext('ui.circ_and_cat.notes.require_initials', 'GUI: Require staff initials for entry/edit of item and patron notes.', 'coust', 'label'),
+ oils_i18n_gettext('ui.circ_and_cat.notes.require_initials', 'Appends staff initials and edit date into note content.', 'coust', 'description'),
+ 'bool' );
+
+COMMIT;
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_notes.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_notes.xul 2009-12-17 07:35:22 UTC (rev 15182)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_notes.xul 2009-12-17 07:40:06 UTC (rev 15183)
@@ -159,35 +159,36 @@
<rows> \
<row><label value="' + $('catStrings').getString('staff.cat.copy_notes.new_note.public') + '"/><checkbox id="pub" name="fancy_data" checked="false"/></row> \
<row><label value="' + $('catStrings').getString('staff.cat.copy_notes.new_note.title') + '"/><textbox id="title" name="fancy_data" context="clipboard"/></row> \
- <row><label value="' + $('catStrings').getString('staff.cat.copy_notes.new_note.note') + '"/><textbox multiline="true" id="note" name="fancy_data" context="clipboard"/></row> \
- <row><spacer/><hbox> \
+ <row><label value="' + $('catStrings').getString('staff.cat.copy_notes.new_note.note') + '"/><textbox multiline="true" id="note" name="fancy_data" context="clipboard"/></row>';
+ var show_initials = String( g.data.hash.aous['ui.circ_and_cat.notes.require_initials'] ) == 'true';
+ if (show_initials) {
+ xml += '<row><label value="'+$("catStrings").getString('staff.cat.copy_notes.new_note.initials')+'"/><textbox id="initials" name="fancy_required_data" context="clipboard"/></row>';
+ }
+ xml += '<row><spacer/><hbox> \
<button label="' + $('catStrings').getString('staff.cat.copy_notes.new_note.cancel.label') + '" name="fancy_cancel" accesskey="' + $('catStrings').getString('staff.cat.copy_notes.new_note.cancel.accesskey') + '"/> \
<button label="' + $('catStrings').getString('staff.cat.copy_notes.new_note.add_note.label') + '" accesskey="' + $('catStrings').getString('staff.cat.copy_notes.new_note.add_note.accesskey') + '" name="fancy_submit"/></hbox></row> \
</rows></grid></groupbox>';
- //g.data.init({'via':'stash'});
- //g.data.temp_note_xml = xml; g.data.stash('temp_note_xml');
JSAN.use('util.window'); var win = new util.window();
var fancy_prompt_data = win.open(
urls.XUL_FANCY_PROMPT,
- //+ '?xml_in_stash=temp_note_xml'
- //+ '&focus=' + window.escape('title')
- //+ '&title=' + window.escape('Add Note'),
'fancy_prompt', 'chrome,resizable,modal,width=700,height=500',
{ 'xml' : xml, 'focus' : 'title', 'title' : $('catStrings').getString('staff.cat.copy_notes.new_note.add_note.label') }
);
- //g.data.init({'via':'stash'});
if (fancy_prompt_data.fancy_status == 'complete') {
//alert(js2JSON(g.data.fancy_prompt_data));
var note = new acpn();
note.isnew(1);
note.title( fancy_prompt_data.title );
+ if (fancy_prompt_data.initials) {
+ fancy_prompt_data.note = fancy_prompt_data.note
+ + $("commonStrings").getFormattedString('staff.initials.format',[fancy_prompt_data.initials,util.date.formatted_date(new Date(),'%F')]);
+ }
note.value( fancy_prompt_data.note );
note.pub( get_bool( fancy_prompt_data.pub ) ? get_db_true() : get_db_false() );
note.owning_copy( g.copy_id );
var r = g.network.simple_request('FM_ACPN_CREATE',[ ses(), note ]);
if (typeof r.ilsevent != 'undefined') throw(r);
setTimeout(function() {
- alert($('catStrings').getString('staff.cat.copy_notes.new_note.success'));
refresh();},0
);
}
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2009-12-17 07:35:22 UTC (rev 15182)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2009-12-17 07:40:06 UTC (rev 15183)
@@ -211,11 +211,11 @@
staff.cat.copy_notes.new_note.public=Public?
staff.cat.copy_notes.new_note.title=Title
staff.cat.copy_notes.new_note.note=Note
+staff.cat.copy_notes.new_note.initials=Initials
staff.cat.copy_notes.new_note.cancel.label=Cancel
staff.cat.copy_notes.new_note.cancel.accesskey=C
staff.cat.copy_notes.new_note.add_note.label=Add Note
staff.cat.copy_notes.new_note.add_note.accesskey=A
-staff.cat.copy_notes.new_note.success=Note added.
staff.cat.copy_notes.new_note.error=The note was not likely created.
staff.cat.copy_summary.copy_id=Copy ID = %1$s
staff.cat.copy_summary.total_circs.label=Total Circs
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties 2009-12-17 07:35:22 UTC (rev 15182)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/common.properties 2009-12-17 07:40:06 UTC (rev 15183)
@@ -27,6 +27,8 @@
openils.global_util.content_window_jsobject.error=Error with get_contentWindow(%1$s) and wrappedJSObject: %2$s
openils.global_util.content_window.error=Error with get_contentWindow(%1$s): %2$s
openils.global_util.font_size.error=Error adjusting the font size: %1$s
+# Appended to notes with certain settings enabled. First position is staff initials, and second position is a date for when the initials were added.
+staff.initials.format= [ %1$s %2$s ]
staff.acp_label_barcode=Barcode
staff.acp_label_call_number=Call Number
staff.acp_label_circ_as_type=Circulate As Type
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties 2009-12-17 07:35:22 UTC (rev 15182)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties 2009-12-17 07:40:06 UTC (rev 15183)
@@ -259,12 +259,12 @@
staff.patron.info_notes.new_note.patron_visible.value=Patron Visible?
staff.patron.info_notes.new_note.title.value=Title
staff.patron.info_notes.new_note.note.value=Note
+staff.patron.info_notes.new_note.initials.value=Initials
staff.patron.info_notes.new_note.cancel.label=Cancel
staff.patron.info_notes.new_note.cancel.accesskey=C
staff.patron.info_notes.new_note.add.label=Add Note
staff.patron.info_notes.new_note.add.accesskey=A
staff.patron.info_notes.new_note.add_note_title=Add Note
-staff.patron.info_notes.new_note.add_note_title=Note added.
staff.patron.info_notes.new_note.note_not_created=The note was not likely created.
staff.patron.info_stat_cats.retrieve_fleshed_patron.failed=Failed to retrieve patron stat cats.
staff.patron.info_stat_cats.render_stat_cats.opac_visible=OPAC Visible
Modified: trunk/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js 2009-12-17 07:35:22 UTC (rev 15182)
+++ trunk/Open-ILS/xul/staff_client/server/patron/edit_standing_penalty.js 2009-12-17 07:40:06 UTC (rev 15183)
@@ -93,7 +93,8 @@
if (initials_tb.value == '') {
initials_tb.focus(); return;
} else {
- note = note + ' - ' + initials_tb.value;
+ JSAN.use('util.date');
+ note = note + commonStrings.getFormattedString('staff.initials.format',[initials_tb.value,util.date.formatted_date(new Date(),'%F')]);
}
}
update_modal_xulG(
Modified: trunk/Open-ILS/xul/staff_client/server/patron/info_notes.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/info_notes.xul 2009-12-17 07:35:22 UTC (rev 15182)
+++ trunk/Open-ILS/xul/staff_client/server/patron/info_notes.xul 2009-12-17 07:40:06 UTC (rev 15183)
@@ -192,18 +192,17 @@
xml += '<label value="'+$("patronStrings").getString('staff.patron.info_notes.new_note.patron_visible.value')+'"/><checkbox id="pub" name="fancy_data"/></row>';
xml += '<row><label value="'+$("patronStrings").getString('staff.patron.info_notes.new_note.title.value')+'"/><textbox id="title" name="fancy_data" context="clipboard"/></row>';
xml += '<row><label value="'+$("patronStrings").getString('staff.patron.info_notes.new_note.note.value')+'"/><textbox multiline="true" id="note" name="fancy_data" context="clipboard"/></row>';
+ var show_initials = String( g.data.hash.aous['ui.circ_and_cat.notes.require_initials'] ) == 'true';
+ if (show_initials) {
+ xml += '<row><label value="'+$("patronStrings").getString('staff.patron.info_notes.new_note.initials.value')+'"/><textbox id="initials" name="fancy_required_data" context="clipboard"/></row>';
+ }
xml += '<row><spacer/><hbox><button label="'+$("patronStrings").getString('staff.patron.info_notes.new_note.cancel.label')+'" name="fancy_cancel"';
xml += ' accesskey="'+$("patronStrings").getString('staff.patron.info_notes.new_note.cancel.accesskey')+'"/>';
xml += '<button label="'+$("patronStrings").getString('staff.patron.info_notes.new_note.add.label')+'"';
xml += ' accesskey="'+$("patronStrings").getString('staff.patron.info_notes.new_note.add.accesskey')+'" name="fancy_submit"/></hbox></row></rows></grid></groupbox>';
- //g.data.init({'via':'stash'});
- //g.data.temp_note_xml = xml; g.data.stash('temp_note_xml');
JSAN.use('util.window'); var win = new util.window();
var fancy_prompt_data = win.open(
urls.XUL_FANCY_PROMPT,
- //+ '?xml_in_stash=temp_note_xml'
- //+ '&focus=' + window.escape('title')
- //+ '&title=' + window.escape('Add Note'),
'fancy_prompt', 'chrome,resizable,modal,width=700,height=500',
{ 'xml' : xml, 'focus' : 'title', 'title' : $("patronStrings").getString('staff.patron.info_notes.new_note.add_note_title') }
);
@@ -212,6 +211,10 @@
var note = new aun();
note.isnew(1);
note.title( fancy_prompt_data.title );
+ if (fancy_prompt_data.initials) {
+ fancy_prompt_data.note = fancy_prompt_data.note
+ + $("commonStrings").getFormattedString('staff.initials.format',[fancy_prompt_data.initials,util.date.formatted_date(new Date(),'%F')]);
+ }
note.value( fancy_prompt_data.note );
note.pub( get_bool( fancy_prompt_data.pub ) ? get_db_true() : get_db_false() );
note.usr( g.patron_id );
@@ -219,7 +222,6 @@
if (typeof r.ilsevent != 'undefined') throw(r);
setTimeout(function(){
g.new_note = true;
- alert($("patronStrings").getString('staff.patron.info_notes.new_note.add_note_title'));
refresh();
},0);
}
Modified: trunk/Open-ILS/xul/staff_client/server/patron/new_standing_penalty.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/new_standing_penalty.js 2009-12-17 07:35:22 UTC (rev 15182)
+++ trunk/Open-ILS/xul/staff_client/server/patron/new_standing_penalty.js 2009-12-17 07:40:06 UTC (rev 15183)
@@ -75,7 +75,8 @@
if (initials_tb.value == '') {
initials_tb.focus(); return;
} else {
- note = note + ' - ' + initials_tb.value;
+ JSAN.use('util.date');
+ note = note + commonStrings.getFormattedString('staff.initials.format',[initials_tb.value,util.date.formatted_date(new Date(),'%F')]);
}
}
update_modal_xulG(
More information about the open-ils-commits
mailing list