Add code to suppress popups on checkin.
Signed-off-by: Victoria Lewis <vlewis@catalystitservices.com>
Signed-off-by: Victoria Lewis <vlewis@catalystitservices.com>
no_precat_alert : $scope.modifiers.no_precat_alert,
auto_print_holds_transits :
$scope.modifiers.auto_print_holds_transits,
- suppress_popups : suppress_popups
+ suppress_popups : suppress_popups,
+ suppress_checkin_popups : suppress_popups
};
return {params : params, options: options};
}).result;
}
+
+ var suppress_popups = false;
+ egCore.org.settings([
+ 'ui.circ.suppress_checkin_popups' // add other settings as needed
+ ]).then(function(set) {
+ suppress_popups = set['ui.circ.suppress_checkin_popups'];
+ });
+
$scope.checkin = function(items) {
+ var options = {suppress_popups : suppress_popups,
+ suppress_checkin_popups : suppress_popups};
if (!items.length) return;
var barcodes = items.map(function(circ)
{ return circ.target_copy().barcode() });
}).result.then(function() {
function do_one() {
if (bc = barcodes.pop()) {
- egCirc.checkin({copy_barcode : bc})
+ egCirc.checkin({copy_barcode : bc}, options)
.finally(do_one);
} else {
reset_page();
if (options.auto_print_holds_transits)
return print_transit();
- return $modal.open({
- templateUrl: tmpl,
- controller: [
+ if(!options.suppress_popups){
+ return $modal.open({
+ templateUrl: tmpl,
+ controller: [
'$scope','$modalInstance',
function($scope , $modalInstance) {
+ $scope.today = new Date();
- $scope.today = new Date();
-
- // copy the print scope into the dialog scope
- angular.forEach(print_context, function(val, key) {
- $scope[key] = val;
- });
+ // copy the print scope into the dialog scope
+ angular.forEach(print_context, function(val, key) {
+ $scope[key] = val;
+ });
- $scope.ok = function() {$modalInstance.close()}
+ $scope.ok = function() {$modalInstance.close()}
- $scope.print = function() {
- $modalInstance.close();
- print_transit();
- }
- }]
+ $scope.print = function() {
+ $modalInstance.close();
+ print_transit();
+ }
+ }]
- }).result;
+ }).result;
+ } else {return};
});
}