Merge pull request #4880 from totten/master-cs3
[civicrm-core.git] / CRM / Custom / Form / MoveField.php
index 9100205b10a0feb92ec3b73514d856950e194316..f3f24ad9436450d0e615b72362685b357d939fc9 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_MoveField extends CRM_Core_Form {
 
   /**
-   * the src group id
+   * The src group id
    *
    * @var int
    */
   protected $_srcGID;
 
   /**
-   * the src field id
+   * The src field id
    *
    * @var int
    */
   protected $_srcFID;
 
   /**
-   * the dst group id
+   * The dst group id
    *
    * @var int
    */
   protected $_dstGID;
 
   /**
-   * the dst field id
+   * The dst field id
    *
    * @var int
    */
@@ -74,12 +74,12 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
   protected $_srcFieldLabel;
 
   /**
-   * set up variables to build the form
+   * Set up variables to build the form
    *
    * @return void
    * @acess protected
    */
-  function preProcess() {
+  public function preProcess() {
     $this->_srcFID = CRM_Utils_Request::retrieve('fid', 'Positive',
       $this, TRUE
     );
@@ -103,10 +103,9 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
   }
 
   /**
-   * Function to actually build the form
+   * Build the form object
    *
    * @return void
-   * @access public
    */
   public function buildQuickForm() {
 
@@ -141,7 +140,14 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
     $this->addFormRule(array('CRM_Custom_Form_MoveField', 'formRule'), $this);
   }
 
-  static function formRule($fields, $files, $self) {
+  /**
+   * @param $fields
+   * @param $files
+   * @param $self
+   *
+   * @return array|bool
+   */
+  public static function formRule($fields, $files, $self) {
     $self->_dstGID = $fields['dst_group_id'];
     $tmp           = CRM_Core_BAO_CustomField::_moveFieldValidate($self->_srcFID, $self->_dstGID);
     $errors        = array();
@@ -155,7 +161,6 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
    * Process the form when submitted
    *
    * @return void
-   * @access public
    */
   public function postProcess() {
     CRM_Core_BAO_CustomField::moveField($this->_srcFID, $this->_dstGID);
@@ -169,8 +174,7 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
       array(
       1 => $this->_srcFieldLabel,
           2 => $dstGroup,
-        3 => $srcUrl
+        3 => $srcUrl,
         )), '', 'success');
   }
 }
-