<?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. |
| |
/**
*
* @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 >>'));
}
*
* @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
*