Merge pull request #4851 from totten/master-createtest-bao
[civicrm-core.git] / CRM / Pledge / Form / Pledge.php
index 12715b7522a7abbb4074befc2ea897c5212a241f..37218ae44c67a6c0d2119b1efa3ce0eb6082c045 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -41,44 +41,38 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
   public $_action;
 
   /**
-   * the id of the pledge that we are proceessing
+   * The id of the pledge that we are proceessing
    *
    * @var int
-   * @public
    */
   public $_id;
 
   /**
-   * the id of the contact associated with this pledge
+   * The id of the contact associated with this pledge
    *
    * @var int
-   * @public
    */
   public $_contactID;
 
   /**
    * The Pledge values if an existing pledge
-   * @public
    */
   public $_values;
 
   /**
    * The Pledge frequency Units
-   * @public
    */
   public $_freqUnits;
 
   /**
-   * is current pledge pending.
-   * @public
+   * Is current pledge pending.
    */
   public $_isPending = FALSE;
 
   /**
-   * set variables up before form is built
+   * Set variables up before form is built
    *
    * @return void
-   * @access public
    */
   public function preProcess() {
     $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
@@ -135,11 +129,10 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
    * Set default values for the form.
    * the default values are retrieved from the database
    *
-   * @access public
    *
    * @return void
    */
-  function setDefaultValues() {
+  public function setDefaultValues() {
     $defaults = $this->_values;
 
     $fields = array();
@@ -190,7 +183,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
       $defaults['max_reminders'] = 1;
       $defaults['additional_reminder_day'] = 5;
       $defaults['frequency_unit'] = array_search('month', $this->_freqUnits);
-            $defaults['financial_type_id']    = array_search( 'Donation', CRM_Contribute_PseudoConstant::financialType() );
+      $defaults['financial_type_id']    = array_search('Donation', CRM_Contribute_PseudoConstant::financialType());
     }
 
     $pledgeStatus = CRM_Contribute_PseudoConstant::contributionStatus();
@@ -222,7 +215,6 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
    * Build the form object
    *
    * @return void
-   * @access public
    */
   public function buildQuickForm() {
     if ($this->_action & CRM_Core_Action::DELETE) {
@@ -256,7 +248,8 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     );
     foreach ($paneNames as $name => $type) {
       $urlParams = "snippet=4&formType={$type}";
-      $allPanes[$name] = array('url' => CRM_Utils_System::url('civicrm/contact/view/pledge', $urlParams),
+      $allPanes[$name] = array(
+      'url' => CRM_Utils_System::url('civicrm/contact/view/pledge', $urlParams),
         'open' => 'false',
         'id' => $type,
       );
@@ -385,9 +378,9 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
 
     $this->addDate('acknowledge_date', ts('Acknowledgment Date'));
 
-        $this->add('select', 'financial_type_id',
-                   ts( 'Financial Type' ),
-                   array(''=>ts( '- select -' )) + CRM_Contribute_PseudoConstant::financialType( ),
+    $this->add('select', 'financial_type_id',
+                   ts('Financial Type'),
+                   array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(),
       TRUE
     );
 
@@ -446,18 +439,19 @@ class CRM_Pledge_Form_Pledge 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 array $fields
+   *   The input form values.
+   * @param array $files
+   *   The uploaded files if any.
    * @param $self
    *
    *
    * @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();
 
     if ($fields['amount'] <= 0) {
@@ -483,7 +477,6 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
   /**
    * Process the form submission
    *
-   * @access public
    *
    * @return void
    */
@@ -662,4 +655,3 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     }
   }
 }
-