Add ISBN and Circ Modifier options to Pre-Cat dialog. Circ Modifier value gets remem...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 17 Sep 2009 15:06:19 +0000 (15:06 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 17 Sep 2009 15:06:19 +0000 (15:06 +0000)
non-submits.

TODO: Test against middle layer .checkout.full once it supports circ_modifier argument.  We're broken until then.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@14034 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/circ/pre_cat_fields.xul

index 24e6856..cbd66e3 100644 (file)
 <!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">
index 604dfb4..fb962e4 100644 (file)
@@ -658,11 +658,13 @@ circ.checkout.prototype = {
                                                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 {
index ec32c39..8085b22 100644 (file)
@@ -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">
 
        <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
                        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;"/>
                        <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>