fixed beta 1 bugs, 31062, 31063, 31101, 31067, 31065
[com.zyxware.civiwci.git] / CRM / Wci / Page / ProgressBarList.php
index 02f8e1cc677b73994b98df751863b0bfd9e3a64e..f0a220c2650889f86679393413979e3e3711dca5 100644 (file)
@@ -27,6 +27,7 @@ class CRM_Wci_Page_ProgressBarList extends CRM_Core_Page {
       return $controller->run();
     } 
     elseif ($action & CRM_Core_Action::DELETE) {
+      $errorScope = CRM_Core_TemporaryErrorScope::useException();
       try {
         $transaction = new CRM_Core_Transaction();
         $sql = "DELETE FROM civicrm_wci_progress_bar_formula where progress_bar_id = " . $id;
@@ -37,8 +38,8 @@ class CRM_Wci_Page_ProgressBarList extends CRM_Core_Page {
         $transaction->commit();
       }
       catch (Exception $e) {
-        //TODO
-        print_r($e->getMessage());
+        $errmgs = $e->getMessage() . ts('. Check whether progressbar is used by any widget or not');
+        CRM_Core_Session::setStatus($errmgs, '', 'error');
         $transaction->rollback();      
       } 
     }