Merge pull request #4511 from giant-rabbit/ajax-fatal-log-fix
[civicrm-core.git] / CRM / Activity / Form / Task / FileOnCase.php
index 8bd80d673c65fc6727af32b2e13dad9bab155482..c20206b9e71eb19f45dd8db065bf19e27df1da99 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $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
    * @access public
-   */ function preProcess() {
-    /*
-         * initialize the task and row fields
-         */
-
+   */
+  function preProcess() {
     parent::preProcess();
     $session = CRM_Core_Session::singleton();
     $this->_userContext = $session->readUserContext();
 
     CRM_Utils_System::setTitle(ts('File on Case'));
-
-    $validationFailed = FALSE;
-
-    // insert validations here
-
-    // then redirect
-    if ($validationFailed) {
-      CRM_Utils_System::redirect($this->_userContext);
-    }
   }
 
   /**
-   * Build the form
+   * Build the form object
    *
    * @access public
    *
    * @return void
    */
   function buildQuickForm() {
-    $this->addElement('text', 'unclosed_cases', ts('Select Case'));
-    $this->add('hidden', 'unclosed_case_id', '', array('id' => 'unclosed_case_id'));
+    $this->add('text', 'unclosed_case_id', ts('Select Case'), array('class' => 'huge'), TRUE);
     $this->addDefaultButtons(ts('Continue >>'));
   }
 
@@ -103,30 +90,10 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task {
    *
    * @return void
    */
-  function addRules() {
-    $this->addFormRule(array('CRM_Activity_Form_Task_FileOnCase', 'formRule'));
-  }
-
-  /**
-   * global validation rules for the form
-   *
-   * @param array $fields posted values of the form
-   *
-   * @return array list of errors to be posted back to the form
-   * @static
-   * @access public
-   */
-  static
-  function formRule($fields) {
-    $errors = array();
-    if (empty($fields['unclosed_case_id'])) {
-      $errors['unclosed_case_id'] = ts('Case is a required field.');
-    }
-    return $errors;
-  }
+  function addRules() {}
 
   /**
-   * process the form after the input has been submitted and validated
+   * Process the form after the input has been submitted and validated
    *
    * @access public
    *