more comment fixes
[civicrm-core.git] / CRM / Case / Form / Activity / ChangeCaseStatus.php
index 21fda360de36af1cba489d61b32190589e477292..fe0a699e117a649ac078367fea86a3e858fa3360 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | 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
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2015
  */
 
 /**
- * This class generates form components for OpenCase Activity
- *
+ * This class generates form components for OpenCase Activity.
  */
 class CRM_Case_Form_Activity_ChangeCaseStatus {
 
@@ -51,13 +48,14 @@ class CRM_Case_Form_Activity_ChangeCaseStatus {
   }
 
   /**
-   * Set default values for the form. For edit/view mode
-   * the default values are retrieved from the database
+   * Set default values for the form.
+   *
+   * For edit/view mode the default values are retrieved from the database.
    *
    *
    * @param CRM_Core_Form $form
    *
-   * @return void
+   * @return array
    */
   public static function setDefaultValues(&$form) {
     $defaults = array();
@@ -101,7 +99,7 @@ class CRM_Case_Form_Activity_ChangeCaseStatus {
   }
 
   /**
-   * Global validation rules for the form
+   * Global validation rules for the form.
    *
    * @param array $values
    *   Posted values of the form.
@@ -109,35 +107,31 @@ class CRM_Case_Form_Activity_ChangeCaseStatus {
    * @param $files
    * @param CRM_Core_Form $form
    *
-   * @return array list of errors to be posted back to the form
-   * @static
+   * @return array
+   *   list of errors to be posted back to the form
    */
   public static function formRule($values, $files, $form) {
     return TRUE;
   }
 
   /**
-   * Process the form submission
+   * Process the form submission.
    *
    *
    * @param CRM_Core_Form $form
    * @param array $params
-   *
-   * @return void
    */
   public static function beginPostProcess(&$form, &$params) {
     $params['id'] = CRM_Utils_Array::value('case_id', $params);
   }
 
   /**
-   * Process the form submission
+   * Process the form submission.
    *
    *
    * @param CRM_Core_Form $form
    * @param array $params
-   * @param $activity
-   *
-   * @return void
+   * @param CRM_Activity_BAO_Activity $activity
    */
   public static function endPostProcess(&$form, &$params, $activity) {
     $groupingValues = CRM_Core_OptionGroup::values('case_status', FALSE, TRUE, FALSE, NULL, 'value');
@@ -152,7 +146,8 @@ class CRM_Case_Form_Activity_ChangeCaseStatus {
         // FIXME: Is there an existing function to close a relationship?
         $query = 'UPDATE civicrm_relationship SET end_date=%2 WHERE id=%1';
         foreach ($rels as $relId => $relData) {
-          $relParams = array(1 => array($relId, 'Integer'),
+          $relParams = array(
+            1 => array($relId, 'Integer'),
             2 => array($params['end_date'], 'Timestamp'),
           );
           CRM_Core_DAO::executeQuery($query, $relParams);
@@ -178,11 +173,11 @@ class CRM_Case_Form_Activity_ChangeCaseStatus {
     $params['priority_id'] = CRM_Core_OptionGroup::getValue('priority', 'Normal', 'name');
     $activity->priority_id = $params['priority_id'];
 
-    foreach ($form->_oldCaseStatus as $statuskey => $statusval ) {
+    foreach ($form->_oldCaseStatus as $statuskey => $statusval) {
       if ($activity->subject == 'null') {
         $activity->subject = ts('Case status changed from %1 to %2', array(
             1 => CRM_Utils_Array::value($statusval, $form->_caseStatus),
-            2 => CRM_Utils_Array::value($params['case_status_id'], $form->_caseStatus)
+            2 => CRM_Utils_Array::value($params['case_status_id'], $form->_caseStatus),
           )
         );
         $activity->save();
@@ -192,4 +187,5 @@ class CRM_Case_Form_Activity_ChangeCaseStatus {
     // FIXME: does this do anything ?
     $params['statusMsg'] = ts('Case Status changed successfully.');
   }
+
 }