cbox.startup();
-
// set the value for the cbox
if (values[name].length) {
var orderIdent = self.getLiOrderIdent(li);
}
}
+ if (!self.orderIdentAllowed)
+ cbox.attr('disabled', true);
+
sel._cbox = cbox;
cbox._lineitem = li;
dojo.connect(cbox, 'onChange', updateOrderIdent);
}
-
changeComboBox(typeSel); // force the initial draw
typeSel.onchange = function() {changeComboBox(typeSel)};
};
+ this.testOrderIdentPerms = function(org, callback) {
+ var self = this;
+ new openils.User().getPermOrgList(
+ 'ACQ_SET_LINEITEM_IDENTIFIER',
+ function(orgs) {
+ console.log('found orgs = ' + orgs);
+ for (var i = 0; i < orgs.length; i++) {
+ if (Number(orgs[i]) == Number(org)) {
+ self.orderIdentAllowed = true;
+ if (callback) callback();
+ return;
+ }
+ }
+ if (callback) callback();
+ },
+ true, true
+ );
+ };
+
this.checkClaimEligibility = function(li, callback, row) {
/* Assume always eligible, i.e. from this interface we don't care about
* claim eligibility any more. this is where the user would force a
{flesh_lineitem_count:true, flesh_owner:true}],
oncomplete: function(r) {
plist = openils.Util.readResponse(r);
- drawPl(plist);
+ liTable.testOrderIdentPerms(
+ plist.org_unit(),
+ function() { drawPl(plist) }
+ );
}
}
);
}
function drawPl() {
-
+
dojo.byId("oils-acq-picklist-name").innerHTML = plist.name();
dojo.byId("oils-acq-picklist-attr-owner").innerHTML = plist.owner().usrname();
dojo.byId("oils-acq-picklist-attr-count").innerHTML = plist.entry_count();