return org;
}
- fieldmapper.aou.prototype.orgNodeTrail = function (node) {
+ fieldmapper.aou.prototype.orgNodeTrail = function(node, asId) {
if (!node) node = this;
if (!node) return [];
node = null;
}
- return na.reverse();
+ na.reverse();
+ if (asId) return na.map(function(o) { return o.id(); });
+ else return na;
}
fieldmapper.aou.orgNodeTrail = fieldmapper.aou.prototype.orgNodeTrail;
var ftList;
function ftInit() {
+ pcrud = new openils.PermaCrud();
+
new openils.User().buildPermOrgSelector(
"ADMIN_ACQ_FUND_TAG",
ftOwnerSelect,
ftOwnerSelect,
"onChange",
function() {
- ftOwner = this.getValue();
+ ftOwner = fieldmapper.aou.findOrgUnit(this.attr("value"));
ftGrid.resetStore();
buildFtGrid();
}
}
function buildFtGrid() {
- if (!pcrud) pcrud = new openils.PermaCrud();
- if (!ftOwner) ftOwner = openils.User.user.ws_ou();
+ if (!ftOwner)
+ ftOwner = fieldmapper.aou.findOrgUnit(openils.User.user.ws_ou());
pcrud.search(
"acqft",
- {"owner": fieldmapper.aou.fullPath(ftOwner, true /* asId */)},
+ {"owner": fieldmapper.aou.orgNodeTrail(ftOwner, true /* asId */)},
{
"async": true,
"oncomplete": function(r) {
</div>
</div>
<div class="oils-acq-basic-roomy">
- <span>Owned by</span>
+ <span>Show tags available to</span>
<select
dojoType="openils.widget.OrgUnitFilteringSelect"
jsId="ftOwnerSelect"
searchAttr="shortname" labelAttr="shortname">
</select>
- <span>or a descendant of the same:</span>
</div>
<table jsId="ftGrid"
dojoType="openils.widget.AutoGrid"