});
fieldmapper.standardRequest(
- ['open-ils.acq', 'open-ils.acq.lineitem.retrieve'],
+ ['open-ils.acq', 'open-ils.acq.lineitem.retrieve.authoritative'],
{
params : [ openils.User.authtoken, liId, args ],
-
+ async : true,
oncomplete : function(r) {
var lineitem = openils.Util.readResponse(r);
if(!lineitem) return;
var orderDate = '';
var liLink = '';
+ if(pl && pl.name() == '') // special pl
+ pl = null;
+
if(po) {
liLink = oilsBasePath + '/acq/po/view/' + po.id() + '/' + lineitem.id();
- var date = dojo.date.stamp.fromISOString(po.order_date());
- if(date) {
- orderDate = dojo.date.locale.format(date, {selector:'date'});
+ if(po.order_date()) {
+ var date = dojo.date.stamp.fromISOString(po.order_date());
+ if(date) {
+ orderDate = dojo.date.locale.format(date, {selector:'date'});
+ }
}
}
lineitem.order_summary().encumbrance_amount() || '0.00',
lineitem.order_summary().paid_amount() || '0.00',
orderDate,
- liLink
- ]
+ liLink,
+ (po) ? 'foo' : '', // forces class='hiddenfoo' i.e. not hidden
+ (pl) ? 'foo' : '', // ditto
+ encodeURIComponent(location.pathname + location.search)
+ ],
+ function(str) {
+ // prevent long titles from filling up the page
+ var truncSize = 100;
+ if(str.length > truncSize)
+ str = str.substring(0, truncSize) + '...';
+ return str;
+ }
);
callback(lineitem, displayString);