INFRA-132 - s/true/TRUE/
[civicrm-core.git] / CRM / Contact / Form / Task / AlterPreferences.php
index 9950d1c02dd06e69cb691751d7698a3a826f9789..c634632410868d1618de7d71a2f8d303fb9c3d93 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -42,11 +42,10 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task {
   /**
    * Build the form object
    *
-   * @access public
    *
    * @return void
    */
-   function buildQuickForm() {
+   public function buildQuickForm() {
     // add select for preferences
 
     $options = array(ts('Add Selected Options'), ts('Remove selected options'));
@@ -62,18 +61,17 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task {
     $this->addDefaultButtons(ts('Set Privacy Options'));
   }
 
-  function addRules() {
+  public function addRules() {
     $this->addFormRule(array('CRM_Contact_Form_Task_AlterPreferences', 'formRule'));
   }
 
   /**
    * Set the default form values
    *
-   * @access protected
    *
    * @return array the default array reference
    */
-  function setDefaultValues() {
+  public function setDefaultValues() {
     $defaults = array();
 
     $defaults['actionTypeOption'] = 0;
@@ -86,7 +84,7 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task {
    *
    * @return array
    */
-  static function formRule($form, $rule) {
+  public static function formRule($form, $rule) {
     $errors = array();
     if (empty($form['pref']) && empty($form['contact_taglist'])) {
       $errors['_qf_default'] = ts("Please select at least one privacy option.");
@@ -97,7 +95,6 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task {
   /**
    * Process the form after the input has been submitted and validated
    *
-   * @access public
    *
    * @return void
    */
@@ -113,11 +110,11 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task {
     if (!empty($params['pref'])) {
       $privacyValues = $params['pref'];
       $count = 0;
-      foreach($this->_contactIds as $contact_id) {
+      foreach ($this->_contactIds as $contact_id) {
         $contact = new CRM_Contact_BAO_Contact();
         $contact->id = $contact_id;
 
-        foreach($privacyValues as $privacy_key => $privacy_value) {
+        foreach ($privacyValues as $privacy_key => $privacy_value) {
           $contact->$privacy_key = $privacyValueNew;
         }
         $contact->save();
@@ -126,7 +123,7 @@ class CRM_Contact_Form_Task_AlterPreferences extends CRM_Contact_Form_Task {
       // Status message
       $privacyOptions = CRM_Core_SelectValues::privacy();
       $status = array();
-      foreach($privacyValues as $privacy_key => $privacy_value) {
+      foreach ($privacyValues as $privacy_key => $privacy_value) {
         $label = $privacyOptions[$privacy_key];
         $status[] = $privacyValueNew ? ts("Added '%1'", array(1 => $label)) : ts("Removed '%1'", array(1 => $label));
       }