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

Mike Rylander mrylander at gmail.com
Mon Feb 21 11:10:56 EST 2011


On Fri, Feb 18, 2011 at 4:29 PM, Dan Scott <dan at coffeecode.net> wrote:
> On Thu, Feb 17, 2011 at 03:35:14PM -0400, Grant Johnson wrote:
>> Hi,
>>
>> Dan gave UPEI some awesome functionality that display's Call Number,
>> Location and Status on the brief results screen.
>> As well as the Due-Date in the full record display.
>>
>> The dojo query that returns Status is:
>>
>>    dojo.query('status', cp).forEach(function (status) {
>>       var pfx = dojo.doc.createTextNode(' (');
>>       output.appendChild(pfx);
>>       dojo.create('b', { "innerHTML":
>> dojox.xml.parser.textContent(status)  }, output);
>>       var sfx = dojo.doc.createTextNode(')');
>>       output.appendChild(sfx);
>>      });
>>
>>
>> Can I, should I, How would I...  modify/add the Due-Date in the brief
>> results when the status is "checked-out".
>
> On 2.0, you can replace that chunk of text with the chunk at
> http://paste.lisp.org/display/119822 (see the annotation for better date
> formatting).
>
> Caveats: that code tests against the English value for "Checked out"
> which isn't guaranteed to be the case for other languages,

in 2.0 and beyond, you can check the value of the @ident attribute of
the <status> element, and if it's "1" then you know it's checked out.
Status ids are magic numbers below 100.

> and uses a
> hard coded string for "Due date". And it has only been tested on Firefox
> and Chrome.
>
> Also, the dojo.date.locale.format function formats the date according to
> the browser language preference, so most people with a default en-us
> language preference get the questionable MM/dd/YY format instead of the
> perfectly sensible YYYY-MM-DD. You can override this in the options.
>
> Hopefully this is a start, anyway.
>

Tangentially related to this discussion, I'd like to take a straw poll
on something.  I'm currently working on several features that will end
up having an effect on supercat holdings output, and getting that in
place now (not fully integrated, mind you, just that the stored procs
exists) will greatly reduce my pain of later feature integration.
Thoughts or concerns?  (Like, "Mike, in-db unapi xml generation is
lame. Shush!")

-- 
Mike Rylander
 | VP, Research and Design
 | Equinox Software, Inc. / The Evergreen Experts
 | phone:  1-877-OPEN-ILS (673-6457)
 | email:  miker at esilibrary.com
 | web:  http://www.esilibrary.com


More information about the Open-ils-dev mailing list