Merge remote-tracking branch 'origin/4.5' into 4.5-master-2015-02-24-17-24-05
[civicrm-core.git] / CRM / PCP / Form / Campaign.php
index 321589e6be2aa79de83562153f53f21bf1b78ff7..b84bae80aec248fded2363b6123037c96b23c999 100644 (file)
@@ -96,7 +96,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form {
   }
 
   /**
-   * Build the form object
+   * Build the form object.
    *
    * @return void
    */
@@ -142,6 +142,9 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form {
     }
 
     $this->addElement('checkbox', 'is_active', ts('Active'));
+    if ($this->_context == 'dashboard') {
+      CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/admin/pcp', 'reset=1'));
+    }
 
     $this->addButtons(
       array(
@@ -160,7 +163,7 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form {
   }
 
   /**
-   * Global form rule
+   * Global form rule.
    *
    * @param array $fields
    *   The input form values.
@@ -184,14 +187,14 @@ class CRM_PCP_Form_Campaign extends CRM_Core_Form {
   }
 
   /**
-   * Process the form submission
+   * Process the form submission.
    *
    *
    * @return void
    */
   public function postProcess() {
     $params = $this->controller->exportValues($this->_name);
-    $checkBoxes = array('is_thermometer', 'is_honor_roll', 'is_active');
+    $checkBoxes = array('is_thermometer', 'is_honor_roll', 'is_active', 'is_notify');
 
     foreach ($checkBoxes as $key) {
       if (!isset($params[$key])) {