[OPEN-ILS-DEV] Display due date on brief display

Dan Scott dan at coffeecode.net
Fri Feb 18 18:00:52 EST 2011


On Fri, Feb 18, 2011 at 05:08:56PM -0500, Dan Wells wrote:
> Hello Grant,
> 
> Dan's solution looks great, but I wanted to add that in 2.0 only there is also a 'open-ils.circ.copy.due_date.retrieve' method which will get just the due date and nothing else, which could save on some overhead if you really just need the date.  Let us know if you want to try it and need any help dropping it in to Dan's code.
> 

Excellent point, Dan; I hadn't noticed the addition of that method. I
know that UPEI is on 1.6 currently but should they (or someone else)
want to use the open-ils.circ method in 2.0, swap in these 4 lines for
their counterparts in the paste:

var ddses = new OpenSRF.ClientSession('open-ils.circ');
var ddreq = ddses.request('open-ils.circ.copy.due_date.retrieve', cp_id);
ddreq.oncomplete = function(r) {
     var due_date = r.recv().content().replace(/^(.+)(\d\d)(\d\d)$/, "$1$2:$3");

Perhaps we should just add "due_date" as another attribute on the copy
returned by holdings_xml in unapi and avoid the extra call entirely -
but then someone else will want to do something like display the number
of holds currently targeted at the copy in question. Heh :)


More information about the Open-ils-dev mailing list