<div class="col-md-3">
<div class="input-group">
<span class="input-group-addon">[% l('Show holdings at or below') %]</span>
- <eg-org-selector selected="holdings_ou" onchange="holdings_ou_changed" sticky-setting="cat.holdings_view_ou"></eg-org-selector>
+ <eg-org-selector selected="holdings_ou" onchange="holdings_ou_changed"
+ sticky-setting="cat.holdings_view_ou"
+ styleorg="bold_ous"></eg-org-selector>
</div>
</div>
</div>
$scope.holdings_cb_changed(item.checkbox,item.checked);
}
+ $scope.ous_to_style = []
+ egCore.net.request(
+ 'open-ils.search',
+ 'open-ils.search.biblio.copy_counts.retrieve.staff',
+ $scope.record_id
+ ).then(function(res) {
+ var ous = [];
+ if (res) {
+ angular.forEach(res, function(copy_count) {
+ $scope.ous_to_style.push(copy_count[0]);
+ });
+ }
+ return ous;
+ });
+ $scope.bold_ous = {
+ orgArray : $scope.ous_to_style,
+ apply : function(str, org_shortname) {
+ str = str + '<b>' + org_shortname; + '</b>';
+ return str;
+ }
+ }
+
function gatherSelectedHoldingsIds () {
var cp_id_list = [];
angular.forEach(
// optional name of settings key for persisting
// the last selected org unit
- stickySetting : '@'
+ stickySetting : '@',
+
+ // optional parameters to style Org Units
+ styleorg : '='
},
templateUrl : './share/t_org_select',
var secretEmptyKey = '_INTERNAL_';
function formatName(org) {
- return " ".repeat(org.ou_type().depth()) + org.shortname();
+ var org_str = " ".repeat(org.ou_type().depth());
+ if ($scope.styleorg && $scope.styleorg.orgArray.includes(org.id())) {
+ return $scope.styleorg.apply(org_str, org.shortname());
+ } else {
+ return org_str + org.shortname();
+ }
}
// avoid linking the full fleshed tree to the scope by
}
).then(
function() {
-
$scope.selecteName = '';
-
$scope.shortNames = egCore.org.list()
.filter(function(org) {
return !(
// Trim leading tree-spaces before displaying selected value
$scope.formatDisplayName = function(shortName) {
- return ($scope.selectedName || '').trim();
+ return ($scope.selectedName || '').trim().replace(/<[^>]*>?/gm, '');
}
$scope.orgIsDisabled = function(shortName) {
if ($scope.alldisabled === 'true') return true;
if (shortName && $scope.disableTest) {
var org = egCore.org.list().filter(function(org) {
- return org.shortname() === shortName.trim();
+ return org.shortname() === shortName.trim().replace(/<[^>]*>?/gm, '');
})[0];
return org && $scope.disableTest(org.id());
if ($scope.selectedName &&
!$scope.orgIsDisabled($scope.selectedName)) {
$scope.selected = egCore.org.list().filter(function(org) {
- return org.shortname() === $scope.selectedName.trim()
+ return org.shortname() === $scope.selectedName.trim().replace(/<[^>]*>?/gm, '')
})[0];
} else {
$scope.selected = null;