From: erickson Date: Fri, 27 Oct 2006 13:32:00 +0000 (+0000) Subject: Now alerting a friendlier error if a duplicate non-cat-type is created X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8d9b4e06df24cc325e020cc9fda1b9e6ddff8d55;p=Evergreen.git Now alerting a friendlier error if a duplicate non-cat-type is created git-svn-id: svn://svn.open-ils.org/ILS/trunk@6524 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/admin/non_cat_types.js b/Open-ILS/xul/staff_client/server/admin/non_cat_types.js index eb03281d2a..b445c974cc 100644 --- a/Open-ILS/xul/staff_client/server/admin/non_cat_types.js +++ b/Open-ILS/xul/staff_client/server/admin/non_cat_types.js @@ -51,9 +51,16 @@ function ncCreateNew() { var inh = $('nc_new_inhouse').checked ? 1 : null; var req = new Request(CREATE_NON_CAT_TYPE, SESSION, name, org, time + ' ' + type, inh ); + req.request.alertEvent = false; req.send(true); var res = req.result(); - if(checkILSEvent(res)) throw res; + + if(checkILSEvent(res)) { + if( res.textcode == 'NON_CAT_TYPE_EXISTS' ) + return alertId('nc_type_exists'); + alert(js2JSON(res)); + } + alertId('nc_update_success'); ncFetchTypes(); } diff --git a/Open-ILS/xul/staff_client/server/admin/non_cat_types.xhtml b/Open-ILS/xul/staff_client/server/admin/non_cat_types.xhtml index 8680f224f8..5e53675a60 100644 --- a/Open-ILS/xul/staff_client/server/admin/non_cat_types.xhtml +++ b/Open-ILS/xul/staff_client/server/admin/non_cat_types.xhtml @@ -151,6 +151,11 @@ Non cataloged type successfully updated + + A Non-Cat type with the selected name already exists. + + +