From 37cfe2bd9107e6f310eb31f0a8111406fa54372d Mon Sep 17 00:00:00 2001 From: miker Date: Sun, 21 Dec 2008 02:23:00 +0000 Subject: [PATCH] adding support for ordery_by and select in search and retrieveAll git-svn-id: svn://svn.open-ils.org/ILS/trunk@11641 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/PermaCrud.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/PermaCrud.js b/Open-ILS/web/js/dojo/openils/PermaCrud.js index c542683554..8d1a6da7de 100644 --- a/Open-ILS/web/js/dojo/openils/PermaCrud.js +++ b/Open-ILS/web/js/dojo/openils/PermaCrud.js @@ -90,10 +90,14 @@ if(!dojo._hasResource["openils.PermaCrud"]) { retrieveAll : function ( fm_class /* Fieldmapper class hint */, opts /* Option hash */) { var pkey = fieldmapper[fm_class].Indentifier; + var order_by = {}; + if (opts.order_by) order_by.order_by = opts.order_by; + if (opts.select) order_by.select = opts.select; + var req_hash = dojo.mixin( opts, { method : 'open-ils.pcrud.search.' + fm_class + '.atomic', - params : [ this.auth(), { fieldmapper[fm_class].Indentifier : { '!=' : null } } ] + params : [ this.auth(), { fieldmapper[fm_class].Indentifier : { '!=' : null } }, order_by ] } ); @@ -114,10 +118,14 @@ if(!dojo._hasResource["openils.PermaCrud"]) { search : function ( fm_class /* Fieldmapper class hint */, search /* Fieldmapper query object */, opts /* Option hash */) { var pkey = fieldmapper[fm_class].Indentifier; + var order_by = {}; + if (opts.order_by) order_by.order_by = opts.order_by; + if (opts.select) order_by.select = opts.select; + var req_hash = dojo.mixin( opts, { method : 'open-ils.pcrud.search.' + fm_class + '.atomic', - params : [ this.auth(), search ] + params : [ this.auth(), search, order_by ] } ); -- 2.11.0