[open-ils-commits] r18573 - in branches/rel_2_0/Open-ILS: src/perlmods/OpenILS/Application/Acq web/js/dojo/openils/widget (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 1 23:03:20 EDT 2010
Author: erickson
Date: 2010-11-01 23:03:17 -0400 (Mon, 01 Nov 2010)
New Revision: 18573
Modified:
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm
branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Log:
back-porting 18571, 18572. provider fetching updates, autofieldwidget linked class loader
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm 2010-11-02 03:00:57 UTC (rev 18572)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm 2010-11-02 03:03:17 UTC (rev 18573)
@@ -93,7 +93,12 @@
$U->user_has_work_perm_at($e, $limit_perm, {descendants =>1});
return [] unless @$org_ids;
- $conn->respond($_) for @{$e->search_acq_provider({owner => $org_ids})};
+ $conn->respond($_) for @{
+ $e->search_acq_provider([
+ {owner => $org_ids, active => 't'},
+ {order_by => {acqpro => 'code'}}
+ ])
+ };
return undef;
}
Modified: branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2010-11-02 03:00:57 UTC (rev 18572)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2010-11-02 03:03:17 UTC (rev 18573)
@@ -413,8 +413,10 @@
this.widget = new dijit.form.FilteringSelect(this.dijitArgs, this.parentNode);
this.widget.searchAttr = this.widget.labelAttr = vfield.selector || vfield.name;
this.widget.valueAttr = vfield.name;
+ this.widget.attr('disabled', true);
var oncomplete = function(list) {
+ self.widget.attr('disabled', false);
if(self.labelFormat)
self.widget.labelAttr = '_label';
@@ -477,6 +479,9 @@
} else {
+ if(!this.dataLoader && openils.widget.AutoFieldWidget.defaultLinkedDataLoader[linkClass])
+ this.dataLoader = openils.widget.AutoFieldWidget.defaultLinkedDataLoader[linkClass];
+
if(this.dataLoader) {
// caller provided an external function for retrieving the data
@@ -651,5 +656,30 @@
openils.widget.AutoFieldWidget.localeStrings = dojo.i18n.getLocalization("openils.widget", "AutoFieldWidget");
openils.widget.AutoFieldWidget.cache = {};
+ openils.widget.AutoFieldWidget.defaultLinkedDataLoader = {};
+
+ /* Custom provider-as-link-class fetcher. Fitler is ignored.
+ * All viewable providers are retrieved.
+ */
+ openils.widget.AutoFieldWidget.defaultLinkedDataLoader.acqpro =
+ function(linkClass, fitler, oncomplete) {
+
+ fieldmapper.standardRequest(
+ ['open-ils.acq', 'open-ils.acq.provider.org.retrieve'],
+ {
+ async : true,
+ params : [openils.User.authtoken],
+ oncomplete : function(r) {
+ var resp;
+ var list = [];
+ while(resp = r.recv()) {
+ var pro = resp.content();
+ if(pro) list.push(pro);
+ }
+ oncomplete(list);
+ }
+ }
+ );
+ }
}
More information about the open-ils-commits
mailing list