From 5a4b6fd59219d5f8bee94e7ba533588c5ebd7e0d Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 27 Jun 2006 04:24:01 +0000 Subject: [PATCH] menu for circulate as type 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 | 1 + Open-ILS/xul/staff_client/chrome/content/main/constants.js | 1 + Open-ILS/xul/staff_client/chrome/content/util/functional.js | 6 +++++- Open-ILS/xul/staff_client/server/cat/copy_editor.js | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js index ce1a2fcb8a..3ee140f254 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js @@ -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 ], diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index d26797cb7c..057cf19646 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -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' }, diff --git a/Open-ILS/xul/staff_client/chrome/content/util/functional.js b/Open-ILS/xul/staff_client/chrome/content/util/functional.js index 3ad80cbc25..66af424937 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/functional.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/functional.js @@ -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; diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js index 542193c4a0..17e253fcd1 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -532,8 +532,8 @@ g.panes_and_field_names = { [ "Circulate as Type", { - render: 'fm.circ_as_type() == null ? "" : 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 ? "" : 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);', } ], [ -- 2.43.2