menu for circulate as type
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 27 Jun 2006 04:24:01 +0000 (04:24 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 27 Jun 2006 04:24:01 +0000 (04:24 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4798 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/chrome/content/util/functional.js
Open-ILS/xul/staff_client/server/cat/copy_editor.js

index ce1a2fc..3ee140f 100644 (file)
@@ -65,6 +65,7 @@ OpenILS.data.prototype = {
 
                'pgt' : [ api.FM_PGT_RETRIEVE.app, api.FM_PGT_RETRIEVE.method, [], true ],
                'cit' : [ api.FM_CIT_RETRIEVE.app, api.FM_CIT_RETRIEVE.method, [], true ],
+               'citm' : [ api.FM_CITM_RETRIEVE.app, api.FM_CITM_RETRIEVE.method, [], true ],
                'cst' : [ api.FM_CST_RETRIEVE.app, api.FM_CST_RETRIEVE.method, [], true ],
                'acpl' : [ api.FM_ACPL_RETRIEVE.app, api.FM_ACPL_RETRIEVE.method, [], true ],
                'ccs' : [ api.FM_CCS_RETRIEVE.app, api.FM_CCS_RETRIEVE.method, [], true ],
index d26797c..057cf19 100644 (file)
@@ -85,6 +85,7 @@ const api = {
        'FM_CIRC_COUNT_RETRIEVE_VIA_COPY' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.circulation.count' },
        'FM_CIRC_EDIT_DUE_DATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.circulation.due_date.update' },
        'FM_CIT_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.ident_types.retrieve' },
+       'FM_CITM_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.item_type_map.retrieve.all' },
        'FM_CNCT_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.non_cat_types.retrieve.all' },
        'FM_CST_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.standings.retrieve' },
        'FM_MB_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.billing.create' },
index 3ad80cb..66af424 100644 (file)
@@ -93,7 +93,11 @@ util.functional.convert_object_list_to_hash = function(list) {
        var my_hash = new Object();
        if (list) {
                for (var i = 0; i < list.length; i++) {
-                       my_hash[ list[i].id() ] = list[i];
+                       if (typeof list[i].id == 'function') {
+                               my_hash[ list[i].id() ] = list[i];
+                       } else if (typeof list[i].code == 'function') {
+                               my_hash[ list[i].code() ] = list[i];
+                       }
                }
        }
        return my_hash;
index 542193c..17e253f 100644 (file)
@@ -532,8 +532,8 @@ g.panes_and_field_names = {
         [
                "Circulate as Type",    
                {       
-                       render: 'fm.circ_as_type() == null ? "<Unset>" : fm.circ_as_type()',
-                       input: 'c = function(v){ g.apply("circ_as_type",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);',
+                       render: 'fm.circ_as_type() == null ? "<Unset>" : g.data.hash.citm[ fm.circ_as_type() ].value()',
+                       input: 'c = function(v){ g.apply("circ_as_type",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( util.functional.map_list( g.data.list.citm, function(n){return [ n.code() + " - " + n.value(), n.code()];} ).sort() ); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
                } 
        ],
        [