From 2db38700221cb2168fd468f3e83eb4c4e98f3ab5 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Mon, 12 Dec 2016 14:42:54 -0500 Subject: [PATCH] webstaff: add sounds related to checkout Signed-off-by: Jason Etheridge Signed-off-by: Kathy Lussier --- Open-ILS/web/js/ui/default/staff/circ/services/circ.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js index a2692ead1c..2d34b81a1f 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js @@ -237,10 +237,16 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, service.munge_resp_data = function(final_resp,worklog_action,worklog_method) { var data = final_resp.data = {}; - if (!final_resp.evt[0]) return; + if (!final_resp.evt[0]) { + egCore.audio.play('warning.unknown.no_event'); + return; + } var payload = final_resp.evt[0].payload; - if (!payload) return; + if (!payload) { + egCore.audio.play('warning.unknown.no_payload'); + return; + } data.circ = payload.circ; data.parent_circ = payload.parent_circ; @@ -446,6 +452,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, // Other events switch (evt[0].textcode) { case 'SUCCESS': + egCore.audio.play('success.checkout'); return $q.when(final_resp); case 'ITEM_NOT_CATALOGED': @@ -453,27 +460,32 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, return service.precat_dialog(params, options); case 'OPEN_CIRCULATION_EXISTS': + egCore.audio.play('warning.checkout.open_circ'); return service.circ_exists_dialog(evt, params, options); case 'COPY_IN_TRANSIT': + egCore.audio.play('warning.checkout.in_transit'); return service.copy_in_transit_dialog(evt, params, options); case 'PATRON_CARD_INACTIVE': case 'PATRON_INACTIVE': case 'PATRON_ACCOUNT_EXPIRED': case 'CIRC_CLAIMS_RETURNED': + egCore.audio.play('warning.checkout'); return service.exit_alert( egCore.strings[evt[0].textcode], {barcode : params.copy_barcode} ); case 'PERM_FAILURE': + egCore.audio.play('warning.checkout.permission'); return service.exit_alert( egCore.strings[evt[0].textcode], {permission : evt[0].ilsperm} ); default: + egCore.audio.play('warning.checkout.unknown'); return service.exit_alert( egCore.strings.CHECKOUT_FAILED_GENERIC, { barcode : params.copy_barcode, -- 2.11.0