[open-ils-commits] r14034 - in trunk/Open-ILS: web/opac/locale/en-US xul/staff_client/server/circ (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Sep 17 11:06:22 EDT 2009
Author: phasefx
Date: 2009-09-17 11:06:19 -0400 (Thu, 17 Sep 2009)
New Revision: 14034
Modified:
trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
trunk/Open-ILS/xul/staff_client/server/circ/checkout.js
trunk/Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul
Log:
Add ISBN and Circ Modifier options to Pre-Cat dialog. Circ Modifier value gets remembered between pre-cat invocations for a given staff client session. General reworking of the dialog to better handle closure of the window on
non-submits.
TODO: Test against middle layer .checkout.full once it supports circ_modifier argument. We're broken until then.
Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-09-17 14:29:45 UTC (rev 14033)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-09-17 15:06:19 UTC (rev 14034)
@@ -1907,8 +1907,14 @@
<!ENTITY staff.circ.in_house_use.save_cols_btn.label "Save Columns">
<!ENTITY staff.circ.pre_cat.window.title "Pre-Catalog Fields">
<!ENTITY staff.circ.pre_cat.caption.label "Pre-Catalog Field Entry">
-<!ENTITY staff.circ.pre_cat.dummy_title.value "Title">
-<!ENTITY staff.circ.pre_cat.dummy_author.value "Author">
+<!ENTITY staff.circ.pre_cat.dummy_title.label "Title">
+<!ENTITY staff.circ.pre_cat.dummy_title.accesskey "T">
+<!ENTITY staff.circ.pre_cat.dummy_author.label "Author">
+<!ENTITY staff.circ.pre_cat.dummy_author.accesskey "A">
+<!ENTITY staff.circ.pre_cat.dummy_isbn.label "ISBN">
+<!ENTITY staff.circ.pre_cat.dummy_isbn.accesskey "I">
+<!ENTITY staff.circ.pre_cat.dummy_circ_modifier.label "Circ Modifier">
+<!ENTITY staff.circ.pre_cat.dummy_circ_modifier.accesskey "M">
<!ENTITY staff.circ.pre_cat.cancel.label "Cancel">
<!ENTITY staff.circ.pre_cat.cancel.accesskey "C">
<!ENTITY staff.circ.pre_cat.checkout.label "Check Out">
Modified: trunk/Open-ILS/xul/staff_client/server/circ/checkout.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/checkout.js 2009-09-17 14:29:45 UTC (rev 14033)
+++ trunk/Open-ILS/xul/staff_client/server/circ/checkout.js 2009-09-17 15:06:19 UTC (rev 14034)
@@ -658,11 +658,13 @@
obj.data.stash_retrieve();
params.permit_key = permit.payload;
- params.dummy_title = obj.data.dummy_title;
- params.dummy_author = obj.data.dummy_author;
+ params.dummy_title = obj.data.precat_dummy_title;
+ params.dummy_author = obj.data.precat_dummy_author;
+ params.dummy_isbn = obj.data.precat_dummy_isbn;
+ params.circ_modifier = obj.data.precat_circ_modifier;
params.precat = 1;
- if (params.dummy_title !== '') {
+ if (obj.data.precat_submit == 'go') {
//obj._checkout( params ); No real request method here anymore
obj.checkout( params );
} else {
Modified: trunk/Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul 2009-09-17 14:29:45 UTC (rev 14033)
+++ trunk/Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul 2009-09-17 15:06:19 UTC (rev 14034)
@@ -24,7 +24,6 @@
<window id="pre_cat_fields" title="&staff.circ.pre_cat.window.title;"
orient="vertical" style="overflow: auto"
onload="try{my_init();font_helper(); }catch(E){alert(E);}"
- onunload="try{my_finish();}catch(E){alert(E);}"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
@@ -49,19 +48,44 @@
JSAN.use('OpenILS.data'); g.data = new OpenILS.data();
g.data.init({'via':'stash'});
+ g.data.precat_dummy_title = '';
+ g.data.precat_dummy_author = '';
+ g.data.precat_dummy_isbn = '';
+ g.data.precat_submit = 'cancel';
+ g.data.stash('precat_submit');
+
+ JSAN.use('util.widgets'); JSAN.use('util.functional');
+ var x = util.widgets.make_menulist(
+ [ [ $("catStrings").getString("staff.cat.copy_editor.field.unset_or_null"), "<HACK:KLUDGE:NULL>" ] ].concat(
+ util.functional.map_list( g.data.list.circ_modifier, function(obj) { return [ obj, obj ]; } ).sort()
+ )
+ );
+ x.setAttribute('id','dummy_circ_modifier');
+ document.getElementById('placeholder').appendChild(x);
+ if (g.data.precat_circ_modifier) {
+ x.setAttribute('value', g.data.precat_circ_modifier);
+ x.value = g.data.precat_circ_modifier;
+ }
document.getElementById('dummy_title').focus();
}
function my_finish() {
- /* FIXME -- need unique temp space name */
- /* FIXME -- We need to blank dummy_title on a forced window close */
- g.data.stash('dummy_title','dummy_author');
+ g.data.precat_dummy_title = document.getElementById('dummy_title').value;
+ g.data.precat_dummy_author = document.getElementById('dummy_author').value;
+ g.data.precat_dummy_isbn = document.getElementById('dummy_isbn').value;
+ var cm = document.getElementById('dummy_circ_modifier').value;
+ if (cm == '<HACK:KLUDGE:NULL>') cm = null;
+ g.data.precat_circ_modifier = cm;
+ g.data.precat_submit = 'go';
+ g.data.stash('precat_dummy_title','precat_dummy_author','precat_dummy_isbn','precat_circ_modifier','precat_submit');
+ window.close();
}
]]>
</script>
<messagecatalog id="circStrings" src="/xul/server/locale/<!--#echo var='locale'-->/circ.properties" />
+ <messagecatalog id="catStrings" src="/xul/server/locale/<!--#echo var='locale'-->/cat.properties" />
<groupbox>
<caption label="&staff.circ.pre_cat.caption.label;"/>
@@ -69,19 +93,27 @@
<columns><column /><column flex="1"/></columns>
<rows>
<row>
- <label value="&staff.circ.pre_cat.dummy_title.value;" control="dummy_title"/>
- <textbox id="dummy_title" onchange="g.data.dummy_title = event.target.value;" context="clipboard"/>
+ <label value="&staff.circ.pre_cat.dummy_title.label;" accesskey="&staff.circ.pre_cat.dummy_title.accesskey;" control="dummy_title"/>
+ <textbox id="dummy_title" context="clipboard"/>
</row>
<row>
- <label value="&staff.circ.pre_cat.dummy_author.value;" control="dummy_author"/>
- <textbox id="dummy_author" onchange="g.data.dummy_author = event.target.value;" context="clipboard"/>
+ <label value="&staff.circ.pre_cat.dummy_author.label;" accesskey="&staff.circ.pre_cat.dummy_author.accesskey;" control="dummy_author"/>
+ <textbox id="dummy_author" context="clipboard"/>
</row>
+ <row>
+ <label value="&staff.circ.pre_cat.dummy_isbn.label;" accesskey="&staff.circ.pre_cat.dummy_isbn.accesskey;" control="dummy_isbn"/>
+ <textbox id="dummy_isbn" context="clipboard"/>
+ </row>
+ <row>
+ <label value="&staff.circ.pre_cat.dummy_circ_modifier.label;" accesskey="&staff.circ.pre_cat.dummy_circ_modifier.accesskey;" control="dummy_circ_modifier"/>
+ <box id="placeholder" />
+ </row>
</rows>
</grid>
<hbox>
<spacer flex="1"/>
- <button label="&staff.circ.pre_cat.cancel.label;" oncommand="g.data.dummy_title = ''; window.close()" accesskey="&staff.circ.pre_cat.cancel.accesskey;"/>
- <button label="&staff.circ.pre_cat.checkout.label;" oncommand="window.close();" accesskey="&staff.circ.pre_cat.checkout.accesskey;"/>
+ <button label="&staff.circ.pre_cat.cancel.label;" oncommand="window.close()" accesskey="&staff.circ.pre_cat.cancel.accesskey;"/>
+ <button label="&staff.circ.pre_cat.checkout.label;" oncommand="my_finish();" accesskey="&staff.circ.pre_cat.checkout.accesskey;"/>
</hbox>
</groupbox>
More information about the open-ils-commits
mailing list