From: Jagadedes Date: Thu, 6 Nov 2014 06:23:34 +0000 (+0530) Subject: #31037 show status message X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8966f337b02ca9269bb2836574c65bb0641c0167;p=com.zyxware.civiwci.git #31037 show status message --- diff --git a/CRM/Wci/Form/CreateWidget.php b/CRM/Wci/Form/CreateWidget.php index 100233b..1df5148 100644 --- a/CRM/Wci/Form/CreateWidget.php +++ b/CRM/Wci/Form/CreateWidget.php @@ -292,7 +292,7 @@ where w.id=" . $this->_id;*/ CRM_Core_DAO::executeQuery($sql); CRM_Core_DAO::executeQuery("SET foreign_key_checks = 1;"); $transaction->commit(); - + CRM_Core_Session::setStatus(ts('Widget created successfuly'), '', 'success'); if(isset($_REQUEST['_qf_CreateWidget_next'])) { (isset($this->_id)) ? $widget_id = $this->_id : $widget_id = CRM_Core_DAO::singleValueQuery('SELECT LAST_INSERT_ID()'); @@ -302,8 +302,7 @@ where w.id=" . $this->_id;*/ } } catch (Exception $e) { - //TODO - print_r($e->getMessage()); + CRM_Core_Session::setStatus(ts('Failed to create widget'), '', 'error'); $transaction->rollback(); } diff --git a/CRM/Wci/Form/ProgressBar.php b/CRM/Wci/Form/ProgressBar.php index 8e0fcae..ed38046 100644 --- a/CRM/Wci/Form/ProgressBar.php +++ b/CRM/Wci/Form/ProgressBar.php @@ -157,12 +157,11 @@ class CRM_Wci_Form_ProgressBar extends CRM_Core_Form { } $transaction->commit(); - + CRM_Core_Session::setStatus(ts('Progress bar created successfuly'), '', 'success'); CRM_Utils_System::redirect('progress-bar?reset=1'); } catch (Exception $e) { - //TODO - print_r($e->getMessage()); + CRM_Core_Session::setStatus(ts('Failed to create progress bar'), '', 'error'); $transaction->rollback(); } diff --git a/CRM/Wci/Form/WCISettings.php b/CRM/Wci/Form/WCISettings.php index af07b14..a18348f 100644 --- a/CRM/Wci/Form/WCISettings.php +++ b/CRM/Wci/Form/WCISettings.php @@ -30,7 +30,7 @@ class CRM_Wci_Form_WCISettings extends CRM_Core_Form { $this->addButtons(array( array( 'type' => 'submit', - 'name' => ts('Submit'), + 'name' => ts('Save'), 'isDefault' => TRUE, ), )); @@ -45,7 +45,7 @@ class CRM_Wci_Form_WCISettings extends CRM_Core_Form { // export form elements $this->assign('elementNames', $this->getRenderableElementNames()); - CRM_Utils_System::setTitle(ts('WCI Settings')); + CRM_Utils_System::setTitle(ts('Widget Settings')); parent::buildQuickForm(); } @@ -54,6 +54,7 @@ class CRM_Wci_Form_WCISettings extends CRM_Core_Form { $values = $this->exportValues(); civicrm_api3('setting', 'create', array('domain_id' => 1, 'default_wci_widget' => $values['default_widget'],)); civicrm_api3('setting', 'create', array('domain_id' => 1, 'default_wci_profile' => $values['default_profile'],)); + CRM_Core_Session::setStatus(ts('Widget settings are saved to database'), '', 'success'); parent::postProcess(); } diff --git a/templates/CRM/Wci/Form/WCISettings.tpl b/templates/CRM/Wci/Form/WCISettings.tpl index c99bb1f..c87735a 100644 --- a/templates/CRM/Wci/Form/WCISettings.tpl +++ b/templates/CRM/Wci/Form/WCISettings.tpl @@ -1,5 +1,5 @@ {* HEADER *} - +
{include file="CRM/common/formButtons.tpl" location="top"}
@@ -25,3 +25,4 @@
{include file="CRM/common/formButtons.tpl" location="bottom"}
+