provide a list for circ modifier in copy editor
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 6 Aug 2006 23:08:46 +0000 (23:08 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 6 Aug 2006 23:08:46 +0000 (23:08 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5322 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Open-ILS/xul/staff_client/chrome/content/main/constants.js
Open-ILS/xul/staff_client/server/cat/copy_editor.js

index a86d501..acbed7a 100644 (file)
@@ -310,6 +310,20 @@ OpenILS.data.prototype = {
 
                this.chain.push(
                        function() {
+                               try {
+                                       var robj = obj.network.simple_request('CIRC_MODIFIER_LIST',[]);
+                                       if (typeof robj.ilsevent != 'undefined') throw(robj);
+                                       obj.list.circ_modifier = robj;
+                               } catch(E) {
+                                       var error = 'Error: ' + js2JSON(E);
+                                       obj.error.sdump('D_ERROR',error);
+                                       throw(E);
+                               }
+                       }
+               );
+
+               this.chain.push(
+                       function() {
                                var f = gen_fm_retrieval_func(
                                        'cnal',
                                        [
index 664237e..b41c63d 100644 (file)
@@ -20,6 +20,7 @@ const api = {
        'CHECKOUT' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.checkout' },
        'CHECKOUT_PERMIT' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.checkout.permit' },
        'CHECKOUT_RENEW' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.renew' },
+       'CIRC_MODIFIER_LIST' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.circ_modifier.retrieve.all' },
        'FM_ACN_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.callnumber.retrieve' },
        'FM_ACN_TREE_UPDATE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.asset.volume.fleshed.batch.update' },
        'FM_ACN_TREE_LIST_RETRIEVE_VIA_RECORD_ID_AND_ORG_IDS' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.asset.copy_tree.retrieve' },
index 90b1a6b..8db1308 100644 (file)
@@ -618,7 +618,8 @@ g.panes_and_field_names = {
                "Circulation Modifier",
                {       
                        render: 'fm.circ_modifier() == null ? "<Unset>" : fm.circ_modifier()',
-                       input: 'c = function(v){ g.apply("circ_modifier",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);',
+                       /*input: 'c = function(v){ g.apply("circ_modifier",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);',*/
+                       input: 'c = function(v){ g.apply("circ_modifier",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( g.data.list.circ_modifier, function(obj) { return [ obj, obj ]; } ).sort() ); x.setAttribute("editable","true"); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                }
        ],
 ],