<div class="col-md-6" ng-class="{'bg-success': working.status !== undefined}">
<select class="form-control"
ng-disabled="!defaults.attributes.status" ng-model="working.status"
- ng-options="s.id() as s.name() for s in status_list">
+ ng-options="s.id() as s.name() disable when magic_status_list.indexOf(s.id(),0) > -1 for s in status_list">
</select>
</div>
</div>
};
+ service.get_magic_statuses = function() {
+ /* TODO: make these more configurable per lp1616170 */
+ return $q.when([
+ 1 /* Checked out */
+ ,3 /* Lost */
+ ,6 /* In transit */
+ ,8 /* On holds shelf */
+ ,16 /* Long overdue */
+ ,18 /* Canceled Transit */
+ ]);
+ }
+
service.get_statuses = function() {
if (egCore.env.ccs)
return $q.when(egCore.env.ccs.list);
return true;
}
- createSimpleUpdateWatcher = function (field) {
+ createSimpleUpdateWatcher = function (field,exclude_copies_with_one_of_these_values) {
return $scope.$watch('working.' + field, function () {
var newval = $scope.working[field];
angular.forEach(
$scope.workingGridControls.selectedItems(),
function (cp) {
+ if (exclude_copies_with_one_of_these_values
+ && exclude_copies_with_one_of_these_values.indexOf(cp[field](),0) > -1) {
+ return;
+ }
if (cp[field]() !== newval) {
cp[field](newval);
cp.ischanged(1);
createSimpleUpdateWatcher('location');
$scope.status_list = [];
+ itemSvc.get_magic_statuses().then(function(list){
+ $scope.magic_status_list = list;
+ createSimpleUpdateWatcher('status',$scope.magic_status_list);
+ });
itemSvc.get_statuses().then(function(list){
$scope.status_list = list;
});
- createSimpleUpdateWatcher('status');
$scope.circ_modifier_list = [];
itemSvc.get_circ_mods().then(function(list){
});
$scope.status_list = [];
+ itemSvc.get_magic_statuses().then(function(list){
+ $scope.magic_status_list = list;
+ });
itemSvc.get_statuses().then(function(list){
$scope.status_list = list;
});