controller :
['$scope', '$modalInstance',
function($scope, $modalInstance) {
- $scope.args = {}
+ $scope.can_be_pickup = egCore.org.CanHaveUsers;
+ $scope.args = {};
$scope.ok = function() {
var vals = hold_ids.map(function(hold_id) {
return {
return nodes;
};
+ // tests that a node can have users
+ service.CanHaveUsers = function(node_or_id) {
+ return Boolean(service
+ .get(node_or_id)
+ .ou_type()
+ .can_have_users());
+ }
+
+ // tests that a node can have volumes
+ service.CanHaveVolumes = function(node_or_id) {
+ return Boolean(service
+ .get(node_or_id)
+ .ou_type()
+ .can_have_vols());
+ }
+
// list of org_unit objects or IDs for me + descendants
service.descendants = function(node_or_id, as_id) {
var node = service.get(node_or_id);
// Each org unit is passed into this function and, for
// any org units where the response value is true, the
// org unit will not be added to the selector.
- hiddenTest : '=',
+ hiddenTest : '&',
+
+ // Each org unit is passed into this function and, for
+ // any org units where the response value is true, the
+ // org unit will not be available for selection.
+ disableTest : '&',
// Caller can either $watch(selected, ..) or register an
// onchange handler.
+ '</button>'
+ '<ul class="dropdown-menu">'
+ '<li ng-repeat="org in orgList" ng-hide="hiddenTest(org.id)">'
- + '<a href ng-click="orgChanged(org)"'
+ + '<a href ng-click="orgChanged(org)" ng-disabled="disableTest(org.id)" '
+ 'style="padding-left: {{org.depth * 10 + 5}}px">'
+ '{{org.shortname}}'
+ '</a>'