switch(evt[0].textcode) {
case 'COPY_NOT_AVAILABLE':
- return service.copy_not_avail_dialog(evt[0], params, options);
+ return service.copy_not_avail_dialog(evt, params, options);
case 'COPY_ALERT_MESSAGE':
return service.copy_alert_dialog(evt[0], params, options, 'checkout');
default:
if (!angular.isArray(evt)) evt = [evt];
egCore.audio.play('warning.circ.event_override');
+ var copy_alert = evt.filter(function(e) {
+ return e.textcode == 'COPY_ALERT_MESSAGE';
+ });
+ evt = evt.filter(function(e) {
+ return e.textcode !== 'COPY_ALERT_MESSAGE';
+ });
+
return $uibModal.open({
templateUrl: './circ/share/t_event_override_dialog',
backdrop: 'static',
function() {
options.override = true;
+ if (copy_alert.length > 0) {
+ return service.copy_alert_dialog(copy_alert, params, options, action);
+ }
+
if (action == 'checkin') {
return service.checkin(params, options);
}
}
service.copy_not_avail_dialog = function(evt, params, options) {
- if (angular.isArray(evt)) evt = evt[0];
+ if (!angular.isArray(evt)) evt = [evt];
+
+ var copy_alert = evt.filter(function(e) {
+ return e.textcode == 'COPY_ALERT_MESSAGE';
+ });
+ evt = evt.filter(function(e) {
+ return e.textcode !== 'COPY_ALERT_MESSAGE';
+ });
+ evt = evt[0];
+
return $uibModal.open({
templateUrl: './circ/share/t_copy_not_avail_dialog',
backdrop: 'static',
}).result.then(
function() {
options.override = true;
+
+ if (copy_alert.length > 0) {
+ return service.copy_alert_dialog(copy_alert, params, options, 'checkout');
+ }
+
return service.checkout(params, options);
}
);