From 17ea980829bbfc0eee48a376ffaff9c19ce974b5 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 1 Dec 2011 17:13:27 -0500 Subject: [PATCH] ACQ Vandeley : acq UI bits for temp queues vs named queues Signed-off-by: Bill Erickson --- Open-ILS/src/templates/acq/common/vlagent.tt2 | 10 ++++++++++ Open-ILS/web/js/ui/default/acq/common/vlagent.js | 25 +++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/acq/common/vlagent.tt2 b/Open-ILS/src/templates/acq/common/vlagent.tt2 index ce14f80d88..0b112bd102 100644 --- a/Open-ILS/src/templates/acq/common/vlagent.tt2 +++ b/Open-ILS/src/templates/acq/common/vlagent.tt2 @@ -37,4 +37,14 @@ [% l('Insufficient Quality Fall-Through Profile') %]
+ + + [% l('Temporary Queue') %] + + + +
+ [% l('Named Queue') %] + + diff --git a/Open-ILS/web/js/ui/default/acq/common/vlagent.js b/Open-ILS/web/js/ui/default/acq/common/vlagent.js index bd305afbdc..b53395b44c 100644 --- a/Open-ILS/web/js/ui/default/acq/common/vlagent.js +++ b/Open-ILS/web/js/ui/default/acq/common/vlagent.js @@ -12,10 +12,12 @@ function VLAgent(args) { {key : 'auto_overlay_1match'}, {key : 'auto_overlay_best_match'}, {key : 'match_quality_ratio'}, + {key : 'tmp_queue'}, {key : 'match_set', cls : 'vms'}, {key : 'bib_source', cls : 'cbs'}, {key : 'merge_profile', cls : 'vmp'}, - {key : 'fall_through_merge_profile', cls : 'vmp'} + {key : 'fall_through_merge_profile', cls : 'vmp'}, + {key : 'named_queue', cls : 'vbq'} ]; this.init = function() { @@ -23,14 +25,14 @@ function VLAgent(args) { dojo.forEach(this.widgets, function(widg) { - if (widg.cls) { // selectors + new openils.widget.AutoFieldWidget({ fmClass : widg.cls, selfReference : true, orgLimitPerms : [self.limitPerm || 'CREATE_PURCHASE_ORDER'], parentNode : dojo.byId('acq_vl:' + widg.key) - }).build(function(w) { widg.dijit = w }); + }).build(function(dijit) { self._widgetPostBuild(widg, dijit) }); } else { // bools widg.dijit = dijit.byId('acq_vl:' + widg.key); @@ -39,6 +41,23 @@ function VLAgent(args) { ); } + this._widgetPostBuild = function(widg, dijit) { + var self = this; + widg.dijit = dijit; + + // don't allow selecting a named queue if temp queue is selected + if (widg.cls == 'vbq') { + dijit.attr('disabled', true); + var tmpd = self.widgets.filter(function(item){return (item.key == 'tmp_queue')})[0].dijit; + tmpd.attr('checked', true); + dojo.connect( + tmpd, 'onChange', + function(val) { dijit.attr('disabled', val) } + ); + } + } + + this.values = function() { var values = {}; dojo.forEach(this.widgets, -- 2.11.0