Merge pull request #4607 from samuelsov/CRM-15637
[civicrm-core.git] / CRM / Custom / Form / Group.php
index 2e497f24450613192b274c84180ebfe4dd6182f5..43cb12da115e1dfff3dd6e6ff85aed90d802a271 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 class CRM_Custom_Form_Group extends CRM_Core_Form {
 
   /**
-   * the set id saved to the session for an update
+   * The set id saved to the session for an update
    *
    * @var int
-   * @access protected
    */
   protected $_id;
 
@@ -50,33 +49,29 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
    *  set is empty or not
    *
    * @var bool
-   * @access protected
    */
   protected $_isGroupEmpty = TRUE;
 
   /**
-   * array of existing subtypes set for a custom set
+   * Array of existing subtypes set for a custom set
    *
    * @var array
-   * @access protected
    */
   protected $_subtypes = array();
 
   /**
-   * array of default params
+   * Array of default params
    *
    * @var array
-   * @access protected
    */
   protected $_defaults = array();
 
   /**
-   * Function to set variables up before form is built
+   * Set variables up before form is built
    *
    * @param null
    *
    * @return void
-   * @access public
    */
   public function preProcess() {
     // current set id
@@ -110,19 +105,17 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
   }
 
   /**
-   * global form rule
+   * Global form rule
    *
    * @param array $fields the input form values
    * @param array $files the uploaded files if any
    * @param $self
    *
-   * @internal param array $options additional user data
    *
    * @return true if no errors, else array of errors
-   * @access public
    * @static
    */
-  static function formRule($fields, $files, $self) {
+  public static function formRule($fields, $files, $self) {
     $errors = array();
 
     //validate group title as well as name.
@@ -181,20 +174,18 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
    * @param null
    *
    * @return void
-   * @access public
    * @see valid_date
    */
-  function addRules() {
+  public function addRules() {
     $this->addFormRule(array('CRM_Custom_Form_Group', 'formRule'), $this);
   }
 
   /**
-   * Function to actually build the form
+   * Build the form object
    *
    * @param null
    *
    * @return void
-   * @access public
    */
   public function buildQuickForm() {
     $this->applyFilter('__ALL__', 'trim');
@@ -405,15 +396,14 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
   }
 
   /**
-   * This function sets the default values for the form. Note that in edit/view mode
+   * Set default values for the form. Note that in edit/view mode
    * the default values are retrieved from the database
    *
    * @param null
    *
    * @return array   array of default values
-   * @access public
    */
-  function setDefaultValues() {
+  public function setDefaultValues() {
     $defaults = &$this->_defaults;
     $this->assign('showMaxMultiple', TRUE);
     if ($this->_action == CRM_Core_Action::ADD) {
@@ -444,9 +434,6 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
         $defaults['extends'][1] = array(0 => '');
       }
 
-
-      $subName = CRM_Utils_Array::value('extends_entity_column_id', $defaults);
-
       if ($extends == 'Relationship' && !empty($this->_subtypes)) {
         $relationshipDefaults = array();
         foreach ($defaults['extends'][1] as $donCare => $rel_type_id) {
@@ -466,7 +453,6 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
    * @param null
    *
    * @return void
-   * @access public
    */
   public function postProcess() {
     // get the submitted form values.
@@ -532,18 +518,14 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
     }
   }
 
-  /*
-   * Function to return a formatted list of relationship name.
-   * @param $list array array of relationship name.
-   * @static
-   * return array array of relationship name.
-   */
   /**
-   * @param $list
+   * Return a formatted list of relationship name.
+   *
+   * @param array $list array of relationship name.
    *
-   * @return array
+   * @return array of relationship name.
    */
-  static function getFormattedList(&$list) {
+  public static function getFormattedList(&$list) {
     $relName = array();
 
     foreach ($list as $listItemKey => $itemValue) {
@@ -567,4 +549,3 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
     return $relName;
   }
 }
-