Now alerting a friendlier error if a duplicate non-cat-type is created
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 27 Oct 2006 13:32:00 +0000 (13:32 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 27 Oct 2006 13:32:00 +0000 (13:32 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6524 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/admin/non_cat_types.js
Open-ILS/xul/staff_client/server/admin/non_cat_types.xhtml

index eb03281..b445c97 100644 (file)
@@ -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();
 }
index 8680f22..5e53675 100644 (file)
                Non cataloged type successfully updated
        </span>
 
+       <span class='hide_me' id='nc_type_exists'>
+               A Non-Cat type with the selected name already exists.
+       </span>
+
+
 </html>