Merge pull request #5473 from aydun/CRM-16160
[civicrm-core.git] / CRM / Activity / Form / Task / FileOnCase.php
index dc1b4e391698c4e4c95c83cbc3fced04bf369105..95da2b5edd9f2adff898df0a441b175e3ccd9fcb 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
 class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task {
 
   /**
-   * The title of the group
+   * The title of the group.
    *
    * @var string
    */
   protected $_title;
 
   /**
-   * Variable to store redirect path
-   *
+   * Variable to store redirect path.
    */
   protected $_userContext;
 
   /**
-   * Variable to store contact Ids
-   *
+   * Variable to store contact Ids.
    */
   public $_contacts;
 
   /**
-   * Build all the data structures needed to build the form
+   * Build all the data structures needed to build the form.
    *
    * @return void
    */
@@ -71,34 +69,34 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task {
   }
 
   /**
-   * Build the form object
+   * Build the form object.
    *
    *
    * @return void
    */
   public function buildQuickForm() {
     $this->add('text', 'unclosed_case_id', ts('Select Case'), array('class' => 'huge'), TRUE);
-    $this->addDefaultButtons(ts('Continue >>'));
+    $this->addDefaultButtons(ts('Save'));
   }
 
   /**
-   * Add local and global form rules
+   * Add local and global form rules.
    *
    *
    * @return void
    */
-  public function addRules() {}
+  public function addRules() {
+  }
 
   /**
-   * Process the form after the input has been submitted and validated
+   * Process the form after the input has been submitted and validated.
    *
    *
    * @return void
    */
-
   public function postProcess() {
-    $formparams      = $this->exportValues();
-    $caseId          = $formparams['unclosed_case_id'];
+    $formparams = $this->exportValues();
+    $caseId = $formparams['unclosed_case_id'];
     $filedActivities = 0;
     foreach ($this->_activityHolderIds as $key => $id) {
       $targetContactValues = $defaults = array();
@@ -131,8 +129,9 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task {
       }
       else {
         CRM_Core_Session::setStatus(ts('Not permitted to file activity %1 %2.', array(
-          1 => empty($defaults['subject']) ? '' : $defaults['subject'],
-          2 => $defaults['activity_date_time'])),
+            1 => empty($defaults['subject']) ? '' : $defaults['subject'],
+            2 => $defaults['activity_date_time'],
+          )),
           ts("Error"), "error");
       }
     }
@@ -140,4 +139,5 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task {
     CRM_Core_Session::setStatus($filedActivities, ts("Filed Activities"), "success");
     CRM_Core_Session::setStatus("", ts('Total Selected Activities: %1', array(1 => count($this->_activityHolderIds))), "info");
   }
+
 }