Merge pull request #4925 from KarinG/patch-1
authorYashodha Chaku <yashodha.chaku@webaccessglobal.com>
Thu, 15 Jan 2015 11:46:40 +0000 (17:16 +0530)
committerYashodha Chaku <yashodha.chaku@webaccessglobal.com>
Thu, 15 Jan 2015 11:46:40 +0000 (17:16 +0530)
CRM-15814 - Gecoder maxlength issue -> go to 12

338 files changed:
CRM/ACL/Form/WordPress/Permissions.php
CRM/ACL/Page/ACLBasic.php
CRM/ACL/Page/EntityRole.php
CRM/Activity/BAO/Activity.php
CRM/Activity/Form/Task/AddToTag.php
CRM/Admin/Form/Mapping.php
CRM/Admin/Form/Preferences/Address.php
CRM/Admin/Form/ScheduleReminders.php
CRM/Admin/Form/Setting.php
CRM/Admin/Form/Setting/Mapping.php
CRM/Admin/Form/Tag.php
CRM/Admin/Form/WordReplacements.php
CRM/Admin/Page/AJAX.php
CRM/Campaign/Form/Gotv.php
CRM/Campaign/Form/Survey/Results.php
CRM/Campaign/Form/Task.php
CRM/Campaign/Form/Task/Interview.php
CRM/Campaign/Page/AJAX.php
CRM/Case/BAO/Case.php
CRM/Case/Form/Task/Restore.php
CRM/Case/Info.php
CRM/Case/StateMachine/Search.php
CRM/Contact/BAO/Contact.php
CRM/Contact/BAO/Contact/Utils.php
CRM/Contact/BAO/GroupContact.php
CRM/Contact/BAO/GroupContactCache.php
CRM/Contact/BAO/Individual.php
CRM/Contact/BAO/Query.php
CRM/Contact/BAO/Relationship.php
CRM/Contact/Form/Domain.php
CRM/Contact/Form/Edit/Address.php
CRM/Contact/Form/Edit/Email.php
CRM/Contact/Form/Edit/IM.php
CRM/Contact/Form/Edit/Phone.php
CRM/Contact/Form/Edit/TagsAndGroups.php
CRM/Contact/Form/RelatedContact.php
CRM/Contact/Form/Search/Custom.php
CRM/Contact/Form/Search/Custom/ActivitySearch.php
CRM/Contact/Form/Search/Custom/PostalMailing.php
CRM/Contact/Form/Search/Custom/PriceSet.php
CRM/Contact/Form/Search/Custom/ZipCodeRange.php
CRM/Contact/Form/Task.php
CRM/Contact/Form/Task/AddToHousehold.php
CRM/Contact/Form/Task/Delete.php
CRM/Contact/Form/Task/HookSample.php
CRM/Contact/Form/Task/Print.php
CRM/Contact/Form/Task/Result.php
CRM/Contact/Form/Task/SaveSearch.php
CRM/Contact/Form/Task/Unhold.php
CRM/Contact/Import/Form/Preview.php
CRM/Contact/Import/Form/Summary.php
CRM/Contact/Import/Parser.php
CRM/Contact/Import/Parser/Contact.php
CRM/Contact/Page/View/Sunlight.php
CRM/Contact/Page/View/Tag.php
CRM/Contact/Selector/Custom.php
CRM/Contact/StateMachine/Search.php
CRM/Contribute/BAO/Contribution.php
CRM/Contribute/BAO/Contribution/Utils.php
CRM/Contribute/BAO/ContributionPage.php
CRM/Contribute/BAO/Query.php
CRM/Contribute/Controller/ContributionPage.php
CRM/Contribute/Form/CancelSubscription.php
CRM/Contribute/Form/ContributionPage/Settings.php
CRM/Contribute/Form/SoftCredit.php
CRM/Contribute/Form/Task/Email.php
CRM/Contribute/Import/Form/DataSource.php
CRM/Contribute/Import/Form/Summary.php
CRM/Contribute/Page/ContributionPage.php
CRM/Contribute/Page/ContributionRecur.php
CRM/Contribute/Page/UserDashboard.php
CRM/Contribute/StateMachine/Search.php
CRM/Core/Action.php
CRM/Core/BAO/ActionSchedule.php
CRM/Core/BAO/Cache.php
CRM/Core/BAO/ConfigSetting.php
CRM/Core/BAO/Domain.php
CRM/Core/BAO/Email.php
CRM/Core/BAO/File.php
CRM/Core/BAO/LabelFormat.php
CRM/Core/BAO/LocationType.php
CRM/Core/BAO/Log.php
CRM/Core/BAO/MailSettings.php
CRM/Core/BAO/Mapping.php
CRM/Core/BAO/MessageTemplate.php
CRM/Core/BAO/Note.php
CRM/Core/BAO/OptionGroup.php
CRM/Core/BAO/Preferences.php
CRM/Core/BAO/PrevNextCache.php
CRM/Core/BAO/UFField.php
CRM/Core/Component/Config.php
CRM/Core/Controller.php
CRM/Core/Controller/Simple.php
CRM/Core/DAO.php
CRM/Core/Form/Tag.php
CRM/Core/I18n/SchemaStructure_2_2_0.php
CRM/Core/I18n/SchemaStructure_3_0_alpha1.php
CRM/Core/InnoDBIndexer.php
CRM/Core/LegacyErrorHandler.php
CRM/Core/Page.php
CRM/Core/Page/AJAX.php
CRM/Core/Page/Angular.php
CRM/Core/Page/Basic.php
CRM/Core/Payment.php
CRM/Core/Payment/AuthorizeNet.php
CRM/Core/Payment/BaseIPN.php
CRM/Core/Payment/Elavon.php
CRM/Core/Payment/FirstData.php
CRM/Core/Payment/PayPalProIPN.php
CRM/Core/Payment/eWAY.php
CRM/Core/Permission/Base.php
CRM/Core/Permission/DrupalBase.php
CRM/Core/Permission/Joomla.php
CRM/Core/Permission/Soap.php
CRM/Core/Permission/UnitTests.php
CRM/Core/QuickForm/Action/Upload.php
CRM/Core/QuickForm/NestedAdvMultiSelect.php
CRM/Core/Smarty/plugins/block.crmRegion.php
CRM/Custom/Form/Field.php
CRM/Custom/Form/MoveField.php
CRM/Custom/Form/Option.php
CRM/Custom/Import/Form/DataSource.php
CRM/Dashlet/Page/Blog.php
CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php
CRM/Dedupe/BAO/QueryBuilder/IndividualUnsupervised.php
CRM/Dedupe/Merger.php
CRM/Event/BAO/Event.php
CRM/Event/BAO/ParticipantStatusType.php
CRM/Event/Badge.php
CRM/Event/Cart/Form/Checkout/ParticipantsAndPrices.php
CRM/Event/Cart/Form/Checkout/Payment.php
CRM/Event/Cart/Page/CheckoutAJAX.php
CRM/Event/Form/ManageEvent/Registration.php
CRM/Event/Form/Participant.php
CRM/Event/Form/ParticipantFeeSelection.php
CRM/Event/Form/Registration.php
CRM/Event/Form/Registration/AdditionalParticipant.php
CRM/Event/Form/Registration/Register.php
CRM/Event/Form/Task/Email.php
CRM/Event/Form/Task/ParticipantStatus.php
CRM/Event/Import/Form/Summary.php
CRM/Event/Page/ManageEvent.php
CRM/Event/Page/Tab.php
CRM/Extension/Downloader.php
CRM/Extension/Manager.php
CRM/Financial/BAO/PaymentProcessorType.php
CRM/Financial/Form/FinancialAccount.php
CRM/Financial/Page/AJAX.php
CRM/Grant/Form/Task.php
CRM/Grant/Form/Task/Delete.php
CRM/Grant/Info.php
CRM/Group/Form/Edit.php
CRM/Group/Page/Group.php
CRM/Logging/Differ.php
CRM/Logging/ReportSummary.php
CRM/Logging/Schema.php
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/BAO/Recipients.php
CRM/Mailing/Event/BAO/Confirm.php
CRM/Mailing/Event/BAO/Delivered.php
CRM/Mailing/Event/BAO/Queue.php
CRM/Mailing/Event/BAO/Unsubscribe.php
CRM/Mailing/Form/Search.php
CRM/Mailing/Form/Unsubscribe.php
CRM/Mailing/Page/Tab.php
CRM/Mailing/Selector/Event.php
CRM/Member/BAO/Membership.php
CRM/Member/BAO/MembershipLog.php
CRM/Member/BAO/MembershipType.php
CRM/Member/BAO/Query.php
CRM/Member/Form/MembershipBlock.php
CRM/Member/Form/Task/PickProfile.php
CRM/Member/Import/Parser/Membership.php
CRM/Member/Page/Tab.php
CRM/Member/StateMachine/Search.php
CRM/PCP/BAO/PCP.php
CRM/PCP/Form/Event.php
CRM/PCP/Form/PCP.php
CRM/PCP/Page/PCPInfo.php
CRM/Pledge/Form/Pledge.php
CRM/Pledge/Form/Task/Delete.php
CRM/Pledge/Info.php
CRM/Pledge/Selector/Search.php
CRM/Price/BAO/PriceField.php
CRM/Price/Form/Field.php
CRM/Profile/Form.php
CRM/Profile/Selector/Listings.php
CRM/Report/Form.php
CRM/Report/Form/Case/Detail.php
CRM/Report/Form/Contact/Detail.php
CRM/Report/Form/Contact/LoggingDetail.php
CRM/Report/Form/Contact/Relationship.php
CRM/Report/Form/Contact/Summary.php
CRM/Report/Form/Contribute/History.php
CRM/Report/Form/Contribute/LoggingDetail.php
CRM/Report/Form/Contribute/Lybunt.php
CRM/Report/Form/Contribute/Repeat.php
CRM/Report/Form/Contribute/TopDonor.php
CRM/Report/Form/Event/IncomeCountSummary.php
CRM/Report/Form/Event/ParticipantListing.php
CRM/Report/Form/Event/Summary.php
CRM/Report/Form/Extended.php
CRM/Report/Form/Grant/Statistics.php
CRM/Report/Form/Membership/Summary.php
CRM/Report/Form/Pledge/Detail.php
CRM/Report/Form/Pledge/Summary.php
CRM/Report/Interface.php
CRM/Report/Page/InstanceList.php
CRM/SMS/Controller/Send.php
CRM/SMS/Form/Provider.php
CRM/SMS/StateMachine/Send.php
CRM/UF/Form/Field.php
CRM/UF/Page/Field.php
CRM/UF/Page/ProfileEditor.php
CRM/Upgrade/Form.php
CRM/Upgrade/Incremental/php/FourTwo.php
CRM/Upgrade/Incremental/sql/4.6.alpha3.mysql.tpl [new file with mode: 0644]
CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php
CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php
CRM/Utils/API/HTMLInputCoder.php
CRM/Utils/Array.php
CRM/Utils/Date.php
CRM/Utils/File.php
CRM/Utils/Geocode/Yahoo.php
CRM/Utils/Hook/Joomla.php
CRM/Utils/Hook/Soap.php
CRM/Utils/Mail.php
CRM/Utils/Mail/EmailProcessor.php
CRM/Utils/Migrate/Export.php
CRM/Utils/Migrate/ExportJSON.php
CRM/Utils/Money.php
CRM/Utils/PDF/Utils.php
CRM/Utils/REST.php
CRM/Utils/ReCAPTCHA.php
CRM/Utils/Recent.php
CRM/Utils/SQL/Insert.php
CRM/Utils/SoapServer.php
CRM/Utils/String.php
CRM/Utils/System.php
CRM/Utils/System/Base.php
CRM/Utils/System/Drupal.php
CRM/Utils/System/Drupal6.php
CRM/Utils/System/Soap.php
CRM/Utils/System/UnitTests.php
CRM/Utils/Tree.php
CRM/Utils/Type.php
CRM/Widget/Widget.php
Civi/CCase/Analyzer.php
Civi/Core/Container.php
Civi/Core/Transaction/Manager.php
Civi/Install/Requirements.php
api/v3/Contact.php
api/v3/CustomField.php
api/v3/CustomGroup.php
api/v3/EntityTag.php
api/v3/GroupContact.php
api/v3/Im.php
api/v3/Job.php
api/v3/Mailing.php
api/v3/MailingEventConfirm.php
api/v3/MailingEventResubscribe.php
api/v3/MailingJob.php
api/v3/Membership.php
api/v3/MessageTemplate.php
api/v3/Note.php
api/v3/OptionGroup.php
api/v3/PledgePayment.php
api/v3/Profile.php
api/v3/UFGroup.php
api/v3/UFMatch.php
api/v3/utils.php
bin/cleanup42.php
bin/cli.class.php
bin/csv/delete.php
bin/deprecated/UpdateAddress.php
bin/setup.sh
css/dashboard.css
install/index.php
install/template.css
settings/Developer.setting.php
sql/civicrm_generated.mysql
tests/extensions/test.extension.manager.searchtest/main.php
tests/phpunit/AllTests.php
tests/phpunit/CRM/Activity/AllTests.php
tests/phpunit/CRM/AllTests.php
tests/phpunit/CRM/Bridge/OG/DrupalTest.php
tests/phpunit/CRM/Contact/AllTests.php
tests/phpunit/CRM/Contact/BAO/ContactTest.php
tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php
tests/phpunit/CRM/Contribute/AllTests.php
tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php
tests/phpunit/CRM/Core/Config/MailerTest.php
tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php
tests/phpunit/CRM/Core/TransactionTest.php
tests/phpunit/CRM/Extension/Container/AllTests.php
tests/phpunit/CRM/Group/Page/AjaxTest.php
tests/phpunit/CRM/Mailing/BAO/QueryTest.php
tests/phpunit/CRM/Member/AllTests.php
tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php
tests/phpunit/CRM/Member/BAO/MembershipTest.php
tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php
tests/phpunit/CRM/Member/Form/MembershipTest.php
tests/phpunit/CRM/Pledge/AllTests.php
tests/phpunit/CRM/Utils/QueryFormatterTest.php
tests/phpunit/Civi/AllTests.php
tests/phpunit/CiviTest/AuthorizeNet.php
tests/phpunit/CiviTest/CiviDBAssert.php
tests/phpunit/CiviTest/CiviUnitTestCase.php
tests/phpunit/HelloTest.php
tests/phpunit/WebTest/Case/AddCaseTypeTest.php
tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php
tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php
tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php
tests/phpunit/WebTest/Contribute/OnlineContributionTest.php
tests/phpunit/WebTest/Contribute/UpdateContributionTest.php
tests/phpunit/WebTest/Event/AddPricesetTest.php
tests/phpunit/WebTest/Event/MultiprofileEventTest.php
tests/phpunit/WebTest/Event/PCPAddTest.php
tests/phpunit/WebTest/Mailing/MailingTest.php
tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php
tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php
tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php
tests/phpunit/WebTest/Member/StandaloneAddTest.php
tests/phpunit/WebTest/Profile/DedupeTest.php
tests/phpunit/WebTest/Release/ReleaseTestCase.php
tests/phpunit/WebTest/Report/LoggingReportTest.php
tests/phpunit/api/v3/ActivityTest.php
tests/phpunit/api/v3/ContributionTest.php
tests/phpunit/api/v3/CustomFieldTest.php
tests/phpunit/api/v3/MailingTest.php
tests/phpunit/api/v3/PledgeTest.php
tests/phpunit/api/v3/ProductTest.php
tests/phpunit/api/v3/ProfileTest.php
tests/phpunit/api/v3/SyntaxConformanceTest.php
tests/phpunit/api/v3/UFJoinTest.php
tests/phpunit/api/v3/UFMatchTest.php
tests/templates/documentFunction.tpl
xml/version.xml

index 489bd60757b1cc386649379e1474bedbd33e3a6d..acd6254449b6acc7c4062f89cbdc3875899363c5 100644 (file)
@@ -90,7 +90,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form {
           'type' => 'next',
           'name' => ts('Save'),
           'spacing' => '',
-          'isDefault' => FALSE
+          'isDefault' => FALSE,
         ),
       )
     );
@@ -143,7 +143,7 @@ class CRM_ACL_Form_WordPress_Permissions extends CRM_Core_Form {
           CRM_Core_Session::setStatus(
             ts('The %1 role was assigned one or more permissions that may prove dangerous for users of that role to have. Please reconsider assigning %2 to them.', array(
                 1 => $wp_roles->role_names[$role],
-                2 => implode(', ', $warningPermissionNames)
+                2 => implode(', ', $warningPermissionNames),
               )),
             ts('Unsafe Permission Settings')
           );
index 09f260b79b8100f07c4ca125eceef91f422421d5..4f83ddeba17d342ce09f99973dbd6b0342cda805 100644 (file)
@@ -112,7 +112,7 @@ class CRM_ACL_Page_ACLBasic extends CRM_Core_Page_Basic {
       array(
         'title' => ts('Access Control'),
         'url' => CRM_Utils_System::url('civicrm/admin/access', 'reset=1'),
-      )
+      ),
     );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
 
index 338504d984f138e9ae0fb3a8a455d45d681b3d94..4a6c8aa49b2e1bd5d4f5c3cf934328992b508c0c 100644 (file)
@@ -126,7 +126,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic {
         'url' => CRM_Utils_System::url('civicrm/admin/access',
           'reset=1'
         ),
-      )
+      ),
     );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
     CRM_Utils_System::setTitle(ts('Assign Users to Roles'));
index 30529a7d001a0d276aed38f9d3fd5a069dc0f736..1685e121aeec9c099b0510c1cd18a93f78c4edca 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
- * This class is for activity functions
- *
+ * This class is for activity functions.s
  */
 class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
 
@@ -54,12 +52,12 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
   static $_importableFields = NULL;
 
   /**
-   * Check if there is absolute minimum of data to add the object
+   * Check if there is absolute minimum of data to add the object.
    *
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
    *
-   * @return boolean
+   * @return bool
    */
   public static function dataExists(&$params) {
     if (!empty($params['source_contact_id']) || !empty($params['id'])) {
@@ -69,7 +67,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
   }
 
   /**
-   * Fetch object based on array of properties
+   * Fetch object based on array of properties.
    *
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
@@ -139,12 +137,12 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
   }
 
   /**
-   * Delete the activity
+   * Delete the activity.
    *
    * @param array $params
    * @param bool $moveToTrash
    *
-   * @return void
+   * @return mixed
    */
   public static function deleteActivity(&$params, $moveToTrash = FALSE) {
     // CRM-9137
@@ -245,12 +243,10 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
   }
 
   /**
-   * Delete activity assignment record
+   * Delete activity assignment record.
    *
    * @param int $activityId
    * @param int $recordTypeID
-   *
-   * @return null
    */
   public static function deleteActivityContact($activityId, $recordTypeID = NULL) {
     $activityContact = new CRM_Activity_BAO_ActivityContact();
@@ -262,14 +258,14 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
   }
 
   /**
-   * Process the activities
+   * Process the activities.
    *
    * @param array $params
    *   Associated array of the submitted values.
    *
    * @throws CRM_Core_Exception
    *
-   * @return $this|null|object
+   * @return CRM_Activity_BAO_Activity|null|object
    */
   public static function create(&$params) {
     // check required params
@@ -615,8 +611,12 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
   }
 
   /**
-   * @param $activity
-   * @param null $logMessage
+   * Create an activity.
+   *
+   * @todo elaborate on what this does.
+   *
+   * @param CRM_Core_DAO_Activity $activity
+   * @param string $logMessage
    *
    * @return bool
    */
@@ -640,7 +640,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
   }
 
   /**
-   * Get the list Activities
+   * Get the list Activities.
    *
    * @param array $input
    *   Array of parameters.
@@ -655,8 +655,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
    *    - activity_type_id int|string the activitiy types we want to restrict by
    *
    * @return array
-   *   (reference)      $values the relevant data object values of open activities
-   *
+   *   Relevant data object values of open activities
    */
   public static function &getActivities($input) {
     //step 1: Get the basic activity data
@@ -899,13 +898,16 @@ ORDER BY    fixed_sort_order
   }
 
   /**
-   * Get the component id and name those are enabled and logged in
-   * user has permission. To decide whether we are going to include
-   * component related activities w/ core activity retrieve process.
+   * Get the component id and name if those are enabled and allowed.
+   *
+   * Checks whether logged in user has permission.
+   * To decide whether we are going to include
+   * component related activities with core activity retrieve process.
+   * (what did that just mean?)
    *
    * @return array
    *   Array of component id and name.
-   **/
+   */
   public static function activityComponents() {
     $components = array();
     $compInfo = CRM_Core_Component::getEnabledComponents();
@@ -932,7 +934,7 @@ ORDER BY    fixed_sort_order
   }
 
   /**
-   * Get the activity Count
+   * Get the activity Count.
    *
    * @param array $input
    *   Array of parameters.
@@ -945,7 +947,6 @@ ORDER BY    fixed_sort_order
    *
    * @return int
    *   count of activities
-   *
    */
   public static function &getActivitiesCount($input) {
     $input['count'] = TRUE;
@@ -968,7 +969,7 @@ LEFT JOIN   civicrm_case_activity ON ( civicrm_case_activity.activity_id = tbl.a
   }
 
   /**
-   * Get the activity sql clause to pick activities
+   * Get the activity sql clause to pick activities.
    *
    * @param array $input
    *   Array of parameters.
@@ -982,7 +983,6 @@ LEFT JOIN   civicrm_case_activity ON ( civicrm_case_activity.activity_id = tbl.a
    *
    * @return int
    *   count of activities
-   *
    */
   public static function getActivitySQLClause($input) {
     $params = array();
@@ -1052,7 +1052,6 @@ LEFT JOIN   civicrm_case_activity ON ( civicrm_case_activity.activity_id = tbl.a
       $includeCaseActivities = TRUE;
     }
 
-
     // build main activity table select clause
     $sourceSelect = '';
 
@@ -1148,8 +1147,9 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
   }
 
   /**
-   * Send the message to all the contacts and also insert a
-   * contact activity in each contacts record
+   * Send the message to all the contacts.
+   *
+   * Also insert a contact activity in each contacts record.
    *
    * @param array $contactDetails
    *   The array of contact details to send the email.
@@ -1176,7 +1176,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
    * @return array
    *   ( sent, activityId) if any email is sent and activityId
    */
-  static function sendEmail(
+  public static function sendEmail(
     &$contactDetails,
     &$subject,
     &$text,
@@ -1187,7 +1187,8 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
     $attachments = NULL,
     $cc = NULL,
     $bcc = NULL,
-    $contactIds, // FIXME a param with no default shouldn't be last
+    // FIXME a param with no default shouldn't be last
+    $contactIds,
     $additionalDetails = NULL
   ) {
     // get the contact details of logged in contact, which we set as from email
@@ -1273,7 +1274,6 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
       }
     }
 
-
     // get token details for contacts, call only if tokens are used
     $details = array();
     if (!empty($returnProperties) || !empty($tokens) || !empty($allTokens)) {
@@ -1361,6 +1361,8 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
   }
 
   /**
+   * Send SMS.
+   *
    * @param array $contactDetails
    * @param array $activityParams
    * @param array $smsParams
@@ -1370,7 +1372,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
    * @return array
    * @throws CRM_Core_Exception
    */
-  static function sendSMS(
+  public static function sendSMS(
     &$contactDetails,
     &$activityParams,
     &$smsParams = array(),
@@ -1493,12 +1495,11 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
   }
 
   /**
-   * Send the sms message to a specific contact
+   * Send the sms message to a specific contact.
    *
    * @param int $toID
    *   The contact id of the recipient.
    * @param $tokenText
-   * @param $tokenHtml
    * @param array $smsParams
    *   The params used for sending sms.
    * @param int $activityID
@@ -1508,7 +1509,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
    * @return bool|PEAR_Error
    *   true on success or PEAR_Error object
    */
-  static function sendSMSMessage(
+  public static function sendSMSMessage(
     $toID,
     &$tokenText,
     $smsParams = array(),
@@ -1556,7 +1557,6 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
     $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
     $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
 
-
     // add activity target record for every sms that is send
     $activityTargetParams = array(
       'activity_id' => $activityID,
@@ -1569,7 +1569,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
   }
 
   /**
-   * Send the message to a specific contact
+   * Send the message to a specific contact.
    *
    * @param string $from
    *   The name and email of the sender.
@@ -1588,10 +1588,10 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
    * @param null $cc
    * @param null $bcc
    *
-   * @return boolean
-   *   true if successfull else false.
+   * @return bool
+   *   TRUE if successful else FALSE.
    */
-  static function sendMessage(
+  public static function sendMessage(
     $from,
     $fromID,
     $toID,
@@ -1652,7 +1652,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
   }
 
   /**
-   * Combine all the importable fields from the lower levels object
+   * Combine all the importable fields from the lower levels object.
    *
    * The ordering is important, since currently we do not have a weight
    * scheme. Adding weight is super important and should be done in the
@@ -1709,7 +1709,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
   }
 
   /**
-   * get the Activities of a target contact
+   * Get the Activities of a target contact.
    *
    * @param int $contactId
    *   Id of the contact whose activities need to find.
@@ -1724,7 +1724,6 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND
     $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
     $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
 
-
     // First look for activities where contactId is one of the targets
     $query = "
 SELECT activity_id, record_type_id
@@ -1783,7 +1782,7 @@ WHERE      activity.id IN ($activityIds)";
   }
 
   /**
-   * Add activity for Membership/Event/Contribution
+   * Add activity for Membership/Event/Contribution.
    *
    * @param object $activity
    *   (reference) particular component object.
@@ -1791,9 +1790,9 @@ WHERE      activity.id IN ($activityIds)";
    *   For Membership Signup or Renewal.
    * @param int $targetContactID
    *
-   * @return bool
+   * @return bool|NULL
    */
-  static function addActivity(
+  public static function addActivity(
     &$activity,
     $activityType = 'Membership Signup',
     $targetContactID = NULL
@@ -1849,7 +1848,7 @@ SELECT  display_name
     elseif ($activity->__table == 'civicrm_contribution') {
       //create activity record only for Completed Contributions
       if ($activity->contribution_status_id != 1) {
-        return;
+        return NULL;
       }
 
       $subject = NULL;
@@ -1902,13 +1901,13 @@ SELECT  display_name
   }
 
   /**
-   * Get Parent activity for currently viewed activity
+   * Get Parent activity for currently viewed activity.
    *
    * @param int $activityId
    *   Current activity id.
    *
    * @return int
-   *   $parentId  Id of parent activity otherwise false.
+   *   Id of parent activity otherwise false.
    */
   public static function getParentActivity($activityId) {
     static $parentActivities = array();
@@ -1930,7 +1929,7 @@ SELECT  display_name
   }
 
   /**
-   * Get total count of prior revision of currently viewd activity
+   * Get total count of prior revision of currently viewed activity.
    *
    * @param $activityID
    *   Current activity id.
@@ -1968,7 +1967,7 @@ AND id < {$activityID}
   }
 
   /**
-   * Get all prior activities of currently viewed activity
+   * Get all prior activities of currently viewed activity.
    *
    * @param $activityID
    *   Current activity id.
@@ -2019,7 +2018,7 @@ AND cl.modified_id  = c.id
   }
 
   /**
-   * Find the latest revision of a given activity
+   * Find the latest revision of a given activity.
    *
    * @param int $activityID
    *   Prior activity id.
@@ -2052,17 +2051,17 @@ AND cl.modified_id  = c.id
   }
 
   /**
-   * Create a follow up a given activity
+   * Create a follow up a given activity.
    *
    * @param int $activityId
    *   activity id of parent activity.
    * @param array $params
    *
-   * @return $this|null|object
+   * @return CRM_Activity_BAO_Activity|null|object
    */
   public static function createFollowupActivity($activityId, $params) {
     if (!$activityId) {
-      return;
+      return NULL;
     }
 
     $session = CRM_Core_Session::singleton();
@@ -2099,7 +2098,6 @@ AND cl.modified_id  = c.id
    *
    * @return string|bool
    *   if file exists returns $activityTypeFile activity filename otherwise false.
-   *
    */
   public static function getFileForActivityTypeId($activityTypeId, $crmDir = 'Activity') {
     $activityTypes = CRM_Case_PseudoConstant::caseActivityType(FALSE, TRUE);
@@ -2126,11 +2124,11 @@ AND cl.modified_id  = c.id
   }
 
   /**
-   * Restore the activity
+   * Restore the activity.
    *
    * @param array $params
    *
-   * @return void
+   * @return CRM_Activity_DAO_Activity
    */
   public static function restoreActivity(&$params) {
     $activity = new CRM_Activity_DAO_Activity();
@@ -2143,7 +2141,7 @@ AND cl.modified_id  = c.id
   }
 
   /**
-   * Get the exportable fields for Activities
+   * Get the exportable fields for Activities.
    *
    * @param string $name
    *   If it is called by case $name = Case else $name = Activity.
@@ -2165,10 +2163,17 @@ AND cl.modified_id  = c.id
           'type' => CRM_Utils_Type::T_STRING,
         );
 
-
         $Activityfields = array(
-          'activity_type' => array('title' => ts('Activity Type'), 'name' => 'activity_type', 'type' => CRM_Utils_Type::T_STRING),
-          'activity_status' => array('title' => ts('Activity Status'), 'name' => 'activity_status', 'type' => CRM_Utils_Type::T_STRING),
+          'activity_type' => array(
+            'title' => ts('Activity Type'),
+            'name' => 'activity_type',
+            'type' => CRM_Utils_Type::T_STRING,
+          ),
+          'activity_status' => array(
+            'title' => ts('Activity Status'),
+            'name' => 'activity_status',
+            'type' => CRM_Utils_Type::T_STRING,
+          ),
         );
         $fields = array_merge($Activityfields, $exportableFields);
       }
@@ -2206,7 +2211,7 @@ AND cl.modified_id  = c.id
   }
 
   /**
-   * Get the allowed profile fields for Activities
+   * Get the allowed profile fields for Activities.
    *
    * @return array
    *   array of activity profile Fields
@@ -2242,8 +2247,10 @@ AND cl.modified_id  = c.id
   }
 
   /**
-   * This function deletes the activity record related to contact record,
-   * when there are no target and assignee record w/ other contact.
+   * This function deletes the activity record related to contact record.
+   *
+   * This is conditional on there being no target and assignee record
+   * with other contacts.
    *
    * @param int $contactId
    *   ContactId.
@@ -2290,14 +2297,14 @@ AND cl.modified_id  = c.id
   }
 
   /**
-   * Does user has sufficient permission for view/edit activity record?
+   * Does user has sufficient permission for view/edit activity record.
    *
    * @param int $activityId
    *   Activity record id.
    * @param int $action
    *   Edit/view.
    *
-   * @return boolean
+   * @return bool
    */
   public static function checkPermission($activityId, $action) {
     $allow = FALSE;
@@ -2442,13 +2449,13 @@ INNER JOIN  civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n
   }
 
   /**
-   * wrapper for ajax activity selector
+   * Wrapper for ajax activity selector.
    *
    * @param array $params
    *   Associated array for params record id.
    *
    * @return array
-   *   associated array of contact activities
+   *   Associated array of contact activities
    */
   public static function getContactActivitySelector(&$params) {
     // format the params
@@ -2592,7 +2599,8 @@ INNER JOIN  civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n
   }
 
   /**
-   * copy custom fields and attachments from an existing activity to another.
+   * Copy custom fields and attachments from an existing activity to another.
+   *
    * @see CRM_Case_Page_AJAX::_convertToCaseActivity()
    *
    * @param array $params
@@ -2612,7 +2620,8 @@ INNER JOIN  civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n
       }
 
       foreach ($customValues as $key => $value) {
-        if ($value !== NULL) { // CRM-10542
+        if ($value !== NULL) {
+          // CRM-10542
           if (in_array($key, $htmlType)) {
             $fileValues = CRM_Core_BAO_File::path($value, $params['activityID']);
             $customParams["custom_{$key}_-1"] = array(
@@ -2635,6 +2644,8 @@ INNER JOIN  civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n
   }
 
   /**
+   * Get activity contact.
+   *
    * @param int $activityId
    * @param int $recordTypeID
    * @param string $column
@@ -2654,6 +2665,8 @@ INNER JOIN  civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n
   }
 
   /**
+   * Get source contact id.
+   *
    * @param int $activityId
    *
    * @return null
@@ -2669,6 +2682,10 @@ INNER JOIN  civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n
   }
 
   /**
+   * Set api filter.
+   *
+   * @todo Document what this is for.
+   *
    * @param array $params
    */
   public function setApiFilter(&$params) {
index b7d825aac1ccc35ec679c26ee2d24bcffa6ccbb6..6fc196e5fcd05921f6ba5be769965e08b0b8aff9 100644 (file)
@@ -148,9 +148,9 @@ class CRM_Activity_Form_Task_AddToTag extends CRM_Activity_Form_Task {
       $status = array(ts('%count activities tagged', array('count' => $added, 'plural' => '%count activities tagged')));
       if ($notAdded) {
         $status[] = ts('%count activities already had this tag', array(
-            'count' => $notAdded,
-            'plural' => '%count activities already had this tag'
-          ));
+          'count' => $notAdded,
+          'plural' => '%count activities already had this tag',
+        ));
       }
       $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
       CRM_Core_Session::setStatus($status, ts("Added Tag <em>%1</em>", array(1 => $this->_tags[$key])), 'success', array('expires' => 0));
index ed1a99e5a9833097f5b959aaba2a4c99ebadd257..0ff7d2ef5afa6bd167f8404caf7fc3c83c269bce 100644 (file)
@@ -67,7 +67,7 @@ class CRM_Admin_Form_Mapping extends CRM_Admin_Form {
       );
       $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
           'CRM_Core_DAO_Mapping',
-          $this->_id
+          $this->_id,
         ));
 
       $this->addElement('text', 'description', ts('Description'),
index 1b2eac7a0b5d306e49386f53cee412f5b12f67ee..57be327a5967af2fce4063b56e41e05b6ec080a2 100644 (file)
@@ -43,8 +43,8 @@ class CRM_Admin_Form_Preferences_Address extends CRM_Admin_Form_Preferences {
 
     // Address Standardization
     $addrProviders = array(
-        '' => '- select -'
-      ) + CRM_Core_SelectValues::addressProvider();
+      '' => '- select -',
+    ) + CRM_Core_SelectValues::addressProvider();
 
     $this->_varNames = array(
       CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME => array(
index 3b1ee87705cfe90819da283b48444c2adf6d77c2..8e0c222178df9db58a8a7fcc0d72d8e15bd96dc5 100644 (file)
@@ -67,8 +67,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
       return;
     }
     elseif ($this->_action & (CRM_Core_Action::UPDATE)) {
-      $this->_mappingID =
-        CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'mapping_id');
+      $this->_mappingID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'mapping_id');
       if ($this->_context == 'event') {
         $this->_compId = CRM_Utils_Request::retrieve('compId', 'Integer', $this);
       }
index 35a60e44c8e3bb6cca068419ff8c8d0c13accd50..5aaf82f8b83747915d859c6b8898da143bb0392c 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
  * This class generates form components generic to CiviCRM settings
- *
  */
 class CRM_Admin_Form_Setting extends CRM_Core_Form {
 
@@ -44,10 +42,8 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
 
   /**
    * Set default values for the form.
-   * default values are retrieved from the database
    *
-   *
-   * @return void
+   * Default values are retrieved from the database.
    */
   public function setDefaultValues() {
     if (!$this->_defaults) {
@@ -89,11 +85,11 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
 
       //Set defaults for autocomplete and contact reference options
       $this->_defaults['autocompleteContactSearch'] = array(
-          '1' => 1
-        ) + $autoSearchFields;
+        '1' => 1,
+      ) + $autoSearchFields;
       $this->_defaults['autocompleteContactReference'] = array(
-          '1' => 1
-        ) + $cRSearchFields;
+        '1' => 1,
+      ) + $cRSearchFields;
 
       // we can handle all the ones defined in the metadata here. Others to be converted
       foreach ($this->_settings as $setting => $group) {
@@ -115,9 +111,7 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
   }
 
   /**
-   * Build the form object
-   *
-   * @return void
+   * Build the form object.
    */
   public function buildQuickForm() {
     $session = CRM_Core_Session::singleton();
@@ -169,10 +163,7 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
   }
 
   /**
-   * Process the form submission
-   *
-   *
-   * @return void
+   * Process the form submission.
    */
   public function postProcess() {
     // store the submitted values in an array
@@ -182,6 +173,10 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form {
   }
 
   /**
+   * Common Process.
+   *
+   * @todo Document what I do.
+   *
    * @param array $params
    */
   public function commonProcess(&$params) {
index a8a052b75aef6709b511ff48174d172a660a4a9c..ee0acdd7f6139e69e9c485521f7ea4d9d4b22907 100644 (file)
@@ -88,8 +88,6 @@ class CRM_Admin_Form_Setting_Mapping extends CRM_Admin_Form_Setting {
    * add the rules (mainly global rules) for form.
    * All local rules are added near the element
    *
-   * @param null
-   *
    * @return void
    */
   public function addRules() {
index af478be545c8c11b2f96169e6afdfdd7a28c7868..2ddd301f5eb6a00286b3d858ee3149ed2197e4e9 100644 (file)
@@ -94,7 +94,7 @@ class CRM_Admin_Form_Tag extends CRM_Admin_Form {
       );
       $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
           'CRM_Core_DAO_Tag',
-          $this->_id
+          $this->_id,
         ));
 
       $this->add('text', 'description', ts('Description'),
index 4394353ba637ebda32e357bed799da1ab265ab3a..b0d0db63a226679436d6c36b2a33b50fd1958745 100644 (file)
@@ -55,7 +55,7 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form {
       array(
         'title' => ts('Word Replacements'),
         'url' => $breadCrumbUrl,
-      )
+      ),
     );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
   }
@@ -219,7 +219,7 @@ class CRM_Admin_Form_WordReplacements extends CRM_Core_Form {
    */
   public function postProcess() {
     $params = $this->controller->exportValues($this->_name);
-    $this->_numStrings = sizeof($params['old']);
+    $this->_numStrings = count($params['old']);
 
     $enabled['exactMatch'] = $enabled['wildcardMatch'] = $disabled['exactMatch'] = $disabled['wildcardMatch'] = array();
     for ($i = 1; $i <= $this->_numStrings; $i++) {
index 35d7aa9e2c8f1e5b59a397b6428eb43d8232f4a5..a95514675eea54a5cc6eca43f5b8aee4ebf06a88 100644 (file)
@@ -115,7 +115,7 @@ class CRM_Admin_Page_AJAX {
             $ret['illegal'] = TRUE;
             $table = $template->fetch('CRM/Price/Page/table.tpl');
             $ret['content'] = ts('Unable to disable the \'%1\' price set - it is currently in use by one or more active events, contribution pages or contributions.', array(
-                1 => $priceSet
+                1 => $priceSet,
               )) . "<br/> $table";
           }
           else {
index dd2fb7833b992efe5d315f6b3cc7da2070af813d..169f0b48d0b225419d54c344139c9f897febd9b0 100755 (executable)
@@ -30,7 +30,6 @@
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
@@ -50,11 +49,9 @@ class CRM_Campaign_Form_Gotv extends CRM_Core_Form {
   protected $_searchVoterFor;
 
   /**
-   * Processing needed for buildForm and later
-   *
-   * @return void
+   * Processing needed for buildForm and later.
    */
-  function preProcess() {
+  public function preProcess() {
     $this->_search = CRM_Utils_Array::value('search', $_GET);
     $this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE);
     $this->_surveyId = CRM_Utils_Request::retrieve('sid', 'Positive', $this);
@@ -96,10 +93,7 @@ class CRM_Campaign_Form_Gotv extends CRM_Core_Form {
   }
 
   /**
-   * Build the form object
-   *
-   *
-   * @return void
+   * Build the form object.
    */
   public function buildQuickForm() {
     if ($this->_search) {
index 70e49c6571781bfeeecdc804251359d0bc9821da..039ef71573b46d1b1d331da567a326fa3d503489 100644 (file)
@@ -77,8 +77,6 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
    * 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
    */
@@ -100,8 +98,6 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
   /**
    * Build the form object
    *
-   * @param null
-   *
    * @return void
    */
   public function buildQuickForm() {
@@ -344,8 +340,6 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
   /**
    * Process the form
    *
-   * @param null
-   *
    * @return void
    */
   public function postProcess() {
@@ -415,23 +409,21 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
     if (!$this->_reportId && $survey->id && !empty($params['create_report'])) {
       $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
       $activityStatus = array_flip($activityStatus);
-      $this->_params =
-        array(
-          'name' => "survey_{$survey->id}",
-          'title' => $params['report_title'] ? $params['report_title'] : $this->_values['title'],
-          'status_id_op' => 'eq',
-          'status_id_value' => $activityStatus['Scheduled'], // reserved status
-          'survey_id_value' => array($survey->id),
-          'description' => ts('Detailed report for canvassing, phone-banking, walk lists or other surveys.'),
-        );
+      $this->_params = array(
+        'name' => "survey_{$survey->id}",
+        'title' => $params['report_title'] ? $params['report_title'] : $this->_values['title'],
+        'status_id_op' => 'eq',
+        'status_id_value' => $activityStatus['Scheduled'], // reserved status
+        'survey_id_value' => array($survey->id),
+        'description' => ts('Detailed report for canvassing, phone-banking, walk lists or other surveys.'),
+      );
       //Default value of order by
-      $this->_params['order_bys'] =
-        array(
-          1 => array(
-            'column' => 'sort_name',
-            'order' => 'ASC',
-          ),
-        );
+      $this->_params['order_bys'] = array(
+        1 => array(
+          'column' => 'sort_name',
+          'order' => 'ASC',
+        ),
+      );
       // for WalkList or default
       $displayFields = array(
         'id',
@@ -445,25 +437,24 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
       if (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') ==
         $this->_values['activity_type_id']
       ) {
-        $this->_params['order_bys'] =
-          array(
-            1 => array(
-              'column' => 'street_name',
-              'order' => 'ASC',
-            ),
-            2 => array(
-              'column' => 'street_number_odd_even',
-              'order' => 'ASC',
-            ),
-            3 => array(
-              'column' => 'street_number',
-              'order' => 'ASC',
-            ),
-            4 => array(
-              'column' => 'sort_name',
-              'order' => 'ASC',
-            ),
-          );
+        $this->_params['order_bys'] = array(
+          1 => array(
+            'column' => 'street_name',
+            'order' => 'ASC',
+          ),
+          2 => array(
+            'column' => 'street_number_odd_even',
+            'order' => 'ASC',
+          ),
+          3 => array(
+            'column' => 'street_number',
+            'order' => 'ASC',
+          ),
+          4 => array(
+            'column' => 'sort_name',
+            'order' => 'ASC',
+          ),
+        );
       }
       elseif (CRM_Core_OptionGroup::getValue('activity_type', 'PhoneBank') ==
         $this->_values['activity_type_id']
index 3fcab21335c564615a2af1df5b87f291df7d404b..f87ede84b452f4ea112776d4391b37f954796196 100755 (executable)
@@ -81,7 +81,7 @@ class CRM_Campaign_Form_Task extends CRM_Core_Form {
    *
    * @return void
    */
-  function preProcess() {
+  public function preProcess() {
     $values = $this->controller->exportValues('Search');
 
     $this->_task = $values['task'];
index 20425cbfc907e32d7ec0ca30f4463d9e5781db5a..99f77408d3a9a461d9e7d5d517aa574b1496a98c 100755 (executable)
@@ -81,7 +81,7 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task {
       foreach (array(
                  'surveyId',
                  'contactIds',
-                 'interviewerId'
+                 'interviewerId',
                ) as $fld) {
         $this->{"_$fld"} = $this->get($fld);
       }
@@ -300,7 +300,7 @@ WHERE {$clause}
       $this->addElement('select', "order_bys[{$i}][column]", ts('Order by Column'), $options);
       $this->addElement('select', "order_bys[{$i}][order]", ts('Order by Order'), array(
           'ASC' => 'Ascending',
-          'DESC' => 'Descending'
+          'DESC' => 'Descending',
         ));
     }
 
@@ -321,7 +321,7 @@ WHERE {$clause}
       if (!empty($this->_resultOptions)) {
         $this->add('select', "field[$contactId][result]", ts('Result'),
           array(
-            '' => ts('- select -')
+            '' => ts('- select -'),
           ) +
           array_combine($this->_resultOptions, $this->_resultOptions)
         );
@@ -350,7 +350,7 @@ WHERE {$clause}
         'name' => ts('Done'),
         'subName' => 'interview',
         'isDefault' => TRUE,
-      )
+      ),
     );
 
     $buttons[] = array(
@@ -431,11 +431,10 @@ WHERE {$clause}
     else {
       $defaults['order_bys'] =
         array(
-          1 =>
-            array(
-              'column' => 'contact_a.sort_name',
-              'order' => 'ASC',
-            ),
+          1 => array(
+            'column' => 'contact_a.sort_name',
+            'order' => 'ASC',
+          ),
         );
     }
     return $defaults;
@@ -458,7 +457,7 @@ WHERE {$clause}
       foreach (array(
                  'surveyId',
                  'contactIds',
-                 'interviewerId'
+                 'interviewerId',
                ) as $fld) {
         $this->controller->set($fld, $this->{"_$fld"});
       }
@@ -466,7 +465,6 @@ WHERE {$clause}
     }
 
     // vote is done through ajax
-    return;
   }
 
   /**
index b8cf42de6d5eefeccd5809a8fa6629b2773cc4dc..b6aeb8ffc5253b85ceb18561fa15952ccccb7fe4 100644 (file)
@@ -158,7 +158,7 @@ class CRM_Campaign_Page_AJAX {
     //format multi-select group and contact types.
     foreach (array(
                'group',
-               'contact_type'
+               'contact_type',
              ) as $param) {
       $paramValue = CRM_Utils_Array::value($param, $params);
       if ($paramValue) {
@@ -174,7 +174,7 @@ class CRM_Campaign_Page_AJAX {
     foreach (array(
                'campaign_survey_id',
                'survey_interviewer_id',
-               'campaign_search_voter_for'
+               'campaign_search_voter_for',
              ) as $fld) {
       $voterClauseParams[$fld] = CRM_Utils_Array::value($fld, $params);
     }
@@ -499,7 +499,7 @@ class CRM_Campaign_Page_AJAX {
       array(
         'value' => '',
         'title' => ts('- select -'),
-      )
+      ),
     );
     foreach ($campaigns as $value => $title) {
       $class = NULL;
@@ -546,7 +546,7 @@ class CRM_Campaign_Page_AJAX {
       array(
         'value' => '',
         'title' => ts('- select -'),
-      )
+      ),
     );
     foreach ($campGroups as $grpId => $title) {
       $groups[] = array(
@@ -565,7 +565,7 @@ class CRM_Campaign_Page_AJAX {
   /**
    * Retrieve campaigns as for campaign dashboard.
    *
-   **/
+   */
   public function campaignList() {
     //get the search criteria params.
     $searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST));
@@ -635,7 +635,7 @@ class CRM_Campaign_Page_AJAX {
                'sort',
                'offset',
                'rowCount',
-               'sortOrder'
+               'sortOrder',
              ) as $sortParam) {
       $params[$sortParam] = $$sortParam;
     }
@@ -666,7 +666,7 @@ class CRM_Campaign_Page_AJAX {
   /**
    * Retrieve survey for survey dashboard.
    *
-   **/
+   */
   public function surveyList() {
     //get the search criteria params.
     $searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST));
@@ -738,7 +738,7 @@ class CRM_Campaign_Page_AJAX {
                'sort',
                'offset',
                'rowCount',
-               'sortOrder'
+               'sortOrder',
              ) as $sortParam) {
       $params[$sortParam] = $$sortParam;
     }
@@ -769,7 +769,7 @@ class CRM_Campaign_Page_AJAX {
   /**
    * Retrieve petitions for petition dashboard.
    *
-   **/
+   */
   public function petitionList() {
     //get the search criteria params.
     $searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST));
@@ -836,7 +836,7 @@ class CRM_Campaign_Page_AJAX {
                'sort',
                'offset',
                'rowCount',
-               'sortOrder'
+               'sortOrder',
              ) as $sortParam) {
       $params[$sortParam] = $$sortParam;
     }
index c51b09920316b9444f6e42866e8c0ed79049c706..bd27990f46eabf326277f8b18734fd271a0e6ebf 100644 (file)
@@ -153,7 +153,8 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case {
   /**
    * Create case contact record
    *
-   * @param array case_id, contact_id
+   * @param array $params
+   *   case_id, contact_id
    *
    * @return object
    */
@@ -195,7 +196,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case {
   /**
    * Delet case contact record
    *
-   * @param int case_id
+   * @param int $caseID
    *
    * @return Void
    */
@@ -2341,7 +2342,7 @@ INNER JOIN  civicrm_case_contact ON ( civicrm_case.id = civicrm_case_contact.cas
    *
    * @return int|NULL
    */
-  static function mergeCases(
+  public static function mergeCases(
     $mainContactId, $mainCaseId = NULL, $otherContactId = NULL,
     $otherCaseId = NULL, $changeClient = FALSE) {
     $moveToTrash = TRUE;
@@ -2800,7 +2801,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')';
    * @param bool $checkComponent
    *   Do we need to check component enabled.
    *
-   * @return boolean
+   * @return bool
    */
   public static function checkPermission($activityId, $operation, $actTypeId = NULL, $contactId = NULL, $checkComponent = TRUE) {
     $allow = FALSE;
@@ -3111,7 +3112,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')';
    * @param int $activityID
    *   Activity id.
    *
-   * @return boolean
+   * @return bool
    */
   public static function isCaseActivity($activityID) {
     $isCaseActivity = FALSE;
@@ -3382,7 +3383,7 @@ WHERE id IN (' . implode(',', $copiedActivityIds) . ')';
    * @param array $props
    *   Whatever is known about this dao object.
    *
-   * @return Array|bool
+   * @return array|bool
    */
   public static function buildOptions($fieldName, $context = NULL, $props = array()) {
     $className = __CLASS__;
index 2709c8171d4f9584e497a30975b7cae67a37127e..93bbaa0f9068efd6b96ad90b4fcfc4891a4f9f2e 100644 (file)
@@ -53,7 +53,7 @@ class CRM_Case_Form_Task_Restore extends CRM_Case_Form_Task {
    *
    * @return void
    */
-  function preProcess() {
+  public function preProcess() {
     parent::preProcess();
   }
 
index ce9be2e1a692ee44b7247855c6a4ed37cf04c912..7ee506fe4a161bcffd79d2073a1185a21abe98a3 100644 (file)
@@ -199,7 +199,7 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
             'query' => "reset=1&action=add&atype=$atype&context=standalone",
             'ref' => 'new-case',
             'title' => ts('Case'),
-          )
+          ),
         ));
       }
     }
index 26bee4b885325e1b8773ca31e06ce23b15e63e31..4e460c7e3669d76e70cc8901e3e1f0c8f421280b 100644 (file)
@@ -44,7 +44,7 @@ class CRM_Case_StateMachine_Search extends CRM_Core_StateMachine {
   /**
    * Class constructor
    */
-  function __construct($controller, $action = CRM_Core_Action::NONE) {
+  public function __construct($controller, $action = CRM_Core_Action::NONE) {
     parent::__construct($controller, $action);
 
     $this->_pages = array();
index bc43f7c1b5f68dcdff5c0ac962f2aadc14f1301e..8e9ccee6606607725acab424ba8faec98d9adb0d 100644 (file)
@@ -30,7 +30,6 @@
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
 
@@ -64,14 +63,24 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
    *
    * @var array
    */
-  static $_commPrefs = array('do_not_phone', 'do_not_email', 'do_not_mail', 'do_not_sms', 'do_not_trade');
+  static $_commPrefs = array(
+    'do_not_phone',
+    'do_not_email',
+    'do_not_mail',
+    'do_not_sms',
+    'do_not_trade',
+  );
 
   /**
    * Types of greetings
    *
    * @var array
    */
-  static $_greetingTypes = array('addressee', 'email_greeting', 'postal_greeting');
+  static $_greetingTypes = array(
+    'addressee',
+    'email_greeting',
+    'postal_greeting',
+  );
 
   /**
    * Static field for all the contact information that we can potentially import
@@ -88,27 +97,25 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
   static $_exportableFields = NULL;
 
   /**
-   * Class constructor
-   *
-   * @return \CRM_Contact_DAO_Contact
-   */
-  /**
+   * Class constructor.
    */
   public function __construct() {
     parent::__construct();
   }
 
   /**
-   * Takes an associative array and creates a contact object
+   * Takes an associative array and creates a contact object.
    *
-   * the function extract all the params it needs to initialize the create a
+   * The function extracts all the params it needs to initialize the create a
    * contact object. the params array could contain additional unused name/value
    * pairs
    *
    * @param array $params
-   *   (reference ) an assoc array of name/value pairs.
+   *   (reference) an assoc array of name/value pairs.
    *
-   * @return CRM_Contact_BAO_Contact
+   * @return CRM_Contact_BAO_Contact|CRM_Core_Error
+   *   Created or updated contact object or error object.
+   *   (error objects are being phased out in favour of exceptions)
    */
   public static function add(&$params) {
     $contact = new CRM_Contact_DAO_Contact();
@@ -117,7 +124,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
       return;
     }
 
-    //fix for validate contact sub type CRM-5143
+    // Fix for validate contact sub type CRM-5143.
     if (isset($params['contact_sub_type'])) {
       if (empty($params['contact_sub_type'])) {
         $params['contact_sub_type'] = 'null';
@@ -140,17 +147,17 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
       }
     }
     else {
-      // reset the value
-      // CRM-101XX
+      // Reset the value.
+      // CRM-101XX.
       $params['contact_sub_type'] = 'null';
     }
 
-    //fixed contact source
+    // Fixed contact source.
     if (isset($params['contact_source'])) {
       $params['source'] = $params['contact_source'];
     }
 
-    //fix for preferred communication method
+    // Fix for preferred communication method.
     $prefComm = CRM_Utils_Array::value('preferred_communication_method', $params);
     if ($prefComm && is_array($prefComm)) {
       unset($params['preferred_communication_method']);
@@ -179,7 +186,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
     if ($contact->contact_type == 'Individual') {
       $allNull = FALSE;
 
-      //format individual fields
+      // Format individual fields.
       CRM_Contact_BAO_Individual::format($params, $contact);
     }
     elseif ($contact->contact_type == 'Household') {
@@ -195,7 +202,6 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
       }
     }
 
-    // privacy block
     $privacy = CRM_Utils_Array::value('privacy', $params);
     if ($privacy &&
       is_array($privacy) &&
@@ -207,9 +213,9 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
       }
     }
 
-    // since hash was required, make sure we have a 0 value for it, CRM-1063
-    // fixed in 1.5 by making hash optional
-    // only do this in create mode, not update
+    // Since hash was required, make sure we have a 0 value for it (CRM-1063).
+    // @todo - does this mean we can remove this block?
+    // Fixed in 1.5 by making hash optional, only do this in create mode, not update.
     if ((!array_key_exists('hash', $contact) || !$contact->hash) && !$contact->id) {
       $allNull = FALSE;
       $contact->hash = md5(uniqid(rand(), TRUE));
@@ -230,7 +236,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
     }
 
     if ($contact->contact_type == 'Individual' && (isset($params['current_employer']) || isset($params['employer_id']))) {
-      // create current employer
+      // Create current employer.
       $newEmployer = !empty($params['employer_id']) ? $params['employer_id'] : CRM_Utils_Array::value('current_employer', $params);
 
       $newContact = FALSE;
@@ -241,14 +247,13 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
         CRM_Contact_BAO_Contact_Utils::createCurrentEmployerRelationship($contact->id, $newEmployer, $employerId, $newContact);
       }
       else {
-        //unset if employer id exits
         if ($employerId) {
           CRM_Contact_BAO_Contact_Utils::clearCurrentEmployer($contact->id, $employerId);
         }
       }
     }
 
-    //update cached employee name
+    // Update cached employer name.
     if ($contact->contact_type == 'Organization') {
       CRM_Contact_BAO_Contact_Utils::updateCurrentEmployer($contact->id);
     }
@@ -257,7 +262,8 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
   }
 
   /**
-   * Create contact
+   * Create contact.
+   *
    * takes an associative array and creates a contact object and all the associated
    * derived objects (i.e. individual, location, email, phone etc)
    *
@@ -271,9 +277,14 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
    *   If we need to invoke hooks.
    *
    * @param bool $skipDelete
+   *   Unclear parameter, passed to website create
+   *
+   * @todo explain this parameter
    *
    * @throws Exception
-   * @return CRM_Contact_BAO_Contact
+   * @return CRM_Contact_BAO_Contact|CRM_Core_Error
+   *   Created or updated contribution object. We are deprecating returning an error in
+   *   favour of exceptions
    */
   public static function &create(&$params, $fixAddress = TRUE, $invokeHooks = TRUE, $skipDelete = FALSE) {
     $contact = NULL;
@@ -294,17 +305,17 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
 
     $config = CRM_Core_Config::singleton();
 
-    // CRM-6942: set preferred language to the current language if it’s unset (and we’re creating a contact)
+    // CRM-6942: set preferred language to the current language if it’s unset (and we’re creating a contact).
     if (empty($params['contact_id']) && empty($params['preferred_language'])) {
       $params['preferred_language'] = $config->lcMessages;
     }
 
-    // CRM-9739: set greeting & addressee if unset and we’re creating a contact
+    // CRM-9739: set greeting & addressee if unset and we’re creating a contact.
     if (empty($params['contact_id'])) {
       foreach (self::$_greetingTypes as $greeting) {
         if (empty($params[$greeting . '_id'])) {
-          if ($defaultGreetingTypeId =
-            CRM_Contact_BAO_Contact_Utils::defaultGreeting($params['contact_type'], $greeting)
+          if ($defaultGreetingTypeId
+            CRM_Contact_BAO_Contact_Utils::defaultGreeting($params['contact_type'], $greeting)
           ) {
             $params[$greeting . '_id'] = $defaultGreetingTypeId;
           }
@@ -316,7 +327,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
 
     $contact = self::add($params);
     if (!$contact) {
-      // not dying here is stupid, since we get into wierd situation and into a bug that
+      // Not dying here is stupid, since we get into wierd situation and into a bug that
       // is impossible to figure out for the user or for us
       // CRM-7925
       CRM_Core_Error::fatal();
@@ -325,7 +336,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
     $params['contact_id'] = $contact->id;
 
     if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'is_enabled')) {
-      // Enabling multisite causes the contact to be added to the domain group
+      // Enabling multisite causes the contact to be added to the domain group.
       $domainGroupID = CRM_Core_BAO_Domain::getGroupId();
       if (!empty($domainGroupID)) {
         if (!empty($params['group']) && is_array($params['group'])) {
@@ -349,7 +360,7 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
       }
     }
 
-    //add location Block data
+    // Add location Block data.
     $blocks = CRM_Core_BAO_Location::create($params, $fixAddress);
     foreach ($blocks as $name => $value) {
       $contact->$name = $value;
@@ -405,7 +416,6 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
       }
     }
 
-
     // update the UF user_unique_id if that has changed
     CRM_Core_BAO_UFMatch::updateUFName($contact->id);
 
@@ -459,17 +469,18 @@ class CRM_Contact_BAO_Contact extends CRM_Contact_DAO_Contact {
   }
 
   /**
-   * Get the display name and image of a contact
+   * Get the display name and image of a contact.
    *
    * @param int $id
    *   The contactId.
    *
-   * @param bool $type
+   * @param bool $includeTypeInReturnParameters
+   *   Should type be part of the returned array?
    *
    * @return array
    *   the displayName and contactImage for this contact
    */
-  public static function getDisplayAndImage($id, $type = FALSE) {
+  public static function getDisplayAndImage($id, $includeTypeInReturnParameters = FALSE) {
     //CRM-14276 added the * on the civicrm_contact table so that we have all the contact info available
     $sql = "
 SELECT    civicrm_contact.*,
@@ -498,7 +509,7 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
 
       CRM_Utils_Hook::alterDisplayName($displayName, $id, $dao);
 
-      return $type ? array(
+      return $includeTypeInReturnParameters ? array(
         $displayName,
         $image,
         $dao->contact_type,
@@ -510,11 +521,13 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
   }
 
   /**
+   * Create last viewed link to recently updated contact.
+   *
    * @param array $crudLinkSpec
-   *   With keys:.
-   *   - action: int, CRM_Core_Action::UPDATE or CRM_Core_Action::VIEW [default: VIEW]
-   *   - entity_table: string, eg "civicrm_contact"
-   *   - entity_id: int
+   *  - action: int, CRM_Core_Action::UPDATE or CRM_Core_Action::VIEW [default: VIEW]
+   *  - entity_table: string, eg "civicrm_contact"
+   *  - entity_id: int
+   *
    * @return array|NULL
    *   NULL if unavailable, or
    *   [path: string, query: string, title: string]
@@ -523,6 +536,7 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
   public function createDefaultCrudLink($crudLinkSpec) {
     switch ($crudLinkSpec['action']) {
       case CRM_Core_Action::VIEW:
+
         return array(
           'title' => $this->display_name,
           'path' => 'civicrm/contact/view',
@@ -553,11 +567,9 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
    *   (reference) the default values, some of which need to be resolved.
    * @param bool $reverse
    *   True if we want to resolve the values in the reverse direction (value -> name).
-   *
-   * @return void
    */
   public static function resolveDefaults(&$defaults, $reverse = FALSE) {
-    // hack for birth_date
+    // Hack for birth_date.
     if (!empty($defaults['birth_date'])) {
       if (is_array($defaults['birth_date'])) {
         $defaults['birth_date'] = CRM_Utils_Date::format($defaults['birth_date'], '-');
@@ -671,14 +683,14 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
           );
         }
 
-        //kill the reference.
+        // Kill the reference.
         unset($values);
       }
     }
   }
 
   /**
-   * Fetch object based on array of properties
+   * Fetch object based on array of properties.
    *
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
@@ -730,7 +742,7 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
   }
 
   /**
-   * Get the display name of a contact
+   * Get the display name of a contact.
    *
    * @param int $id
    *   Id of the contact.
@@ -748,7 +760,7 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
   }
 
   /**
-   * Delete a contact and all its associated records
+   * Delete a contact and all its associated records.
    *
    * @param int $id
    *   Id of the contact to delete.
@@ -757,8 +769,8 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
    * @param bool $skipUndelete
    *   Whether to force contact delete or not.
    *
-   * @return boolean
-   *   true if contact deleted, false otherwise
+   * @return bool
+   *   Was contact deleted?
    */
   public static function deleteContact($id, $restore = FALSE, $skipUndelete = FALSE) {
 
@@ -808,7 +820,6 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
       return TRUE;
     }
 
-
     // currently we only clear employer cache.
     // we are not deleting inherited membership if any.
     if ($contact->contact_type == 'Organization') {
@@ -885,13 +896,13 @@ WHERE     civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer');
   }
 
   /**
-   * Delete the image of a contact
+   * Delete the image of a contact.
    *
    * @param int $id
    *   Id of the contact.
    *
-   * @return boolean
-   *   true if contact image is deleted
+   * @return bool
+   *   Was contact image deleted?
    */
   public static function deleteContactImage($id) {
     if (!$id) {
@@ -906,13 +917,14 @@ WHERE id={$id}; ";
   }
 
   /**
-   * Return relative path
+   * Return relative path.
+   *
    * @todo make this a method of $config->userSystem (i.e. UF classes) rather than a static function
    *
    * @param string $absolutePath
    *   Absolute path.
    *
-   * @return String
+   * @return string
    *   Relative url of uploaded image
    */
   public static function getRelativePath($absolutePath) {
@@ -946,7 +958,7 @@ WHERE id={$id}; ";
   }
 
   /**
-   * Return proportional height and width of the image
+   * Return proportional height and width of the image.
    *
    * @param int $imageWidth
    *   Width of image.
@@ -954,8 +966,8 @@ WHERE id={$id}; ";
    * @param int $imageHeight
    *   Height of image.
    *
-   * @return Array
-   *   thumb dimension of image
+   * @return array
+   *   Thumb dimension of image
    */
   public static function getThumbSize($imageWidth, $imageHeight) {
     $thumbWidth = 100;
@@ -978,7 +990,7 @@ WHERE id={$id}; ";
   }
 
   /**
-   * Validate type of contact image
+   * Validate type of contact image.
    *
    * @param array $params
    * @param string $imageIndex
@@ -988,7 +1000,7 @@ WHERE id={$id}; ";
    * @param string $opType
    *   Type of operation like fatal, bounce etc.
    *
-   * @return boolean
+   * @return bool
    *   true if valid image extension
    */
   public static function processImageParams(
@@ -1026,7 +1038,7 @@ WHERE id={$id}; ";
   }
 
   /**
-   * Extract contact id from url for deleting contact image
+   * Extract contact id from url for deleting contact image.
    */
   public static function processImage() {
 
@@ -1047,15 +1059,13 @@ WHERE id={$id}; ";
   }
 
   /**
-   *  Function to set is_delete true or restore deleted contact
+   * Function to set is_delete true or restore deleted contact.
    *
    * @param int $contact
    *   Contact DAO object.
    * @param bool $restore
    *   True to set the is_delete = 1 else false to restore deleted contact,
    *                                i.e. is_delete = 0
-   *
-   * @return void
    */
   public static function contactTrashRestore($contact, $restore = FALSE) {
     $op = ($restore ? 'restore' : 'trash');
@@ -1086,8 +1096,6 @@ WHERE id={$id}; ";
    *
    * @return string
    *   contact_type if $id found else null ""
-   *
-   *
    */
   public static function getContactType($id) {
     return CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $id, 'contact_type');
@@ -1103,8 +1111,6 @@ WHERE id={$id}; ";
    *
    * @return string
    *   contact_sub_type if $id found else null ""
-   *
-   *
    */
   public static function getContactSubType($id, $implodeDelimiter = NULL) {
     $subtype = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $id, 'contact_sub_type');
@@ -1127,8 +1133,6 @@ WHERE id={$id}; ";
    *   Id of the contact whose contact sub/contact type is needed.
    *
    * @return array
-   *
-   *
    */
   public static function getContactTypes($id) {
     $params = array('id' => $id);
@@ -1141,8 +1145,9 @@ WHERE id={$id}; ";
 
     if ($contact) {
       $contactTypes = array();
-      if ($contact->contact_sub_type)
+      if ($contact->contact_sub_type) {
         $contactTypes = explode(CRM_Core_DAO::VALUE_SEPARATOR, trim($contact->contact_sub_type, CRM_Core_DAO::VALUE_SEPARATOR));
+      }
       array_unshift($contactTypes, $contact->contact_type);
 
       return $contactTypes;
@@ -1153,7 +1158,7 @@ WHERE id={$id}; ";
   }
 
   /**
-   * Combine all the importable fields from the lower levels object
+   * Combine all the importable fields from the lower levels object.
    *
    * The ordering is important, since currently we do not have a weight
    * scheme. Adding weight is super important
@@ -1173,7 +1178,7 @@ WHERE id={$id}; ";
    * @return array
    *   array of importable Fields
    */
-  static function importableFields(
+  public static function importableFields(
     $contactType = 'Individual',
     $status = FALSE,
     $showAll = FALSE,
@@ -1355,9 +1360,9 @@ WHERE id={$id}; ";
   }
 
   /**
-   * Combine all the exportable fields from the lower levels object
+   * Combine all the exportable fields from the lower levels object.
    *
-   * currentlty we are using importable fields as exportable fields
+   * Currently we are using importable fields as exportable fields
    *
    * @param int|string $contactType contact Type
    * @param bool $status
@@ -1397,8 +1402,14 @@ WHERE id={$id}; ";
       if (!$fields) {
         $fields = CRM_Contact_DAO_Contact::export();
 
-        // the fields are meant for contact types
-        if (in_array($contactType, array('Individual', 'Household', 'Organization', 'All'))) {
+        // The fields are meant for contact types.
+        if (in_array($contactType, array(
+          'Individual',
+          'Household',
+          'Organization',
+          'All',
+          )
+        )) {
           $fields = array_merge($fields, CRM_Core_OptionValue::getFields('', $contactType));
         }
         // add current employer for individuals
@@ -1450,7 +1461,6 @@ WHERE id={$id}; ";
           CRM_Core_DAO_Worldregion::export()
         );
 
-
         $fields = array_merge($fields,
           CRM_Contact_DAO_Contact::export()
         );
@@ -1596,14 +1606,15 @@ WHERE id={$id}; ";
   }
 
   /**
-   * Get the all contact details(Hierarchical)
+   * Get the all contact details (Hierarchical).
    *
    * @param int $contactId
    *   Contact id.
    * @param array $fields
    *   Fields array.
    *
-   * @return $values array contains the contact details
+   * @return array
+   *   Contact details
    */
   public static function getHierContactDetails($contactId, &$fields) {
     $params = array(array('contact_id', '=', $contactId, 0, 0));
@@ -1611,8 +1622,8 @@ WHERE id={$id}; ";
 
     $returnProperties = self::makeHierReturnProperties($fields, $contactId);
 
-    // we dont know the contents of return properties, but we need the lower level ids of the contact
-    // so add a few fields
+    // We don't know the contents of return properties, but we need the lower
+    // level ids of the contact so add a few fields.
     $returnProperties['first_name'] =
     $returnProperties['organization_name'] =
     $returnProperties['household_name'] =
@@ -1622,15 +1633,16 @@ WHERE id={$id}; ";
   }
 
   /**
-   * Given a set of flat profile style field names, create a hierarchy
-   * for query to use and crete the right sql
+   * Given a set of flat profile style field names, create a hierarchy.
+   *
+   * This is for the query to use, create the right sql.
    *
    * @param $fields
    * @param int $contactId
    *   Contact id.
    *
    * @return array
-   *   a hierarchical property tree if appropriate
+   *   A hierarchical property tree if appropriate
    */
   public static function &makeHierReturnProperties($fields, $contactId = NULL) {
     $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
@@ -1694,7 +1706,7 @@ WHERE id={$id}; ";
   }
 
   /**
-   * Return the primary location type of a contact
+   * Return the primary location type of a contact.
    *
    * $params int     $contactId contact_id
    * $params boolean $isPrimaryExist if true, return primary contact location type otherwise null
@@ -1762,7 +1774,7 @@ WHERE  civicrm_contact.id = %1 ";
   }
 
   /**
-   * Get the display name, primary email and location type of a contact
+   * Get the display name, primary email and location type of a contact.
    *
    * @param int $id
    *   Id of the contact.
@@ -1818,7 +1830,7 @@ ORDER BY civicrm_email.is_primary DESC";
    *   Specifies the default group to which contact is added.
    * @param int $ufGroupId
    *   Uf group id (profile id).
-   * @param ctype
+   * @param string $ctype
    * @param bool $visibility
    *   Basically lets us know where this request is coming from.
    *                                if via a profile from web, we restrict what groups are changed
@@ -1826,7 +1838,7 @@ ORDER BY civicrm_email.is_primary DESC";
    * @return int
    *   contact id created/edited
    */
-  static function createProfileContact(
+  public static function createProfileContact(
     &$params,
     &$fields,
     $contactID = NULL,
@@ -1918,6 +1930,8 @@ ORDER BY civicrm_email.is_primary DESC";
   }
 
   /**
+   * Format profile contact parameters.
+   *
    * @param array $params
    * @param $fields
    * @param int $contactID
@@ -1927,7 +1941,7 @@ ORDER BY civicrm_email.is_primary DESC";
    *
    * @return array
    */
-  static function formatProfileContactParams(
+  public static function formatProfileContactParams(
     &$params,
     &$fields,
     $contactID = NULL,
@@ -2288,9 +2302,10 @@ ORDER BY civicrm_email.is_primary DESC";
   }
 
   /**
-   * Find the get contact details
-   * does not respect ACLs for now, which might need to be rectified at some
-   * stage based on how its used
+   * Find the get contact details.
+   *
+   * This function does not respect ACLs for now, which might need to be rectified at some
+   * stage based on how its used.
    *
    * @param string $mail
    *   Primary email address of the contact.
@@ -2311,7 +2326,6 @@ SELECT     civicrm_contact.id as contact_id,
 FROM       civicrm_contact
 INNER JOIN civicrm_email    ON ( civicrm_contact.id = civicrm_email.contact_id )";
 
-
     if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME, 'uniq_email_per_site')) {
       // try to find a match within a site (multisite).
       $groups = CRM_Core_BAO_Domain::getChildGroupIds();
@@ -2342,7 +2356,7 @@ WHERE      civicrm_email.email = %1 AND civicrm_contact.is_deleted=0";
   }
 
   /**
-   * Find the contact details associated with an OpenID
+   * Find the contact details associated with an OpenID.
    *
    * @param string $openId
    *   OpenId of the contact.
@@ -2381,13 +2395,13 @@ WHERE      civicrm_openid.openid = %1";
   }
 
   /**
-   * Funtion to get primary email of the contact
+   * Get primary email of the contact.
    *
    * @param int $contactID
    *   Contact id.
    *
    * @return string
-   *   >email  email address if present else null
+   *   Email address if present else null
    */
   public static function getPrimaryEmail($contactID) {
     // fetch the primary email
@@ -2409,7 +2423,7 @@ LEFT JOIN civicrm_email    ON ( civicrm_contact.id = civicrm_email.contact_id )
   }
 
   /**
-   * Funtion to get primary OpenID of the contact
+   * Function to get primary OpenID of the contact.
    *
    * @param int $contactID
    *   Contact id.
@@ -2437,15 +2451,15 @@ AND       civicrm_openid.is_primary = 1";
   }
 
   /**
-   * Given the list of params in the params array, fetch the object
-   * and store the values in the values array
+   * Fetch the object and store the values in the values array.
    *
    * @param array $params
    *   Input parameters to find object.
    * @param array $values
    *   Output values of the object.
    *
-   * @return CRM_Contact_BAO_Contact|null the found object or null
+   * @return CRM_Contact_BAO_Contact|null
+   *   The found object or null
    */
   public static function getValues(&$params, &$values) {
     $contact = new CRM_Contact_BAO_Contact();
@@ -2523,8 +2537,7 @@ AND       civicrm_openid.is_primary = 1";
   }
 
   /**
-   * Given the component name and returns
-   * the count of participation of contact
+   * Given the component name and returns the count of participation of contact.
    *
    * @param string $component
    *   Input component name.
@@ -2543,12 +2556,14 @@ AND       civicrm_openid.is_primary = 1";
         return CRM_Core_BAO_EntityTag::getContactTags($contactId, TRUE);
 
       case 'rel':
+
         return CRM_Contact_BAO_Relationship::getRelationship($contactId,
           CRM_Contact_BAO_Relationship::CURRENT,
           0, 1
         );
 
       case 'group':
+
         return CRM_Contact_BAO_GroupContact::getContactGroup($contactId, "Added", NULL, TRUE);
 
       case 'log':
@@ -2604,14 +2619,12 @@ AND       civicrm_openid.is_primary = 1";
   }
 
   /**
-   * Process greetings and cache
+   * Process greetings and cache.
    *
    * @param object $contact
    *   Contact object after save.
    * @param bool $useDefaults
    *   Use default greeting values.
-   *
-   * @return void
    */
   public static function processGreetings(&$contact, $useDefaults = FALSE) {
     if ($useDefaults) {
@@ -3078,8 +3091,9 @@ AND       civicrm_openid.is_primary = 1";
   }
 
   /**
-   * Retrieve display name of contact that address is shared
-   * based on $masterAddressId or $contactId .
+   * Retrieve display name of contact that address is shared.
+   *
+   * This is based on $masterAddressId or $contactId .
    *
    * @param int $masterAddressId
    *   Master id.
@@ -3114,11 +3128,12 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
   }
 
   /**
-   * Get the creation/modification times for a contact
+   * Get the creation/modification times for a contact.
    *
    * @param int $contactId
    *
-   * @return array('created_date' => $, 'modified_date' => $)
+   * @return array
+   *  Dates - ('created_date' => $, 'modified_date' => $)
    */
   public static function getTimestamps($contactId) {
     $timestamps = CRM_Core_DAO::executeQuery(
@@ -3141,8 +3156,10 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
   }
 
   /**
-   * Generate triggers to update the timestamp on the corresponding civicrm_contact row,
-   * on insert/update/delete to a table that extends civicrm_contact.
+   * Generate triggers to update the timestamp.
+   *
+   * The corresponding civicrm_contact row is updated on insert/update/delete
+   * to a table that extends civicrm_contact.
    * Don't regenerate triggers for all such tables if only asked for one table.
    *
    * @param array $info
@@ -3153,7 +3170,6 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
    *   Array of all core or all custom table names extending civicrm_contact
    * @param string $contactRefColumn
    *   'contact_id' if processing core tables, 'entity_id' if processing custom tables
-   * @return void
    *
    * @link https://issues.civicrm.org/jira/browse/CRM-15602
    * @see triggerInfo
@@ -3185,7 +3201,7 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
   }
 
   /**
-   * Get a list of triggers for the contact table
+   * Get a list of triggers for the contact table.
    *
    * @see hook_civicrm_triggerInfo
    * @see CRM_Core_DAO::triggerRebuild
@@ -3249,8 +3265,7 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
   }
 
   /**
-   * Check if contact is being used in civicrm_domain
-   * based on $contactId
+   * Check if contact is being used in civicrm_domain based on $contactId.
    *
    * @param int $contactId
    *   Contact id.
@@ -3259,8 +3274,9 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
    *   true if present else false.
    */
   public static function checkDomainContact($contactId) {
-    if (!$contactId)
+    if (!$contactId) {
       return FALSE;
+    }
     $domainId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', $contactId, 'id', 'contact_id');
 
     if ($domainId) {
@@ -3273,6 +3289,7 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
 
   /**
    * Get options for a given contact field.
+   *
    * @see CRM_Core_DAO::buildOptions
    *
    * TODO: Should we always assume chainselect? What fn should be responsible for controlling that flow?
@@ -3280,7 +3297,7 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
    *
    * @param string $fieldName
    * @param string $context
-   *   @see CRM_Core_DAO::buildOptionsContext.
+   * @see CRM_Core_DAO::buildOptionsContext
    * @param array $props
    *   whatever is known about this dao object.
    *
@@ -3308,12 +3325,13 @@ LEFT JOIN civicrm_address add2 ON ( add1.master_id = add2.id )
   }
 
   /**
-   * Delete a contact-related object that has an 'is_primary' field
+   * Delete a contact-related object that has an 'is_primary' field.
+   *
    * Ensures that is_primary gets assigned to another object if available
    * Also calls pre/post hooks
    *
-   * @var $type : object type
-   * @var $id : object id
+   * @var object $type
+   * @var int $id
    * @return bool
    */
   public static function deleteObjectWithPrimary($type, $id) {
index 0fc398c8c09151998626d28fffc2abc501e68519..7c9a4b8742b21dc402a1030cb98f22df08f57deb 100644 (file)
@@ -222,7 +222,7 @@ WHERE  id IN ( $idString )
    * @param string $inputCheck
    *   Checksum to match against.
    *
-   * @return boolean
+   * @return bool
    *   true if valid, else false
    */
   public static function validChecksum($contactID, $inputCheck) {
@@ -329,10 +329,8 @@ UNION
         'relationship_type_id' => $relTypeId . '_a_b',
         'contact_check' => array($organization => TRUE),
       );
-      list($valid, $invalid, $duplicate,
-        $saved, $relationshipIds
-        ) = CRM_Contact_BAO_Relationship::createMultiple($relationshipParams, $cid);
-
+      list($valid, $invalid, $duplicate, $saved, $relationshipIds)
+        = CRM_Contact_BAO_Relationship::createMultiple($relationshipParams, $cid);
 
       // In case we change employer, clean previous employer related records.
       if (!$previousEmployerID && !$newContact) {
@@ -606,7 +604,7 @@ UPDATE civicrm_contact
       // check permission on acl basis.
       if (in_array($task, array(
         'view',
-        'edit'
+        'edit',
       ))) {
         $aclPermission = CRM_Core_Permission::VIEW;
         if ($task == 'edit') {
@@ -724,7 +722,7 @@ LEFT JOIN  civicrm_email ce ON ( ce.contact_id=c.id AND ce.is_primary = 1 )
     foreach ($returnProperties as $property => $ignore) {
       $value = (in_array($property, array(
         'city',
-        'street_address'
+        'street_address',
       ))) ? 'address' : $property;
       switch ($property) {
         case 'sort_name':
@@ -1079,13 +1077,16 @@ WHERE id IN (" . implode(',', $contactIds) . ")";
    * @param string $greetingType
    *   Greeting type.
    *
-   * @return int
-   *   or null
+   * @return int|NULL
    */
   public static function defaultGreeting($contactType, $greetingType) {
-    $contactTypeFilters = array('Individual' => 1, 'Household' => 2, 'Organization' => 3);
+    $contactTypeFilters = array(
+      'Individual' => 1,
+      'Household' => 2,
+      'Organization' => 3,
+    );
     if (!isset($contactTypeFilters[$contactType])) {
-      return;
+      return NULL;
     }
     $filter = $contactTypeFilters[$contactType];
 
index bfadfc54b8d8d70a4b6f3a3bf6b0c8fe1e24363f..72be26a332fbcdc810c0cfaf39da25b404e2e8ad 100644 (file)
@@ -73,7 +73,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
    *
-   * @return boolean
+   * @return bool
    */
   public static function dataExists(&$params) {
     // return if no data present
@@ -129,7 +129,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
    * @return array
    *   (total, added, notAdded) count of contacts added to group
    */
-  static function addContactsToGroup(
+  public static function addContactsToGroup(
     $contactIds,
     $groupId,
     $method = 'Admin',
@@ -137,7 +137,6 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
     $tracking = NULL
   ) {
 
-
     CRM_Utils_Hook::pre('create', 'GroupContact', $groupId, $contactIds);
 
     list($numContactsAdded,
@@ -179,7 +178,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
    * @return array
    *   (total, removed, notRemoved) count of contacts removed to group
    */
-  static function removeContactsFromGroup(
+  public static function removeContactsFromGroup(
     &$contactIds,
     $groupId,
     $method = 'Admin',
@@ -329,13 +328,11 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
    *
    * @param bool $excludeHidden
    *
-   * @return array
-   *   (reference )|int $values the relevant data object values for the contact or
-   *                                 the total count when $count is TRUE
-   *
-   * $access public
+   * @return array (reference)|int $values
+   *   the relevant data object values for the contact or
+   *   the total count when $count is TRUE
    */
-  static function &getContactGroup(
+  public static function &getContactGroup(
     $contactId,
     $status = NULL,
     $numGroupContact = NULL,
@@ -720,7 +717,7 @@ AND       group_id IN ( $groupIDString )
    * @return array
    *   (total, added, notAdded) count of contacts added to group
    */
-  static function bulkAddContactsToGroup(
+  public static function bulkAddContactsToGroup(
     $contactIDs,
     $groupID,
     $method = 'Admin',
@@ -797,11 +794,11 @@ AND    contact_id IN ( $contactStr )
    *
    * @param string $fieldName
    * @param string $context
-   *   @see CRM_Core_DAO::buildOptionsContext.
+   * @see CRM_Core_DAO::buildOptionsContext
    * @param array $props
    *   whatever is known about this dao object.
    *
-   * @return Array|bool
+   * @return array|bool
    */
   public static function buildOptions($fieldName, $context = NULL, $props = array()) {
     $params = array();
index 71f0986172003ca6ac9531cff2366a239467bffa..e3917eb887975a40b12fbae80b77e55fdbdaba3a 100644 (file)
@@ -43,7 +43,7 @@ class CRM_Contact_BAO_GroupContactCache extends CRM_Contact_DAO_GroupContactCach
    * @param $groupIDs
    *   Of group that we are checking against.
    *
-   * @return boolean
+   * @return bool
    *   TRUE if we did not regenerate, FALSE if we did
    */
   public static function check($groupIDs) {
@@ -117,12 +117,12 @@ AND     ( g.cache_date IS NULL OR
    * Check to see if we have cache entries for this group
    * if not, regenerate, else return
    *
-   * @param int /array $groupID groupID of group that we are checking against
+   * @param int /array $groupIDs groupIDs of group that we are checking against
    *                           if empty, all groups are checked
    * @param int $limit
    *   Limits the number of groups we evaluate.
    *
-   * @return boolean
+   * @return bool
    *   TRUE if we did not regenerate, FALSE if we did
    */
   public static function loadAll($groupIDs = NULL, $limit = 0) {
@@ -468,7 +468,6 @@ WHERE  id = %1
         CRM_Contact_BAO_ProximityQuery::fixInputParams($ssParams);
       }
 
-
       $returnProperties = array();
       if (CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $savedSearchID, 'mapping_id')) {
         $fv = CRM_Contact_BAO_SavedSearch::getFormValues($savedSearchID);
@@ -481,8 +480,7 @@ WHERE  id = %1
         // we split it up and store custom class
         // so temp tables are not destroyed if they are used
         // hence customClass is defined above at top of function
-        $customClass =
-          CRM_Contact_BAO_SearchCustom::customClass($ssParams['customSearchID'], $savedSearchID);
+        $customClass = CRM_Contact_BAO_SearchCustom::customClass($ssParams['customSearchID'], $savedSearchID);
         $searchSQL = $customClass->contactIDs();
         $searchSQL = str_replace('ORDER BY contact_a.id ASC', '', $searchSQL);
         $idName = 'contact_id';
@@ -490,8 +488,8 @@ WHERE  id = %1
       else {
         $formValues = CRM_Contact_BAO_SavedSearch::getFormValues($savedSearchID);
 
-        $query =
-          new CRM_Contact_BAO_Query(
+        $query
+          new CRM_Contact_BAO_Query(
             $ssParams, $returnProperties, NULL,
             FALSE, FALSE, 1,
             TRUE, TRUE,
@@ -501,8 +499,8 @@ WHERE  id = %1
           );
         $query->_useDistinct = FALSE;
         $query->_useGroupBy = FALSE;
-        $searchSQL =
-          $query->searchQuery(
+        $searchSQL
+          $query->searchQuery(
             0, 0, NULL,
             FALSE, FALSE,
             FALSE, TRUE,
@@ -615,7 +613,7 @@ AND  civicrm_group_contact.group_id = $groupID ";
    */
   public static function contactGroup($contactID, $showHidden = FALSE) {
     if (empty($contactID)) {
-      return;
+      return NULL;
     }
 
     if (is_array($contactID)) {
@@ -654,12 +652,12 @@ ORDER BY   gc.contact_id, g.children
       }
       $prevContactID = $dao->contact_id;
       if (!array_key_exists($dao->contact_id, $contactGroup)) {
-        $contactGroup[$dao->contact_id] =
-          array('group' => array(), 'groupTitle' => array());
+        $contactGroup[$dao->contact_id]
+          array('group' => array(), 'groupTitle' => array());
       }
 
-      $contactGroup[$dao->contact_id]['group'][] =
-        array(
+      $contactGroup[$dao->contact_id]['group'][]
+        array(
           'id' => $dao->group_id,
           'title' => $dao->title,
           'description' => $dao->description,
index aa2b0c02f1282b480ff232c1ea9c70ec3b4ca2ae..b2750a788ead75e88598d74c8ae60c79ca64fde6 100644 (file)
@@ -56,7 +56,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
    */
   public static function format(&$params, &$contact) {
     if (!self::dataExists($params)) {
-      return;
+      return NULL;
     }
 
     // "null" value for example is passed by dedupe merge in order to empty.
@@ -274,7 +274,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
     if ($date = CRM_Utils_Array::value('birth_date', $params)) {
       if (in_array($format, array(
         'dd-mm',
-        'mm/dd'
+        'mm/dd',
       ))) {
         $separator = '/';
         if ($format == 'dd-mm') {
@@ -283,17 +283,17 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
         $date = $date . $separator . '1902';
       }
       elseif (in_array($format, array(
-        'yy-mm'
+        'yy-mm',
       ))) {
         $date = $date . '-01';
       }
       elseif (in_array($format, array(
-        'M yy'
+        'M yy',
       ))) {
         $date = $date . '-01';
       }
       elseif (in_array($format, array(
-        'yy'
+        'yy',
       ))) {
         $date = $date . '-01-01';
       }
@@ -306,7 +306,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
     if ($date = CRM_Utils_Array::value('deceased_date', $params)) {
       if (in_array($format, array(
         'dd-mm',
-        'mm/dd'
+        'mm/dd',
       ))) {
         $separator = '/';
         if ($format == 'dd-mm') {
@@ -315,17 +315,17 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
         $date = $date . $separator . '1902';
       }
       elseif (in_array($format, array(
-        'yy-mm'
+        'yy-mm',
       ))) {
         $date = $date . '-01';
       }
       elseif (in_array($format, array(
-        'M yy'
+        'M yy',
       ))) {
         $date = $date . '-01';
       }
       elseif (in_array($format, array(
-        'yy'
+        'yy',
       ))) {
         $date = $date . '-01-01';
       }
@@ -410,7 +410,7 @@ class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
    *
-   * @return boolean
+   * @return bool
    */
   public static function dataExists(&$params) {
     if ($params['contact_type'] == 'Individual') {
index c5b9ba0f62033178c70083ded985ee5d7b7b2776..1e7ef740cd2d4f667b4211d433fbc5549c3a4411 100644 (file)
@@ -409,7 +409,7 @@ class CRM_Contact_BAO_Query {
    *
    * @return \CRM_Contact_BAO_Query
    */
-  function __construct(
+  public function __construct(
     $params = NULL, $returnProperties = NULL, $fields = NULL,
     $includeContactIds = FALSE, $strict = FALSE, $mode = 1,
     $skipPermission = FALSE, $searchDescendentGroups = TRUE,
@@ -688,20 +688,20 @@ class CRM_Contact_BAO_Query {
                 $this->_pseudoConstantsSelect[$name]['element'] = $name;
 
                 if ($tableName == 'email_greeting') {
-                  $this->_pseudoConstantsSelect[$name]['join'] =
-                    " LEFT JOIN civicrm_option_group option_group_email_greeting ON (option_group_email_greeting.name = 'email_greeting')";
+                  $this->_pseudoConstantsSelect[$name]['join']
+                    " LEFT JOIN civicrm_option_group option_group_email_greeting ON (option_group_email_greeting.name = 'email_greeting')";
                   $this->_pseudoConstantsSelect[$name]['join'] .=
                     " LEFT JOIN civicrm_option_value email_greeting ON (contact_a.email_greeting_id = email_greeting.value AND option_group_email_greeting.id = email_greeting.option_group_id ) ";
                 }
                 elseif ($tableName == 'postal_greeting') {
-                  $this->_pseudoConstantsSelect[$name]['join'] =
-                    " LEFT JOIN civicrm_option_group option_group_postal_greeting ON (option_group_postal_greeting.name = 'postal_greeting')";
+                  $this->_pseudoConstantsSelect[$name]['join']
+                    " LEFT JOIN civicrm_option_group option_group_postal_greeting ON (option_group_postal_greeting.name = 'postal_greeting')";
                   $this->_pseudoConstantsSelect[$name]['join'] .=
                     " LEFT JOIN civicrm_option_value postal_greeting ON (contact_a.postal_greeting_id = postal_greeting.value AND option_group_postal_greeting.id = postal_greeting.option_group_id ) ";
                 }
                 elseif ($tableName == 'addressee') {
-                  $this->_pseudoConstantsSelect[$name]['join'] =
-                    " LEFT JOIN civicrm_option_group option_group_addressee ON (option_group_addressee.name = 'addressee')";
+                  $this->_pseudoConstantsSelect[$name]['join']
+                    " LEFT JOIN civicrm_option_group option_group_addressee ON (option_group_addressee.name = 'addressee')";
                   $this->_pseudoConstantsSelect[$name]['join'] .=
                     " LEFT JOIN civicrm_option_value addressee ON (contact_a.addressee_id = addressee.value AND option_group_addressee.id = addressee.option_group_id ) ";
                 }
@@ -726,32 +726,29 @@ class CRM_Contact_BAO_Query {
               $tName = substr($tableName, 8);
               if (in_array($tName, array('country', 'state_province', 'county'))) {
                 if ($tName == 'state_province') {
-                  $this->_pseudoConstantsSelect['state_province_name'] =
-                    array(
-                      'pseudoField' => "{$tName}",
-                      'idCol' => "{$tName}_id",
-                      'bao' => 'CRM_Core_BAO_Address',
-                      'table' => "civicrm_{$tName}",
-                      'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ",
-                    );
-
-                  $this->_pseudoConstantsSelect[$tName] =
-                    array(
-                      'pseudoField' => 'state_province_abbreviation',
-                      'idCol' => "{$tName}_id",
-                      'table' => "civicrm_{$tName}",
-                      'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ",
-                    );
+                  $this->_pseudoConstantsSelect['state_province_name'] = array(
+                    'pseudoField' => "{$tName}",
+                    'idCol' => "{$tName}_id",
+                    'bao' => 'CRM_Core_BAO_Address',
+                    'table' => "civicrm_{$tName}",
+                    'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ",
+                  );
+
+                  $this->_pseudoConstantsSelect[$tName] = array(
+                    'pseudoField' => 'state_province_abbreviation',
+                    'idCol' => "{$tName}_id",
+                    'table' => "civicrm_{$tName}",
+                    'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ",
+                  );
                 }
                 else {
-                  $this->_pseudoConstantsSelect[$name] =
-                    array(
-                      'pseudoField' => "{$tName}_id",
-                      'idCol' => "{$tName}_id",
-                      'bao' => 'CRM_Core_BAO_Address',
-                      'table' => "civicrm_{$tName}",
-                      'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ",
-                    );
+                  $this->_pseudoConstantsSelect[$name] = array(
+                    'pseudoField' => "{$tName}_id",
+                    'idCol' => "{$tName}_id",
+                    'bao' => 'CRM_Core_BAO_Address',
+                    'table' => "civicrm_{$tName}",
+                    'join' => " LEFT JOIN civicrm_{$tName} ON civicrm_address.{$tName}_id = civicrm_{$tName}.id ",
+                  );
                 }
 
                 $this->_select["{$tName}_id"] = "civicrm_address.{$tName}_id as {$tName}_id";
@@ -1009,7 +1006,6 @@ class CRM_Contact_BAO_Query {
           // this is either phone, email or IM
           list($elementName, $elementType) = explode('-', $elementName);
 
-
           if (($elementName != 'phone') && ($elementName != 'im')) {
             $cond = self::getPrimaryCondition($elementType);
           }
@@ -1105,13 +1101,18 @@ class CRM_Contact_BAO_Query {
               );
 
               if (substr_count($a, 'state_province_name') > 0) {
-                $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"] =
-                  array('pseudoField' => "{$pf}_id", 'idCol' => "{$tName}_id", 'bao' => 'CRM_Core_BAO_Address');
+                $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"] = array(
+                  'pseudoField' => "{$pf}_id",
+                  'idCol' => "{$tName}_id",
+                  'bao' => 'CRM_Core_BAO_Address',
+                );
                 $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['select'] = "`$tName`.name as `{$name}-{$elementFullName}`";
               }
               else {
-                $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"] =
-                  array('pseudoField' => 'state_province_abbreviation', 'idCol' => "{$tName}_id");
+                $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"] = array(
+                  'pseudoField' => 'state_province_abbreviation',
+                  'idCol' => "{$tName}_id",
+                );
                 $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['select'] = "`$tName`.abbreviation as `{$name}-{$elementFullName}`";
               }
             }
@@ -1178,8 +1179,8 @@ class CRM_Contact_BAO_Query {
 
                 case 'civicrm_state_province':
                   $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['table'] = $tName;
-                  $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join'] =
-                    "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.state_province_id";
+                  $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join']
+                    "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.state_province_id";
                   if ($addWhere) {
                     $this->_whereTables["{$name}-address"] = $addressJoin;
                   }
@@ -1187,8 +1188,8 @@ class CRM_Contact_BAO_Query {
 
                 case 'civicrm_country':
                   $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['table'] = $newName;
-                  $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join'] =
-                    "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.country_id";
+                  $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join']
+                    "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.country_id";
                   if ($addWhere) {
                     $this->_whereTables["{$name}-address"] = $addressJoin;
                   }
@@ -1196,8 +1197,8 @@ class CRM_Contact_BAO_Query {
 
                 case 'civicrm_county':
                   $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['table'] = $newName;
-                  $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join'] =
-                    "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.county_id";
+                  $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join']
+                    "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.county_id";
                   if ($addWhere) {
                     $this->_whereTables["{$name}-address"] = $addressJoin;
                   }
@@ -1437,7 +1438,7 @@ class CRM_Contact_BAO_Query {
    *
    * @return array
    */
-  static function convertFormValues(&$formValues, $wildcard = 0, $useEquals = FALSE, $apiEntity = NULL) {
+  public static function convertFormValues(&$formValues, $wildcard = 0, $useEquals = FALSE, $apiEntity = NULL) {
     $params = array();
     if (empty($formValues)) {
       return $params;
@@ -1507,7 +1508,7 @@ class CRM_Contact_BAO_Query {
    *
    * @return array|null
    */
-  static function &fixWhereValues($id, &$values, $wildcard = 0, $useEquals = FALSE, $apiEntity = NULL) {
+  public static function &fixWhereValues($id, &$values, $wildcard = 0, $useEquals = FALSE, $apiEntity = NULL) {
     // skip a few search variables
     static $skipWhere = NULL;
     static $likeNames = NULL;
@@ -2986,7 +2987,6 @@ WHERE  id IN ( $groupIDs )
     $op = "LIKE";
     $value = "%{$value}%";
 
-
     $useAllTagTypes = $this->getWhereValues('all_tag_types', $grouping);
     $tagTypesText = $this->getWhereValues('tag_types_text', $grouping);
 
@@ -2994,37 +2994,34 @@ WHERE  id IN ( $groupIDs )
     $tTable = "`civicrm_tag-" . $value . "`";
 
     if ($useAllTagTypes[2]) {
-      $this->_tables[$etTable] =
-      $this->_whereTables[$etTable] =
-        " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id)
-          LEFT JOIN civicrm_tag {$tTable} ON ( {$etTable}.tag_id = {$tTable}.id  )";
+      $this->_tables[$etTable] = $this->_whereTables[$etTable]
+        = " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id)
+            LEFT JOIN civicrm_tag {$tTable} ON ( {$etTable}.tag_id = {$tTable}.id  )";
 
       // search tag in cases
       $etCaseTable = "`civicrm_entity_case_tag-" . $value . "`";
       $tCaseTable = "`civicrm_case_tag-" . $value . "`";
-      $this->_tables[$etCaseTable] =
-      $this->_whereTables[$etCaseTable] =
-        " LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id
-          LEFT JOIN civicrm_case
+      $this->_tables[$etCaseTable] = $this->_whereTables[$etCaseTable]
+        = " LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id
+            LEFT JOIN civicrm_case
             ON (civicrm_case_contact.case_id = civicrm_case.id
                 AND civicrm_case.is_deleted = 0 )
-          LEFT JOIN civicrm_entity_tag {$etCaseTable} ON ( {$etCaseTable}.entity_table = 'civicrm_case' AND {$etCaseTable}.entity_id = civicrm_case.id )
-          LEFT JOIN civicrm_tag {$tCaseTable} ON ( {$etCaseTable}.tag_id = {$tCaseTable}.id  )";
+            LEFT JOIN civicrm_entity_tag {$etCaseTable} ON ( {$etCaseTable}.entity_table = 'civicrm_case' AND {$etCaseTable}.entity_id = civicrm_case.id )
+            LEFT JOIN civicrm_tag {$tCaseTable} ON ( {$etCaseTable}.tag_id = {$tCaseTable}.id  )";
       // search tag in activities
       $etActTable = "`civicrm_entity_act_tag-" . $value . "`";
       $tActTable = "`civicrm_act_tag-" . $value . "`";
       $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
       $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
 
-      $this->_tables[$etActTable] =
-      $this->_whereTables[$etActTable] =
-        " LEFT JOIN civicrm_activity_contact
+      $this->_tables[$etActTable] = $this->_whereTables[$etActTable]
+        = " LEFT JOIN civicrm_activity_contact
             ON ( civicrm_activity_contact.contact_id = contact_a.id AND civicrm_activity_contact.record_type_id = {$targetID} )
-          LEFT JOIN civicrm_activity
+            LEFT JOIN civicrm_activity
             ON ( civicrm_activity.id = civicrm_activity_contact.activity_id
             AND civicrm_activity.is_deleted = 0 AND civicrm_activity.is_current_revision = 1 )
-          LEFT JOIN civicrm_entity_tag as {$etActTable} ON ( {$etActTable}.entity_table = 'civicrm_activity' AND {$etActTable}.entity_id = civicrm_activity.id )
-          LEFT JOIN civicrm_tag {$tActTable} ON ( {$etActTable}.tag_id = {$tActTable}.id  )";
+            LEFT JOIN civicrm_entity_tag as {$etActTable} ON ( {$etActTable}.entity_table = 'civicrm_activity' AND {$etActTable}.entity_id = civicrm_activity.id )
+            LEFT JOIN civicrm_tag {$tActTable} ON ( {$etActTable}.tag_id = {$tActTable}.id  )";
 
       $this->_where[$grouping][] = "({$tTable}.name $op '" . $value . "' OR {$tCaseTable}.name $op '" . $value . "' OR {$tActTable}.name $op '" . $value . "')";
       $this->_qill[$grouping][] = ts('Tag %1 %2', array(1 => $tagTypesText[2], 2 => $op)) . ' ' . $value;
@@ -3066,39 +3063,35 @@ WHERE  id IN ( $groupIDs )
       $names = CRM_Utils_Array::value($value, $tagNames);
     }
 
-
     $useAllTagTypes = $this->getWhereValues('all_tag_types', $grouping);
     $tagTypesText = $this->getWhereValues('tag_types_text', $grouping);
 
     $etTable = "`civicrm_entity_tag-" . $value . "`";
 
     if ($useAllTagTypes[2]) {
-      $this->_tables[$etTable] =
-      $this->_whereTables[$etTable] =
-        " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id  AND {$etTable}.entity_table = 'civicrm_contact') ";
+      $this->_tables[$etTable] = $this->_whereTables[$etTable]
+        = " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id  AND {$etTable}.entity_table = 'civicrm_contact') ";
 
       // search tag in cases
       $etCaseTable = "`civicrm_entity_case_tag-" . $value . "`";
       $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
       $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
 
-      $this->_tables[$etCaseTable] =
-      $this->_whereTables[$etCaseTable] =
-        " LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id
-          LEFT JOIN civicrm_case
+      $this->_tables[$etCaseTable] = $this->_whereTables[$etCaseTable]
+        = " LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id
+            LEFT JOIN civicrm_case
             ON (civicrm_case_contact.case_id = civicrm_case.id
                 AND civicrm_case.is_deleted = 0 )
-          LEFT JOIN civicrm_entity_tag {$etCaseTable} ON ( {$etCaseTable}.entity_table = 'civicrm_case' AND {$etCaseTable}.entity_id = civicrm_case.id ) ";
+            LEFT JOIN civicrm_entity_tag {$etCaseTable} ON ( {$etCaseTable}.entity_table = 'civicrm_case' AND {$etCaseTable}.entity_id = civicrm_case.id ) ";
       // search tag in activities
       $etActTable = "`civicrm_entity_act_tag-" . $value . "`";
-      $this->_tables[$etActTable] =
-      $this->_whereTables[$etActTable] =
-        " LEFT JOIN civicrm_activity_contact
+      $this->_tables[$etActTable] = $this->_whereTables[$etActTable]
+        = " LEFT JOIN civicrm_activity_contact
             ON ( civicrm_activity_contact.contact_id = contact_a.id AND civicrm_activity_contact.record_type_id = {$targetID} )
-          LEFT JOIN civicrm_activity
+            LEFT JOIN civicrm_activity
             ON ( civicrm_activity.id = civicrm_activity_contact.activity_id
             AND civicrm_activity.is_deleted = 0 AND civicrm_activity.is_current_revision = 1 )
-          LEFT JOIN civicrm_entity_tag as {$etActTable} ON ( {$etActTable}.entity_table = 'civicrm_activity' AND {$etActTable}.entity_id = civicrm_activity.id ) ";
+            LEFT JOIN civicrm_entity_tag as {$etActTable} ON ( {$etActTable}.entity_table = 'civicrm_activity' AND {$etActTable}.entity_id = civicrm_activity.id ) ";
 
       // CRM-10338
       if (in_array($op, array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) {
@@ -3110,9 +3103,8 @@ WHERE  id IN ( $groupIDs )
       $this->_qill[$grouping][] = ts('Tag %1 %2', array(1 => $op, 2 => $tagTypesText[2])) . ' ' . $names;
     }
     else {
-      $this->_tables[$etTable] =
-      $this->_whereTables[$etTable] =
-        " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id  AND {$etTable}.entity_table = 'civicrm_contact') ";
+      $this->_tables[$etTable] = $this->_whereTables[$etTable]
+        = " LEFT JOIN civicrm_entity_tag {$etTable} ON ( {$etTable}.entity_id = contact_a.id  AND {$etTable}.entity_table = 'civicrm_contact') ";
 
       // CRM-10338
       if (in_array($op, array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) {
@@ -3144,9 +3136,8 @@ WHERE  id IN ( $groupIDs )
 
     $this->_useDistinct = TRUE;
 
-    $this->_tables['civicrm_note'] =
-    $this->_whereTables['civicrm_note'] =
-      " LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND contact_a.id = civicrm_note.entity_id ) ";
+    $this->_tables['civicrm_note'] = $this->_whereTables['civicrm_note']
+      = " LEFT JOIN civicrm_note ON ( civicrm_note.entity_table = 'civicrm_contact' AND contact_a.id = civicrm_note.entity_id ) ";
 
     $strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower';
     $n = trim($value);
@@ -3555,7 +3546,7 @@ WHERE  id IN ( $groupIDs )
    * @param $values
    * @param bool $fromStateProvince
    *
-   * @return array
+   * @return array|NULL
    */
   public function country(&$values, $fromStateProvince = TRUE) {
     list($name, $op, $value, $grouping, $wildcard) = $values;
@@ -3565,7 +3556,7 @@ WHERE  id IN ( $groupIDs )
       if (!empty($stateValues)) {
         // return back to caller if there are state province values
         // since that handles this case
-        return;
+        return NULL;
       }
     }
 
@@ -3841,7 +3832,6 @@ WHERE  id IN ( $groupIDs )
       }
     }
 
-
     $this->dateQueryBuilder($values, 'contact_a', 'log_date', $fieldName, $fieldTitle);
 
     self::$_openedPanes[ts('Change Log')] = TRUE;
@@ -4032,9 +4022,7 @@ WHERE  id IN ( $groupIDs )
     $relationshipTempTable = NULL;
     if (self::$_relType == 'reciprocal' && empty($targetGroup)) {
       $where = array();
-      self::$_relationshipTempTable =
-      $relationshipTempTable =
-        CRM_Core_DAO::createTempTableName('civicrm_rel');
+      self::$_relationshipTempTable = $relationshipTempTable = CRM_Core_DAO::createTempTableName('civicrm_rel');
       if ($nameClause) {
         $where[$grouping][] = " sort_name $nameClause ";
       }
@@ -4046,7 +4034,6 @@ WHERE  id IN ( $groupIDs )
       }
     }
 
-
     $relTypeInd = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Individual');
     $relTypeOrg = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Organization');
     $relTypeHou = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, 'Household');
@@ -4063,15 +4050,12 @@ WHERE  id IN ( $groupIDs )
       }
     }
 
-
     //check to see if the target contact is in specified group
     if ($targetGroup) {
       //add contacts from static groups
-      $this->_tables['civicrm_relationship_group_contact'] =
-      $this->_whereTables['civicrm_relationship_group_contact'] =
-        " LEFT JOIN civicrm_group_contact civicrm_relationship_group_contact ON civicrm_relationship_group_contact.contact_id = contact_b.id AND civicrm_relationship_group_contact.status = 'Added'";
-      $groupWhere[] =
-        "( civicrm_relationship_group_contact.group_id IN  (" .
+      $this->_tables['civicrm_relationship_group_contact'] = $this->_whereTables['civicrm_relationship_group_contact']
+        = " LEFT JOIN civicrm_group_contact civicrm_relationship_group_contact ON civicrm_relationship_group_contact.contact_id = contact_b.id AND civicrm_relationship_group_contact.status = 'Added'";
+      $groupWhere[] = "( civicrm_relationship_group_contact.group_id IN  (" .
         implode(",", $targetGroup[2]) . ") ) ";
 
       //add contacts from saved searches
@@ -4342,7 +4326,7 @@ civicrm_relationship.is_permission_a_b = 0
    *
    * @return array
    */
-  static function apiQuery(
+  public static function apiQuery(
     $params = NULL,
     $returnProperties = NULL,
     $fields = NULL,
@@ -4448,7 +4432,7 @@ civicrm_relationship.is_permission_a_b = 0
    *
    * @return CRM_Core_DAO
    */
-  function searchQuery(
+  public function searchQuery(
     $offset = 0, $rowCount = 0, $sort = NULL,
     $count = FALSE, $includeContactIds = FALSE,
     $sortByChar = FALSE, $groupContacts = FALSE,
@@ -4661,8 +4645,6 @@ civicrm_relationship.is_permission_a_b = 0
    *   Only get deleted contacts.
    * @param bool $count
    *   Return Count only.
-   *
-   * @return null
    */
   public function generatePermissionClause($onlyDeleted = FALSE, $count = FALSE) {
     if (!$this->_skipPermission) {
@@ -4734,7 +4716,6 @@ SELECT COUNT( conts.total_amount ) as total_count,
     // make sure contribution is completed - CRM-4989
     $completedWhere = $where . " AND civicrm_contribution.contribution_status_id = 1 ";
 
-
     $summary = array();
     $summary['total'] = array();
     $summary['total']['count'] = $summary['total']['amount'] = $summary['total']['avg'] = "n/a";
@@ -4887,50 +4868,49 @@ SELECT COUNT( conts.total_amount ) as cancel_count,
         'do_not_mail' => 1,
         'do_not_sms' => 1,
         'do_not_trade' => 1,
-        'location' =>
-          array(
-            '1' => array(
-              'location_type' => 1,
-              'street_address' => 1,
-              'city' => 1,
-              'state_province' => 1,
-              'postal_code' => 1,
-              'postal_code_suffix' => 1,
-              'country' => 1,
-              'phone-Phone' => 1,
-              'phone-Mobile' => 1,
-              'phone-Fax' => 1,
-              'phone-1' => 1,
-              'phone-2' => 1,
-              'phone-3' => 1,
-              'im-1' => 1,
-              'im-2' => 1,
-              'im-3' => 1,
-              'email-1' => 1,
-              'email-2' => 1,
-              'email-3' => 1,
-            ),
-            '2' => array(
-              'location_type' => 1,
-              'street_address' => 1,
-              'city' => 1,
-              'state_province' => 1,
-              'postal_code' => 1,
-              'postal_code_suffix' => 1,
-              'country' => 1,
-              'phone-Phone' => 1,
-              'phone-Mobile' => 1,
-              'phone-1' => 1,
-              'phone-2' => 1,
-              'phone-3' => 1,
-              'im-1' => 1,
-              'im-2' => 1,
-              'im-3' => 1,
-              'email-1' => 1,
-              'email-2' => 1,
-              'email-3' => 1,
-            ),
+        'location' => array(
+          '1' => array(
+            'location_type' => 1,
+            'street_address' => 1,
+            'city' => 1,
+            'state_province' => 1,
+            'postal_code' => 1,
+            'postal_code_suffix' => 1,
+            'country' => 1,
+            'phone-Phone' => 1,
+            'phone-Mobile' => 1,
+            'phone-Fax' => 1,
+            'phone-1' => 1,
+            'phone-2' => 1,
+            'phone-3' => 1,
+            'im-1' => 1,
+            'im-2' => 1,
+            'im-3' => 1,
+            'email-1' => 1,
+            'email-2' => 1,
+            'email-3' => 1,
           ),
+          '2' => array(
+            'location_type' => 1,
+            'street_address' => 1,
+            'city' => 1,
+            'state_province' => 1,
+            'postal_code' => 1,
+            'postal_code_suffix' => 1,
+            'country' => 1,
+            'phone-Phone' => 1,
+            'phone-Mobile' => 1,
+            'phone-1' => 1,
+            'phone-2' => 1,
+            'phone-3' => 1,
+            'im-1' => 1,
+            'im-2' => 1,
+            'im-3' => 1,
+            'email-1' => 1,
+            'email-2' => 1,
+            'email-3' => 1,
+          ),
+        ),
       );
     }
     return self::$_defaultHierReturnProperties;
@@ -4944,7 +4924,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count,
    * @param $fieldTitle
    * @param bool $appendTimeStamp
    */
-  function dateQueryBuilder(
+  public function dateQueryBuilder(
     &$values, $tableName, $fieldName,
     $dbFieldName, $fieldTitle,
     $appendTimeStamp = TRUE
@@ -5057,7 +5037,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count,
    * @param $fieldTitle
    * @param null $options
    */
-  function numberRangeBuilder(
+  public function numberRangeBuilder(
     &$values,
     $tableName, $fieldName,
     $dbFieldName, $fieldTitle,
@@ -5106,8 +5086,8 @@ SELECT COUNT( conts.total_amount ) as cancel_count,
         $displayValue = $options ? $options[$value] : $value;
         $secondDisplayValue = $options ? $options[$secondValue] : $secondValue;
 
-        $this->_qill[$grouping][] =
-          "$fieldTitle - $firstPhrase \"$displayValue\" " . ts('AND') . " $secondPhrase \"$secondDisplayValue\"";
+        $this->_qill[$grouping][]
+          "$fieldTitle - $firstPhrase \"$displayValue\" " . ts('AND') . " $secondPhrase \"$secondDisplayValue\"";
       }
       else {
         $this->_where[$grouping][] = "{$tableName}.{$dbFieldName} $firstOP {$value}";
@@ -5129,8 +5109,6 @@ SELECT COUNT( conts.total_amount ) as cancel_count,
       $displayValue = $options ? $options[$value] : $value;
       $this->_qill[$grouping][] = "$fieldTitle - $phrase \"$displayValue\"";
     }
-
-    return;
   }
 
   /**
@@ -5148,7 +5126,7 @@ SELECT COUNT( conts.total_amount ) as cancel_count,
    *   Data type of the field.
    *
    * @return string
-   *   where clause for the query
+   *   Where clause for the query.
    */
   public static function buildClause($field, $op, $value = NULL, $dataType = NULL) {
     $op = trim($op);
@@ -5387,7 +5365,7 @@ AND   displayRelType.is_active = 1
    * @return void
    *   adds the where clause and qill to the query object
    */
-  function optionValueQuery(
+  public function optionValueQuery(
     $name,
     $op,
     $value,
@@ -5508,14 +5486,14 @@ AND   displayRelType.is_active = 1
   /**
    * Convert the pseudo constants id's to their names
    *
-   * @param CRM_Core_DAO dao
+   * @param CRM_Core_DAO $dao
    * @param bool $return
    *
-   * @return array
+   * @return array|NULL
    */
   public function convertToPseudoNames(&$dao, $return = FALSE) {
     if (empty($this->_pseudoConstantsSelect)) {
-      return;
+      return NULL;
     }
     $values = array();
     foreach ($this->_pseudoConstantsSelect as $key => $value) {
@@ -5586,11 +5564,11 @@ AND   displayRelType.is_active = 1
    * Include pseudo fields LEFT JOIN
    * @param string|array $sort can be a object or string
    *
-   * @return array
+   * @return array|NULL
    */
   public function includePseudoFieldsJoin($sort) {
     if (!$sort || empty($this->_pseudoConstantsSelect)) {
-      return;
+      return NULL;
     }
     $sort = is_string($sort) ? $sort : $sort->orderBy();
     $present = array();
@@ -5633,7 +5611,7 @@ AND   displayRelType.is_active = 1
     return array($presentClause, $presentSimpleFromClause);
   }
 
-  static function buildQillForFieldValue($daoName, $fieldName, $fieldValue, $op, $pseduoExtraParam = array()) {
+  public static function buildQillForFieldValue($daoName, $fieldName, $fieldValue, $op, $pseduoExtraParam = array()) {
     $pseduoOptions = CRM_Core_PseudoConstant::get($daoName, $fieldName, $pseduoExtraParam = array());
     $qillOperators = CRM_Core_SelectValues::getSearchBuilderOperators();
     if ($fieldName == 'activity_type_id') {
@@ -5656,7 +5634,7 @@ AND   displayRelType.is_active = 1
         $op = key($fieldValue);
         $fieldValue = $fieldValue[$op];
       }
-      foreach ((array)$fieldValue as $val) {
+      foreach ((array) $fieldValue as $val) {
         $qillString[] = $pseduoOptions[$val];
       }
       $fieldValue = implode(', ', $qillString);
index 17d1a26f8ab30779f47baee658d087614e73cc1c..941f183f356a0146c56b6afc81eaca0e3f8ce616 100644 (file)
@@ -189,16 +189,15 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
    *
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
-   * @param int $contactId
-   *   This is contact id for adding relationship.
    * @param array $ids
    *   The array that holds all the db ids.
+   * @param int $contactId
+   *   This is contact id for adding relationship.
    *
    * @return CRM_Contact_BAO_Relationship
    */
   public static function add(&$params, $ids = array(), $contactId = NULL) {
-    $relationshipId =
-      CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params));
+    $relationshipId = CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params));
 
     $hook = 'create';
     if ($relationshipId) {
@@ -372,7 +371,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
    *
-   * @return boolean
+   * @return bool
    */
   public static function dataExists(&$params) {
     // return if no data present
@@ -407,7 +406,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
    * @return array
    *   array reference of all relationship types with context to current contact.
    */
-  static function getContactRelationshipType(
+  public static function getContactRelationshipType(
     $contactId = NULL,
     $contactSuffix = NULL,
     $relationshipId = NULL,
@@ -582,7 +581,6 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
    *
    * @param $action
    *
-   * @return null
    */
   public static function disableEnableRelationship($id, $action) {
     $relationship = self::clearCurrentEmployer($id, $action);
@@ -668,7 +666,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
    * @param int $relationshipTypeId
    *   Relationship type id.
    *
-   * @return boolean
+   * @return bool
    *   true if it is valid relationship else false
    */
   public static function checkRelationshipType($contact_a, $contact_b, $relationshipTypeId) {
@@ -739,7 +737,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship {
    * @param int $relationshipId
    *   This is relationship id for the contact.
    *
-   * @return boolean
+   * @return bool
    *   true if record exists else false
    */
   public static function checkDuplicateRelationship(&$params, $id, $contactId = 0, $relationshipId = 0) {
@@ -1045,7 +1043,7 @@ LEFT JOIN  civicrm_country ON (civicrm_address.country_id = civicrm_country.id)
    * @return array|int
    *   relationship records
    */
-  static function getRelationship(
+  public static function getRelationship(
     $contactId = NULL,
     $status = 0, $numRelationship = 0,
     $count = 0, $relationshipId = 0,
@@ -1700,7 +1698,7 @@ AND cc.sort_name LIKE '%$name%'";
    *   Api input array.
    * @param null $direction
    *
-   * @return array
+   * @return array|void
    */
   public static function membershipTypeToRelationshipTypes(&$params, $direction = NULL) {
     $membershipType = civicrm_api3('membership_type', 'getsingle', array(
@@ -1709,12 +1707,12 @@ AND cc.sort_name LIKE '%$name%'";
     ));
     $relationshipTypes = $membershipType['relationship_type_id'];
     if (empty($relationshipTypes)) {
-      return;
+      return NULL;
     }
     // if we don't have any contact data we can only filter on type
     if (empty($params['contact_id']) && empty($params['contact_id_a']) && empty($params['contact_id_a'])) {
       $params['relationship_type_id'] = array('IN' => $relationshipTypes);
-      return;
+      return NULL;
     }
     else {
       $relationshipDirections = (array) $membershipType['relationship_direction'];
index 22328fb9db9a79110d1d061ab5a43d7043805655..d749ee8eaf4e0d2324f3fe7f3012509de98acad4 100644 (file)
@@ -298,7 +298,6 @@ class CRM_Contact_Form_Domain extends CRM_Core_Form {
       $emailParams['weight'] = CRM_Utils_Weight::getDefaultWeight('CRM_Core_DAO_OptionValue', $fieldValues);
     }
 
-
     //reset default within domain.
     $emailParams['reset_default_for'] = array('domain_id' => CRM_Core_Config::domainID());
 
index 65500055d53a3d70fb7891d7c975458c1b6f94f3..a064ef281215db4dd41f273e32a34af3a8b75d3b 100644 (file)
@@ -74,7 +74,7 @@ class CRM_Contact_Form_Edit_Address {
     //make location type required for inline edit
     $form->addSelect("address[$blockId][location_type_id]", array(
         'entity' => 'address',
-        'class' => 'eight'
+        'class' => 'eight',
       ) + $js, $inlineEdit);
 
     if (!$inlineEdit) {
@@ -118,12 +118,12 @@ class CRM_Contact_Form_Edit_Address {
       'postal_code' => array(
         ts('Zip / Postal Code'),
         array_merge($attributes['postal_code'], array('class' => 'crm_postal_code')),
-        NULL
+        NULL,
       ),
       'postal_code_suffix' => array(
         ts('Postal Code Suffix'),
         array('size' => 4, 'maxlength' => 12, 'class' => 'crm_postal_code_suffix'),
-        NULL
+        NULL,
       ),
       'country_id' => array(ts('Country'), $attributes['country_id'], 'country'),
       'state_province_id' => array(ts('State/Province'), $attributes['state_province_id'], NULL),
@@ -144,7 +144,7 @@ class CRM_Contact_Form_Edit_Address {
         if (in_array($nameWithoutID, array(
             'street_number',
             'street_name',
-            'street_unit'
+            'street_unit',
           )) && !empty($addressOptions['street_address_parsing'])
         ) {
           $continue = FALSE;
@@ -265,7 +265,7 @@ class CRM_Contact_Form_Edit_Address {
       $profileLinks = CRM_Core_BAO_UFGroup::getCreateLinks(array(
           'new_individual',
           'new_organization',
-          'new_household'
+          'new_household',
         ), 'shared_address');
       $form->addEntityRef("address[$blockId][master_contact_id]", ts('Share With'), array('create' => $profileLinks));
     }
@@ -359,7 +359,7 @@ class CRM_Contact_Form_Edit_Address {
             'name' => $shareAddressContactNames[$addressValue['master_id']]['name'],
             'options' => CRM_Core_BAO_Address::getValues(array(
                 'entity_id' => $master_cid,
-                'contact_id' => $master_cid
+                'contact_id' => $master_cid,
               )),
             'master_id' => $addressValue['master_id'],
           );
@@ -387,11 +387,11 @@ class CRM_Contact_Form_Edit_Address {
                      'street_number',
                      'street_number_suffix',
                      'street_name',
-                     'street_unit'
+                     'street_unit',
                    ) as $fld) {
             if (in_array($fld, array(
               'street_name',
-              'street_unit'
+              'street_unit',
             ))) {
               $streetAddress .= ' ';
             }
index 003d1b6e1b8c3f806aa4dfaa4122ccab6548152f..916f22b041da15935dbb055d15a5a4da76a189aa 100644 (file)
@@ -69,7 +69,7 @@ class CRM_Contact_Form_Edit_Email {
       $form->addSelect("email[$blockId][location_type_id]", array(
           'entity' => 'email',
           'class' => 'eight',
-          'placeholder' => NULL
+          'placeholder' => NULL,
         ));
 
       $multipleBulk = CRM_Core_BAO_Email::isMultipleBulkMail();
index 755fc50335dd885d5cafc87bc62aa5e5c6d962a6..07ba127a869403a6b0f71b0edd9e00a5c885d954 100644 (file)
@@ -66,7 +66,7 @@ class CRM_Contact_Form_Edit_IM {
     $form->addSelect("im[$blockId][location_type_id]", array(
         'entity' => 'im',
         'class' => 'eight',
-        'placeholder' => NULL
+        'placeholder' => NULL,
       ));
 
     //IM box
index 71c48d2b27c5f4ad67aa9ad6d66324997a72bdda..dd50d6c221cdaa896eb67072b2d5e2f1985aac57 100644 (file)
@@ -30,7 +30,6 @@
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
@@ -39,7 +38,7 @@
 class CRM_Contact_Form_Edit_Phone {
 
   /**
-   * Build the form object elements for a phone object
+   * Build the form object elements for a phone object.
    *
    * @param CRM_Core_Form $form
    *   Reference to the form object.
@@ -47,8 +46,6 @@ class CRM_Contact_Form_Edit_Phone {
    *   Block number to build.
    * @param bool $blockEdit
    *   Is it block edit.
-   *
-   * @return void
    */
   public static function buildQuickForm(&$form, $addressBlockCount = NULL, $blockEdit = FALSE) {
     // passing this via the session is AWFUL. we need to fix this
@@ -65,7 +62,7 @@ class CRM_Contact_Form_Edit_Phone {
     $form->addSelect("phone[$blockId][phone_type_id]", array(
         'entity' => 'phone',
         'class' => 'eight',
-        'placeholder' => NULL
+        'placeholder' => NULL,
       ));
 
     //main phone number with crm_phone class
@@ -78,7 +75,7 @@ class CRM_Contact_Form_Edit_Phone {
       $form->addSelect("phone[$blockId][location_type_id]", array(
           'entity' => 'phone',
           'class' => 'eight',
-          'placeholder' => NULL
+          'placeholder' => NULL,
         ));
 
       //is_Primary radio
index 65979724a970695d741a8b6b23f587978146158c..de0b5d3e939d7d4637f0974af7c22c7c4359e1ec 100644 (file)
@@ -64,7 +64,7 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
    * @param string $groupElementType
    *
    */
-  static function buildQuickForm(
+  public static function buildQuickForm(
     &$form,
     $contactId = 0,
     $type = self::ALL,
index 5ef9d24927f54ca00cac521a040a29c75c5a35fc..33c301d0b66c63bf9c280ba86848557e5064c66d 100644 (file)
@@ -30,7 +30,6 @@
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
@@ -39,7 +38,6 @@
  * It delegates the work to lower level subclasses and integrates the changes
  * back in. It also uses a lot of functionality with the CRM API's, so any change
  * made here could potentially affect the API etc. Be careful, be aware, use unit tests.
- *
  */
 class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
 
@@ -65,9 +63,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
   protected $_defaults = array();
 
   /**
-   * Build all the data structures needed to build the form
-   *
-   * @return void
+   * Build all the data structures needed to build the form.
    */
   public function preProcess() {
     // reset action from the session
@@ -103,20 +99,17 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
   }
 
   /**
-   * Set default values for the form. Note that in edit/view mode
-   * the default values are retrieved from the database
-   *
+   * Set default values for the form.
    *
-   * @return void
+   * Note that in edit/view mode the default values are retrieved from the
+   * database
    */
   public function setDefaultValues() {
     return $this->_defaults;
   }
 
   /**
-   * Build the form object
-   *
-   * @return void
+   * Build the form object.
    */
   public function buildQuickForm() {
     $params = array();
@@ -155,9 +148,6 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
 
   /**
    * Form submission of new/edit contact is processed.
-   *
-   *
-   * @return void
    */
   public function postProcess() {
     // store the submitted values in an array
@@ -167,7 +157,7 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form {
     foreach (array(
                'phone',
                'email',
-               'address'
+               'address',
              ) as $locFld) {
       if (!empty($this->_defaults[$locFld]) && $this->_defaults[$locFld][1]['location_type_id']) {
         $params[$locFld][1]['is_primary'] = $this->_defaults[$locFld][1]['is_primary'];
index 7c4edc51724dd59638dc09d683c24b210404bf3a..ad8e178bb483f864a232992b6fe0ae3728e94de5 100644 (file)
@@ -70,7 +70,7 @@ class CRM_Contact_Form_Search_Custom extends CRM_Contact_Form_Search {
         'url' => CRM_Utils_System::url('civicrm/contact/search/custom/list',
           'reset=1'
         ),
-      )
+      ),
     );
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
 
index 54ed4e595d2224c50bf3ff91eca73d14695ce93f..e21c6479ece0f6b562a7ff8661e3701732976f6f 100644 (file)
@@ -158,7 +158,7 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch implements CRM_Contact_Form_
   /**
    * Construct the search query
    */
-  function all(
+  public function all(
     $offset = 0, $rowcount = 0, $sort = NULL,
     $includeContactIDs = FALSE, $justIDs = FALSE
   ) {
index 58d036604153470978cc6562adf1385ac59cb74f..eaad6b2989e6a5c673a9829ea92612066da844e9 100644 (file)
@@ -75,7 +75,7 @@ class CRM_Contact_Form_Search_Custom_PostalMailing extends CRM_Contact_Form_Sear
    *
    * @return string
    */
-  function all(
+  public function all(
     $offset = 0, $rowcount = 0, $sort = NULL,
     $includeContactIDs = FALSE, $justIDs = FALSE
   ) {
index ae6fd34e6e3864916ce6457d4f73e4b9a26e29b6..2830daa662d4fac1397b70a12eef5ae36f4b2010 100644 (file)
@@ -276,7 +276,7 @@ AND    p.entity_id    = e.id
    *
    * @return string
    */
-  function all(
+  public function all(
     $offset = 0, $rowcount = 0, $sort = NULL,
     $includeContactIDs = FALSE, $justIDs = FALSE
   ) {
index 966eb4ba9d625e87080bd07649e6e4ab0562e84a..24cdfe3169e56f24cc84392ea0a485b44695ea13 100644 (file)
@@ -96,7 +96,7 @@ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Searc
    *
    * @return string
    */
-  function all(
+  public function all(
     $offset = 0, $rowcount = 0, $sort = NULL,
     $includeContactIDs = FALSE, $justIDs = FALSE
   ) {
index 134c6965207b79df788610b5b7f7e86fb95eb2c1..a8070022e3f5020437de1972968c5d40734b5483 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
  * This class generates form components for search-result tasks
- *
  */
 class CRM_Contact_Form_Task extends CRM_Core_Form {
 
@@ -87,17 +85,15 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
   static protected $_searchFormValues;
 
   /**
-   * Build all the data structures needed to build the form
-   *
-   * @param
-   *
-   * @return void
+   * Build all the data structures needed to build the form.
    */
   public function preProcess() {
     self::preProcessCommon($this);
   }
 
   /**
+   * Common pre-processing function.
+   *
    * @param CRM_Core_Form $form
    * @param bool $useTable
    */
@@ -258,7 +254,6 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
       }
     }
 
-
     if (CRM_Utils_Array::value('radio_ts', self::$_searchFormValues) == 'ts_sel'
       && ($form->_action != CRM_Core_Action::COPY)
     ) {
@@ -277,8 +272,9 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
   }
 
   /**
-   * Get the contact id for custom search
-   * we are not using prev/next table incase of custom search
+   * Get the contact id for custom search.
+   *
+   * we are not using prev/next table in case of custom search
    */
   public function getContactIds() {
     // need to perform action on all contacts
@@ -326,9 +322,9 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
 
 
   /**
-   * Set default values for the form. Relationship that in edit/view action
-   * the default values are retrieved from the database
+   * Set default values for the form. Relationship that in edit/view action.
    *
+   * The default values are retrieved from the database.
    *
    * @return array
    */
@@ -338,34 +334,28 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
   }
 
   /**
-   * add the rules for form.
-   *
-   * @return void
+   * Add the rules for form.
    */
   public function addRules() {
   }
 
   /**
-   * Build the form object
-   *
-   * @return void
+   * Build the form object.
    */
   public function buildQuickForm() {
     $this->addDefaultButtons(ts('Confirm Action'));
   }
 
   /**
-   * Process the form after the input has been submitted and validated
-   *
-   *
-   * @return void
+   * Process the form after the input has been submitted and validated.
    */
   public function postProcess() {
   }
 
   /**
-   * Simple shell that derived classes can call to add buttons to
-   * the form with a customized title for the main Submit
+   * Simple shell that derived classes can call to add form buttons.
+   *
+   * Allows customized title for the main Submit
    *
    * @param string $title
    *   Title of the main button.
@@ -373,8 +363,6 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
    *   Button type for the form after processing.
    * @param string $backType
    * @param bool $submitOnce
-   *
-   * @return void
    */
   public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) {
     $this->addButtons(array(
@@ -393,10 +381,8 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
 
   /**
    * Replace ids of household members in $this->_contactIds with the id of their household.
-   * CRM-8338
    *
-   *
-   * @return void
+   * CRM-8338
    */
   public function mergeContactIdsByHousehold() {
     if (empty($this->_contactIds)) {
index cad57bfc0b2c39075e822cece526472eeb76e036..f537e23ca0c6d74d65682772f56fdfd69024a1f9 100644 (file)
@@ -62,7 +62,7 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
 
     $this->add('select', 'relationship_type_id', ts('Relationship Type'),
       array(
-        '' => ts('- select -')
+        '' => ts('- select -'),
       ) +
       CRM_Contact_BAO_Relationship::getRelationType("Household"), TRUE
     );
@@ -164,27 +164,27 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
             'count' => $valid,
             'plural' => '%count %2 %3 relationships created',
             2 => $relationship,
-            3 => $house
-          ))
+            3 => $house,
+        )),
       );
       if ($duplicate) {
         $status[] = ts('%count was skipped because the contact is already %2 %3', array(
             'count' => $duplicate,
             'plural' => '%count were skipped because the contacts are already %2 %3',
             2 => $relationship,
-            3 => $house
+            3 => $house,
           ));
       }
       if ($invalid) {
         $status[] = ts('%count relationship was not created because the contact is not of the right type for this relationship', array(
             'count' => $invalid,
-            'plural' => '%count relationships were not created because the contact is not of the right type for this relationship'
+            'plural' => '%count relationships were not created because the contact is not of the right type for this relationship',
           ));
       }
       $status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
       CRM_Core_Session::setStatus($status, ts('Relationship created.', array(
             'count' => $valid,
-            'plural' => 'Relationships created.'
+            'plural' => 'Relationships created.',
           )), 'success', array('expires' => 0));
     }
   }
@@ -285,8 +285,7 @@ class CRM_Contact_Form_Task_AddToHousehold extends CRM_Contact_Form_Task {
 
         $contact_type = '<img src="' . $config->resourceBase . 'i/contact_';
 
-        $searchRows[$contactID]['type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ?
-            $result->contact_sub_type : $result->contact_type
+        $searchRows[$contactID]['type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type
         );
       }
 
index 61a4bb795c90c39d9d0594399882edab0d21c311..0bde6dccdbecbcfc22e73fc662c8687f3f145e64 100644 (file)
@@ -128,14 +128,14 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
           // more than one contact deleted
           $message = ts('One of the selected contacts has an address record that is shared with 1 other contact.', array(
               'plural' => 'One or more selected contacts have address records which are shared with %count other contacts.',
-              'count' => $sharedAddressCount
+              'count' => $sharedAddressCount,
             ));
         }
         else {
           // only one contact deleted
           $message = ts('This contact has an address record which is shared with 1 other contact.', array(
               'plural' => 'This contact has an address record which is shared with %count other contacts.',
-              'count' => $sharedAddressCount
+              'count' => $sharedAddressCount,
             ));
         }
         CRM_Core_Session::setStatus($message . ' ' . ts('Shared addresses will not be removed or altered but will no longer be shared.'), ts('Shared Addesses Owner'));
@@ -258,21 +258,21 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
         $status = ts('%1 has been restored from the trash.', array(
             1 => $name,
             'plural' => '%count contacts restored from trash.',
-            'count' => $deleted
+            'count' => $deleted,
           ));
       }
       elseif ($this->_skipUndelete) {
         $status = ts('%1 has been permanently deleted.', array(
             1 => $name,
             'plural' => '%count contacts permanently deleted.',
-            'count' => $deleted
+            'count' => $deleted,
           ));
       }
       else {
         $status = ts('%1 has been moved to the trash.', array(
             1 => $name,
             'plural' => '%count contacts moved to trash.',
-            'count' => $deleted
+            'count' => $deleted,
           ));
       }
       $session->setStatus($status, $title, 'success');
index 7cd440096ae8807cb4c19586e28056643c4f85c0..0f0763044755988c4e00e9cdabfc55c2fb9bcedd 100644 (file)
@@ -57,7 +57,6 @@ WHERE  e.contact_id = c.id
 AND    e.is_primary = 1
 AND    c.id IN ( $contactIDs )";
 
-
     $rows = array();
     $dao = CRM_Core_DAO::executeQuery($query);
     while ($dao->fetch()) {
index 0b4995e53da58d80090ebe3802826b399cc8513c..270e6aaeb6884e28555ce1df85dab7df8f748979 100644 (file)
@@ -62,7 +62,7 @@ class CRM_Contact_Form_Task_Print extends CRM_Contact_Form_Task {
           '=',
           1,
           0,
-          0
+          0,
         );
       }
     }
index 3696721a679e67de78956c4d56921c874a224b8c..f8e04f498195ce39171987b1e9b24df7f463f943 100644 (file)
@@ -54,7 +54,7 @@ class CRM_Contact_Form_Task_Result extends CRM_Contact_Form_Task {
     $context = $this->get('context');
     if (in_array($context, array(
       'smog',
-      'amtg'
+      'amtg',
     ))) {
       $urlParams = 'reset=1&force=1&context=smog&gid=';
       $urlParams .= ($context == 'smog') ? $this->get('gid') : $this->get('amtgID');
@@ -94,7 +94,6 @@ class CRM_Contact_Form_Task_Result extends CRM_Contact_Form_Task {
 
     $url = CRM_Utils_System::url('civicrm/contact/' . $fragment, $path);
     $session->replaceUserContext($url);
-    return;
   }
 
   /**
index 935409a302ea733425a23ba773f5cbfa0982fee6..44e435576819f800c6b06ced48dc34c531de7b82 100644 (file)
@@ -51,7 +51,7 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task {
    *
    * @return void
    */
-  function preProcess() {
+  public function preProcess() {
     $this->_id = NULL;
 
     // get the submitted values of the search form
@@ -95,7 +95,6 @@ class CRM_Contact_Form_Task_SaveSearch extends CRM_Contact_Form_Task {
       CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'title'), TRUE
     );
 
-
     $this->addElement('textarea', 'description', ts('Description'),
       CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Group', 'description')
     );
index 05ec941b34e435f9dd0b56591624453e539dcb14..70487f4136779360a086235165f1ee026420b655 100644 (file)
@@ -31,13 +31,13 @@ WHERE on_hold = 1 AND hold_date is not null AND contact_id in (" . implode(",",
       if ($result) {
         CRM_Core_Session::setStatus(ts('%count email was found on hold and updated.', array(
               'count' => $result,
-              'plural' => '%count emails were found on hold and updated.'
+              'plural' => '%count emails were found on hold and updated.',
             )), ts('Emails Restored'), 'success');
       }
       else {
         CRM_Core_Session::setStatus(ts('The selected contact does not have an email on hold.', array(
               'count' => $result,
-              'plural' => 'None of the selected contacts have an email on hold.'
+              'plural' => 'None of the selected contacts have an email on hold.',
             )), ts('No Emails to Restore'), 'info');
       }
     }
index cd916b6636b90a8dbf97856fcb4cbbdd74014aa8..38b3f97b7c66439e58b8ea540cd1c1d42054d877 100644 (file)
@@ -149,7 +149,7 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
     if (!empty($groups)) {
       $this->addElement('select', 'groups', ts('Add imported records to existing group(s)'), $groups, array(
           'multiple' => "multiple",
-          'class' => 'crm-select2'
+          'class' => 'crm-select2',
         ));
     }
 
index 4522a0e363f31d49af3e98a55f284e7d2bd65d72..d46087cc38c4d9fafb50c9a8bf7dfe61c96663e5 100644 (file)
@@ -113,7 +113,7 @@ class CRM_Contact_Import_Form_Summary extends CRM_Import_Form_Summary {
       'groupAdditions',
       'tagAdditions',
       'unMatchCount',
-      'unparsedAddressCount'
+      'unparsedAddressCount',
     );
     foreach ($properties as $property) {
       $this->assign($property, $this->get($property));
index fddfc8f8bbd211ede749e412253387a14ab04624..81ac494bb58ddfd0fb836b5a8f4598ea3081783f 100644 (file)
@@ -101,7 +101,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
    *
    * @return mixed
    */
-  function run(
+  public function run(
     $tableName,
     &$mapper,
     $mode = self::MODE_PREVIEW,
@@ -405,9 +405,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
    * Given a list of the importable field keys that the user has selected
    * set the active fields array to this list
    *
-   * @param array mapped array of values
-   *
-   * @return void
+   * @param array $fieldKeys
+   *   Mapped array of values.
    */
   public function setActiveFields($fieldKeys) {
     $this->_activeFieldCount = count($fieldKeys);
@@ -554,10 +553,8 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
           }
 
           $value = array(
-            $this->_activeFields[$i]->_name =>
-              $this->_activeFields[$i]->_value,
-            'location_type_id' =>
-              $this->_activeFields[$i]->_hasLocationType,
+            $this->_activeFields[$i]->_name => $this->_activeFields[$i]->_value,
+            'location_type_id' => $this->_activeFields[$i]->_hasLocationType,
           );
 
           if (isset($this->_activeFields[$i]->_phoneType)) {
@@ -653,7 +650,7 @@ abstract class CRM_Contact_Import_Parser extends CRM_Import_Parser {
    * @param string $dataPattern
    * @param bool $hasLocationType
    */
-  function addField(
+  public function addField(
     $name, $title, $type = CRM_Utils_Type::T_INT,
     $headerPattern = '//', $dataPattern = '//',
     $hasLocationType = FALSE
index 0e00b30a59c0b6cdb91768a9e464640f920a2d94..72393cfb39f068c14514d232845d595e2ddce5c6 100644 (file)
@@ -102,7 +102,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
   /**
    * Class constructor
    */
-  function __construct(
+  public function __construct(
     &$mapperKeys, $mapperLocType = NULL, $mapperPhoneType = NULL, $mapperImProvider = NULL, $mapperRelated = NULL, $mapperRelatedContactType = NULL, $mapperRelatedContactDetails = NULL, $mapperRelatedContactLocType = NULL, $mapperRelatedContactPhoneType = NULL, $mapperRelatedContactImProvider = NULL,
     $mapperWebsiteType = NULL, $mapperRelatedContactWebsiteType = NULL
   ) {
@@ -148,8 +148,8 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
     }
 
     //Relationship importables
-    $this->_relationships = $relations =
-      CRM_Contact_BAO_Relationship::getContactRelationshipType(
+    $this->_relationships = $relations
+      CRM_Contact_BAO_Relationship::getContactRelationshipType(
         NULL, NULL, NULL, $this->_contactType,
         FALSE, 'label', TRUE, $this->_contactSubType
       );
@@ -250,7 +250,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
    * @param array $values
    *   The array of values belonging to this line.
    *
-   * @return boolean
+   * @return bool
    */
   public function mapField(&$values) {
     return CRM_Import_Parser::VALID;
@@ -262,7 +262,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
    * @param array $values
    *   The array of values belonging to this line.
    *
-   * @return boolean
+   * @return bool
    *   the result of this processing
    */
   public function preview(&$values) {
@@ -275,7 +275,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
    * @param array $values
    *   The array of values belonging to this line.
    *
-   * @return boolean
+   * @return boo
    *   the result of this processing
    */
   public function summary(&$values) {
@@ -449,7 +449,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
    *
    * @param bool $doGeocodeAddress
    *
-   * @return boolean
+   * @return bool
    *   the result of this processing
    */
   public function import($onDuplicate, &$values, $doGeocodeAddress = FALSE) {
@@ -1013,8 +1013,6 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
           $newContact = $this->createContact($formatted, $contactFields, $onDuplicate, $contactId);
         }
         // else skip does nothing and just returns an error code.
-
-
         if ($cid) {
           $contact = array(
             'contact_id' => $cid,
index 09b2d1148f0a5fd2b00dd19245b1b07525b91163..9bd21723e94d587e4f1bdfd0fc223ef30ec58d6f 100644 (file)
@@ -37,7 +37,7 @@ class CRM_Contact_Page_View_Sunlight extends CRM_Contact_Page_View {
   /**
    * called when action is browse
    *
-   * @return null
+   * @return void
    */
   public function browse() {
     // get the primary city, state and zip for the contact
index dd9e83f736537d9f60d7fc13d81abed7a4b8f632..7e902626c5debd3701d27046310ed435b3c5b0bf 100644 (file)
@@ -37,7 +37,7 @@ class CRM_Contact_Page_View_Tag extends CRM_Core_Page {
   /**
    * called when action is browse
    *
-   * @return null
+   * @return void
    */
   public function browse() {
     $controller = new CRM_Core_Controller_Simple('CRM_Tag_Form_Tag', ts('Contact Tags'), $this->_action);
index b0a8cf111e939d8d042e43b56d1d9991e7e66a9e..4a6c9c85a5c56ce42e84d8cd6baffd0411cfb168 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id: Selector.php 11510 2007-09-18 09:21:34Z lobo $
- *
  */
 
 /**
  * This class is used to retrieve and display a range of
  * contacts that match the given criteria (specifically for
  * results of advanced search options.
- *
  */
 class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
 
@@ -100,7 +98,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
   protected $_customSearchClass;
 
   /**
-   * Class constructor
+   * Class constructor.
    *
    * @param $customSearchClass
    * @param array $formValues
@@ -117,7 +115,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
    *
    * @return \CRM_Contact_Selector_Custom
    */
-  function __construct(
+  public function __construct(
     $customSearchClass,
     $formValues = NULL,
     $params = NULL,
@@ -154,8 +152,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
 
   /**
    * This method returns the links that are given for each search row.
-   * currently the links added for each row are
    *
+   * Currently the links added for each row are
    * - View
    * - Edit
    *
@@ -214,8 +212,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
   }
 
   /**
-   * Returns the column headers as an array of tuples:
-   * (name, sortName (key to the sort array))
+   * Returns the column headers as an array of tuples.
+   *
+   * Keys are name, sortName, key to the sort array.
    *
    * @param string $action
    *   The action being performed.
@@ -251,7 +250,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
   /**
    * Returns total number of rows for the query.
    *
-   * @param
+   * @param null $action
    *
    * @return int
    *   Total number of rows
@@ -261,7 +260,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
   }
 
   /**
-   * Returns all the rows in the given offset and rowCount
+   * Returns all the rows in the given offset and rowCount.
    *
    * @param string $action
    *   The action being performed.
@@ -371,11 +370,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
   }
 
   /**
-   * Given the current formValues, gets the query in local
-   * language
-   *
-   * @param array (
-   * reference)   $formValues   submitted formValues
+   * Given the current formValues, gets the query in local language.
    *
    * @return array
    *   which contains an array of strings
@@ -385,6 +380,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
   }
 
   /**
+   * Get summary.
+   *
    * @return mixed
    */
   public function getSummary() {
@@ -405,6 +402,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
   }
 
   /**
+   * Do nothing.
+   *
    * @return null
    */
   public function alphabetQuery() {
@@ -412,6 +411,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
   }
 
   /**
+   * Generate contact ID query.
+   *
    * @param array $params
    * @param $action
    * @param int $sortID
@@ -420,7 +421,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
    *
    * @return Object
    */
-  public function &contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') {
+  public function contactIDQuery($params, $action, $sortID, $displayRelationshipType = NULL, $queryOperator = 'AND') {
     $params = array();
     $sql = $this->_search->contactIDs($params);
 
@@ -428,7 +429,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
   }
 
   /**
-   * @param $rows
+   * Add actions.
+   *
+   * @param array $rows
    */
   public function addActions(&$rows) {
     $links = self::links($this->_key);
@@ -453,7 +456,9 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector {
   }
 
   /**
-   * @param $rows
+   * Remove actions.
+   *
+   * @param array $rows
    */
   public function removeActions(&$rows) {
     foreach ($rows as $rid => & $rValue) {
index 2b35e17f34588f87f1e2b8ce6fd5c3035899fd59..9dc31c61a8c5b722257df0c6316e2b417dc29ae3 100644 (file)
@@ -44,7 +44,7 @@ class CRM_Contact_StateMachine_Search extends CRM_Core_StateMachine {
   /**
    * Class constructor
    */
-  function __construct($controller, $action = CRM_Core_Action::NONE) {
+  public function __construct($controller, $action = CRM_Core_Action::NONE) {
     parent::__construct($controller, $action);
 
     $this->_pages = array();
index 2a7df6cb53ccd6542b511d8810c35c8a07e55bfe..bb56e5641c0b131ff5ee06bd6e699eeef38f88a0 100644 (file)
@@ -642,16 +642,16 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
           'title' => ts('Contribution Page'),
           'name' => 'contribution_page',
           'where' => 'civicrm_contribution_page.title',
-          'data_type' => CRM_Utils_Type::T_STRING
-        ));
+          'data_type' => CRM_Utils_Type::T_STRING,
+        )
+      );
 
       $contributionNote = array(
-        'contribution_note' =>
-          array(
-            'title' => ts('Contribution Note'),
-            'name' => 'contribution_note',
-            'data_type' => CRM_Utils_Type::T_TEXT,
-          ),
+        'contribution_note' => array(
+          'title' => ts('Contribution Note'),
+          'name' => 'contribution_note',
+          'data_type' => CRM_Utils_Type::T_TEXT,
+        ),
       );
 
       $contributionRecurId = array(
@@ -844,7 +844,7 @@ INNER JOIN  civicrm_contact contact ON ( contact.id = civicrm_contribution.conta
    *   (reference) store ids of duplicate contribs.
    * @param int $id
    *
-   * @return boolean
+   * @return bool
    *   true if duplicate, false otherwise
    */
   public static function checkDuplicate($input, &$duplicates, $id = NULL) {
@@ -1580,7 +1580,7 @@ LEFT JOIN  civicrm_contribution contribution ON ( componentPayment.contribution_
               WHERE     membership_id=$membership->id
               ORDER BY  id DESC
               LIMIT     1;";
-            $dao = new CRM_Core_DAO;
+            $dao = new CRM_Core_DAO();
             $dao->query($sql);
             if ($dao->fetch()) {
               if (!empty($dao->membership_type_id)) {
@@ -2570,7 +2570,7 @@ WHERE  contribution_id = %1 ";
    *
    * @param bool $isNotCancelled
    *
-   * @return boolean
+   * @return bool
    */
   public static function isCancelSubscriptionSupported($contributionId, $isNotCancelled = TRUE) {
     $cacheKeyString = "$contributionId";
@@ -3156,7 +3156,7 @@ WHERE  contribution_id = %1 ";
    * @param array $props
    *   whatever is known about this dao object.
    *
-   * @return Array|bool
+   * @return array|bool
    */
   public static function buildOptions($fieldName, $context = NULL, $props = array()) {
     $className = __CLASS__;
index 8a99a5aa22fd6b063d08b48e94a0c3cd5d31ee7a..75bd26eb26ff3c8dc0e39b9af7e24ca34bd5bcdf 100644 (file)
@@ -61,7 +61,7 @@ class CRM_Contribute_BAO_Contribution_Utils {
    *   associated array
    *
    */
-  static function processConfirm(
+  public static function processConfirm(
     &$form,
     &$paymentParams,
     &$premiumParams,
@@ -511,7 +511,7 @@ INNER JOIN   civicrm_contact contact ON ( contact.id = contrib.contact_id )
         1 => array(
           'email' => $params['email'],
           'location_type_id' => $billingLocTypeId,
-        )
+        ),
       );
     }
 
@@ -568,7 +568,7 @@ INNER JOIN   civicrm_contact contact ON ( contact.id = contrib.contact_id )
     if (!in_array($type, array(
       'paypal',
       'google',
-      'csv'
+      'csv',
     ))
     ) {
       // return the params as is
@@ -806,10 +806,10 @@ INNER JOIN   civicrm_contact contact ON ( contact.id = contrib.contact_id )
     // if this is a recurring contribution then process it first
     if ($params['trxn_type'] == 'subscrpayment') {
       // see if a recurring record already exists
-      $recurring = new CRM_Contribute_BAO_ContributionRecur;
+      $recurring = new CRM_Contribute_BAO_ContributionRecur();
       $recurring->processor_id = $params['processor_id'];
       if (!$recurring->find(TRUE)) {
-        $recurring = new CRM_Contribute_BAO_ContributionRecur;
+        $recurring = new CRM_Contribute_BAO_ContributionRecur();
         $recurring->invoice_id = $params['invoice_id'];
         $recurring->find(TRUE);
       }
index 979a181bbb3da2326b1c974baa46a55d40964bd7..4869a306a41827678460fddaeaf270d1a2b0745b 100644 (file)
@@ -326,6 +326,7 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio
         'priceSetID' => CRM_Utils_Array::value('priceSetID', $values),
         'title' => $title,
         'isShare' => CRM_Utils_Array::value('is_share', $values),
+        'thankyou_title' => CRM_Utils_Array::value('thankyou_title', $values),
       );
 
       if ($contributionTypeId = CRM_Utils_Array::value('financial_type_id', $values)) {
index 88e97572a1074d7c40cdde2bea431c0d5b851e91..c0d5791315b530c3a5c185846bf984fc7eba3e09 100644 (file)
@@ -138,7 +138,7 @@ class CRM_Contribute_BAO_Query {
 
     // get payment instrument id
     if (!empty($query->_returnProperties['payment_instrument_id'])) {
-      $query->_select['instrument_id'] =  "contribution_payment_instrument.value as instrument_id";
+      $query->_select['instrument_id'] = "contribution_payment_instrument.value as instrument_id";
       $query->_select['payment_instrument_id'] = "contribution_payment_instrument.value as payment_instrument_id";
       $query->_element['instrument_id'] = $query->_element['payment_instrument_id'] = 1;
       $query->_tables['civicrm_contribution'] = 1;
@@ -362,7 +362,7 @@ class CRM_Contribute_BAO_Query {
 
       case 'financial_type':
         $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fields[$name]['where'], $op, $value, 'String');
-        CRM_Core_Error::debug( '$query', $query->_where[$grouping] );
+        CRM_Core_Error::debug('$query', $query->_where[$grouping]);
         list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Contribute_DAO_Contribution', $name, $value, $op);
         $query->_qill[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$name]['title'], 2 => $op, 3 => $value));
         $query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1;
@@ -876,7 +876,7 @@ class CRM_Contribute_BAO_Query {
     $form->add('select', 'contribution_currency_type',
       ts('Currency Type'),
       array(
-        '' => ts('- any -')
+        '' => ts('- any -'),
       ) +
       CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('labelColumn' => 'name')),
       FALSE, array('class' => 'crm-select2')
@@ -890,7 +890,7 @@ class CRM_Contribute_BAO_Query {
     $form->add('select', 'contribution_page_id',
       ts('Contribution Page'),
       array(
-        '' => ts('- any -')
+        '' => ts('- any -'),
       ) +
       CRM_Contribute_PseudoConstant::contributionPage(),
       FALSE, array('class' => 'crm-select2')
@@ -903,7 +903,7 @@ class CRM_Contribute_BAO_Query {
     $form->add('select', 'contribution_pcp_made_through_id',
       ts('Personal Campaign Page'),
       array(
-        '' => ts('- any -')
+        '' => ts('- any -'),
       ) +
       CRM_Contribute_PseudoConstant::pcPage(),
       FALSE, array('class' => 'crm-select2')
@@ -1038,7 +1038,7 @@ class CRM_Contribute_BAO_Query {
   public static function buildDateWhere(&$values, $query, $name, $field, $title) {
     $fieldPart = strpos($name, $field);
     if ($fieldPart === FALSE) {
-      return;
+      return NULL;
     }
     // we only have recurring dates using this ATM so lets' short cut to find the table name
     $table = 'contribution_recur';
index 821173bde7c7f2f865a34d76fb8621be3370e7c3..d93223655314a7ffca4d03f50a7c658f9b45f81a 100644 (file)
@@ -30,7 +30,6 @@
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
  * Typically the first form will display the search criteria and it's results
  *
  * The second form is used to process search results with the asscociated actions
- *
  */
 class CRM_Contribute_Controller_ContributionPage extends CRM_Core_Controller {
 
   /**
-   * Class constructor
+   * Class constructor.
+   *
+   * @param string $title
+   * @param bool|int $action
+   * @param bool $modal
    */
   public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) {
 
     parent::__construct($title, $modal);
-
-
     $this->_stateMachine = new CRM_Contribute_StateMachine_ContributionPage($this, $action);
-
-    // create and instantiate the pages
+    // Create and instantiate the pages.
     $this->addPages($this->_stateMachine, $action);
-
-    // add all the actions
     $this->addActions();
   }
 }
index 99553db3cbf26047cd6ac1499ca4cfcfc29c935b..9f06661bd9d72487affb81def17f05dc0399d5c8 100644 (file)
@@ -125,8 +125,8 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
     $this->assign('mode', $this->_mode);
 
     if ($this->_subscriptionDetails->contact_id) {
-      list($this->_donorDisplayName, $this->_donorEmail) =
-        CRM_Contact_BAO_Contact::getContactDetails($this->_subscriptionDetails->contact_id);
+      list($this->_donorDisplayName, $this->_donorEmail)
+        CRM_Contact_BAO_Contact::getContactDetails($this->_subscriptionDetails->contact_id);
     }
   }
 
@@ -186,8 +186,6 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
    * 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
    */
@@ -227,8 +225,8 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
       CRM_Core_Error::displaySessionError($cancelSubscription);
     }
     elseif ($cancelSubscription) {
-      $activityParams =
-        array(
+      $activityParams
+        array(
           'subject' => $this->_mid ? ts('Auto-renewal membership cancelled') : ts('Recurring contribution cancelled'),
           'details' => $message,
         );
@@ -244,10 +242,10 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
           $inputParams = array('id' => $this->_mid);
           CRM_Member_BAO_Membership::getValues($inputParams, $tplParams);
           $tplParams = $tplParams[$this->_mid];
-          $tplParams['membership_status'] =
-            CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $tplParams['status_id']);
-          $tplParams['membershipType'] =
-            CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $tplParams['membership_type_id']);
+          $tplParams['membership_status']
+            CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $tplParams['status_id']);
+          $tplParams['membershipType']
+            CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $tplParams['membership_type_id']);
           $status = ts('The automatic renewal of your %1 membership has been cancelled as requested. This does not affect the status of your membership - you will receive a separate notification when your membership is up for renewal.', array(1 => $tplParams['membershipType']));
           $msgTitle = 'Membership Renewal Cancelled';
           $msgType = 'info';
@@ -277,9 +275,8 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
               $value,
               array('title', 'receipt_from_name', 'receipt_from_email')
             );
-            $receiptFrom =
-              '"' .
-              CRM_Utils_Array::value('receipt_from_name', $value[$this->_subscriptionDetails->contribution_page_id]) .
+            $receiptFrom
+              = '"' . CRM_Utils_Array::value('receipt_from_name', $value[$this->_subscriptionDetails->contribution_page_id]) .
               '" <' .
               $value[$this->_subscriptionDetails->contribution_page_id]['receipt_from_email'] .
               '>';
@@ -290,8 +287,8 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
           }
 
           // send notification
-          $sendTemplateParams =
-            array(
+          $sendTemplateParams
+            array(
               'groupName' => $this->_mode == 'auto_renew' ? 'msg_tpl_workflow_membership' : 'msg_tpl_workflow_contribution',
               'valueName' => $this->_mode == 'auto_renew' ? 'membership_autorenew_cancelled' : 'contribution_recurring_cancelled',
               'contactId' => $this->_subscriptionDetails->contact_id,
@@ -328,11 +325,12 @@ class CRM_Contribute_Form_CancelSubscription extends CRM_Core_Form {
       $session->setStatus($status, $msgTitle, $msgType);
     }
     elseif (!$userID) {
-      if ($status)
+      if ($status) {
         CRM_Utils_System::setUFMessage($status);
-      // keep result as 1, since we not displaying anything on the redirected page anyway
-      return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus',
+        // keep result as 1, since we not displaying anything on the redirected page anyway
+        return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contribute/subscriptionstatus',
         "reset=1&task=cancel&result=1"));
+      }
     }
   }
 }
index f1e4efee12ed82f4837d888b60039b13d5982044..d6c8cf23222b76ba5730070427784e8d8f983321 100644 (file)
@@ -144,20 +144,19 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
     $coreTypes = array('Contact', 'Organization');
 
     $entities[] = array(
-      'entity_name' => array ('contact_1'),
+      'entity_name' => array('contact_1'),
       'entity_type' => 'OrganizationModel',
     );
 
     if ($member && $member['is_active']) {
       $coreTypes[] = 'Membership';
       $entities[] = array(
-        'entity_name' => array ('membership_1'),
+        'entity_name' => array('membership_1'),
         'entity_type' => 'MembershipModel',
       );
     }
-    
-    $allowCoreTypes = array_merge($coreTypes, 
-      CRM_Contact_BAO_ContactType::subTypes('Organization'));
+
+    $allowCoreTypes = array_merge($coreTypes, CRM_Contact_BAO_ContactType::subTypes('Organization'));
     $allowSubTypes = array();
 
     $this->addProfileSelector('onbehalf_profile_id', ts('Organization Profile'), $allowCoreTypes, $allowSubTypes, $entities);
@@ -207,7 +206,7 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
         'Contact',
         'Individual',
         'Organization',
-        'Household'
+        'Household',
       ), CRM_Contact_BAO_ContactType::subTypes('Individual'));
     $allowSubTypes = array();
 
@@ -349,19 +348,17 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
     $dao = CRM_Contribute_BAO_ContributionPage::create($params);
 
     $ufJoinParams = array(
-      'onbehalf_profile_id' =>
-        array(
-          'is_active' => 1,
-          'module' => 'OnBehalf',
-          'entity_table' => 'civicrm_contribution_page',
-          'entity_id' => $dao->id,
-        ),
-      'honor_block_is_active' =>
-        array(
-          'module' => 'soft_credit',
-          'entity_table' => 'civicrm_contribution_page',
-          'entity_id' => $dao->id,
-        ),
+      'onbehalf_profile_id' => array(
+        'is_active' => 1,
+        'module' => 'OnBehalf',
+        'entity_table' => 'civicrm_contribution_page',
+        'entity_id' => $dao->id,
+      ),
+      'honor_block_is_active' => array(
+        'module' => 'soft_credit',
+        'entity_table' => 'civicrm_contribution_page',
+        'entity_id' => $dao->id,
+      ),
     );
 
     foreach ($ufJoinParams as $index => $ufJoinParam) {
index f63f076f2408fcb4d0c4a848928b81592fbb113b..31a54b9cdf90f46a769f6ffdffb42bce3128a0a9 100644 (file)
@@ -133,7 +133,7 @@ class CRM_Contribute_Form_SoftCredit {
       $form->addSelect("soft_credit_type[{$rowNumber}]", array(
           'entity' => 'contribution_soft',
           'field' => 'soft_credit_type_id',
-          'label' => ts('Type')
+          'label' => ts('Type'),
         ));
       if (!empty($form->_softCreditInfo['soft_credit'][$rowNumber]['soft_credit_id'])) {
         $form->add('hidden', "soft_credit_id[{$rowNumber}]",
index 61a8c04d8c95252c51f4f048ab8a54a16e2df827..4b74ea47ff2485ae23dc9da4174cbf0b10505004 100644 (file)
@@ -61,7 +61,7 @@ class CRM_Contribute_Form_Task_Email extends CRM_Contribute_Form_Task {
    *
    * @return void
    */
-  function preProcess() {
+  public function preProcess() {
     CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);
     parent::preProcess();
 
index fe1ece4e0ce40b550b3e4dce83670b11bc880b85..714ef886ac999141b759ede0ee034212e9724d32 100644 (file)
@@ -68,7 +68,7 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Core_Form {
     $this->setMaxFileSize($uploadFileSize);
     $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
           1 => $uploadSize,
-          2 => $uploadFileSize
+          2 => $uploadFileSize,
         )), 'maxfilesize', $uploadFileSize);
     $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
     $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
index 0dd9e0bbbe0a55313c7e55fc5f21c93bad936e32..3377c217d6fb847557eb43e4b29c03475b86b036 100644 (file)
@@ -122,7 +122,7 @@ class CRM_Contribute_Import_Form_Summary extends CRM_Import_Form_Summary {
       'validPledgePaymentRowCount',
       'invalidPledgePaymentRowCount',
       'downloadPledgePaymentErrorRecordsUrl',
-      'downloadSoftCreditErrorRecordsUrl'
+      'downloadSoftCreditErrorRecordsUrl',
     );
     foreach ($properties as $property) {
       $this->assign($property, $this->get($property));
index dd04b55cce4a9cb6947ddc225c5163f26b9f7199..6ccdf2d34e7b3e6eba320b6ba37cfb301709b1fe 100644 (file)
@@ -71,7 +71,7 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page {
    *
    * @return array
    */
-  function &actionLinks() {
+  public function &actionLinks() {
     // check if variable _actionsLinks is populated
     if (!isset(self::$_actionLinks)) {
       // helper variable for nicer formatting
@@ -294,7 +294,7 @@ class CRM_Contribute_Page_ContributionPage extends CRM_Core_Page {
         'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(),
           'reset=1'
         ),
-      )
+      ),
     );
 
     // what action to take ?
@@ -624,7 +624,7 @@ ORDER BY title asc
    *
    * @return int[]
    */
-  function getCampaignIds() {
+  public function getCampaignIds() {
     // The unfiltered value from the session cannot be trusted, it needs to be
     // processed to get a clean array of positive integers.
     $ids = array();
@@ -640,7 +640,7 @@ ORDER BY title asc
    * @param $whereClause
    * @param array $whereParams
    */
-  function pager($whereClause, $whereParams) {
+  public function pager($whereClause, $whereParams) {
 
     $params['status'] = ts('Contribution %%StatusMessage%%');
     $params['csvString'] = NULL;
index e69a98a79f7495af67dce4228c7ae003b5eb9f42..2056235b6d5b1ddfa3766bc216abfcc1499a2e3d 100644 (file)
@@ -48,7 +48,7 @@ class CRM_Contribute_Page_ContributionRecur extends CRM_Core_Page {
    *
    * @return void
    */
-  function view() {
+  public function view() {
     $recur = new CRM_Contribute_DAO_ContributionRecur();
     $recur->id = $this->_id;
     if ($recur->find(TRUE)) {
index d33b0a618e26798a22d6bc02e2435e9c0a58d4f4..608f2cbff13fd8c1702bd3a11d903ebce1fc9eb0 100644 (file)
@@ -36,8 +36,6 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo
 
   /**
    * called when action is browse
-   *
-   * @return null
    */
   public function listContribution() {
     $controller = new CRM_Core_Controller_Simple(
@@ -145,8 +143,6 @@ class CRM_Contribute_Page_UserDashboard extends CRM_Contact_Page_View_UserDashBo
   /**
    * the main function that is called when the page
    * loads, it decides the which action has to be taken for the page.
-   *
-   * @return null
    */
   public function run() {
     $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
index 7c752e0103e33c5cfe1b99dff6b2bffaf7e1b62f..84c75a82fdc944f0341bd7092da15180ac4213af 100644 (file)
@@ -44,7 +44,7 @@ class CRM_Contribute_StateMachine_Search extends CRM_Core_StateMachine {
   /**
    * Class constructor
    */
-  function __construct($controller, $action = CRM_Core_Action::NONE) {
+  public function __construct($controller, $action = CRM_Core_Action::NONE) {
     parent::__construct($controller, $action);
 
     $this->_pages = array();
index a31f1883a96b6943b77e8fd9c814ea20a3ded79b..e8071a7d73504e142b81d248c799f7f7fd7be8b1 100644 (file)
@@ -200,7 +200,7 @@ class CRM_Core_Action {
    * @return string
    *   the html string
    */
-  static function formLink(
+  public static function formLink(
     $links,
     $mask,
     $values,
@@ -321,8 +321,6 @@ class CRM_Core_Action {
   /**
    * Get the mask for a permission (view, edit or null)
    *
-   * @param string the permission
-   *
    * @return int
    *   the mask for the above permission
    */
index fe62f46a393a089c571eed499f8d97a4ccc765cd..d964724840f8760c902df2280255318e435937a6 100644 (file)
@@ -71,7 +71,6 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule {
   /**
    * Get all fields of the type Date
    */
-
   public static function getDateFields() {
     $allFields = CRM_Core_BAO_CustomField::getFields('');
     $dateFields = array('birth_date' => ts('Birth Date'));
@@ -489,7 +488,7 @@ AND   cas.entity_value = $id AND
       foreach (array(
                  'text',
                  'html',
-                 'sms_text'
+                 'sms_text',
                ) as $elem) {
         $$elem = $smarty->fetch("string:{$$elem}");
       }
@@ -529,7 +528,7 @@ AND   cas.entity_value = $id AND
         $smsParams = array(
           'To' => $phoneNumber,
           'provider_id' => $schedule->sms_provider_id,
-          'activity_subject' => $messageSubject
+          'activity_subject' => $messageSubject,
         );
         $activityTypeID = CRM_Core_OptionGroup::getValue('activity_type',
           'SMS',
@@ -701,16 +700,16 @@ AND   cas.entity_value = $id AND
       $activityStatusID = FALSE;
       if ($actionSchedule->record_activity) {
         if ($mapping->entity == 'civicrm_membership') {
-          $activityTypeID =
-            CRM_Core_OptionGroup::getValue('activity_type', 'Membership Renewal Reminder', 'name');
+          $activityTypeID
+            CRM_Core_OptionGroup::getValue('activity_type', 'Membership Renewal Reminder', 'name');
         }
         else {
-          $activityTypeID =
-            CRM_Core_OptionGroup::getValue('activity_type', 'Reminder Sent', 'name');
+          $activityTypeID
+            CRM_Core_OptionGroup::getValue('activity_type', 'Reminder Sent', 'name');
         }
 
-        $activityStatusID =
-          CRM_Core_OptionGroup::getValue('activity_status', 'Completed', 'name');
+        $activityStatusID
+          CRM_Core_OptionGroup::getValue('activity_status', 'Completed', 'name');
       }
 
       if ($mapping->entity == 'civicrm_activity') {
@@ -753,7 +752,7 @@ LEFT JOIN civicrm_option_value ov ON e.activity_type_id = ov.value AND ov.option
           'fee_amount',
           'contact_email',
           'contact_phone',
-          'balance'
+          'balance',
         );
         $extraSelect = ', ov.label as event_type, ev.title, ev.id as event_id, ev.start_date, ev.end_date, ev.summary, ev.description, address.street_address, address.city, address.state_province_id, address.postal_code, email.email as contact_email, phone.phone as contact_phone ';
 
@@ -880,8 +879,8 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL
         if ($toEmail || !(empty($toPhoneNumber) or $toDoNotSms)) {
           $to['email'] = $toEmail;
           $to['phone'] = $toPhoneNumber;
-          $result =
-            CRM_Core_BAO_ActionSchedule::sendReminder(
+          $result
+            CRM_Core_BAO_ActionSchedule::sendReminder(
               $dao->contactID,
               $to,
               $actionSchedule->id,
@@ -913,8 +912,7 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL
           $activityParams = array(
             'subject' => $actionSchedule->title,
             'details' => $actionSchedule->body_html,
-            'source_contact_id' =>
-              $session->get('userID') ? $session->get('userID') : $dao->contactID,
+            'source_contact_id' => $session->get('userID') ? $session->get('userID') : $dao->contactID,
             'target_contact_id' => $dao->contactID,
             'activity_date_time' => date('YmdHis'),
             'status_id' => $activityStatusID,
@@ -1333,9 +1331,10 @@ INNER JOIN {$reminderJoinClause}
         $valsqlInsertValues = CRM_Core_DAO::executeQuery($sqlInsertValues, array(
             1 => array(
               $actionSchedule->id,
-              'Integer'
-            )
-          ));
+              'Integer',
+            ),
+          )
+        );
 
         $arrValues = array();
         while ($valsqlInsertValues->fetch()) {
index d3e5dfd8b2e090a890ef1afe5b573972e5793125..8755afd8b2680938838adfe159dda24622267c75 100644 (file)
@@ -376,7 +376,7 @@ AND    CREATE_TIME < date_sub( NOW( ), INTERVAL $timeIntervalDays day )
       );
       foreach ($transactionPages as $trPage) {
         $params[] = array("%${trPage}%", 'String');
-        $where[] = 'path LIKE %' . sizeof($params);
+        $where[] = 'path LIKE %' . count($params);
       }
 
       $sql = "
index 546b145ac7531b0e9e03195284ec515faf29f5d1..4b2a5f2709ce03b59434b6e0923deeaabf8c5fd0 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Core_BAO_ConfigSetting {
    * @param array $params
    *   Associated array of civicrm variables.
    *
-   * @return null
+   * @return void
    */
   public static function create($params) {
     self::add($params);
@@ -63,7 +63,7 @@ class CRM_Core_BAO_ConfigSetting {
    * @param array $params
    *   Associated array of civicrm variables.
    *
-   * @return null
+   * @return void
    */
   public static function add(&$params) {
     self::fixParams($params);
@@ -71,8 +71,8 @@ class CRM_Core_BAO_ConfigSetting {
     // also set a template url so js files can use this
     // CRM-6194
     $params['civiRelativeURL'] = CRM_Utils_System::url('CIVI_BASE_TEMPLATE');
-    $params['civiRelativeURL'] =
-      str_replace(
+    $params['civiRelativeURL']
+      str_replace(
         'CIVI_BASE_TEMPLATE',
         '',
         $params['civiRelativeURL']
@@ -144,7 +144,7 @@ class CRM_Core_BAO_ConfigSetting {
    * @param array $params
    *   Associated array of civicrm variables.
    *
-   * @return null
+   * @return void
    */
   public static function fixParams(&$params) {
     // in our old civicrm.settings.php we were using ISO code for country and
@@ -178,7 +178,7 @@ class CRM_Core_BAO_ConfigSetting {
    * @param array $values
    *   Associated array of civicrm variables stored in db.
    *
-   * @return null
+   * @return void
    */
   public static function formatParams(&$params, &$values) {
     if (empty($params) ||
@@ -228,7 +228,7 @@ class CRM_Core_BAO_ConfigSetting {
       $defaults = unserialize($domain->config_backend);
       if ($defaults === FALSE || !is_array($defaults)) {
         $defaults = array();
-        return;
+        return FALSE;
       }
 
       $skipVars = self::skipVars();
@@ -519,7 +519,6 @@ class CRM_Core_BAO_ConfigSetting {
     list($oldURL, $oldDir, $oldSiteName, $oldSiteRoot) = self::getConfigSettings();
     list($newURL, $newDir, $newSiteName, $newSiteRoot) = self::getBestGuessSettings();
 
-
     // retrieve these values from the argument list
     $variables = array('URL', 'Dir', 'SiteName', 'SiteRoot', 'Val_1', 'Val_2', 'Val_3');
     $states = array('old', 'new');
@@ -656,7 +655,7 @@ WHERE  option_group_id = (
    * @param string $componentName
    *   Name of the component to be enabled, needs to be valid.
    *
-   * @return boolean
+   * @return bool
    *   true if valid component name and enabling succeeds, else false
    */
   public static function enableComponent($componentName) {
@@ -672,8 +671,8 @@ WHERE  option_group_id = (
     }
 
     // get enabled-components from DB and add to the list
-    $enabledComponents =
-      CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
+    $enabledComponents
+      CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
     $enabledComponents[] = $componentName;
 
     self::setEnabledComponents($enabledComponents);
@@ -691,8 +690,8 @@ WHERE  option_group_id = (
     }
 
     // get enabled-components from DB and add to the list
-    $enabledComponents =
-      CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
+    $enabledComponents
+      CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'enable_components', NULL, array());
     $enabledComponents = array_diff($enabledComponents, array($componentName));
 
     self::setEnabledComponents($enabledComponents);
index e137c049763fd0bd9d23368778185d652500b4ff..27709bdd6574773a29385e0a8f5a5c191439ca7d 100644 (file)
@@ -131,8 +131,6 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
   /**
    * Get the location values of a domain
    *
-   * @param NULL
-   *
    * @return array
    *   Location::getValues
    */
index 33ff4babd78905d09dd3dcbf74468e6fc7a6d846..87649e5d9fbc599ed9c8db72ee214f81ab024b38 100644 (file)
@@ -117,7 +117,7 @@ WHERE  contact_id = {$params['contact_id']}
    * @param array $entityBlock
    *   Input parameters to find object.
    *
-   * @return boolean
+   * @return bool
    */
   public static function &getValues($entityBlock) {
     return CRM_Core_BAO_Block::getValues('email', $entityBlock);
index f78231f25877b7762456bab7b951208eb10df81a..0834b4a7286324ad52a4a7f2ad452f3a3e0f85ed 100644 (file)
@@ -85,7 +85,7 @@ class CRM_Core_BAO_File extends CRM_Core_DAO_File {
    *
    * @throws Exception
    */
-  static function filePostProcess(
+  public static function filePostProcess(
     $data,
     $fileTypeID,
     $entityTable,
@@ -495,7 +495,7 @@ AND       CEF.entity_id    = %2";
    * @param $entityTable
    * @param int $entityID
    */
-  static function formatAttachment(
+  public static function formatAttachment(
     &$formValues,
     &$params,
     $entityTable,
@@ -669,7 +669,6 @@ AND       CEF.entity_id    = %2";
     foreach ($currentAttachmentInfo as $fileKey => $fileValue) {
       $fileID = $fileValue['fileID'];
       $fileType = $fileValue['mime_type'];
-      $eid = $entityID;
       if ($fileID) {
         if ($fileType == 'image/jpeg' ||
           $fileType == 'image/pjpeg' ||
index 0de74960ee72a88aff6f1d94da1c8b8f597a67a8..089a23a2cf7dbc587446be87bd24948a57408d54 100644 (file)
@@ -157,8 +157,6 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue {
   /**
    * Get page orientations recognized by the DOMPDF package used to create PDF letters.
    *
-   * @param void
-   *
    * @return array
    *   array of page orientations
    */
@@ -186,8 +184,6 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue {
   /**
    * Get font sizes supported by the TCPDF package used to create PDF labels.
    *
-   * @param void
-   *
    * @return array
    *   array of font sizes
    */
@@ -203,8 +199,6 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue {
   /**
    * Get measurement units recognized by the TCPDF package used to create PDF labels.
    *
-   * @param void
-   *
    * @return array
    *   array of measurement units
    */
@@ -220,8 +214,6 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue {
   /**
    * Get text alignment recognized by the TCPDF package used to create PDF labels.
    *
-   * @param void
-   *
    * @return array
    *   array of alignments
    */
@@ -236,8 +228,6 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue {
   /**
    * Get text alignment recognized by the TCPDF package used to create PDF labels.
    *
-   * @param void
-   *
    * @return array
    *   array of alignments
    */
@@ -280,6 +270,7 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue {
   public static function addOrder(&$list, $returnURL) {
     $filter = "option_group_id = " . self::_getGid();
     CRM_Utils_Weight::addOrder($list, 'CRM_Core_DAO_OptionValue', 'id', $returnURL, $filter);
+    return $list;
   }
 
   /**
@@ -462,8 +453,6 @@ class CRM_Core_BAO_LabelFormat extends CRM_Core_DAO_OptionValue {
   /**
    * Return the name of the group for customized labels
    *
-   * @param void
-   *
    * @return void
    */
   public static function customGroupName() {
index 87848be35c248fbd7241fe2bd60364be938f81f4..7dc1fe5d9c37129df1c42a97f0550570b818a5ad 100644 (file)
@@ -87,8 +87,6 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType {
   /**
    * Retrieve the default location_type
    *
-   * @param NULL
-   *
    * @return object
    *   The default location type object on success,
    *                          null otherwise
index c7b29965a86e38a1fd314c380e2e758589833613..12859cfd4abd08425799c6fe9885c7cf4463da22 100644 (file)
@@ -86,7 +86,7 @@ class CRM_Core_BAO_Log extends CRM_Core_DAO_Log {
    * @param int $tableID
    * @param int $userID
    */
-  static function register(
+  public static function register(
     $contactID,
     $tableName,
     $tableID,
index 692a08dd7572499cd647a7d2aac008a27389581e..f3bf998eacfd2f3dfe06981f6e43421e13dd897d 100644 (file)
@@ -54,7 +54,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings {
     static $mailSettings = array();
     $domainID = CRM_Core_Config::domainID();
     if (empty($mailSettings[$domainID]) || $reset) {
-      $dao = new self;
+      $dao = new self();
       $dao->is_default = 1;
       $dao->domain_id = $domainID;
       $dao->find(TRUE);
@@ -96,7 +96,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings {
   /**
    * Return the "include message ID" flag from the default set of settings.
    *
-   * @return boolean
+   * @return bool
    *   default include message ID
    */
   public static function includeMessageId() {
index 243e496746d5f25cdb538d36c85c2735e76e9947..52b29f049c2386bba8c0b615430cd6781fb2e7d6 100644 (file)
@@ -68,7 +68,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
    * @param int $id
    *   Mapping id.
    *
-   * @return boolean
+   * @return bool
    */
   public static function del($id) {
     // delete from mapping_field table
@@ -204,7 +204,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
    * @param string $mapTypeId
    *   mapping Type.
    *
-   * @return boolean
+   * @return bool
    */
   public static function checkMapping($nameField, $mapTypeId) {
     $mapping = new CRM_Core_DAO_Mapping();
@@ -363,7 +363,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
       foreach (array(
                  'groups',
                  'tags',
-                 'notes'
+                 'notes',
                ) as $value) {
         unset($fields['Individual'][$value]);
         unset($fields['Household'][$value]);
@@ -388,7 +388,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
         $fields['Contact']['note_body'] = array('title' => $noteTitle . ': ' . ts('Body Only'), 'name' => 'note_body');
         $fields['Contact']['note_subject'] = array(
           'title' => $noteTitle . ': ' . ts('Subject Only'),
-          'name' => 'note_subject'
+          'name' => 'note_subject',
         );
       }
     }
@@ -472,8 +472,8 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
       $csRelationships = array();
 
       if ($mappingType == 'Export') {
-        $subTypeRelationshipTypes =
-          CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'],
+        $subTypeRelationshipTypes
+          CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, NULL, NULL, $val['parent'],
             FALSE, 'label', TRUE, $subType);
 
         foreach ($subTypeRelationshipTypes as $key => $var) {
@@ -1109,8 +1109,6 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
         0,
       );
     }
-
-
     return $fields;
   }
 
@@ -1190,7 +1188,7 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping {
     $mappingFields->delete();
 
     if (empty($params['mapper'])) {
-      return;
+      return NULL;
     }
 
     //save record in mapping field table
index eeb4f5448fdcd833b01f227f06827f4c1e8d3bfe..591fcd3320e76513635b7fd3ff577c251f14bcfb 100644 (file)
@@ -99,10 +99,8 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
   /**
    * Delete the Message Templates
    *
-   *
    * @param int $messageTemplatesID
-   *
-   * @return object
+   * @return void
    */
   public static function del($messageTemplatesID) {
     // make sure messageTemplatesID is an integer
@@ -229,7 +227,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
       $smarty = CRM_Core_Smarty::singleton();
       foreach (array(
                  'text',
-                 'html'
+                 'html',
                ) as $elem) {
         $$elem = $smarty->fetch("string:{$$elem}");
       }
@@ -274,12 +272,12 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
   /**
    * Revert a message template to its default subject+text+HTML state
    *
-   * @param int id id of the template
+   * @param int $id id of the template
    *
    * @return void
    */
   public static function revert($id) {
-    $diverted = new self;
+    $diverted = new CRM_Core_BAO_MessageTemplate();
     $diverted->id = (int) $id;
     $diverted->find(1);
 
@@ -287,7 +285,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
       CRM_Core_Error::fatal(ts('Did not find a message template with id of %1.', array(1 => $id)));
     }
 
-    $orig = new self;
+    $orig = new CRM_Core_BAO_MessageTemplate();
     $orig->workflow_id = $diverted->workflow_id;
     $orig->is_reserved = 1;
     $orig->find(1);
@@ -379,7 +377,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
       else {
         CRM_Core_Error::fatal(ts('No such message template: option group %1, option value %2.', array(
               1 => $params['groupName'],
-              2 => $params['valueName']
+              2 => $params['valueName'],
             )));
       }
     }
@@ -409,7 +407,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
     // replace tokens in the three elements (in subject as if it was the text body)
     $domain = CRM_Core_BAO_Domain::getDomain();
     $hookTokens = array();
-    $mailing = new CRM_Mailing_BAO_Mailing;
+    $mailing = new CRM_Mailing_BAO_Mailing();
     $mailing->body_text = $text;
     $mailing->body_html = $html;
     $tokens = $mailing->getTokens();
@@ -452,7 +450,6 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
       $text = CRM_Utils_Token::replaceContactTokens($text, $contact, FALSE, $tokens['text'], FALSE, TRUE);
       $html = CRM_Utils_Token::replaceContactTokens($html, $contact, FALSE, $tokens['html'], FALSE, TRUE);
 
-
       $contactArray = array($contactID => $contact);
       CRM_Utils_Hook::tokenValues($contactArray,
         array($contactID),
@@ -472,8 +469,6 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
     $subject = "{strip}$subject{/strip}";
 
     // parse the three elements with Smarty
-
-
     $smarty = CRM_Core_Smarty::singleton();
     foreach ($params['tplParams'] as $name => $value) {
       $smarty->assign($name, $value);
@@ -481,7 +476,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate {
     foreach (array(
                'subject',
                'text',
-               'html'
+               'html',
              ) as $elem) {
       $$elem = $smarty->fetch("string:{$$elem}");
     }
index bc8fd6c7a708947b561954b514fa662d063c61af..59307f1108e6971c97f6b6b4e8f4503366431dde 100644 (file)
@@ -78,7 +78,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
    * @param object $note
    *   Either the id of the note to retrieve, or the CRM_Core_DAO_Note object itself.
    *
-   * @return boolean
+   * @return bool
    *   TRUE if the note should be displayed, otherwise FALSE
    *
    */
@@ -223,7 +223,7 @@ class CRM_Core_BAO_Note extends CRM_Core_DAO_Note {
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
    *
-   * @return boolean
+   * @return bool
    */
   public static function dataExists(&$params) {
     // return if no data present
index 03a04f4e2e3d982b29dc884d8055c352157873c0..88bbcba9783721ea1a8be282385275dd429df402 100644 (file)
@@ -113,9 +113,6 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup {
    *
    * @param int $optionGroupId
    *   Id of the Option Group to be deleted.
-   *
-   * @return void
-   *
    */
   public static function del($optionGroupId) {
     // need to delete all option value field before deleting group
@@ -134,9 +131,8 @@ class CRM_Core_BAO_OptionGroup extends CRM_Core_DAO_OptionGroup {
    * @param int $optionGroupId
    *   Id of the Option Group.
    *
-   * @return String
+   * @return string
    *   title
-   *
    */
   public static function getTitle($optionGroupId) {
     $optionGroup = new CRM_Core_DAO_OptionGroup();
index 1b1900af9596bc11148ff2902bfde218e8504b61..c2bb7e1fab3e7181355b8c7f1321a6a374d14587 100644 (file)
@@ -130,7 +130,6 @@ AND    v.option_group_id = g.id
 AND    v.is_active = 1
 ";
 
-
     $dao = CRM_Core_DAO::executeQuery($sql);
     while ($dao->fetch()) {
       if (!$dao->value) {
index 00c0882de633a90120368a39b1d3ba9d28e54916..4c2ba15d98d6deffb8f7d34ea7e6e7384a236ad8 100644 (file)
@@ -90,7 +90,6 @@ WHERE  cacheKey     = %3 AND
       $wherePrev = " WHERE pn.id < %1 AND pn.cacheKey = %2 {$where} ORDER BY ID DESC LIMIT 1";
       $sqlPrev = $sql . $wherePrev;
 
-
       $dao = CRM_Core_DAO::executeQuery($sqlPrev, $p);
       if ($dao->fetch()) {
         $pos['prev']['id1'] = $dao->entity_id1;
@@ -147,10 +146,7 @@ WHERE  cacheKey     = %3 AND
     $sql = "DELETE FROM civicrm_prevnext_cache WHERE  entity_table = %1";
     $params = array(1 => array($entityTable, 'String'));
 
-    $pair =
-      !$isViceVersa ?
-        "entity_id1 = %2 AND entity_id2 = %3" :
-        "(entity_id1 = %2 AND entity_id2 = %3) OR (entity_id1 = %3 AND entity_id2 = %2)";
+    $pair = !$isViceVersa ? "entity_id1 = %2 AND entity_id2 = %3" : "(entity_id1 = %2 AND entity_id2 = %3) OR (entity_id1 = %3 AND entity_id2 = %2)";
     $sql .= " AND ( {$pair} )";
     $params[2] = array($id1, 'Integer');
     $params[3] = array($id2, 'Integer');
@@ -408,11 +404,11 @@ WHERE  cacheKey LIKE %1 AND is_selected = 1
    * @param string $entity_table
    *   Entity table.
    *
-   * @return array
+   * @return array|NULL
    */
   public static function getSelection($cacheKey, $action = 'get', $entity_table = 'civicrm_contact') {
     if (!$cacheKey) {
-      return;
+      return NULL;
     }
     $params = array();
 
index 0781e9e5549e98d4704f3e6c52f2f3330caad144..6abb7e34c6160bcdce07bcc582aff05bea0425f8 100644 (file)
@@ -106,7 +106,7 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField {
    * @param int $id
    *   Field Id.
    *
-   * @return boolean
+   * @return bool
    *
    */
   public static function del($id) {
@@ -360,7 +360,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1";
    *
    * @param int $UFFieldId
    *
-   * @return boolean
+   * @return bool
    *   false if custom field are disabled else true
    */
   public static function checkUFStatus($UFFieldId) {
@@ -450,11 +450,11 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1";
    * @param array $optional
    *   Array of types those are optional.
    *
-   * @return boolean
+   * @return bool
    */
   public static function checkValidProfileType($ufGroupId, $required, $optional = NULL) {
     if (!is_array($required) || empty($required)) {
-      return;
+      return FALSE;
     }
 
     $ufGroup = new CRM_Core_DAO_UFGroup();
@@ -569,7 +569,6 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1";
    * @return string
    *   profile group_type
    *
-   * TODO Why is this function in this class? It seems to be about the UFGroup.
    */
   public static function getProfileType($ufGroupId, $returnMixType = TRUE, $onlyPure = FALSE, $skipComponentType = FALSE) {
     $ufGroup = new CRM_Core_DAO_UFGroup();
@@ -590,10 +589,8 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1";
    *   True if only pure profiles are required.
    * @param bool $skipComponentType
    *
-   * @return string
-   *   profile group_type
+   * @return string  profile group_type
    *
-   * TODO Why is this function in this class? It seems to be about the UFGroup.
    */
   public static function calculateProfileType($ufGroupType, $returnMixType = TRUE, $onlyPure = FALSE, $skipComponentType = FALSE) {
     // profile types
@@ -728,7 +725,7 @@ SELECT ufg.id as id
    *
    * @param int $profileID
    *
-   * @return boolean
+   * @return bool
    */
   public static function checkSearchableORInSelector($profileID) {
     $result = FALSE;
@@ -802,7 +799,7 @@ SELECT  id
         'return' => 'field_name, is_required',
         'options' => array(
           'limit' => 0,
-        )
+        ),
       )
     ));
     //check for valid fields ( fields that are present in billing block )
@@ -831,7 +828,7 @@ SELECT  id
     }
 
     if (!in_array($prefixName, $validProfileFields)) {
-      return;
+      return FALSE;
     }
 
     if (!empty($index) && (
@@ -1029,7 +1026,7 @@ SELECT  id
     ));
     //unset selected fields
     foreach ($groupFieldList as $key => $value) {
-      if (is_integer($key)) {
+      if (is_int($key)) {
         unset($fields['Individual'][$value], $fields['Household'][$value], $fields['Organization'][$value]);
         continue;
       }
index 2833538d5cf7ecbbc6835dccbfabb8f26377dfc0..0e599999353392f73ff9071159fad7966c1b7658 100644 (file)
@@ -41,11 +41,8 @@ abstract class CRM_Core_Component_Config {
    * configuration file and injects them into system wide
    * configuration object.
    *
-   * @param $config
+   * @param CRM_Core_Config $config
    * @param $oldMode
-   *
-   * @return array
-   *   collection of component settings
    */
   public function add($config, $oldMode) {
     foreach (get_class_vars(get_class($this)) as $key => $value) {
@@ -54,7 +51,7 @@ abstract class CRM_Core_Component_Config {
   }
 
   /**
-   * TODO
+   * @param array $defaults
    */
   public function setDefaults(&$defaults) {
     foreach (get_class_vars(get_class($this)) as $key => $value) {
index 1cb6fceffabdf056fdf615a9b705e991d02ad155..34c3cf39c11f24e4060acde19e509bc0cc77c074 100644 (file)
@@ -172,10 +172,8 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
    *   Should we add a unique sequence number to the end of the key.
    * @param bool $ignoreKey
    *   Should we not set a qfKey for this controller (for standalone forms).
-   *
-   * @internal param bool $whether controller is modal
    */
-  function __construct(
+  public function __construct(
     $title = NULL,
     $modal = TRUE,
     $mode = NULL,
@@ -195,8 +193,8 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
     // lets try to get it from the session and/or the request vars
     // we do this early on in case there is a fatal error in retrieving the
     // key and/or session
-    $this->_entryURL =
-      CRM_Utils_Request::retrieve('entryURL', 'String', $this);
+    $this->_entryURL
+      CRM_Utils_Request::retrieve('entryURL', 'String', $this);
 
     // add a unique validable key to the name
     $name = CRM_Utils_System::getClassName($this);
@@ -381,8 +379,8 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
    * Helper function to add all the needed default actions. Note that the framework
    * redefines all of the default QFC actions
    *
-   * @param string directory to store all the uploaded files
-   * @param array names for the various upload buttons (note u can have more than 1 upload)
+   * @param string $uploadDirectory to store all the uploaded files
+   * @param array $uploadNames for the various upload buttons (note u can have more than 1 upload)
    *
    *
    * @return void
@@ -663,7 +661,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   /**
    * Getter for embedded
    *
-   * @return boolean
+   * @return bool
    *   return the embedded value
    */
   public function getEmbedded() {
@@ -684,7 +682,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   /**
    * Getter for skipRedirection
    *
-   * @return boolean
+   * @return bool
    *   return the skipRedirection value
    */
   public function getSkipRedirection() {
@@ -740,7 +738,7 @@ class CRM_Core_Controller extends HTML_QuickForm_Controller {
   /**
    * Getter for print
    *
-   * @return boolean
+   * @return bool
    *   return the print value
    */
   public function getPrint() {
index 0c7a4addfbce102b9f8dd6622f2bb5e1ce2058fc..40c489d1fa6bb604d859106e2af1c1ebcc7b4abc 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 class CRM_Core_Controller_Simple extends CRM_Core_Controller {
 
   /**
-   * Constructor
+   * Constructor.
    *
    * @param null $path
+   *   The class Path of the form being implemented
    * @param bool $title
-   * @param string path the class Path of the form being implemented
+   * @param string $mode
    * @param bool $imageUpload
    * @param bool $addSequence
    *   Should we add a unique sequence number to the end of the key.
@@ -51,10 +51,9 @@ class CRM_Core_Controller_Simple extends CRM_Core_Controller {
    *   Should we not set a qfKey for this controller (for standalone forms).
    * @param bool $attachUpload
    *
-   *
    * @return \CRM_Core_Controller_Simple
    */
-  function __construct(
+  public function __construct(
     $path,
     $title,
     $mode = NULL,
@@ -108,6 +107,8 @@ class CRM_Core_Controller_Simple extends CRM_Core_Controller {
   }
 
   /**
+   * Set parent.
+   *
    * @param $parent
    */
   public function setParent($parent) {
@@ -115,7 +116,9 @@ class CRM_Core_Controller_Simple extends CRM_Core_Controller {
   }
 
   /**
-   * @return mixed
+   * Get template file name.
+   *
+   * @return string
    */
   public function getTemplateFileName() {
     // there is only one form here, so should be quite easy
@@ -126,8 +129,10 @@ class CRM_Core_Controller_Simple extends CRM_Core_Controller {
   }
 
   /**
-   * A wrapper for getTemplateFileName that includes calling the hook to
-   * prevent us from having to copy & paste the logic of calling the hook
+   * A wrapper for getTemplateFileName.
+   *
+   * This includes calling the hook to  prevent us from having to copy & paste
+   * the logic of calling the hook
    */
   public function getHookedTemplateFileName() {
     $pageTemplateFile = $this->getTemplateFileName();
index 5216ab720255dfa77e72aa42c96976f62622d5c3..6edc424c07333935b657ac7e49a4f66f33d8001e 100644 (file)
@@ -129,7 +129,7 @@ class CRM_Core_DAO extends DB_DataObject {
       $required = TRUE;
     }
     if (!$required && $dbName != 'contact_id') {
-      $fkDAO = new $FKClassName;
+      $fkDAO = new $FKClassName();
       if ($fkDAO->find(TRUE)) {
         $this->$dbName = $fkDAO->id;
       }
@@ -221,8 +221,8 @@ class CRM_Core_DAO extends DB_DataObject {
 
         case CRM_Utils_Type::T_TIME:
           CRM_Core_Error::fatal('T_TIME shouldnt be used.');
-        //$object->$dbName='000000';
-        //break;
+          //$object->$dbName='000000';
+          //break;
         case CRM_Utils_Type::T_CCNUM:
           $this->$dbName = '4111 1111 1111 1111';
           break;
@@ -409,7 +409,7 @@ class CRM_Core_DAO extends DB_DataObject {
    *
    * @return array
    */
-  static function &fields() {
+  public static function &fields() {
     $result = NULL;
     return $result;
   }
@@ -417,7 +417,6 @@ class CRM_Core_DAO extends DB_DataObject {
   /**
    * Get/set an associative array of table columns
    *
-   * @param array key=>type array
    * @return array
    *   (associative)
    */
@@ -504,8 +503,8 @@ class CRM_Core_DAO extends DB_DataObject {
    * @param array $params
    *   (reference ) associative array of name/value pairs.
    *
-   * @return boolean
-   *   did we copy all null values into the object
+   * @return bool
+   *   Did we copy all null values into the object
    */
   public function copyValues(&$params) {
     $fields = &$this->fields();
@@ -670,7 +669,7 @@ class CRM_Core_DAO extends DB_DataObject {
    * @param string $fieldName
    *   The name of the field in the DAO.
    *
-   * @return boolean
+   * @return bool
    *   true if object exists
    */
   public static function objectExists($value, $daoName, $daoID, $fieldName = 'name') {
@@ -695,7 +694,7 @@ class CRM_Core_DAO extends DB_DataObject {
    * @param bool $i18nRewrite
    *   Whether to rewrite the query on multilingual setups.
    *
-   * @return boolean
+   * @return bool
    *   true if exists, else false
    */
   public static function checkFieldExists($tableName, $columnName, $i18nRewrite = TRUE) {
@@ -779,7 +778,7 @@ LIKE %1
    * @param string $tableName
    * @param string $constraint
    *
-   * @return boolean
+   * @return bool
    *   true if constraint exists, false otherwise
    */
   public static function checkConstraintExists($tableName, $constraint) {
@@ -807,7 +806,7 @@ LIKE %1
    *
    * @throws Exception
    *
-   * @return boolean
+   * @return bool
    *   true if CONSTRAINT keyword exists, false otherwise
    */
   public static function schemaRequiresRebuilding($tables = array("civicrm_contact")) {
@@ -843,7 +842,7 @@ LIKE %1
    * @param string $tableName
    * @param string $columnName
    *
-   * @return boolean
+   * @return bool
    *   true if in format, false otherwise
    */
   public static function checkFKConstraintInFormat($tableName, $columnName) {
@@ -872,7 +871,7 @@ LIKE %1
    * @param string $columnName
    * @param string $columnValue
    *
-   * @return boolean
+   * @return bool
    *   true if the value is always $columnValue, false otherwise
    */
   public static function checkFieldHasAlwaysValue($tableName, $columnName, $columnValue) {
@@ -889,7 +888,7 @@ LIKE %1
    * @param string $tableName
    * @param string $columnName
    *
-   * @return boolean
+   * @return bool
    *   true if if the value is always NULL, false otherwise
    */
   public static function checkFieldIsAlwaysNull($tableName, $columnName) {
@@ -905,7 +904,7 @@ LIKE %1
    *
    * @param string $tableName
    *
-   * @return boolean
+   * @return bool
    *   true if exists, else false
    */
   public static function checkTableExists($tableName) {
@@ -1017,7 +1016,7 @@ FROM   civicrm_domain
    * @param string $searchColumn
    *   Name of the column you want to search by.
    *
-   * @return boolean
+   * @return bool
    *   true if we found and updated the object, else false
    */
   public static function setFieldValue($daoName, $searchValue, $setColumn, $setValue, $searchColumn = 'id') {
@@ -1125,10 +1124,12 @@ FROM   civicrm_domain
    * @param bool $i18nRewrite
    * @param bool $trapException
    *
-   * @return CRM_Core_DAO
+   * @return CRM_Core_DAO|object
    *   object that holds the results of the query
+   *   NB - if this is defined as just returning a DAO phpstorm keeps pointing
+   *   out all the properties that are not part of the DAO
    */
-  static function &executeQuery(
+  public static function &executeQuery(
     $query,
     $params = array(),
     $abort = TRUE,
@@ -1159,7 +1160,7 @@ FROM   civicrm_domain
     if ($freeDAO ||
       preg_match('/^(insert|update|delete|create|drop|replace)/i', $queryStr)
     ) {
-      // we typically do this for insert/update/delete stataments OR if explicitly asked to
+      // we typically do this for insert/update/delete statements OR if explicitly asked to
       // free the dao
       $dao->free();
     }
@@ -1178,7 +1179,7 @@ FROM   civicrm_domain
    *   the result of the query if any
    *
    */
-  static function &singleValueQuery(
+  public static function &singleValueQuery(
     $query,
     $params = array(),
     $abort = TRUE,
@@ -1309,7 +1310,7 @@ FROM   civicrm_domain
    * @return CRM_Core_DAO
    *   the newly created copy of the object
    */
-  static function &copyGeneric($daoName, $criteria, $newData = NULL, $fieldsFix = NULL, $blockCopyOfDependencies = NULL) {
+  public static function &copyGeneric($daoName, $criteria, $newData = NULL, $fieldsFix = NULL, $blockCopyOfDependencies = NULL) {
     $object = new $daoName();
     if (!$newData) {
       $object->id = $criteria['id'];
@@ -1462,7 +1463,7 @@ SELECT contact_id
    *   an object of type referenced by daoName
    */
   public static function commonRetrieveAll($daoName, $fieldIdName = 'id', $fieldId, &$details, $returnProperities = NULL) {
-    require_once(str_replace('_', DIRECTORY_SEPARATOR, $daoName) . ".php");
+    require_once str_replace('_', DIRECTORY_SEPARATOR, $daoName) . ".php";
     $object = new $daoName();
     $object->$fieldIdName = $fieldId;
 
@@ -1583,9 +1584,10 @@ SELECT contact_id
    * @param int $numObjects
    * @param bool $createOnly
    *
-   * @return
+   * @return object|array|NULL
+   *   NULL if $createOnly. A single object if $numObjects==1. Otherwise, an array of multiple objects.
    */
-  static function createTestObject(
+  public static function createTestObject(
     $daoName,
     $params = array(),
     $numObjects = 1,
@@ -1602,7 +1604,7 @@ SELECT contact_id
       'CRM_Core_DAO_StateProvince',
       'CRM_Core_DAO_Country',
       'CRM_Core_DAO_Domain',
-      'CRM_Financial_DAO_FinancialType'
+      'CRM_Financial_DAO_FinancialType',
       //because valid ones exist & we use pick them due to pseudoconstant can't reliably create & delete these
     );
 
@@ -1651,7 +1653,7 @@ SELECT contact_id
     }
 
     if ($createOnly) {
-      return;
+      return NULL;
     }
     elseif ($numObjects == 1) {
       return $objects[0];
@@ -1823,7 +1825,7 @@ SELECT contact_id
   public static function triggerRebuild($tableName = NULL, $force = FALSE) {
     $info = array();
 
-    $logging = new CRM_Logging_Schema;
+    $logging = new CRM_Logging_Schema();
     $logging->triggerInfo($info, $tableName, $force);
 
     CRM_Core_I18n_Schema::triggerInfo($info, $tableName);
@@ -1864,7 +1866,7 @@ SELECT contact_id
   public static function dropTriggers($tableName = NULL) {
     $info = array();
 
-    $logging = new CRM_Logging_Schema;
+    $logging = new CRM_Logging_Schema();
     $logging->triggerInfo($info, $tableName);
 
     // drop all existing triggers on all tables
@@ -2122,11 +2124,11 @@ SELECT contact_id
    *
    * @param string $fieldName
    * @param string $context
-   *   @see CRM_Core_DAO::buildOptionsContext.
+   * @see CRM_Core_DAO::buildOptionsContext
    * @param array $props
    *   whatever is known about this bao object.
    *
-   * @return Array|bool
+   * @return array|bool
    */
   public static function buildOptions($fieldName, $context = NULL, $props = array()) {
     // If a given bao does not override this function
@@ -2142,7 +2144,7 @@ SELECT contact_id
   public function getOptionLabels() {
     $fields = $this->fields();
     if ($fields === NULL) {
-      throw new Exception ('Cannot call getOptionLabels on CRM_Core_DAO');
+      throw new Exception('Cannot call getOptionLabels on CRM_Core_DAO');
     }
     foreach ($fields as $field) {
       $name = CRM_Utils_Array::value('name', $field);
@@ -2270,13 +2272,12 @@ SELECT contact_id
             }
             $escapedCriteria = array_map(array(
               'CRM_Core_DAO',
-              'escapeString'
+              'escapeString',
             ), $criteria);
             if (!$returnSanitisedArray) {
               return (sprintf('%s %s ("%s")', $fieldName, $operator, implode('", "', $escapedCriteria)));
             }
             return $escapedCriteria;
-            break;
 
           // binary operators
 
@@ -2313,7 +2314,7 @@ SELECT contact_id
       'BETWEEN',
       'NOT BETWEEN',
       'IS NOT NULL',
-      'IS NULL'
+      'IS NULL',
     );
   }
 
index 50c182feea484a08f1894729b219e613389bad8f..2a004296768fc1bca705dc4333f15efd88b24fd3 100644 (file)
@@ -60,7 +60,7 @@ class CRM_Core_Form_Tag {
    *
    * @return void
    */
-  static function buildQuickForm(
+  public static function buildQuickForm(
     &$form, $parentNames, $entityTable, $entityId = NULL, $skipTagCreate = FALSE,
     $skipEntityAction = FALSE, $tagsetElementName = NULL) {
     $tagset = $form->_entityTagValues = array();
index 73ddecbb0109295c730ee3fae5fa2036852f8bee..ea05322b81079f0d4712ee414989ac44475c6924 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Core_I18n_SchemaStructure_2_2_0 {
   /**
    * @return mixed
    */
-  static function &indices() {
+  public static function &indices() {
     static $result = NULL;
     if (!$result) {
       $result = unserialize('a:4:{s:20:"civicrm_custom_group";a:1:{s:16:"UI_title_extends";a:4:{s:4:"name";s:16:"UI_title_extends";s:5:"field";a:2:{i:0;s:5:"title";i:1;s:7:"extends";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:20:"civicrm_custom_field";a:1:{s:24:"UI_label_custom_group_id";a:4:{s:4:"name";s:24:"UI_label_custom_group_id";s:5:"field";a:2:{i:0;s:5:"label";i:1;s:15:"custom_group_id";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:17:"civicrm_price_set";a:1:{s:8:"UI_title";a:4:{s:4:"name";s:8:"UI_title";s:5:"field";a:1:{i:0;s:5:"title";}s:11:"localizable";b:1;s:6:"unique";b:1;}}s:15:"civicrm_contact";a:5:{s:15:"index_sort_name";a:3:{s:4:"name";s:15:"index_sort_name";s:5:"field";a:1:{i:0;s:9:"sort_name";}s:11:"localizable";b:1;}s:16:"index_first_name";a:3:{s:4:"name";s:16:"index_first_name";s:5:"field";a:1:{i:0;s:10:"first_name";}s:11:"localizable";b:1;}s:15:"index_last_name";a:3:{s:4:"name";s:15:"index_last_name";s:5:"field";a:1:{i:0;s:9:"last_name";}s:11:"localizable";b:1;}s:20:"index_household_name";a:3:{s:4:"name";s:20:"index_household_name";s:5:"field";a:1:{i:0;s:14:"household_name";}s:11:"localizable";b:1;}s:23:"index_organization_name";a:3:{s:4:"name";s:23:"index_organization_name";s:5:"field";a:1:{i:0;s:17:"organization_name";}s:11:"localizable";b:1;}}}');
index 60923ce4a096b1b34d62a117f1a7553bae09e358..cb8796712641fe007f221cd58a409936ef197e99 100644 (file)
@@ -238,9 +238,9 @@ class CRM_Core_I18n_SchemaStructure_3_0_alpha1 {
   }
 
   /**
-   * @return array
+   * @return array $result
    */
-  static function &tables() {
+  public static function &tables() {
     static $result = NULL;
     if (!$result) {
       $result = array_keys(self::columns());
index fa6d928a00251d3c911e301e9b2d3611dc62532c..eb5f60a02aa5843ea2699d6649105e446292dd71 100644 (file)
@@ -273,7 +273,7 @@ class CRM_Core_InnoDBIndexer {
   }
 
   /**
-   * @return boolean
+   * @return bool
    */
   public function getActive() {
     return $this->isActive;
index b10026ac6b908fb5784282e288c9e450a644aaf9..57b8c80e6852f443cd54468c5ed3dda5f9ca320f 100644 (file)
@@ -5,7 +5,7 @@ class CRM_Core_LegacyErrorHandler {
    * @param \Civi\Core\Event\UnhandledExceptionEvent $event
    * @throws Exception
    */
-  static function handleException($event) {
+  public static function handleException($event) {
     $e = $event->exception;
     if ($e instanceof CRM_Core_Exception) {
       $params = $e->getErrorData();
index 521cd824d9f21ac99e52c000cc6f03c40a1193ad..d35d792434ad44e9e3ba1aa40432a038bd2068a5 100644 (file)
@@ -164,9 +164,6 @@ class CRM_Core_Page {
    * This function takes care of all the things common to all
    * pages. This typically involves assigning the appropriate
    * smarty variable :)
-   *
-   * @return string
-   *   The content generated by running this page
    */
   public function run() {
     if ($this->_embedded) {
@@ -242,7 +239,6 @@ class CRM_Core_Page {
     CRM_Utils_Hook::alterContent($content, 'page', $pageTemplateFile, $this);
 
     echo CRM_Utils_System::theme($content, $this->_print);
-    return;
   }
 
   /**
index 74fbc48a3bc3dc5688a91035dc355a6eca59fd59..af7ae6613a403866019baf89d540ae0ae45fa45d 100644 (file)
@@ -73,7 +73,7 @@ class CRM_Core_Page_AJAX {
         // FIXME: This is done to maintain current wire protocol, but it might be
         // simpler to just require different 'types' for pages and forms
         if (preg_match('/^CRM_[a-zA-Z0-9]+_Page_Inline_/', $className)) {
-          $page = new $className;
+          $page = new $className();
           $page->run();
         }
         else {
index 017f2c219de080ba72535f40b789de3732c8b7b6..7d3bccf0e5226316100fb5530ebc016c1b3ba72e 100644 (file)
@@ -71,36 +71,36 @@ class CRM_Core_Page_Angular extends CRM_Core_Page {
     $angularModules = array();
     $angularModules['angularFileUpload'] = array(
       'ext' => 'civicrm',
-      'js' => array('bower_components/angular-file-upload/angular-file-upload.min.js')
+      'js' => array('bower_components/angular-file-upload/angular-file-upload.min.js'),
     );
     $angularModules['crmApp'] = array('ext' => 'civicrm', 'js' => array('js/angular-crmApp.js'));
     $angularModules['crmAttachment'] = array(
       'ext' => 'civicrm',
       'js' => array('js/angular-crmAttachment.js'),
-      'css' => array('css/angular-crmAttachment.css')
+      'css' => array('css/angular-crmAttachment.css'),
     );
     $angularModules['crmUi'] = array(
       'ext' => 'civicrm',
-      'js' => array('js/angular-crm-ui.js', 'packages/ckeditor/ckeditor.js')
+      'js' => array('js/angular-crm-ui.js', 'packages/ckeditor/ckeditor.js'),
     );
     $angularModules['crmUtil'] = array('ext' => 'civicrm', 'js' => array('js/angular-crm-util.js'));
     // https://github.com/jwstadler/angular-jquery-dialog-service
     $angularModules['dialogService'] = array(
       'ext' => 'civicrm',
-      'js' => array('bower_components/angular-jquery-dialog-service/dialog-service.js')
+      'js' => array('bower_components/angular-jquery-dialog-service/dialog-service.js'),
     );
     $angularModules['ngSanitize'] = array('ext' => 'civicrm', 'js' => array('js/angular-sanitize.js'));
     $angularModules['ui.utils'] = array(
       'ext' => 'civicrm',
-      'js' => array('bower_components/angular-ui-utils/ui-utils.min.js')
+      'js' => array('bower_components/angular-ui-utils/ui-utils.min.js'),
     );
     $angularModules['ui.sortable'] = array(
       'ext' => 'civicrm',
-      'js' => array('bower_components/angular-ui-sortable/sortable.min.js')
+      'js' => array('bower_components/angular-ui-sortable/sortable.min.js'),
     );
     $angularModules['unsavedChanges'] = array(
       'ext' => 'civicrm',
-      'js' => array('bower_components/angular-unsavedChanges/dist/unsavedChanges.min.js')
+      'js' => array('bower_components/angular-unsavedChanges/dist/unsavedChanges.min.js'),
     );
 
     foreach (CRM_Core_Component::getEnabledComponents() as $component) {
index 2c5cce2ebefdcfe6dbdf54358ec05cc9318bd18d..62fea0f40c2bc1fcbe1dbfecb2e6c700a6cf2fc9 100644 (file)
@@ -45,8 +45,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page {
    *
    * @return string
    */
-
-  abstract function getBAOName();
+  abstract protected function getBAOName();
 
   /**
    * An array of action links
@@ -54,21 +53,21 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page {
    * @return array
    *   (reference)
    */
-  abstract function &links();
+  abstract protected function &links();
 
   /**
    * Name of the edit form class
    *
    * @return string
    */
-  abstract function editForm();
+  abstract protected function editForm();
 
   /**
    * Name of the form
    *
    * @return string
    */
-  abstract function editName();
+  abstract protected function editName();
 
   /**
    * UserContext to pop back to
@@ -78,7 +77,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page {
    *
    * @return string
    */
-  abstract function userContext($mode = NULL);
+  abstract protected function userContext($mode = NULL);
 
   /**
    * Get userContext params
@@ -300,7 +299,7 @@ abstract class CRM_Core_Page_Basic extends CRM_Core_Page {
     if (!empty($values['name']) && in_array($values['name'], array(
         'encounter_medium',
         'case_type',
-        'case_status'
+        'case_status',
       ))
     ) {
       static $caseCount = NULL;
index ab50f68298fd1b6aa750e376d912f2044caf32cb..97f9417ae3d9fbc9c1b4829584808541f6c94a95 100644 (file)
@@ -303,7 +303,7 @@ abstract class CRM_Core_Payment {
             'rule_message' => ts('Please enter a valid value for your card security code. This is usually the last 3-4 digits on the card\'s signature panel.'),
             'rule_name' => 'integer',
             'rule_parameters' => NULL,
-          )
+          ),
         ),
       ),
       'credit_card_exp_date' => array(
@@ -318,7 +318,7 @@ abstract class CRM_Core_Payment {
             'rule_message' => ts('Card expiration date cannot be a past date.'),
             'rule_name' => 'currentDate',
             'rule_parameters' => TRUE,
-          )
+          ),
         ),
       ),
       'credit_card_type' => array(
@@ -357,7 +357,7 @@ abstract class CRM_Core_Payment {
             'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'),
             'rule_name' => 'nopunctuation',
             'rule_parameters' => NULL,
-          )
+          ),
         ),
         'is_required' => TRUE,
       ),
@@ -378,7 +378,7 @@ abstract class CRM_Core_Payment {
             'rule_message' => ts('Please enter a valid Bank Identification Number (value must not contain punctuation characters).'),
             'rule_name' => 'nopunctuation',
             'rule_parameters' => NULL,
-          )
+          ),
         ),
       ),
       'bank_name' => array(
@@ -408,7 +408,7 @@ abstract class CRM_Core_Payment {
    *   the result in an nice formatted array (or an error object)
    * @abstract
    */
-  abstract function doDirectPayment(&$params);
+  abstract protected function doDirectPayment(&$params);
 
   /**
    * Process payment - this function wraps around both doTransferPayment and doDirectPayment
@@ -442,7 +442,7 @@ abstract class CRM_Core_Payment {
    * @return string
    *   the error message if any
    */
-  abstract function checkConfig();
+  abstract protected function checkConfig();
 
   /**
    * @param $paymentProcessor
@@ -589,7 +589,7 @@ abstract class CRM_Core_Payment {
    * @param string $method
    *   Method to check for.
    *
-   * @return boolean
+   * @return bool
    */
   public function isSupported($method = 'cancelSubscription') {
     return method_exists(CRM_Utils_System::getClassName($this), $method);
index a62030a1852f94887a2a7a321bb95e4bae88cc8d..da729de70aa9181feed267aeae18709bd3b34b3e 100644 (file)
@@ -396,7 +396,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
    *
    * @return string
    *   the HMAC_MD5 encoding string
-   **/
+   */
   public function hmac($key, $data) {
     if (function_exists('mhash')) {
       // Use PHP mhash extension
@@ -459,7 +459,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment {
    *
    * @return string
    *   fingerprint
-   **/
+   */
   public function CalculateFP() {
     $x_tran_key = $this->_getParam('paymentKey');
     $loginid = $this->_getParam('apiLogin');
index 4f3ca26bb60e515f1cc12013b7f468f16765b0cf..c3e89e9fda5acc24d1d41a25018f847cf6133f4f 100644 (file)
@@ -644,7 +644,7 @@ LIMIT 1;";
           'labelColumn' => 'name',
           'flip' => 1
         ));
-      if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later && -$input['prevContribution']->contribution_status_id == $contributionStatuses['Pending'])) {
+      if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later && $input['prevContribution']->contribution_status_id == $contributionStatuses['Pending'])) {
         $input['payment_processor'] = $paymentProcessorId;
       }
       $input['contribution_status_id'] = $contributionStatuses['Completed'];
index 1ba3d48227609927d3ce036c68609d633de67c33..0587c681d6a6530fed4e257870a273d8c81ccf2b 100644 (file)
@@ -22,7 +22,7 @@
  * WARY of this when coding
  *
  * -----------------------------------------------------------------------------------------------
- **/
+ */
 class CRM_Core_Payment_Elavon extends CRM_Core_Payment {
   // (not used, implicit in the API, might need to convert?)
   const
index 4fb9aa912d0350b0cd024aff3e79a73620bc553b..089838d49e7cea29ad90b0fdf5b83f68a797ad67 100644 (file)
@@ -29,7 +29,7 @@
  * If an result of class error is returned it is treated as a failure
  *
  * -----------------------------------------------------------------------------------------------
- **/
+ */
 
 /**
  * From Payment processor documentation
@@ -63,7 +63,7 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
    */
   static private $_singleton = NULL;
 
-  /**********************************************************
+  /**
    * Constructor
    *
    * @param string $mode
@@ -79,12 +79,12 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
     $this->_paymentProcessor = $paymentProcessor;
   }
 
-  /**********************************************************
+  /**
    * This function is set up and put here to make the mapping of fields
    * from the params object  as visually clear as possible for easy editing
    *
    *  Comment out irrelevant fields
-   **********************************************************/
+   */
   public function mapProcessorFieldstoParams($params) {
     /*concatenate full customer name first  - code from EWAY gateway
          */
@@ -139,10 +139,10 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
     return $requestFields;
   }
 
-  /**********************************************************
+  /**
    * This function sends request and receives response from
    * the processor
-   **********************************************************/
+   */
   public function doDirectPayment(&$params) {
     if ($params['is_recur'] == TRUE) {
       CRM_Core_Error::fatal(ts('%1 - recurring payments not implemented', array(1 => $paymentProcessor)));
@@ -315,9 +315,9 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
     return $contribution->find();
   }
 
-  /**************************************************
+  /**
    * Produces error message and returns from class
-   **************************************************/
+   */
   public function &errorExit($errorCode = NULL, $errorMessage = NULL) {
     $e = CRM_Core_Error::singleton();
 
@@ -330,14 +330,14 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
     return $e;
   }
 
-  /**************************************************
+  /**
    * NOTE: 'doTransferCheckout' not implemented
-   **************************************************/
+   */
   public function doTransferCheckout(&$params, $component) {
     CRM_Core_Error::fatal(ts('This function is not implemented'));
   }
 
-  /********************************************************************************************
+  /**
    * This public function checks to see if we have the right processor config values set
    *
    * NOTE: Called by Events and Contribute to check config params are set prior to trying
@@ -348,10 +348,9 @@ class CRM_Core_Payment_FirstData extends CRM_Core_Payment {
    *
    * returns string $errorMsg if any errors found - null if OK
    *
-   ******************************************************************************************
+   *  function checkConfig( $mode )           CiviCRM V1.9 Declaration
+   * CiviCRM V2.0 Declaration
    */
-  //  function checkConfig( $mode )          // CiviCRM V1.9 Declaration
-  // CiviCRM V2.0 Declaration
   public function checkConfig() {
     $errorMsg = array();
 
index 96d45ccf23996cc93d4b4d3145343394d1af2464..b00c4fbe5d12d1068f65a001a3f53d37d7ba640b 100644 (file)
@@ -163,7 +163,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
    * @param array $ids
    * @param array $objects
    * @param bool $first
-   * @return void|boolean
+   * @return void|bool
    */
   public function recur(&$input, &$ids, &$objects, $first) {
     if (!isset($input['txnType'])) {
@@ -227,7 +227,7 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
       case 'recurring_payment_profile_created':
         if (in_array($recur->contribution_status_id, array(
               array_search('Pending', $contributionStatuses),
-              array_search('In Progress', $contributionStatuses)
+              array_search('In Progress', $contributionStatuses),
             ))
           && !empty($recur->processor_id)
         ) {
@@ -389,14 +389,14 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
    * (with the input parameters) & call this & all will be done
    *
    * @todo the references to POST throughout this class need to be removed
-   * @return void|boolean
+   * @return void|bool
    */
   public function main() {
     CRM_Core_Error::debug_var('GET', $_GET, TRUE, TRUE);
     CRM_Core_Error::debug_var('POST', $_POST, TRUE, TRUE);
     if ($this->_isPaymentExpress) {
       $this->handlePaymentExpress();
-      return;
+      return NULL;
     }
     $objects = $ids = $input = array();
     $this->_component = $input['component'] = self::getValue('m');
@@ -542,7 +542,7 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
 
     $contributionRecur = civicrm_api3('contribution_recur', 'getsingle', array(
         'return' => 'contact_id, id',
-        'invoice_id' => $input['invoice']
+        'invoice_id' => $input['invoice'],
       ));
     $ids['contact'] = $contributionRecur['contact_id'];
     $ids['contributionRecur'] = $contributionRecur['id'];
@@ -557,8 +557,8 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr
     $ids['contributionPage'] = CRM_Core_DAO::singleValueQuery("SELECT contribution_page_id FROM civicrm_contribution WHERE invoice_id = %1", array(
         1 => array(
           $ids['contribution'],
-          'Integer'
-        )
+          'Integer',
+        ),
       ));
     // only handle component at this stage - not terribly sure how a recurring event payment would arise
     // & suspec main function may be a victom of copy & paste
index ee118d5317a42cff43366f8e7b520a3577e0afca..39bf81aa2719c7f9101b2ff1ae5d6046c8de53e3 100644 (file)
@@ -89,7 +89,7 @@
  * ie - all other amounts will return a failed response.
  *
  * -----------------------------------------------------------------------------------------------
- **/
+ */
 class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
   # (not used, implicit in the API, might need to convert?)
   const CHARSET = 'UTF-8';
@@ -102,15 +102,16 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
    */
   static private $_singleton = NULL;
 
-  /**********************************************************
+  /**
+   * *******************************************************
    * Constructor
    *
    * @param string $mode
    *   The mode of operation: live or test.
    *
-   * @param $paymentProcessor
+   * @param int $paymentProcessor
    *
-   * @return \CRM_Core_Payment_eWAY *******************************************************
+   * *******************************************************
    */
   public function __construct($mode, &$paymentProcessor) {
     // require Standard eWAY API libraries
@@ -123,10 +124,12 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
     $this->_processorName = ts('eWay');
   }
 
-  /**********************************************************
+  /**
+   * *******************************************************
    * This function sends request and receives response from
    * eWAY payment process
-   **********************************************************/
+   * *******************************************************
+   */
   public function doDirectPayment(&$params) {
     if (CRM_Utils_Array::value('is_recur', $params) == TRUE) {
       CRM_Core_Error::fatal(ts('eWAY - recurring payments not implemented'));
@@ -144,13 +147,13 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
     //------------------------------------
     // create eWAY gateway objects
     //------------------------------------
-    $eWAYRequest = new GatewayRequest;
+    $eWAYRequest = new GatewayRequest();
 
     if (($eWAYRequest == NULL) || (!($eWAYRequest instanceof GatewayRequest))) {
       return self::errorExit(9001, "Error: Unable to create eWAY Request object.");
     }
 
-    $eWAYResponse = new GatewayResponse;
+    $eWAYResponse = new GatewayResponse();
 
     if (($eWAYResponse == NULL) || (!($eWAYResponse instanceof GatewayResponse))) {
       return self::errorExit(9002, "Error: Unable to create eWAY Response object.");
@@ -420,9 +423,11 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
     return $contribution->find();
   }
 
-  /*************************************************************************************************
+  /**
+   * **********************************************************************************************
    * This function checks the eWAY response status - returning a boolean false if status != 'true'
-   *************************************************************************************************/
+   * ************************************************************************************************
+   */
   public function isError(&$response) {
     $status = $response->Status();
 
@@ -432,9 +437,11 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
     return FALSE;
   }
 
-  /**************************************************
+  /**
+   * ************************************************
    * Produces error message and returns from class
-   **************************************************/
+   * *************************************************
+   */
   public function &errorExit($errorCode = NULL, $errorMessage = NULL) {
     $e = CRM_Core_Error::singleton();
 
@@ -447,14 +454,17 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
     return $e;
   }
 
-  /**************************************************
+  /**
+   * ************************************************
    * NOTE: 'doTransferCheckout' not implemented
-   **************************************************/
+   * ************************************************
+   */
   public function doTransferCheckout(&$params, $component) {
     CRM_Core_Error::fatal(ts('This function is not implemented'));
   }
 
-  /********************************************************************************************
+  /**
+   * *****************************************************************************************
    * This public function checks to see if we have the right processor config values set
    *
    * NOTE: Called by Events and Contribute to check config params are set prior to trying
@@ -467,10 +477,8 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
    *
    * returns string $errorMsg if any errors found - null if OK
    *
-   ******************************************************************************************
+   * *****************************************************************************************
    */
-  //function checkConfig( $mode )          // CiviCRM V1.9 Declaration
-  // CiviCRM V2.0 Declaration
   public function checkConfig() {
     $errorMsg = array();
 
index 5e4f239161dc70a9b7d04cfdeeeefff719af6062..be049664f2482ddc3d0055a4e176630e73445c8e 100644 (file)
@@ -156,10 +156,7 @@ class CRM_Core_Permission_Base {
    * @param string $str
    *   The permission to check.
    *
-   * @return boolean
-   *   true if yes, else false
    */
-
   public function check($str) {
     //no default behaviour
   }
@@ -170,10 +167,9 @@ class CRM_Core_Permission_Base {
    * @param array $array
    *   The roles to check.
    *
-   * @return boolean
+   * @return bool
    *   true if yes, else false
    */
-
   public function checkGroupRole($array) {
     return FALSE;
   }
@@ -184,8 +180,6 @@ class CRM_Core_Permission_Base {
    * @param string $permissionName
    *   Name of the permission we are interested in.
    *
-   * @return string
-   *   a comma separated list of email addresses
    */
   public function permissionEmails($permissionName) {
     CRM_Core_Error::fatal("this function only works in Drupal 6 at the moment");
@@ -197,8 +191,6 @@ class CRM_Core_Permission_Base {
    * @param string $roleName
    *   Name of the role we are interested in.
    *
-   * @return string
-   *   a comma separated list of email addresses
    */
   public function roleEmails($roleName) {
     CRM_Core_Error::fatal("this function only works in Drupal 6 at the moment");
index 18dfbff83452ad996ebd9ffed9b6ad2a6f7cb5c9..a63815eb820ffc6a1383d78cf86e656a70c03bf5 100644 (file)
@@ -259,7 +259,7 @@ class CRM_Core_Permission_DrupalBase extends CRM_Core_Permission_Base {
    * @param array $array
    *   The roles to check.
    *
-   * @return boolean
+   * @return bool
    *   true if yes, else false
    */
   public function checkGroupRole($array) {
index 7110b890ff4e820ccc6dbda983fcd40791bfe876..9ae05208dc41d1aad5829770fb34367326398fe9 100644 (file)
@@ -43,7 +43,7 @@ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base {
    * @param string $str
    *   The permission to check.
    *
-   * @return boolean
+   * @return bool
    *   true if yes, else false
    */
   public function check($str) {
@@ -104,7 +104,7 @@ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base {
    * @param array $array
    *   The roles to check.
    *
-   * @return boolean
+   * @return bool
    *   true if yes, else false
    */
   public function checkGroupRole($array) {
index 1b35fe8e55babf31695cd0a39703fdfbdfd4edb6..b28ed9c19fb945692f188a13b3f26149577a5664 100644 (file)
@@ -44,10 +44,9 @@ class CRM_Core_Permission_Soap extends CRM_Core_Permission_Base {
    * @param string $str
    *   The permission to check.
    *
-   * @return boolean
+   * @return bool
    *   true if yes, else false
    */
-
   public function check($str) {
     return TRUE;
   }
index 904703fc7f710213aed19d67d74f499aecd83b48..2e5043f1e3c59aab6808a218edd2911506d0b3e9 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Core_Permission_UnitTests extends CRM_Core_Permission_Base {
    * @param string $str
    *   The permission to check.
    *
-   * @return boolean
+   * @return bool
    *   true if yes, else false
    */
   public function check($str) {
index a4fea83a62c43316fa30222d95ee474fa8a5acca..9179f6d025bdc5f3d0ab5c82f24a8781d0865ca8 100644 (file)
@@ -31,7 +31,6 @@
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
 
@@ -48,7 +47,7 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
   protected $_uploadDir;
 
   /**
-   * Class constructor
+   * Class constructor.
    *
    * @param object $stateMachine
    *   Reference to state machine object.
@@ -67,7 +66,7 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
   }
 
   /**
-   * Upload and move the file if valid to the uploaded directory
+   * Upload and move the file if valid to the uploaded directory.
    *
    * @param CRM_Core_Form $page
    *   The CRM_Core_Form object.
@@ -77,8 +76,6 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
    *   The name of the page which index the data container with.
    * @param string $uploadName
    *   The name of the uploaded file.
-   *
-   * @return void
    */
   public function upload(&$page, &$data, $pageName, $uploadName) {
     // make sure uploadName exists in the QF array
@@ -101,7 +98,7 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
         if (!$status) {
           CRM_Core_Error::statusBounce(ts('We could not move the uploaded file %1 to the upload directory %2. Please verify that the \'Temporary Files\' setting points to a valid path which is writable by your web server.', array(
                 1 => $value['name'],
-                2 => $this->_uploadDir
+                2 => $this->_uploadDir,
               )));
         }
         if (!empty($data['values'][$pageName][$uploadName]['name'])) {
@@ -123,8 +120,6 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
    *   CRM_Core_Form the current form-page.
    * @param string $actionName
    *   Current action name, as one Action object can serve multiple actions.
-   *
-   * @return void
    */
   public function perform(&$page, $actionName) {
     // like in Action_Next
@@ -134,11 +129,15 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action {
     // the above buildForm potentially changes the action function with different args
     // so basically the rug might have been pulled from us, so we actually just check
     // and potentially call the right one
-    // this allows standalong form uploads to work nicely
+    // this allows standalone form uploads to work nicely
     $page->controller->_actions['upload']->realPerform($page, $actionName);
   }
 
   /**
+   * Real perform.
+   *
+   * @todo document what I do.
+   *
    * @param CRM_Core_Form $page
    * @param string $actionName
    *
index 92d488ee50c6c5521e92ba76d8c51549ab2ceb22..15f81d8f86f87b8d940c9a5fc8f2661d7b4bc074 100644 (file)
@@ -61,7 +61,7 @@ class CRM_Core_QuickForm_NestedAdvMultiSelect extends HTML_QuickForm_advmultisel
    * @throws     PEAR_Error
    * @see        loadArray()
    */
-  function load(
+  public function load(
     &$options, $param1 = NULL, $param2 = NULL,
     $param3 = NULL, $param4 = NULL
   ) {
index 8ef43c03190dfc2b21e7019ded899a6f5f8d78a9..fb016e10b71b5e0898651bd0b3da5f5ef3ff0e7e 100644 (file)
@@ -18,7 +18,7 @@
  */
 function smarty_block_crmRegion($params, $content, &$smarty, &$repeat) {
   if ($repeat) {
-    return;
+    return NULL;
   }
   require_once 'CRM/Core/Region.php';
   $region = CRM_Core_Region::instance($params['name'], FALSE);
index 9bffda7c665e726e63ba6ecf434d58789c7b74e1..edbcbc8543bae01eb675015dd6bb066c7b205a24 100644 (file)
@@ -84,8 +84,6 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
   /**
    * Set variables up before form is built
    *
-   * @param null
-   *
    * @return void
    */
   public function preProcess() {
@@ -171,8 +169,6 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
    * 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
    */
@@ -278,8 +274,6 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
   /**
    * Build the form object
    *
-   * @param null
-   *
    * @return void
    */
   public function buildQuickForm() {
@@ -342,7 +336,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
         'option_group_id',
         ts('Multiple Choice Option Sets'),
         array(
-          '' => ts('- select -')
+          '' => ts('- select -'),
         ) + $optionGroups
       );
     }
@@ -351,7 +345,7 @@ class CRM_Custom_Form_Field extends CRM_Core_Form {
       ts('Option Type'),
       $optionTypes,
       array(
-        'onclick' => "showOptionSelect();"
+        'onclick' => "showOptionSelect();",
       ), '<br/>'
     );
 
@@ -901,8 +895,6 @@ AND    option_group_id = %2";
   /**
    * Process the form
    *
-   * @param null
-   *
    * @return void
    */
   public function postProcess() {
@@ -924,7 +916,7 @@ AND    option_group_id = %2";
       1,
       2,
       3,
-      5
+      5,
     ))) {
       if (empty($params['is_searchable'])) {
         $params['is_search_range'] = 0;
index fcfb6913fd94da3e40b565e5ee75653da53a4b97..0f9f22031f1f169af1c605f218edf37f2784daa2 100644 (file)
@@ -116,8 +116,8 @@ class CRM_Custom_Form_MoveField extends CRM_Core_Form {
     }
 
     $customGroup = array(
-        '' => ts('- select -')
-      ) + $customGroup;
+      '' => ts('- select -'),
+    ) + $customGroup;
     $this->add('select',
       'dst_group_id',
       ts('Destination'),
index ccb0e94cfd96abd989becb55c2655b80e219fb33..e91b96e535d4207e0c12ab3e21011d737b37cdf7 100644 (file)
@@ -67,8 +67,6 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
   /**
    * Set variables up before form is built
    *
-   * @param null
-   *
    * @return void
    */
   public function preProcess() {
@@ -103,8 +101,6 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
    * 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
    */
@@ -151,8 +147,6 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
   /**
    * Build the form object
    *
-   * @param null
-   *
    * @return void
    */
   public function buildQuickForm() {
@@ -392,8 +386,6 @@ SELECT count(*)
   /**
    * Process the form
    *
-   * @param null
-   *
    * @return void
    */
   public function postProcess() {
@@ -425,8 +417,8 @@ SELECT count(*)
     }
 
     $fieldValues = array('option_group_id' => $this->_optionGroupID);
-    $customOption->weight =
-      CRM_Utils_Weight::updateOtherWeights(
+    $customOption->weight
+      CRM_Utils_Weight::updateOtherWeights(
         'CRM_Core_DAO_OptionValue',
         $oldWeight,
         $params['weight'],
@@ -456,8 +448,8 @@ SELECT count(*)
           else {
             $defVal[] = $customOption->value;
           }
-          $customField->default_value =
-            CRM_Core_DAO::VALUE_SEPARATOR .
+          $customField->default_value
+            CRM_Core_DAO::VALUE_SEPARATOR .
             implode(CRM_Core_DAO::VALUE_SEPARATOR, $defVal) .
             CRM_Core_DAO::VALUE_SEPARATOR;
           $customField->save();
@@ -471,8 +463,8 @@ SELECT count(*)
           }
         }
 
-        $customField->default_value =
-          CRM_Core_DAO::VALUE_SEPARATOR .
+        $customField->default_value
+          CRM_Core_DAO::VALUE_SEPARATOR .
           implode(CRM_Core_DAO::VALUE_SEPARATOR, $tempVal) .
           CRM_Core_DAO::VALUE_SEPARATOR;
         $customField->save();
index 64c9c7564f8746e9edc66c4af5b125496cce585a..250cf170c88269c1805ea83b9a41caf11375d70f 100644 (file)
@@ -97,7 +97,7 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form {
     $this->setMaxFileSize($uploadFileSize);
     $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
           1 => $uploadSize,
-          2 => $uploadFileSize
+          2 => $uploadFileSize,
         )), 'maxfilesize', $uploadFileSize);
     $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
     $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
index 60069a94fd554c9174c86f9537c44587d37c9857..c76d86b6782ed6832601fe8be656a802a03859b2 100644 (file)
@@ -117,7 +117,7 @@ class CRM_Dashlet_Page_Blog extends CRM_Core_Page {
         $item = (array) $item;
         // Clean up description - remove tags that would break dashboard layout
         $description = preg_replace('#<h[1-3][^>]*>(.+?)</h[1-3][^>]*>#s', '<h4>$1</h4>', $item['description']);
-        $item['description'] = strip_tags($description, "<a><p><h4><h5><h6><b><i><em><strong><ol><ul><li><dd><dt><code><pre><br>");
+        $item['description'] = strip_tags($description, "<a><p><h4><h5><h6><b><i><em><strong><ol><ul><li><dd><dt><code><pre><br/>");
         $blog[] = $item;
       }
       if ($blog) {
index 973242b41fcf40fdbde86cf09118e0a82268602a..67ec55e4a3631f009740d7aacde4089ec68b80ca 100644 (file)
@@ -7,7 +7,9 @@
 class CRM_Dedupe_BAO_QueryBuilder_IndividualSupervised extends CRM_Dedupe_BAO_QueryBuilder {
 
   /**
-   * @param $rg
+   * Record - what do I do.
+   *
+   * @param object $rg
    *
    * @return array
    */
@@ -17,9 +19,18 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualSupervised extends CRM_Dedupe_BAO_Qu
     $civicrm_email = CRM_Utils_Array::value('civicrm_email', $rg->params, array());
 
     $params = array(
-      1 => array(CRM_Utils_Array::value('first_name', $civicrm_contact, ''), 'String'),
-      2 => array(CRM_Utils_Array::value('last_name', $civicrm_contact, ''), 'String'),
-      3 => array(CRM_Utils_Array::value('email', $civicrm_email, ''), 'String'),
+      1 => array(
+        CRM_Utils_Array::value('first_name', $civicrm_contact, ''),
+        'String',
+      ),
+      2 => array(
+        CRM_Utils_Array::value('last_name', $civicrm_contact, ''),
+        'String',
+      ),
+      3 => array(
+        CRM_Utils_Array::value('email', $civicrm_email, ''),
+        'String',
+      ),
     );
 
     return array(
@@ -35,7 +46,9 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualSupervised extends CRM_Dedupe_BAO_Qu
   }
 
   /**
-   * @param $rg
+   * Internal - what do I do.
+   *
+   * @param object $rg
    *
    * @return array
    */
@@ -52,8 +65,8 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualSupervised extends CRM_Dedupe_BAO_Qu
                 email1.email=email2.email
             WHERE contact1.contact_type = 'Individual'
               AND " . self::internalFilters($rg);
-    return array("civicrm_contact.{$rg->name}.{$rg->threshold}" => $query);
+    return array(
+      "civicrm_contact.{$rg->name}.{$rg->threshold}" => $query,
+    );
   }
 }
-
-;
index 07c7bb797d58e07092b51f1cf793c2c919e83b25..4776f8024d23aa5c4b8dd3cfab8562acf5c83de6 100644 (file)
@@ -108,5 +108,3 @@ AND    " . self::internalFilters($rg);
     return array("civicrm_contact.{$rg->name}.{$rg->threshold}" => $query);
   }
 }
-
-;
index 1e208b170ebfbaaa1d1f51bc1fe6abb6c6bef431..17daf65be2795afd4dd39c5c0c83d0c4ad9a9fab 100644 (file)
@@ -563,7 +563,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    *   Helps decide how to behave when there are conflicts.
    *                              A 'safe' value skips the merge if there are any un-resolved conflicts.
    *                              Does a force merge otherwise.
-   * @param bool $autoFlipWether to let api decide which contact to retain and which to delete.
+   * @param bool $autoFlip to let api decide which contact to retain and which to delete.
    *   Wether to let api decide which contact to retain and which to delete.
    * @param bool $redirectForPerformance
    *
@@ -608,7 +608,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    *   Helps decide how to behave when there are conflicts.
    *                             A 'safe' value skips the merge if there are any un-resolved conflicts.
    *                             Does a force merge otherwise (aggressive mode).
-   * @param bool $autoFlipWether to let api decide which contact to retain and which to delete.
+   * @param bool $autoFlip to let api decide which contact to retain and which to delete.
    *   Wether to let api decide which contact to retain and which to delete.
    *
    *
@@ -823,7 +823,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       $params = array(
         'contact_id' => $cid,
         'version' => 3,
-        'return' => array_merge(array('display_name'), self::getContactFields())
+        'return' => array_merge(array('display_name'), self::getContactFields()),
       );
       $result = civicrm_api('contact', 'get', $params);
 
@@ -855,11 +855,10 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
         $specialValues[$moniker]['preferred_communication_method'] = CRM_Core_DAO::VALUE_SEPARATOR . $prefCommList . CRM_Core_DAO::VALUE_SEPARATOR;
       }
       $names = array(
-        'preferred_communication_method' =>
-          array(
-            'newName' => 'preferred_communication_method_display',
-            'groupName' => 'preferred_communication_method',
-          ),
+        'preferred_communication_method' => array(
+          'newName' => 'preferred_communication_method_display',
+          'groupName' => 'preferred_communication_method',
+        ),
       );
       CRM_Core_OptionGroup::lookupValues($specialValues[$moniker], $names);
 
@@ -1430,7 +1429,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
                 if (in_array($htmlType, array(
                   'CheckBox',
                   'Multi-Select',
-                  'AdvMulti-Select'
+                  'AdvMulti-Select',
                 ))) {
                   $submitted[$key] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
                       $mergeValue
@@ -1443,7 +1442,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
             }
             elseif (in_array($htmlType, array(
               'Multi-Select Country',
-              'Multi-Select State/Province'
+              'Multi-Select State/Province',
             ))) {
               //we require submitted values should be in array format
               if ($value) {
@@ -1617,7 +1616,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       'modified_date',
       'primary_contact_id',
       'sort_name',
-      'user_unique_id'
+      'user_unique_id',
     );
     foreach ($contactFields as $field => $value) {
       if (in_array($field, $invalidFields)) {
@@ -1629,10 +1628,10 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
 
   /**
    * Added for CRM-12695
-   * Based on the contactId provided
+   * Based on the contactID provided
    * add/update membership(s) to related contacts
    *
-   * @param contactId
+   * @param int $contactID
    */
   public static function addMembershipToRealtedContacts($contactID) {
     $dao = new CRM_Member_DAO_Membership();
index 64ebe160c7c6bd850ac0d04884cf733aaa3f3a96..5018a771443b94de61326b33a81b230b82582a10 100644 (file)
@@ -260,7 +260,7 @@ class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
    *
    * @return array
    */
-  static function getEvents(
+  public static function getEvents(
     $all = 0,
     $id = FALSE,
     $isActive = TRUE,
@@ -579,13 +579,13 @@ $event_summary_limit
    * Get participant count
    *
    * @param int $eventId
-   * @param bool $considerStatusConsider status for participant count.
+   * @param bool $considerStatus consider status for participant count.
    *   Consider status for participant count.
-   * @param bool $statusConsider counted participant.
+   * @param bool $status counted participant.
    *   Consider counted participant.
-   * @param bool $considerRoleConsider role for participant count.
+   * @param bool $considerRole consider role for participant count.
    *   Consider role for participant count.
-   * @param bool $roleConsider counted( is filter role) participant.
+   * @param bool $role consider counted( is filter role) participant.
    *   Consider counted( is filter role) participant.
    *
    *
@@ -713,19 +713,19 @@ WHERE civicrm_address.geo_code_1 IS NOT NULL
    *
    * @param date $start
    *   Get events with start date >= this date.
-   * @param int $typeGet events on the a specific event type (by event_type_id).
+   * @param int $type Get events on the a specific event type (by event_type_id).
    *   Get events on the a specific event type (by event_type_id).
-   * @param int $eventIdReturn a single event - by event id.
+   * @param int $eventId Return a single event - by event id.
    *   Return a single event - by event id.
    * @param date $end
    *   Also get events with end date >= this date.
-   * @param bool $onlyPublicInclude public events only, default TRUE.
+   * @param bool $onlyPublic Include public events only, default TRUE.
    *   Include public events only, default TRUE.
    *
    * @return array
    *   array of all the events that are searched
    */
-  static function &getCompleteInfo(
+  public static function &getCompleteInfo(
     $start = NULL,
     $type = NULL,
     $eventId = NULL,
@@ -944,7 +944,7 @@ WHERE civicrm_event.is_active = 1
         array('id' => $id),
         array(
           'loc_block_id' =>
-            ($locBlockId) ? $locBlockId : NULL,
+          ($locBlockId) ? $locBlockId : NULL,
         ),
         $fieldsFix
       );
@@ -1260,7 +1260,7 @@ WHERE civicrm_event.is_active = 1
    *
    * @return void
    */
-  static function buildCustomDisplay(
+  public static function buildCustomDisplay(
     $id,
     $name,
     $cid,
@@ -1724,7 +1724,7 @@ WHERE  id = $cfID
    * @return array
    *   array of Additional participant's info OR array of Ids.
    */
-  static function buildCustomProfile(
+  public static function buildCustomProfile(
     $participantId,
     $values,
     $contactId = NULL,
@@ -1885,7 +1885,7 @@ WHERE  ce.loc_block_id = $locBlockId";
    *
    * @param array $values
    * @param int $eventID
-   * @return boolean
+   * @return bool
    */
   public static function validRegistrationRequest($values, $eventID) {
     // check that the user has permission to register for this event
@@ -2218,7 +2218,7 @@ LEFT  JOIN  civicrm_price_field_value value ON ( value.id = lineItem.price_field
         // Fixme - this is going to ignore context, better to get conditions, add params, and call PseudoConstant::get
         return CRM_Financial_BAO_FinancialType::getIncomeFinancialType();
 
-        break;
+      break;
     }
     return CRM_Core_PseudoConstant::get(__CLASS__, $fieldName, $params, $context);
   }
index 86439c42a723a15daed575e10897c65cdea32870..00b5db2ac66b1f344b40a39ab9b8e75be834df0b 100644 (file)
@@ -36,13 +36,13 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu
   /**
    * @param array $params
    *
-   * @return $this|null
+   * @return this|null
    */
   public static function add(&$params) {
     if (empty($params)) {
       return NULL;
     }
-    $dao = new CRM_Event_DAO_ParticipantStatusType;
+    $dao = new CRM_Event_DAO_ParticipantStatusType();
     $dao->copyValues($params);
     return $dao->save();
   }
@@ -50,7 +50,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu
   /**
    * @param array $params
    *
-   * @return $this|null
+   * @return this|null
    */
   public static function &create(&$params) {
     $transaction = new CRM_Core_Transaction();
@@ -70,7 +70,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu
    */
   public static function deleteParticipantStatusType($id) {
     // return early if there are participants with this status
-    $participant = new CRM_Event_DAO_Participant;
+    $participant = new CRM_Event_DAO_Participant();
     $participant->status_id = $id;
     if ($participant->find()) {
       return FALSE;
@@ -78,7 +78,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu
 
     CRM_Utils_Weight::delWeight('CRM_Event_DAO_ParticipantStatusType', $id);
 
-    $dao = new CRM_Event_DAO_ParticipantStatusType;
+    $dao = new CRM_Event_DAO_ParticipantStatusType();
     $dao->id = $id;
     $dao->find(TRUE);
     $dao->delete();
@@ -94,7 +94,7 @@ class CRM_Event_BAO_ParticipantStatusType extends CRM_Event_DAO_ParticipantStatu
   public static function retrieve(&$params, &$defaults) {
     $result = NULL;
 
-    $dao = new CRM_Event_DAO_ParticipantStatusType;
+    $dao = new CRM_Event_DAO_ParticipantStatusType();
     $dao->copyValues($params);
     if ($dao->find(TRUE)) {
       CRM_Core_DAO::storeValues($dao, $defaults);
index f5e59dad35d39d94cf9814cb2e359dd55fb3f2fb..cb77e25ed0d873c85af4f196b368008d5bb28b34 100644 (file)
@@ -51,7 +51,7 @@ class CRM_Event_Badge {
       'cap' => 'round',
       'join' => 'round',
       'dash' => '2,2',
-      'color' => array(0, 0, 200)
+      'color' => array(0, 0, 200),
     );
     $this->format = '5160';
     $this->imgExtension = 'png';
@@ -80,7 +80,7 @@ class CRM_Event_Badge {
    *
    * @param array $participants
    *
-   * @return null
+   * @return;
    */
   public function run(&$participants) {
     // fetch the 1st participant, and take her event to retrieve its attributes
@@ -154,8 +154,8 @@ class CRM_Event_Badge {
             'cap' => 'round',
             'join' => 'round',
             'dash' => '2,10',
-            'color' => array(255, 0, 0)
-          )
+            'color' => array(255, 0, 0),
+          ),
         ));
     }
     $img = $this->getImageFileName($this->event->id, $img);
@@ -172,7 +172,7 @@ class CRM_Event_Badge {
 
   /**
    * This is supposed to be overrided
-   **/
+   */
   public function generateLabel($participant) {
     $txt = "{$this->event['title']}
 {$participant['display_name']}
@@ -189,7 +189,7 @@ class CRM_Event_Badge {
    *
    * @param array $participants
    *
-   * @return null
+   * @return;
    */
   public function createLabels(&$participants) {
 
index 608c1e239922a4972ebfee7fa1b549f3aeeb8567..74fe540a9d5f4f9123eae0e9f05810037717d0e6 100644 (file)
@@ -146,7 +146,7 @@ class CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices extends CRM_Event_Cart_
               $this->_errors[$form->html_field_name('email')] = ts("The participant %1 is already registered for %2 (%3).", array(
                   1 => $participant_fields['email'],
                   2 => $event_in_cart->event->title,
-                  3 => $event_in_cart->event->start_date
+                  3 => $event_in_cart->event->start_date,
                 ));
             }
           }
index 38b7b9c7b2f4822819f2f8648268a7d649f38cfb..9933061ad8133279c3c923d2e262e213724f2d83 100644 (file)
@@ -561,7 +561,7 @@ class CRM_Event_Cart_Form_Checkout_Payment extends CRM_Event_Cart_Form_Cart {
   /**
    * @param array $params
    *
-   * @return array
+   * @return array|void
    * @throws Exception
    */
   public function make_payment(&$params) {
index 194f8b50fb63ae8882ab5e958d3cc73f87f6b3fd..da1a2395ab39cf02a93c118140a5624cd2499f6a 100644 (file)
@@ -14,7 +14,7 @@ class CRM_Event_Cart_Page_CheckoutAJAX {
     $params_array = array(
       'cart_id' => $cart->id,
       'contact_id' => CRM_Event_Cart_Form_Cart::find_or_create_contact(),
-      'event_id' => $event_id
+      'event_id' => $event_id,
     );
 
     //XXX security?
index 2583c06eae4a24a343e39fb2d4795d87eba9e2f2..72640c0a1b1d42b1c48e6c03dc66336103e78611 100644 (file)
@@ -248,12 +248,12 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
       ts('Allow Online Registration'),
       NULL,
       array(
-        'onclick' => "return showHideByValue('is_online_registration',
-        '',
-        'registration_blocks',
-        'block',
-        'radio',
-        false );",
+        'onclick' => "return showHideByValue('is_online_registration'," .
+        "''," .
+        "'registration_blocks'," .
+        "'block'," .
+        "'radio'," .
+        "false );",
       )
     );
 
@@ -354,7 +354,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
    *   Label.
    * @param array $configs
    *   Optional, for addProfileSelector(), defaults to using getProfileSelectorTypes().
-   **/
+   */
   public function buildMultipleProfileBottom(&$form, $count, $prefix = '', $label = 'Include Profile', $configs = NULL) {
     extract((is_null($configs)) ? self::getProfileSelectorTypes() : $configs);
     $element = $prefix . "custom_post_id_multiple[$count]";
@@ -367,7 +367,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
    *
    * @return array
    *   ['allowCoreTypes' => array, 'allowSubTypes' => array, 'profileEntities' => array]
-   **/
+   */
   public static function getProfileSelectorTypes() {
     $configs = array(
       'allowCoreTypes' => array(),
@@ -377,7 +377,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
 
     $configs['allowCoreTypes'] = array_merge(array(
         'Contact',
-        'Individual'
+        'Individual',
       ), CRM_Contact_BAO_ContactType::subTypes('Individual'));
     $configs['allowCoreTypes'][] = 'Participant';
     //CRM-15427
@@ -393,7 +393,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
     $configs['profileEntities'][] = array(
       'entity_name' => 'participant_1',
       'entity_type' => 'ParticipantModel',
-      'entity_sub_type' => '*'
+      'entity_sub_type' => '*',
     );
 
     return $configs;
@@ -672,7 +672,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
    * Collect all email fields for an array of profile ids
    *
    * @param $profileIds
-   * @return boolean
+   * @return bool
    */
   public static function getEmailFields($profileIds) {
     $emailFields = array();
@@ -693,7 +693,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
    * Check if a profile contains required fields
    *
    * @param $profileIds
-   * @return boolean
+   * @return bool
    */
   public static function isProfileComplete($profileIds) {
     $profileReqFields = array();
@@ -728,9 +728,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
    *
    * @param $profileIds
    * @param int $rgId
-   * @return boolean
+   * @return bool
    */
-
   public function canProfilesDedupe($profileIds, $rgId = 0) {
 
     // find the unsupervised rule
index 9a393994026eba0da8155c10a1529755387bf93d..bae80a7a25aff4396a2bb910c68d13a2807c88ce 100644 (file)
@@ -290,7 +290,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
           array(
             'title' => ts('CiviEvent Dashboard'),
             'url' => CRM_Utils_System::url('civicrm/event', 'reset=1'),
-          )
+          ),
         );
 
         CRM_Utils_System::appendBreadCrumb($breadCrumbs);
@@ -643,7 +643,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     if ($this->_single && $this->_context == 'standalone') {
       $this->addEntityRef('contact_id', ts('Contact'), array(
           'create' => TRUE,
-          'api' => array('extra' => array('email'))
+          'api' => array('extra' => array('email')),
         ), TRUE);
     }
 
@@ -703,8 +703,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name')
       );
       $checkCancelledJs = array(
-        'onchange' =>
-          "checkCancelled( this.value, {$cancelledparticipantStatusId},{$cancelledContributionStatusId});",
+        'onchange' => "checkCancelled( this.value, {$cancelledparticipantStatusId},{$cancelledContributionStatusId});",
       );
 
       $participantStatusId = array_search('Pending from pay later',
@@ -742,7 +741,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
 
     $this->addSelect('status_id', $checkCancelledJs + array(
         'options' => $statusOptions,
-        'option_url' => 'civicrm/admin/participant_status'
+        'option_url' => 'civicrm/admin/participant_status',
       ), TRUE);
 
     $this->addElement('checkbox', 'is_notify', ts('Send Notification'), NULL);
@@ -857,7 +856,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       $contactId = $self->_contactId;
       $eventId = CRM_Utils_Array::value('event_id', $values);
       if (!empty($contactId) && !empty($eventId)) {
-        $dupeCheck = new CRM_Event_BAO_Participant;
+        $dupeCheck = new CRM_Event_BAO_Participant();
         $dupeCheck->contact_id = $contactId;
         $dupeCheck->event_id = $eventId;
         $dupeCheck->find(TRUE);
@@ -907,7 +906,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         $duplicateContacts = 0;
         while (list($k, $dupeCheckContactId) = each($this->_contactIds)) {
           // Eliminate contacts that have already been assigned to this event.
-          $dupeCheck = new CRM_Event_BAO_Participant;
+          $dupeCheck = new CRM_Event_BAO_Participant();
           $dupeCheck->contact_id = $dupeCheckContactId;
           $dupeCheck->event_id = $event_id;
           $dupeCheck->find(TRUE);
@@ -1078,8 +1077,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
         CRM_Core_Error::fatal(ts('Selected Event is not Paid Event '));
       }
 
-      $eventTitle =
-        CRM_Core_DAO::getFieldValue(
+      $eventTitle
+        CRM_Core_DAO::getFieldValue(
           'CRM_Event_DAO_Event',
           $params['event_id'],
           'title'
@@ -1089,7 +1088,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       if (empty($params['source'])) {
         $this->_params['participant_source'] = ts('Offline Registration for Event: %2 by: %1', array(
             1 => $userName,
-            2 => $eventTitle
+            2 => $eventTitle,
           ));
       }
       else {
@@ -1115,8 +1114,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       }
 
       // also add location name to the array
-      $params["address_name-{$this->_bltID}"] =
-        CRM_Utils_Array::value('billing_first_name', $params) . ' ' .
+      $params["address_name-{$this->_bltID}"]
+        CRM_Utils_Array::value('billing_first_name', $params) . ' ' .
         CRM_Utils_Array::value('billing_middle_name', $params) . ' ' .
         CRM_Utils_Array::value('billing_last_name', $params);
 
@@ -1228,8 +1227,8 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
       );
 
       //add contribution record
-      $this->_params['financial_type_id'] =
-        CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['event_id'], 'financial_type_id');
+      $this->_params['financial_type_id']
+        CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $params['event_id'], 'financial_type_id');
       $this->_params['mode'] = $this->_mode;
 
       //add contribution reocord
@@ -1322,7 +1321,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
           if (empty($params['source'])) {
             $contributionParams['source'] = ts('%1 : Offline registration (by %2)', array(
                 1 => $eventTitle,
-                2 => $userName
+                2 => $userName,
               ));
           }
           else {
index 0e0be7404a44abc0027feee6f66d0cac0d1182b3..6d1d7d4399c5ca7c662b7c3066ed953f529d2fc2 100644 (file)
@@ -181,7 +181,7 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
     $statusOptions = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
     $this->add('select', 'status_id', ts('Participant Status'),
       array(
-        '' => ts('- select -')
+        '' => ts('- select -'),
       ) + $statusOptions,
       TRUE
     );
index d5afd4e341737fa46de05ae4f1de47065bbbd969..cfe4db0805fb559661a7b49d83c5b1a39116286f 100644 (file)
@@ -393,8 +393,8 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
       $this->set('values', $this->_values);
       $this->set('fields', $this->_fields);
 
-      $this->_availableRegistrations =
-        CRM_Event_BAO_Participant::eventFull(
+      $this->_availableRegistrations
+        CRM_Event_BAO_Participant::eventFull(
           $this->_values['event']['id'], TRUE,
           CRM_Utils_Array::value('has_waitlist', $this->_values['event'])
         );
@@ -832,7 +832,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
    */
   public static function addParticipant(&$form, $contactID) {
     if (empty($form->_params)) {
-      return;
+      return NULL;
     }
     $params = $form->_params;
     $transaction = new CRM_Core_Transaction();
@@ -879,8 +879,7 @@ WHERE  v.option_group_id = g.id
       ),
       'register_date' => ($registerDate) ? $registerDate : date('YmdHis'),
       'source' => CRM_Utils_String::ellipsify(
-        isset($params['participant_source']) ?
-          CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params),
+        isset($params['participant_source']) ? CRM_Utils_Array::value('participant_source', $params) : CRM_Utils_Array::value('description', $params),
         $participantFields['participant_source']['maxlength']
       ),
       'fee_level' => CRM_Utils_Array::value('amount_level', $params),
@@ -1290,8 +1289,8 @@ WHERE  v.option_group_id = g.id
             $optionMaxValues[$priceFieldId][$optId] = $currentMaxValue;
           }
           else {
-            $optionMaxValues[$priceFieldId][$optId] =
-              $currentMaxValue + CRM_Utils_Array::value($optId, CRM_Utils_Array::value($priceFieldId, $optionMaxValues), 0);
+            $optionMaxValues[$priceFieldId][$optId]
+              $currentMaxValue + CRM_Utils_Array::value($optId, CRM_Utils_Array::value($priceFieldId, $optionMaxValues), 0);
           }
 
         }
@@ -1308,16 +1307,16 @@ WHERE  v.option_group_id = g.id
         if ($optMax && $total > $optMax) {
           $errors['soldOutOptions'][] = ts('Option %1 has sold out.', array(1 => $feeBlock[$fieldId]['options'][$optId]['label']));
           if ($opDbCount && ($opDbCount >= $optMax)) {
-            $errors[$currentParticipantNum]["price_{$fieldId}"] =
-              ts('Sorry, this option is currently sold out.');
+            $errors[$currentParticipantNum]["price_{$fieldId}"]
+              ts('Sorry, this option is currently sold out.');
           }
           elseif (($optMax - $opDbCount) == 1) {
-            $errors[$currentParticipantNum]["price_{$fieldId}"] =
-              ts('Sorry, currently only a single seat is available for this option.', array(1 => ($optMax - $opDbCount)));
+            $errors[$currentParticipantNum]["price_{$fieldId}"]
+              ts('Sorry, currently only a single seat is available for this option.', array(1 => ($optMax - $opDbCount)));
           }
           else {
-            $errors[$currentParticipantNum]["price_{$fieldId}"] =
-              ts('Sorry, currently only %1 seats are available for this option.', array(1 => ($optMax - $opDbCount)));
+            $errors[$currentParticipantNum]["price_{$fieldId}"]
+              ts('Sorry, currently only %1 seats are available for this option.', array(1 => ($optMax - $opDbCount)));
           }
         }
       }
index 35c11170be8dfe801ded20ccb4477bac5893d6e3..3ad922376bee0869a98aeafeee853d3d65dfc2ee 100644 (file)
@@ -178,7 +178,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
     $pre = $post = array();
     foreach (array(
                'pre',
-               'post'
+               'post',
              ) as $keys) {
       if (isset($this->_values['additional_custom_' . $keys . '_id'])) {
         $this->buildCustom($this->_values['additional_custom_' . $keys . '_id'], 'additionalCustom' . ucfirst($keys), TRUE);
@@ -186,7 +186,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
       }
       foreach (array(
                  'first_name',
-                 'last_name'
+                 'last_name',
                ) as $name) {
         if (array_key_exists($name, $$keys) &&
           CRM_Utils_Array::value('is_required', CRM_Utils_Array::value($name, $$keys))
@@ -258,20 +258,20 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
           if ($this->_requireApproval) {
             $statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Registration for this event requires approval. You will receive an email once your registration has been reviewed.", array(
                 1 => ++$processedCnt,
-                2 => $spaces
+                2 => $spaces,
               ));
           }
           else {
             $statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed).", array(
                 1 => ++$processedCnt,
-                2 => $spaces
+                2 => $spaces,
               ));
           }
         }
         else {
           $statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Please go back to the main registration page and reduce the number of additional people. You will also need to complete payment information.", array(
               1 => ++$processedCnt,
-              2 => $spaces
+              2 => $spaces,
             ));
           $allowToProceed = FALSE;
         }
@@ -365,7 +365,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
               'name' => ts('Skip Participant'),
               'subName' => 'skip',
               'icon' => 'seek-next',
-            )
+            ),
           )
         );
       }
@@ -487,7 +487,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
           ) {
             $errors['_qf_default'] = ts('It looks like event has only %2 seats available and you are trying to register %1 participants, so could you please select price options accordingly.', array(
                 1 => $totalParticipants,
-                2 => $self->_availableRegistrations
+                2 => $self->_availableRegistrations,
               ));
           }
         }
@@ -763,7 +763,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
    *
    * @param bool $isButtonJs
    *
-   * @return boolean
+   * @return bool
    *   ture on success.
    */
   public function isLastParticipant($isButtonJs = FALSE) {
@@ -777,7 +777,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
   /**
    * Reset values for all options those are full.
    *
-   **/
+   */
   public function resetElementValue($optionFullIds = array()) {
     if (!is_array($optionFullIds) ||
       empty($optionFullIds) ||
@@ -847,7 +847,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
     foreach (array(
                'constantValues',
                'submitValues',
-               'defaultValues'
+               'defaultValues',
              ) as $val) {
       $values = &$this->{"_$val"};
       if (!is_array($values) || empty($values)) {
index f7cf8a7180ed6c07c575bfcc5acd48834afbef03..cfb1aa15d028f80cfe3127f1e2528e6792332550 100644 (file)
@@ -255,8 +255,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
     // add this event's default participant role to defaults array
     // (for cases where participant_role field is included in form via profile)
     if ($this->_values['event']['default_role_id']) {
-      $this->_defaults['participant_role'] =
-      $this->_defaults['participant_role_id'] = $this->_values['event']['default_role_id'];
+      $this->_defaults['participant_role']
+        = $this->_defaults['participant_role_id'] = $this->_values['event']['default_role_id'];
     }
     if ($this->_priceSetId && !empty($this->_feeBlock)) {
       foreach ($this->_feeBlock as $key => $val) {
@@ -751,7 +751,6 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
         $dbTotalCount = CRM_Utils_Array::value($optId, $recordedOptionsCount, 0);
         $currentTotalCount = CRM_Utils_Array::value($optId, $currentOptionsCount, 0);
 
-
         $totalCount = $currentTotalCount + $dbTotalCount;
         $isFull = FALSE;
         if ($maxValue &&
index 37f62567b1ceab203277fc0337304db6dfa5d8ad..c95b221868f5d859d2c54ab5387b0ddbe330a280 100644 (file)
@@ -30,7 +30,6 @@
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id: Email.php 45499 2013-02-08 12:31:05Z kurund $
- *
  */
 
 /**
@@ -63,11 +62,9 @@ class CRM_Event_Form_Task_Email extends CRM_Event_Form_Task {
   public $_templates = NULL;
 
   /**
-   * Build all the data structures needed to build the form
-   *
-   * @return void
+   * Build all the data structures needed to build the form.
    */
-  function preProcess() {
+  public function preProcess() {
     CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);
     parent::preProcess();
 
@@ -78,10 +75,7 @@ class CRM_Event_Form_Task_Email extends CRM_Event_Form_Task {
   }
 
   /**
-   * Build the form object
-   *
-   *
-   * @return void
+   * Build the form object.
    */
   public function buildQuickForm() {
     //enable form element
@@ -91,10 +85,7 @@ class CRM_Event_Form_Task_Email extends CRM_Event_Form_Task {
   }
 
   /**
-   * Process the form after the input has been submitted and validated
-   *
-   *
-   * @return void
+   * Process the form after the input has been submitted and validated.
    */
   public function postProcess() {
     CRM_Contact_Form_Task_EmailCommon::postProcess($this);
index f27f0d818bd52a9b3d409eaf4d74d0da9d2a65b6..046e5f02381bdab6edc62af76b94f449defcef34 100644 (file)
@@ -36,7 +36,7 @@ class CRM_Event_Form_Task_ParticipantStatus extends CRM_Event_Form_Task_Batch {
   public function buildQuickForm() {
     // CRM_Event_Form_Task_Batch::buildQuickForm() gets ufGroupId
     // from the form, so set it here to the id of the reserved profile
-    $dao = new CRM_Core_DAO_UFGroup;
+    $dao = new CRM_Core_DAO_UFGroup();
     $dao->name = 'participant_status';
     $dao->find(TRUE);
     $this->set('ufGroupId', $dao->id);
@@ -45,7 +45,7 @@ class CRM_Event_Form_Task_ParticipantStatus extends CRM_Event_Form_Task_Batch {
     asort($statuses, SORT_STRING);
     $this->add('select', 'status_change', ts('Change All Statuses'),
       array(
-        '' => ts('- select status -')
+        '' => ts('- select status -'),
       ) + $statuses
     );
 
index 8cb666679a953ee44e1b8a5429d6f8317e6f7a6c..85b7693570f3527d3a97fb883e437f4955efc454 100644 (file)
@@ -104,7 +104,7 @@ class CRM_Event_Import_Form_Summary extends CRM_Import_Form_Summary {
       'downloadDuplicateRecordsUrl',
       'downloadMismatchRecordsUrl',
       'groupAdditions',
-      'unMatchCount'
+      'unMatchCount',
     );
     foreach ($properties as $property) {
       $this->assign($property, $this->get($property));
index 484ad36e50bc517a14e21d64f649fed51f0f8ab9..320c328b9dc97ce2b7e5f140b3caf84b9d3016ea 100644 (file)
@@ -111,64 +111,64 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page {
       self::$_tabLinks = array();
     }
     if (!isset(self::$_tabLinks[$cacheKey])) {
-      self::$_tabLinks[$cacheKey]['settings'] =
-        array(
+      self::$_tabLinks[$cacheKey]['settings']
+        array(
           'title' => ts('Info and Settings'),
           'url' => 'civicrm/event/manage/settings',
           'field' => 'id',
         );
-      self::$_tabLinks[$cacheKey]['location'] =
-        array(
+      self::$_tabLinks[$cacheKey]['location']
+        array(
           'title' => ts('Location'),
           'url' => 'civicrm/event/manage/location',
           'field' => 'loc_block_id',
         );
 
-      self::$_tabLinks[$cacheKey]['fee'] =
-        array(
+      self::$_tabLinks[$cacheKey]['fee']
+        array(
           'title' => ts('Fees'),
           'url' => 'civicrm/event/manage/fee',
           'field' => 'is_monetary',
         );
-      self::$_tabLinks[$cacheKey]['registration'] =
-        array(
+      self::$_tabLinks[$cacheKey]['registration']
+        array(
           'title' => ts('Online Registration'),
           'url' => 'civicrm/event/manage/registration',
           'field' => 'is_online_registration',
         );
+
       if (CRM_Core_Permission::check('administer CiviCRM')) {
-        self::$_tabLinks[$cacheKey]['reminder'] =
-          array(
+        self::$_tabLinks[$cacheKey]['reminder']
+          array(
             'title' => ts('Schedule Reminders'),
             'url' => 'civicrm/event/manage/reminder',
             'field' => 'reminder',
           );
       }
-      self::$_tabLinks[$cacheKey]['conference'] =
-        array(
+      self::$_tabLinks[$cacheKey]['conference']
+        array(
           'title' => ts('Conference Slots'),
           'url' => 'civicrm/event/manage/conference',
           'field' => 'slot_label_id',
         );
-      self::$_tabLinks[$cacheKey]['friend'] =
-        array(
+      self::$_tabLinks[$cacheKey]['friend']
+        array(
           'title' => ts('Tell a Friend'),
           'url' => 'civicrm/event/manage/friend',
           'field' => 'friend',
         );
-      self::$_tabLinks[$cacheKey]['pcp'] =
-        array(
+      self::$_tabLinks[$cacheKey]['pcp']
+        array(
           'title' => ts('Personal Campaign Pages'),
           'url' => 'civicrm/event/manage/pcp',
           'field' => 'is_pcp_enabled',
         );
-      self::$_tabLinks[$cacheKey]['repeat'] =
-        array(
+      self::$_tabLinks[$cacheKey]['repeat']
+        array(
           'title' => ts('Repeat'),
           'url' => 'civicrm/event/manage/repeat',
           'field' => 'is_repeating_event',
         );
-
     }
 
     if (!$enableCart) {
@@ -214,7 +214,7 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page {
         array(
           'title' => ts('Manage Events'),
           'url' => CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1'),
-        )
+        ),
       );
       CRM_Utils_System::appendBreadCrumb($breadCrumb);
     }
@@ -302,7 +302,7 @@ ORDER BY start_date desc
     // get the list of active event pcps
     $eventPCPS = array();
 
-    $pcpDao = new CRM_PCP_DAO_PCPBlock;
+    $pcpDao = new CRM_PCP_DAO_PCPBlock();
     $pcpDao->entity_table = 'civicrm_event';
     $pcpDao->find();
 
@@ -418,8 +418,7 @@ ORDER BY start_date desc
   }
 
   public function search() {
-    if (isset($this->_action) &
-      (CRM_Core_Action::ADD |
+    if (isset($this->_action) & (CRM_Core_Action::ADD |
         CRM_Core_Action::UPDATE |
         CRM_Core_Action::DELETE
       )
index 1cc1f3f996248fffe6b3550efc5362f24ebb78e5..861598ad95389b2998b80e147f0ef3c067c769f1 100644 (file)
@@ -39,8 +39,6 @@ class CRM_Event_Page_Tab extends CRM_Core_Page {
 
   /**
    * called when action is browse
-   *
-   * @return null
    */
   public function browse() {
     $controller = new CRM_Core_Controller_Simple(
@@ -283,8 +281,6 @@ class CRM_Event_Page_Tab extends CRM_Core_Page {
   /**
    * used for the to show the associated
    * contribution for the participant
-   *
-   * @return null
    */
   public function associatedContribution() {
     if (CRM_Core_Permission::access('CiviContribute')) {
index 6610b13ae7ebd78448edea9810af34eb62ad6a8d..2e7fed3a0406bb3212184ffb7078e7e67b6ed69b 100644 (file)
@@ -139,7 +139,7 @@ class CRM_Extension_Downloader {
    *   URL of a .zip file.
    * @param string $localFile
    *   Path at which to store the .zip file.
-   * @return boolean
+   * @return bool
    *   Whether the download was successful.
    */
   public function fetch($remoteFile, $localFile) {
index dc9109ed172398a1915f207172db3f0198b8db2c..a94397f6b194a2a359bad15069d469b35599ac6a 100644 (file)
@@ -352,7 +352,6 @@ class CRM_Extension_Manager {
         case self::STATUS_INSTALLED_MISSING:
           throw new CRM_Extension_Exception("Cannot uninstall extension; disable it first: $key");
 
-          break;
         case self::STATUS_DISABLED:
           list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception
           $typeManager->onPreUninstall($info);
index 4cf903e6620bba57c337ca3faffc61afdd30f47c..354d5ad0bd1f6c1d7a6169673c24d6d5b31a0883 100644 (file)
@@ -86,8 +86,6 @@ class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentPr
   /**
    * Retrieve the default payment processor
    *
-   * @param NULL
-   *
    * @return object
    *   The default payment processor object on success,
    *                          null otherwise
@@ -175,7 +173,7 @@ class CRM_Financial_BAO_PaymentProcessorType extends CRM_Financial_DAO_PaymentPr
    * @param int $paymentProcessorTypeId
    *   ID of the processor to be deleted.
    *
-   * @return bool
+   * @return bool|NULL
    */
   public static function del($paymentProcessorTypeId) {
     $query = "
@@ -188,7 +186,7 @@ WHERE pp.payment_processor_type_id = ppt.id AND ppt.id = %1";
 
     if ($dao->fetch()) {
       CRM_Core_Session::setStatus(ts('There is a Payment Processor associated with selected Payment Processor type, hence it can not be deleted.'), ts('Deletion Error'), 'error');
-      return;
+      return NULL;
     }
 
     $paymentProcessorType = new CRM_Financial_DAO_PaymentProcessorType();
index 9f0c13ef02927d8affe41df0c290761b9aa84916..a3b9edd0b8ff1499755bfc4b5601818fb8a8de7e 100644 (file)
@@ -97,9 +97,9 @@ class CRM_Financial_Form_FinancialAccount extends CRM_Contribute_Form {
     $this->add('text', 'accounting_code', ts('Accounting Code'), $attributes['accounting_code']);
     $elementAccounting = $this->add('text', 'account_type_code', ts('Account Type Code'), $attributes['account_type_code']);
     $this->addEntityRef('contact_id', ts('Owner'), array(
-        'api' => array('params' => array('contact_type' => 'Organization')),
-        'create' => TRUE
-      ));
+      'api' => array('params' => array('contact_type' => 'Organization')),
+      'create' => TRUE,
+    ));
     $this->add('text', 'tax_rate', ts('Tax Rate'), $attributes['tax_rate']);
     $this->add('checkbox', 'is_deductible', ts('Tax-Deductible?'));
     $elementActive = $this->add('checkbox', 'is_active', ts('Enabled?'));
index 6832c9afd88e8076083f6c5003bb40c7ce5e9bee..6e4bd6abb6530c683fa2cb63c91f0d98e4586a96 100644 (file)
@@ -85,9 +85,9 @@ class CRM_Financial_Page_AJAX {
           $selectedArray['selected'] = 'Selected';
         }
         $elements[] = array(
-            'name' => $name,
-            'value' => $id,
-          ) + $selectedArray;
+          'name' => $name,
+          'value' => $id,
+        ) + $selectedArray;
       }
     }
     CRM_Utils_JSON::output($elements);
@@ -261,18 +261,17 @@ class CRM_Financial_Page_AJAX {
   }
 
   public static function getFinancialTransactionsList() {
-    $sortMapper =
-      array(
-        0 => '',
-        1 => '',
-        2 => 'sort_name',
-        3 => 'amount',
-        4 => 'trxn_id',
-        5 => 'transaction_date',
-        6 => 'payment_method',
-        7 => 'status',
-        8 => 'name',
-      );
+    $sortMapper = array(
+      0 => '',
+      1 => '',
+      2 => 'sort_name',
+      3 => 'amount',
+      4 => 'trxn_id',
+      5 => 'transaction_date',
+      6 => 'payment_method',
+      7 => 'status',
+      8 => 'name',
+    );
 
     $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
     $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
@@ -290,34 +289,32 @@ class CRM_Financial_Page_AJAX {
       $params['sortBy'] = $sort . ' ' . $sortOrder;
     }
 
-    $returnvalues =
-      array(
-        'civicrm_financial_trxn.payment_instrument_id as payment_method',
-        'civicrm_contribution.contact_id as contact_id',
-        'civicrm_contribution.id as contributionID',
-        'contact_a.sort_name',
-        'civicrm_financial_trxn.total_amount as amount',
-        'civicrm_financial_trxn.trxn_id as trxn_id',
-        'contact_a.contact_type',
-        'contact_a.contact_sub_type',
-        'civicrm_financial_trxn.trxn_date as transaction_date',
-        'name',
-        'civicrm_contribution.currency as currency',
-        'civicrm_financial_trxn.status_id as status',
-        'civicrm_financial_trxn.check_number as check_number',
-      );
+    $returnvalues = array(
+      'civicrm_financial_trxn.payment_instrument_id as payment_method',
+      'civicrm_contribution.contact_id as contact_id',
+      'civicrm_contribution.id as contributionID',
+      'contact_a.sort_name',
+      'civicrm_financial_trxn.total_amount as amount',
+      'civicrm_financial_trxn.trxn_id as trxn_id',
+      'contact_a.contact_type',
+      'contact_a.contact_sub_type',
+      'civicrm_financial_trxn.trxn_date as transaction_date',
+      'name',
+      'civicrm_contribution.currency as currency',
+      'civicrm_financial_trxn.status_id as status',
+      'civicrm_financial_trxn.check_number as check_number',
+    );
 
-    $columnHeader =
-      array(
-        'contact_type' => '',
-        'sort_name' => ts('Contact Name'),
-        'amount' => ts('Amount'),
-        'trxn_id' => ts('Trxn ID'),
-        'transaction_date' => ts('Received'),
-        'payment_method' => ts('Payment Method'),
-        'status' => ts('Status'),
-        'name' => ts('Type'),
-      );
+    $columnHeader = array(
+      'contact_type' => '',
+      'sort_name' => ts('Contact Name'),
+      'amount' => ts('Amount'),
+      'trxn_id' => ts('Trxn ID'),
+      'transaction_date' => ts('Received'),
+      'payment_method' => ts('Payment Method'),
+      'status' => ts('Status'),
+      'name' => ts('Type'),
+    );
 
     if ($sort && $sortOrder) {
       $params['sortBy'] = $sort . ' ' . $sortOrder;
@@ -450,19 +447,18 @@ class CRM_Financial_Page_AJAX {
     }
 
     $iFilteredTotal = $iTotal = $params['total'];
-    $selectorElements =
-      array(
-        'check',
-        'contact_type',
-        'sort_name',
-        'amount',
-        'trxn_id',
-        'transaction_date',
-        'payment_method',
-        'status',
-        'name',
-        'action',
-      );
+    $selectorElements = array(
+      'check',
+      'contact_type',
+      'sort_name',
+      'amount',
+      'trxn_id',
+      'transaction_date',
+      'payment_method',
+      'status',
+      'name',
+      'action',
+    );
 
     echo CRM_Utils_JSON::encodeDataTableSelector($financialitems, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
     CRM_Utils_System::civiExit();
@@ -484,12 +480,11 @@ class CRM_Financial_Page_AJAX {
     foreach ($cIDs as $key => $value) {
       $recordPID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $value, 'payment_instrument_id');
       if ($action == 'Remove' || ($recordPID == $batchPID && $action == 'Assign') || !isset($batchPID)) {
-        $params =
-          array(
-            'entity_id' => $value,
-            'entity_table' => 'civicrm_financial_trxn',
-            'batch_id' => $entityID,
-          );
+        $params = array(
+          'entity_id' => $value,
+          'entity_table' => 'civicrm_financial_trxn',
+          'batch_id' => $entityID,
+        );
         if ($action == 'Assign') {
           $updated = CRM_Batch_BAO_Batch::addBatchEntity($params);
         }
@@ -512,18 +507,17 @@ class CRM_Financial_Page_AJAX {
     $params = array('id' => $batchID);
     $batchInfo = CRM_Batch_BAO_Batch::retrieve($params, $value);
     $batchTotals = CRM_Batch_BAO_Batch::batchTotals(array($batchID));
-    $batchSummary =
-      array(
-        'created_by' => CRM_Contact_BAO_Contact::displayName($batchInfo->created_id),
-        'status' => CRM_Core_OptionGroup::getLabel('batch_status', $batchInfo->status_id),
-        'description' => $batchInfo->description,
-        'payment_instrument' => CRM_Core_OptionGroup::getLabel('payment_instrument', $batchInfo->payment_instrument_id),
-        'item_count' => $batchInfo->item_count,
-        'assigned_item_count' => $batchTotals[$batchID]['item_count'],
-        'total' => CRM_Utils_Money::format($batchInfo->total),
-        'assigned_total' => CRM_Utils_Money::format($batchTotals[$batchID]['total']),
-        'opened_date' => CRM_Utils_Date::customFormat($batchInfo->created_date),
-      );
+    $batchSummary = array(
+      'created_by' => CRM_Contact_BAO_Contact::displayName($batchInfo->created_id),
+      'status' => CRM_Core_OptionGroup::getLabel('batch_status', $batchInfo->status_id),
+      'description' => $batchInfo->description,
+      'payment_instrument' => CRM_Core_OptionGroup::getLabel('payment_instrument', $batchInfo->payment_instrument_id),
+      'item_count' => $batchInfo->item_count,
+      'assigned_item_count' => $batchTotals[$batchID]['item_count'],
+      'total' => CRM_Utils_Money::format($batchInfo->total),
+      'assigned_total' => CRM_Utils_Money::format($batchTotals[$batchID]['total']),
+      'opened_date' => CRM_Utils_Date::customFormat($batchInfo->created_date),
+    );
 
     CRM_Utils_JSON::output($batchSummary);
   }
index 00be8531225a7f90e0432eb59064da357b8b769a..3fcc187ae4b7dd90bb0e549ac439fcb4ff589011 100644 (file)
@@ -74,7 +74,7 @@ class CRM_Grant_Form_Task extends CRM_Core_Form {
    *
    * @return void
    */
-  function preProcess() {
+  public function preProcess() {
     self::preProcessCommon($this);
   }
 
index 30f55d2d99a42c00211ab82a5e392f79543c881c..6ac833fa80ba4db5e94089f44d9d34091240259b 100644 (file)
@@ -53,7 +53,7 @@ class CRM_Grant_Form_Task_Delete extends CRM_Grant_Form_Task {
    *
    * @return void
    */
-  function preProcess() {
+  public function preProcess() {
     parent::preProcess();
 
     //check permission for delete.
index a569c7fcb7a50e42e2958387bb11347b94e5375b..ae1405ddf88bf39557c0d072b166a26aee0a7115 100644 (file)
@@ -135,7 +135,7 @@ class CRM_Grant_Info extends CRM_Core_Component_Info {
           'query' => "reset=1&action=add&context=standalone",
           'ref' => 'new-grant',
           'title' => ts('Grant'),
-        )
+        ),
       ));
     }
   }
index 0062ef2839ea72c523e9181268dae2cb2b49cccd..a6908ab4ad450eec3878828f317667f101bdd352 100644 (file)
@@ -95,7 +95,7 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
           'url' => CRM_Utils_System::url('civicrm/group',
             'reset=1'
           ),
-        )
+        ),
       );
       CRM_Utils_System::appendBreadCrumb($breadCrumb);
 
@@ -126,8 +126,7 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
         $groupValues = array(
           'id' => $this->_id,
           'title' => $this->_title,
-          'saved_search_id' =>
-            isset($this->_groupValues['saved_search_id']) ? $this->_groupValues['saved_search_id'] : '',
+          'saved_search_id' => isset($this->_groupValues['saved_search_id']) ? $this->_groupValues['saved_search_id'] : '',
         );
         if (isset($this->_groupValues['saved_search_id'])) {
           $groupValues['mapping_id'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch',
@@ -140,13 +139,11 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
           );
         }
         if (!empty($this->_groupValues['created_id'])) {
-          $groupValues['created_by'] =
-            CRM_Core_DAO::getFieldValue("CRM_Contact_DAO_Contact", $this->_groupValues['created_id'], 'sort_name', 'id');
+          $groupValues['created_by'] = CRM_Core_DAO::getFieldValue("CRM_Contact_DAO_Contact", $this->_groupValues['created_id'], 'sort_name', 'id');
         }
 
         if (!empty($this->_groupValues['modified_id'])) {
-          $groupValues['modified_by'] =
-            CRM_Core_DAO::getFieldValue("CRM_Contact_DAO_Contact", $this->_groupValues['modified_id'], 'sort_name', 'id');
+          $groupValues['modified_by'] = CRM_Core_DAO::getFieldValue("CRM_Contact_DAO_Contact", $this->_groupValues['modified_id'], 'sort_name', 'id');
         }
 
         $this->assign_by_ref('group', $groupValues);
@@ -284,8 +281,7 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
     $this->addButtons(array(
         array(
           'type' => 'upload',
-          'name' =>
-            ($this->_action == CRM_Core_Action::ADD) ? ts('Continue') : ts('Save'),
+          'name' => ($this->_action == CRM_Core_Action::ADD) ? ts('Continue') : ts('Save'),
           'isDefault' => TRUE,
         ),
         array(
index df6c826064f8593d9e93e2a62cd8b1b9d5674558..e65020f9b0f2f5152bf3fd4c0d65ab770fe08026 100644 (file)
@@ -45,7 +45,6 @@ class CRM_Group_Page_Group extends CRM_Core_Page_Basic {
   /**
    * Define action links
    *
-   * @return array
    *   self::$_links array of action links
    */
   public function &links() {
index 58c3697cee06ee547f2c07bc5d482517b6c39d71..08db3bbb5cae0202d433f344a0086b3b827cb772 100644 (file)
@@ -81,7 +81,7 @@ class CRM_Logging_Differ {
       2 => array($this->log_date, 'String'),
     );
 
-    $logging = new CRM_Logging_Schema;
+    $logging = new CRM_Logging_Schema();
     $addressCustomTables = $logging->entityCustomDataLogTables('Address');
 
     $contactIdClause = $join = '';
@@ -311,7 +311,7 @@ WHERE lt.log_conn_id = %1 AND
             break;
         }
 
-        $dao = new $daos[$table];
+        $dao = new $daos[$table]();
         foreach ($dao->fields() as $field) {
           $titles[$table][$field['name']] = CRM_Utils_Array::value('title', $field);
 
index db82501a6af9db7d7236c0de5db4d237eff05495..7487f06b4652151aa8afe7f713fa250cf391a83e 100644 (file)
@@ -56,124 +56,123 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form {
     $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
     $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
 
-    $this->_logTables =
-      array(
-        'log_civicrm_contact' => array(
-          'fk' => 'id',
+    $this->_logTables = array(
+      'log_civicrm_contact' => array(
+        'fk' => 'id',
+      ),
+      'log_civicrm_email' => array(
+        'fk' => 'contact_id',
+        'log_type' => 'Contact',
+      ),
+      'log_civicrm_phone' => array(
+        'fk' => 'contact_id',
+        'log_type' => 'Contact',
+      ),
+      'log_civicrm_address' => array(
+        'fk' => 'contact_id',
+        'log_type' => 'Contact',
+      ),
+      'log_civicrm_note' => array(
+        'fk' => 'entity_id',
+        'entity_table' => TRUE,
+        'bracket_info' => array(
+          'table' => 'log_civicrm_note',
+          'column' => 'subject',
         ),
-        'log_civicrm_email' => array(
-          'fk' => 'contact_id',
-          'log_type' => 'Contact',
+      ),
+      'log_civicrm_note_comment' => array(
+        'fk' => 'entity_id',
+        'table_name' => 'log_civicrm_note',
+        'joins' => array(
+          'table' => 'log_civicrm_note',
+          'join' => "entity_log_civireport.entity_id = fk_table.id AND entity_log_civireport.entity_table = 'civicrm_note'",
         ),
-        'log_civicrm_phone' => array(
-          'fk' => 'contact_id',
-          'log_type' => 'Contact',
+        'entity_table' => TRUE,
+        'bracket_info' => array(
+          'table' => 'log_civicrm_note',
+          'column' => 'subject',
         ),
-        'log_civicrm_address' => array(
-          'fk' => 'contact_id',
-          'log_type' => 'Contact',
+      ),
+      'log_civicrm_group_contact' => array(
+        'fk' => 'contact_id',
+        'bracket_info' => array(
+          'entity_column' => 'group_id',
+          'table' => 'log_civicrm_group',
+          'column' => 'title',
         ),
-        'log_civicrm_note' => array(
-          'fk' => 'entity_id',
-          'entity_table' => TRUE,
-          'bracket_info' => array(
-            'table' => 'log_civicrm_note',
-            'column' => 'subject',
-          ),
+        'action_column' => 'status',
+        'log_type' => 'Group',
+      ),
+      'log_civicrm_entity_tag' => array(
+        'fk' => 'entity_id',
+        'bracket_info' => array(
+          'entity_column' => 'tag_id',
+          'table' => 'log_civicrm_tag',
+          'column' => 'name',
         ),
-        'log_civicrm_note_comment' => array(
-          'fk' => 'entity_id',
-          'table_name' => 'log_civicrm_note',
-          'joins' => array(
-            'table' => 'log_civicrm_note',
-            'join' => "entity_log_civireport.entity_id = fk_table.id AND entity_log_civireport.entity_table = 'civicrm_note'",
-          ),
-          'entity_table' => TRUE,
-          'bracket_info' => array(
-            'table' => 'log_civicrm_note',
-            'column' => 'subject',
-          ),
+        'entity_table' => TRUE,
+      ),
+      'log_civicrm_relationship' => array(
+        'fk' => 'contact_id_a',
+        'bracket_info' => array(
+          'entity_column' => 'relationship_type_id',
+          'table' => 'log_civicrm_relationship_type',
+          'column' => 'label_a_b',
         ),
-        'log_civicrm_group_contact' => array(
-          'fk' => 'contact_id',
-          'bracket_info' => array(
-            'entity_column' => 'group_id',
-            'table' => 'log_civicrm_group',
-            'column' => 'title',
-          ),
-          'action_column' => 'status',
-          'log_type' => 'Group',
+      ),
+      'log_civicrm_activity_for_target' => array(
+        'fk' => 'contact_id',
+        'table_name' => 'log_civicrm_activity',
+        'joins' => array(
+          'table' => 'log_civicrm_activity_contact',
+          'join' => "(entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$targetID})",
         ),
-        'log_civicrm_entity_tag' => array(
-          'fk' => 'entity_id',
-          'bracket_info' => array(
-            'entity_column' => 'tag_id',
-            'table' => 'log_civicrm_tag',
-            'column' => 'name',
-          ),
-          'entity_table' => TRUE,
+        'bracket_info' => array(
+          'entity_column' => 'activity_type_id',
+          'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
         ),
-        'log_civicrm_relationship' => array(
-          'fk' => 'contact_id_a',
-          'bracket_info' => array(
-            'entity_column' => 'relationship_type_id',
-            'table' => 'log_civicrm_relationship_type',
-            'column' => 'label_a_b',
-          ),
+        'log_type' => 'Activity',
+      ),
+      'log_civicrm_activity_for_assignee' => array(
+        'fk' => 'contact_id',
+        'table_name' => 'log_civicrm_activity',
+        'joins' => array(
+          'table' => 'log_civicrm_activity_contact',
+          'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$assigneeID}",
         ),
-        'log_civicrm_activity_for_target' => array(
-          'fk' => 'contact_id',
-          'table_name' => 'log_civicrm_activity',
-          'joins' => array(
-            'table' => 'log_civicrm_activity_contact',
-            'join' => "(entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$targetID})",
-          ),
-          'bracket_info' => array(
-            'entity_column' => 'activity_type_id',
-            'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
-          ),
-          'log_type' => 'Activity',
+        'bracket_info' => array(
+          'entity_column' => 'activity_type_id',
+          'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
         ),
-        'log_civicrm_activity_for_assignee' => array(
-          'fk' => 'contact_id',
-          'table_name' => 'log_civicrm_activity',
-          'joins' => array(
-            'table' => 'log_civicrm_activity_contact',
-            'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$assigneeID}",
-          ),
-          'bracket_info' => array(
-            'entity_column' => 'activity_type_id',
-            'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
-          ),
-          'log_type' => 'Activity',
+        'log_type' => 'Activity',
+      ),
+      'log_civicrm_activity_for_source' => array(
+        'fk' => 'contact_id',
+        'table_name' => 'log_civicrm_activity',
+        'joins' => array(
+          'table' => 'log_civicrm_activity_contact',
+          'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$sourceID}",
         ),
-        'log_civicrm_activity_for_source' => array(
-          'fk' => 'contact_id',
-          'table_name' => 'log_civicrm_activity',
-          'joins' => array(
-            'table' => 'log_civicrm_activity_contact',
-            'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$sourceID}",
-          ),
-          'bracket_info' => array(
-            'entity_column' => 'activity_type_id',
-            'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
-          ),
-          'log_type' => 'Activity',
+        'bracket_info' => array(
+          'entity_column' => 'activity_type_id',
+          'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
         ),
-        'log_civicrm_case' => array(
-          'fk' => 'contact_id',
-          'joins' => array(
-            'table' => 'log_civicrm_case_contact',
-            'join' => 'entity_log_civireport.id = fk_table.case_id',
-          ),
-          'bracket_info' => array(
-            'entity_column' => 'case_type_id',
-            'options' => CRM_Case_PseudoConstant::caseType('title', FALSE),
-          ),
+        'log_type' => 'Activity',
+      ),
+      'log_civicrm_case' => array(
+        'fk' => 'contact_id',
+        'joins' => array(
+          'table' => 'log_civicrm_case_contact',
+          'join' => 'entity_log_civireport.id = fk_table.case_id',
         ),
-      );
+        'bracket_info' => array(
+          'entity_column' => 'case_type_id',
+          'options' => CRM_Case_PseudoConstant::caseType('title', FALSE),
+        ),
+      ),
+    );
 
-    $logging = new CRM_Logging_Schema;
+    $logging = new CRM_Logging_Schema();
 
     // build _logTables for contact custom tables
     $customTables = $logging->entityCustomDataLogTables('Contact');
@@ -187,15 +186,14 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form {
     // build _logTables for address custom tables
     $customTables = $logging->entityCustomDataLogTables('Address');
     foreach ($customTables as $table) {
-      $this->_logTables[$table] =
-        array(
-          'fk' => 'contact_id',// for join of fk_table with contact table
-          'joins' => array(
-            'table' => 'log_civicrm_address', // fk_table
-            'join' => 'entity_log_civireport.entity_id = fk_table.id',
-          ),
-          'log_type' => 'Contact',
-        );
+      $this->_logTables[$table] = array(
+        'fk' => 'contact_id', // for join of fk_table with contact table
+        'joins' => array(
+          'table' => 'log_civicrm_address', // fk_table
+          'join' => 'entity_log_civireport.entity_id = fk_table.id',
+        ),
+        'log_type' => 'Contact',
+      );
     }
 
     // allow log tables to be extended via report hooks
@@ -386,7 +384,6 @@ SELECT {$this->_logTables[$entity]['bracket_info']['entity_column']}
         $entityID = $id;
       }
 
-
       if ($entityID && $logDate &&
         array_key_exists('table', $this->_logTables[$entity]['bracket_info'])
       ) {
index a4902c1461e08bcee1a92e0ad2e43c214829ffab..6bc0dbd3dd88b9a4f913f57e6f71c5fb52bb0a60 100644 (file)
@@ -143,7 +143,7 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
    * Drop triggers for all logged tables.
    */
   public function dropTriggers($tableName = NULL) {
-    $dao = new CRM_Core_DAO;
+    $dao = new CRM_Core_DAO();
 
     if ($tableName) {
       $tableNames = array($tableName);
@@ -347,13 +347,14 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
     // add report instances
     $domain_id = CRM_Core_Config::domainID();
     foreach ($this->reports as $report) {
-      $dao = new CRM_Report_DAO_ReportInstance;
+      $dao = new CRM_Report_DAO_ReportInstance();
       $dao->domain_id = $domain_id;
       $dao->report_id = $report;
       $dao->title = $titles[$report];
       $dao->permission = 'administer CiviCRM';
-      if ($report == 'logging/contact/summary')
+      if ($report == 'logging/contact/summary') {
         $dao->is_reserved = 1;
+      }
       $dao->insert();
     }
   }
@@ -407,13 +408,12 @@ WHERE  table_schema IN ('{$this->db}', '{$civiDB}')";
         if (!array_key_exists($dao->TABLE_NAME, $columnSpecs)) {
           $columnSpecs[$dao->TABLE_NAME] = array();
         }
-        $columnSpecs[$dao->TABLE_NAME][$dao->COLUMN_NAME] =
-          array(
-            'COLUMN_NAME' => $dao->COLUMN_NAME,
-            'DATA_TYPE' => $dao->DATA_TYPE,
-            'IS_NULLABLE' => $dao->IS_NULLABLE,
-            'COLUMN_DEFAULT' => $dao->COLUMN_DEFAULT,
-          );
+        $columnSpecs[$dao->TABLE_NAME][$dao->COLUMN_NAME] = array(
+          'COLUMN_NAME' => $dao->COLUMN_NAME,
+          'DATA_TYPE' => $dao->DATA_TYPE,
+          'IS_NULLABLE' => $dao->IS_NULLABLE,
+          'COLUMN_DEFAULT' => $dao->COLUMN_DEFAULT,
+        );
       }
     }
     return $columnSpecs[$table];
@@ -530,7 +530,7 @@ COLS;
     // delete report instances
     $domain_id = CRM_Core_Config::domainID();
     foreach ($this->reports as $report) {
-      $dao = new CRM_Report_DAO_ReportInstance;
+      $dao = new CRM_Report_DAO_ReportInstance();
       $dao->domain_id = $domain_id;
       $dao->report_id = $report;
       $dao->delete();
index 97ecd92d2954044504a87f75660bd77919b50814..6340976779f33fe74529f71bca189dfc70d509a4 100644 (file)
@@ -123,7 +123,7 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
    *
    * @return CRM_Mailing_Event_BAO_Queue|string
    */
-  static function &getRecipients(
+  public static function &getRecipients(
     $job_id,
     $mailing_id = NULL,
     $offset = NULL,
@@ -623,11 +623,8 @@ ORDER BY   i.contact_id, i.{$tempColumn}
   }
 
   /**
-   *
-   * Returns the regex patterns that are used for preparing the text and html templates
-   *
-   *
-   **/
+   * Returns the regex patterns that are used for preparing the text and html templates.
+   */
   private function &getPatterns($onlyHrefs = FALSE) {
 
     $patterns = array();
@@ -648,16 +645,17 @@ ORDER BY   i.contact_id, i.{$tempColumn}
     $patterns[] = '\\\\\{\w+\.\w+\\\\\}|\{\{\w+\.\w+\}\}';
     $patterns[] = '\{\w+\.\w+\}';
 
-    $patterns = '{' . join('|', $patterns) . '}im';
+    $patterns = '{' . implode('|', $patterns) . '}im';
 
     return $patterns;
   }
 
   /**
-   *  returns an array that denotes the type of token that we are dealing with
-   *  we use the type later on when we are doing a token replcement lookup
+   * Returns an array that denotes the type of token that we are dealing with
+   * we use the type later on when we are doing a token replacement lookup
    *
-   * @param string $token The token for which we will be doing adata lookup
+   * @param string $token
+   *   The token for which we will be doing adata lookup.
    *
    * @return array
    *   An array that holds the token itself and the type.
@@ -723,9 +721,7 @@ ORDER BY   i.contact_id, i.{$tempColumn}
    * Prepares the text and html templates
    * for generating the emails and returns a copy of the
    * prepared templates
-   *
-   *
-   **/
+   */
   private function getPreparedTemplates() {
     if (!$this->preparedTemplates) {
       $patterns['html'] = $this->getPatterns(TRUE);
@@ -737,7 +733,7 @@ ORDER BY   i.contact_id, i.{$tempColumn}
       foreach (array(
                  'html',
                  'text',
-                 'subject'
+                 'subject',
                ) as $key) {
         if (!isset($templates[$key])) {
           continue;
@@ -765,16 +761,13 @@ ORDER BY   i.contact_id, i.{$tempColumn}
   }
 
   /**
-   *
-   *  Retrieve a ref to an array that holds the email and text templates for this email
-   *  assembles the complete template including the header and footer
-   *  that the user has uploaded or declared (if they have dome that)
-   *
+   * Retrieve a ref to an array that holds the email and text templates for this email
+   * assembles the complete template including the header and footer
+   * that the user has uploaded or declared (if they have dome that)
    *
    * @return array
    *   reference to an assoc array
-   *
-   **/
+   */
   private function &getTemplates() {
     if (!$this->templates) {
       $this->getHeaderFooter();
@@ -792,7 +785,7 @@ ORDER BY   i.contact_id, i.{$tempColumn}
           $template[] = $this->footer->body_text;
         }
 
-        $this->templates['text'] = join("\n", $template);
+        $this->templates['text'] = implode("\n", $template);
       }
 
       if ($this->body_html) {
@@ -808,7 +801,7 @@ ORDER BY   i.contact_id, i.{$tempColumn}
           $template[] = $this->footer->body_html;
         }
 
-        $this->templates['html'] = join("\n", $template);
+        $this->templates['html'] = implode("\n", $template);
 
         // this is where we create a text template from the html template if the text template did not exist
         // this way we ensure that every recipient will receive an email even if the pref is set to text and the
@@ -821,7 +814,7 @@ ORDER BY   i.contact_id, i.{$tempColumn}
       if ($this->subject) {
         $template = array();
         $template[] = $this->subject;
-        $this->templates['subject'] = join("\n", $template);
+        $this->templates['subject'] = implode("\n", $template);
       }
     }
     return $this->templates;
@@ -841,8 +834,7 @@ ORDER BY   i.contact_id, i.{$tempColumn}
    *
    * @return array
    *   reference to an assoc array
-   *
-   **/
+   */
   public function &getTokens() {
     if (!$this->tokens) {
 
@@ -875,8 +867,7 @@ ORDER BY   i.contact_id, i.{$tempColumn}
    *
    * @return array
    *   reference to an assoc array
-   *
-   **/
+   */
   public function &getFlattenedTokens() {
     if (!$this->flattenedTokens) {
       $tokens = $this->getTokens();
@@ -934,7 +925,7 @@ ORDER BY   i.contact_id, i.{$tempColumn}
           'return' => 'id',
           'options' => array(
             'limit' => 100000000000,
-          )
+          ),
         )
       );
 
@@ -968,11 +959,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
   }
 
   /**
-   * Retrieve the header and footer for this mailing
-   *
-   * @param void
-   *
-   * @return void
+   * Load this->header and this->footer.
    */
   private function getHeaderFooter() {
     if (!$this->header and $this->header_id) {
@@ -1303,7 +1290,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
         ($contact['preferred_mail_format'] == 'HTML' && !array_key_exists('html', $pEmails))
       )
     ) {
-      $textBody = join('', $text);
+      $textBody = implode('', $text);
       if ($useSmarty) {
         $textBody = $smarty->fetch("string:$textBody");
       }
@@ -1314,7 +1301,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
           $contact['preferred_mail_format'] == 'Both'
         ))
     ) {
-      $htmlBody = join('', $html);
+      $htmlBody = implode('', $html);
       if ($useSmarty) {
         $htmlBody = $smarty->fetch("string:$htmlBody");
       }
@@ -1335,7 +1322,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
 
     $mailingSubject = CRM_Utils_Array::value('subject', $pEmails);
     if (is_array($mailingSubject)) {
-      $mailingSubject = join('', $mailingSubject);
+      $mailingSubject = implode('', $mailingSubject);
     }
     $mailParams['Subject'] = $mailingSubject;
 
@@ -1358,7 +1345,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
         'html',
         'attachments',
         'toName',
-        'toEmail'
+        'toEmail',
       ))
       ) {
         $headers[$paramKey] = $paramValue;
@@ -1806,8 +1793,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       'bounce' => CRM_Mailing_Event_BAO_Bounce::getTableName(),
       'forward' => CRM_Mailing_Event_BAO_Forward::getTableName(),
       'url' => CRM_Mailing_BAO_TrackableURL::getTableName(),
-      'urlopen' =>
-        CRM_Mailing_Event_BAO_TrackableURLOpen::getTableName(),
+      'urlopen' => CRM_Mailing_Event_BAO_TrackableURLOpen::getTableName(),
       'component' => CRM_Mailing_BAO_Component::getTableName(),
       'spool' => CRM_Mailing_BAO_Spool::getTableName(),
     );
@@ -1876,10 +1862,9 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       $report['component'][] = array(
         'type' => $components[$mailing->type],
         'name' => $mailing->name,
-        'link' =>
-          CRM_Utils_System::url('civicrm/mailing/component',
-            "reset=1&action=update&id={$mailing->id}"
-          ),
+        'link' => CRM_Utils_System::url('civicrm/mailing/component',
+          "reset=1&action=update&id={$mailing->id}"
+        ),
       );
     }
 
@@ -2070,7 +2055,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
       foreach (array(
                  'scheduled_date',
                  'start_date',
-                 'end_date'
+                 'end_date',
                ) as $key) {
         $row[$key] = CRM_Utils_Date::customFormat($row[$key]);
       }
@@ -2124,16 +2109,14 @@ ORDER BY   civicrm_email.is_bulkmail DESC
     while ($mailing->fetch()) {
       $report['click_through'][] = array(
         'url' => $mailing->url,
-        'link' =>
-          CRM_Utils_System::url(
-            'civicrm/mailing/report/event',
-            "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}"
-          ),
-        'link_unique' =>
-          CRM_Utils_System::url(
-            'civicrm/mailing/report/event',
-            "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}&distinct=1"
-          ),
+        'link' => CRM_Utils_System::url(
+          'civicrm/mailing/report/event',
+          "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}"
+        ),
+        'link_unique' => CRM_Utils_System::url(
+          'civicrm/mailing/report/event',
+          "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}&distinct=1"
+        ),
         'clicks' => $mailing->clicks,
         'unique' => $mailing->unique_clicks,
         'rate' => CRM_Utils_Array::value('delivered', $report['event_totals']) ? (100.0 * $mailing->unique_clicks) / $report['event_totals']['delivered'] : 0,
@@ -2185,11 +2168,10 @@ ORDER BY   civicrm_email.is_bulkmail DESC
 
     $actionLinks = array(CRM_Core_Action::VIEW => array('name' => ts('Report')));
     if (CRM_Core_Permission::check('view all contacts')) {
-      $actionLinks[CRM_Core_Action::ADVANCED] =
-        array(
-          'name' => ts('Advanced Search'),
-          'url' => 'civicrm/contact/search/advanced',
-        );
+      $actionLinks[CRM_Core_Action::ADVANCED] = array(
+        'name' => ts('Advanced Search'),
+        'url' => 'civicrm/contact/search/advanced',
+      );
     }
     $action = array_sum(array_keys($actionLinks));
 
@@ -2306,7 +2288,6 @@ ORDER BY   civicrm_email.is_bulkmail DESC
     if (!in_array($id, $mailingIDs)) {
       CRM_Core_Error::fatal(ts('You do not have permission to access this mailing report'));
     }
-    return;
   }
 
   /**
@@ -2337,8 +2318,8 @@ ORDER BY   civicrm_email.is_bulkmail DESC
    * where the user has access to ALL groups, and hence ALL mailings and return a
    * value of TRUE (to avoid the downstream where clause with a list of mailing list IDs
    *
-   * @return boolean
-   *   | array - TRUE if the user has access to all mailings, else array of mailing IDs (possibly empty)
+   * @return bool|array
+   *   TRUE if the user has access to all mailings, else array of mailing IDs (possibly empty).
    */
   public static function mailingACLIDs() {
     // CRM-11633
@@ -2692,7 +2673,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
       $form->assign('templates', TRUE);
       $form->add('select', 'template', ts('Select Template'),
         array(
-          '' => ts('- select -')
+          '' => ts('- select -'),
         ) + $form->_templates, FALSE,
         array('onChange' => "selectValue( this.value,'' );")
       );
@@ -2839,7 +2820,7 @@ WHERE  civicrm_mailing_job.id = %1
     if ($mode == NULL && CRM_Core_BAO_MailSettings::defaultDomain() == "EXAMPLE.ORG") {
       throw new CRM_Core_Exception(ts('The <a href="%1">default mailbox</a> has not been configured. You will find <a href="%2">more info in the online user and administrator guide</a>', array(
             1 => CRM_Utils_System::url('civicrm/admin/mailSettings', 'reset=1'),
-            2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/"
+            2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/",
           )));
     }
 
index 71d0704f556b5a18b082c6acb0ef2fb8c89c537a..2a0cf10f82f1289d2d38b62003b00debbb7df10a 100644 (file)
@@ -63,7 +63,7 @@ WHERE  mailing_id = %1
    *
    * @return Object
    */
-  static function mailingQuery(
+  public static function mailingQuery(
     $mailingID,
     $offset = NULL, $limit = NULL
   ) {
index d4560698ba0d9d448e6a74aa732647232b9cd9a4..1f003cd0918c0303d64fef00074f39ef41361668 100644 (file)
@@ -57,7 +57,7 @@ class CRM_Mailing_Event_BAO_Confirm extends CRM_Mailing_Event_DAO_Confirm {
    * @param string $hash
    *   The hash.
    *
-   * @return boolean
+   * @return bool
    *   True on success
    */
   public static function confirm($contact_id, $subscribe_id, $hash) {
index fe2606c2267ae1a4ad6f8c91199e1d9543472c3e..2eb5e68da33248546e5e173a59c26a49258ca5bd 100755 (executable)
@@ -280,7 +280,7 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered {
    *   Consider mailings that were completed not more than $maxDays ago.
    *
    * @return void
-   **/
+   */
   public static function updateEmailResetDate($minDays = 3, $maxDays = 7) {
     $dao = new CRM_Core_Dao();
 
index 1ed0e5491098c32c2912e2e32221dd48a06dfc1e..1546ac382ffbfe1a4e79a1bcaaa21726775ed57f 100644 (file)
@@ -63,8 +63,6 @@ class CRM_Mailing_Event_BAO_Queue extends CRM_Mailing_Event_DAO_Queue {
   /**
    * Create a security hash from the job, email and contact ids
    *
-   * @param array The ids to be hashed
-   *
    * @return int
    *   The hash
    */
index a442d3ce31182d248b0c89b7cb13721be5132cb4..438afc6394a3662d65ff48ebd9894782398d9c2a 100755 (executable)
@@ -57,7 +57,7 @@ class CRM_Mailing_Event_BAO_Unsubscribe extends CRM_Mailing_Event_DAO_Unsubscrib
    * @param string $hash
    *   The hash.
    *
-   * @return boolean
+   * @return bool
    *   Was the contact successfully unsubscribed?
    */
   public static function unsub_from_domain($job_id, $queue_id, $hash) {
index aaf30ca74da18088e45d777fadd872c1c8522d68..09de5f3f84a1f37eaff43e14d75cc30e9e420647 100644 (file)
@@ -120,7 +120,7 @@ class CRM_Mailing_Form_Search extends CRM_Core_Form {
         'sms',
         'status_unscheduled',
         'is_archived',
-        'hidden_find_mailings'
+        'hidden_find_mailings',
       );
       foreach ($fields as $field) {
         if (isset($params[$field]) &&
@@ -128,7 +128,7 @@ class CRM_Mailing_Form_Search extends CRM_Core_Form {
         ) {
           if (in_array($field, array(
               'mailing_from',
-              'mailing_to'
+              'mailing_to',
             )) && !$params["mailing_relative"]
           ) {
             $time = ($field == 'mailing_to') ? '235959' : NULL;
index 876aa3ab528109774697184184eb7bc7eaf3980d..991b4d2dd905f0049e196c9e304b0cc31d6699dd 100644 (file)
@@ -103,13 +103,10 @@ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form {
   }
 
   public function postProcess() {
-
     $values = $this->exportValues();
 
     // check if EmailTyped matches Email address
     $result = CRM_Utils_String::compareStr($this->_email, $values['email_confirm'], TRUE);
-
-
     $job_id = $this->_job_id;
     $queue_id = $this->_queue_id;
     $hash = $this->_hash;
index c2352b1870157f4d65c60e6789608950eb20cb28..fb97b7de0936048a810ee5207df52cb280c0d0b9 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
  * This class handle mailing and contact related functions
- *
  */
 class CRM_Mailing_Page_Tab extends CRM_Contact_Page_View {
   /**
@@ -48,17 +46,13 @@ class CRM_Mailing_Page_Tab extends CRM_Contact_Page_View {
   public $_contactId = NULL;
 
   /**
-   * called when action is browse
-   *
-   * @return null
+   * Called when action is browse.
    */
   public function browse() {
   }
 
   /**
-   * Build all the data structures needed to build the form
-   *
-   * @return void
+   * Build all the data structures needed to build the form.
    */
   public function preProcess() {
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
@@ -70,23 +64,20 @@ class CRM_Mailing_Page_Tab extends CRM_Contact_Page_View {
     $this->assign('contactId', $this->_contactId);
     $this->assign('displayName', $displayName);
 
-    // check logged in url permission
+    // Check logged in url permission.
     CRM_Contact_Page_View::checkUserPermission($this);
 
-    // set page title
     CRM_Utils_System::setTitle(ts('Mailings sent to %1', array(1 => $displayName)));
   }
 
   /**
-   * the main function that is called when the page loads,
-   * it decides the which action has to be taken for the page.
+   * The main function that is called when the page loads.
    *
-   * @return null
+   * It decides the which action has to be taken for the page.
    */
   public function run() {
     $this->preProcess();
     $this->browse();
-
-    return parent::run();
+    parent::run();
   }
 }
index 3275ff833709fc0e03e5814106b17316d58d2b19..eefd5ede4bf10680002c4e5e705d17359084a269 100644 (file)
@@ -261,67 +261,76 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
     switch ($this->_event_type) {
       case 'queue':
         $event = new CRM_Mailing_Event_BAO_Queue();
-        return $event->getTotalCount($this->_mailing_id,
+        $result = $event->getTotalCount($this->_mailing_id,
           $this->_job_id
         );
+        return $result;
 
       case 'delivered':
         $event = new CRM_Mailing_Event_BAO_Delivered();
-        return $event->getTotalCount($this->_mailing_id,
+        $result = $event->getTotalCount($this->_mailing_id,
           $this->_job_id,
           $this->_is_distinct
         );
+        return $result;
 
       case 'opened':
         $event = new CRM_Mailing_Event_BAO_Opened();
-        return $event->getTotalCount($this->_mailing_id,
+        $result = $event->getTotalCount($this->_mailing_id,
           $this->_job_id,
           $this->_is_distinct
         );
+        return $result;
 
       case 'bounce':
         $event = new CRM_Mailing_Event_BAO_Bounce();
-        return $event->getTotalCount($this->_mailing_id,
+        $result = $event->getTotalCount($this->_mailing_id,
           $this->_job_id,
           $this->_is_distinct
         );
+        return $result;
 
       case 'forward':
         $event = new CRM_Mailing_Event_BAO_Forward();
-        return $event->getTotalCount($this->_mailing_id,
+        $result = $event->getTotalCount($this->_mailing_id,
           $this->_job_id,
           $this->_is_distinct
         );
+        return $result;
 
       case 'reply':
         $event = new CRM_Mailing_Event_BAO_Reply();
-        return $event->getTotalCount($this->_mailing_id,
+        $result = $event->getTotalCount($this->_mailing_id,
           $this->_job_id,
           $this->_is_distinct
         );
+        return $result;
 
       case 'unsubscribe':
         $event = new CRM_Mailing_Event_BAO_Unsubscribe();
-        return $event->getTotalCount($this->_mailing_id,
+        $result = $event->getTotalCount($this->_mailing_id,
           $this->_job_id,
           $this->_is_distinct
         );
+        return $result;
 
       case 'optout':
         $event = new CRM_Mailing_Event_BAO_Unsubscribe();
-        return $event->getTotalCount($this->_mailing_id,
+        $result = $event->getTotalCount($this->_mailing_id,
           $this->_job_id,
           $this->_is_distinct,
           FALSE
         );
+        return $result;
 
       case 'click':
         $event = new CRM_Mailing_Event_BAO_TrackableURLOpen();
-        return $event->getTotalCount($this->_mailing_id,
+        $result = $event->getTotalCount($this->_mailing_id,
           $this->_job_id,
           $this->_is_distinct,
           $this->_url_id
         );
+        return $result;
 
       default:
         return 0;
@@ -348,59 +357,67 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
   public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
     switch ($this->_event_type) {
       case 'queue':
-        return CRM_Mailing_Event_BAO_Queue::getRows($this->_mailing_id,
+        $rows = CRM_Mailing_Event_BAO_Queue::getRows($this->_mailing_id,
           $this->_job_id, $offset, $rowCount, $sort
         );
-        break;
+        return $rows;
 
       case 'delivered':
-        return CRM_Mailing_Event_BAO_Delivered::getRows($this->_mailing_id,
+        $rows = CRM_Mailing_Event_BAO_Delivered::getRows($this->_mailing_id,
           $this->_job_id, $this->_is_distinct,
           $offset, $rowCount, $sort
         );
+        return $rows;
 
       case 'opened':
-        return CRM_Mailing_Event_BAO_Opened::getRows($this->_mailing_id,
+        $rows = CRM_Mailing_Event_BAO_Opened::getRows($this->_mailing_id,
           $this->_job_id, $this->_is_distinct,
           $offset, $rowCount, $sort
         );
+        return $rows;
 
       case 'bounce':
-        return CRM_Mailing_Event_BAO_Bounce::getRows($this->_mailing_id,
+        $rows = CRM_Mailing_Event_BAO_Bounce::getRows($this->_mailing_id,
           $this->_job_id, $this->_is_distinct,
           $offset, $rowCount, $sort
         );
+        return $rows;
 
       case 'forward':
-        return CRM_Mailing_Event_BAO_Forward::getRows($this->_mailing_id,
+        $rows = CRM_Mailing_Event_BAO_Forward::getRows($this->_mailing_id,
           $this->_job_id, $this->_is_distinct,
           $offset, $rowCount, $sort
         );
+        return $rows;
 
       case 'reply':
-        return CRM_Mailing_Event_BAO_Reply::getRows($this->_mailing_id,
+        $rows = CRM_Mailing_Event_BAO_Reply::getRows($this->_mailing_id,
           $this->_job_id, $this->_is_distinct,
           $offset, $rowCount, $sort
         );
+        return $rows;
 
       case 'unsubscribe':
-        return CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
+        $rows = CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
           $this->_job_id, $this->_is_distinct,
           $offset, $rowCount, $sort, TRUE
         );
+        return $rows;
 
       case 'optout':
-        return CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
+        $rows = CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
           $this->_job_id, $this->_is_distinct,
           $offset, $rowCount, $sort, FALSE
         );
+        return $rows;
 
       case 'click':
-        return CRM_Mailing_Event_BAO_TrackableURLOpen::getRows(
+        $rows = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows(
           $this->_mailing_id, $this->_job_id,
           $this->_is_distinct, $this->_url_id,
           $offset, $rowCount, $sort
         );
+        return $rows;
 
       default:
         return NULL;
@@ -413,10 +430,11 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
    * @param string $output
    *   Type of output.
    *
-   * @return string
+   * @return string|NULL
    *   name of the file
    */
   public function getExportFileName($output = 'csv') {
+    return NULL;
   }
 
   public function eventToTitle() {
@@ -428,17 +446,11 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
         'delivered' => ts('Successful Deliveries'),
         'bounce' => ts('Bounces'),
         'forward' => ts('Forwards'),
-        'reply' => $this->_is_distinct
-          ? ts('Unique Replies')
-          : ts('Replies'),
+        'reply' => $this->_is_distinct ? ts('Unique Replies') : ts('Replies'),
         'unsubscribe' => ts('Unsubscribe Requests'),
         'optout' => ts('Opt-out Requests'),
-        'click' => $this->_is_distinct
-          ? ts('Unique Click-throughs')
-          : ts('Click-throughs'),
-        'opened' => $this->_is_distinct
-          ? ts('Unique Tracked Opens')
-          : ts('Tracked Opens'),
+        'click' => $this->_is_distinct ? ts('Unique Click-throughs') : ts('Click-throughs'),
+        'opened' => $this->_is_distinct ? ts('Unique Tracked Opens') : ts('Tracked Opens'),
       );
     }
     return $events[$this->_event_type];
index f9ce69dccca59aea7af4e246f3c7d124570ba7ec..3a6503deee2ebe09b41359d54c807850833323b3 100644 (file)
@@ -446,7 +446,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership {
    *
    * @param int $action
    *
-   * @return Array
+   * @return array
    *   array of contact_id of all related contacts.
    */
   public static function checkMembershipRelationship($membershipId, $contactId, $action = CRM_Core_Action::ADD) {
@@ -597,7 +597,7 @@ INNER JOIN  civicrm_membership_type type ON ( type.id = membership.membership_ty
    *   Membership id that needs to be deleted.
    *
    *
-   * @return $results   no of deleted Membership on success, false otherwise
+   * @return int $results  id of deleted Membership on success, false otherwise
    */
   public static function del($membershipId) {
     //delete related first and then delete parent.
@@ -612,7 +612,7 @@ INNER JOIN  civicrm_membership_type type ON ( type.id = membership.membership_ty
    *   Membership id that needs to be deleted.
    *
    *
-   * @return $results   no of deleted Membership on success, false otherwise
+   * @return int $results id of deleted Membership on success, false otherwise
    */
   public static function deleteMembership($membershipId) {
     // CRM-12147, retrieve membership data before we delete it for hooks
@@ -677,7 +677,7 @@ INNER JOIN  civicrm_membership_type type ON ( type.id = membership.membership_ty
    */
   public static function deleteRelatedMemberships($ownerMembershipId, $contactId = NULL) {
     if (!$ownerMembershipId && !$contactId) {
-      return;
+      return FALSE;
     }
 
     $membership = new CRM_Member_DAO_Membership();
@@ -748,7 +748,7 @@ INNER JOIN  civicrm_membership_type type ON ( type.id = membership.membership_ty
    *   Is this a separate membership payment
    *
    */
-  static function buildMembershipBlock(
+  public static function buildMembershipBlock(
     &$form,
     $pageID,
     $cid,
@@ -1519,7 +1519,7 @@ AND civicrm_membership.is_test = %2";
    * @throws CRM_Core_Exception
    *
    */
-  static function renewMembershipFormWrapper(
+  public static function renewMembershipFormWrapper(
     $contactID,
     $membershipTypeID,
     $is_test,
@@ -1762,7 +1762,7 @@ WHERE  civicrm_membership.contact_id = civicrm_contact.id
     if ($reset) {
       // not sure why a static var is in use here - we need a way to reset it from the test suite
       $relatedContactIds = array();
-      return;
+      return FALSE;
     }
 
     $membership = new CRM_Member_DAO_Membership();
@@ -1898,7 +1898,8 @@ WHERE  civicrm_membership.contact_id = civicrm_contact.id
               CRM_Member_BAO_Membership::create($params, $relMemIds);
               $available--;
             }
-            else { // we have run out of inherited memberships, so delete extras
+            else {
+              // we have run out of inherited memberships, so delete extras
               self::deleteMembership($params['id']);
             }
             // we need to first check if there will remain inherited memberships, so queue it up
@@ -1922,22 +1923,22 @@ WHERE  civicrm_membership.contact_id = civicrm_contact.id
    *
    * @param int $membershipId
    *
-   * @return boolean
-   *   true if deleted false otherwise
+   * @return object
+   *   $membershipPayment deleted membership payment object
    */
   public static function deleteMembershipPayment($membershipId) {
 
-    $membesrshipPayment = new CRM_Member_DAO_MembershipPayment();
-    $membesrshipPayment->membership_id = $membershipId;
-    $membesrshipPayment->find();
+    $membershipPayment = new CRM_Member_DAO_MembershipPayment();
+    $membershipPayment->membership_id = $membershipId;
+    $membershipPayment->find();
 
-    while ($membesrshipPayment->fetch()) {
-      CRM_Contribute_BAO_Contribution::deleteContribution($membesrshipPayment->contribution_id);
-      CRM_Utils_Hook::pre('delete', 'MembershipPayment', $membesrshipPayment->id, $membesrshipPayment);
+    while ($membershipPayment->fetch()) {
+      CRM_Contribute_BAO_Contribution::deleteContribution($membershipPayment->contribution_id);
+      CRM_Utils_Hook::pre('delete', 'MembershipPayment', $membershipPayment->id, $membershipPayment);
       $membesrshipPayment->delete();
-      CRM_Utils_Hook::post('delete', 'MembershipPayment', $membesrshipPayment->id, $membesrshipPayment);
+      CRM_Utils_Hook::post('delete', 'MembershipPayment', $membershipPayment->id, $membershipPayment);
     }
-    return $membesrshipPayment;
+    return $membershipPayment;
   }
 
   /**
@@ -2032,7 +2033,7 @@ FROM   civicrm_membership_type
    *
    * @param bool $isNotCancelled
    *
-   * @return boolean
+   * @return bool
    */
   public static function isCancelSubscriptionSupported($mid, $isNotCancelled = TRUE) {
     $cacheKeyString = "$mid";
index e34f6d1ab87f3e369da6f2e37c2247330858be1c..3cced1d432bba80148770f68436322190d4638d8 100644 (file)
@@ -62,7 +62,6 @@ class CRM_Member_BAO_MembershipLog extends CRM_Member_DAO_MembershipLog {
    *
    * @return mixed
    */
-
   public static function del($membershipID) {
     $membershipLog = new CRM_Member_DAO_MembershipLog();
     $membershipLog->membership_id = $membershipID;
index d03bb4b80f9bfa5ff11de430871ad3e24aeec04f..b35392376b1aed830f457bb1700602936a9fe492 100644 (file)
@@ -167,7 +167,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
         $message .= '<br/>' . ts('%3. There are some contacts who have this membership type assigned to them. Search for contacts with this membership type from <a href=\'%1\'>Find Members</a>. If you are still getting this message after deleting these memberships, there may be contacts in the Trash (deleted) with this membership type. Try using <a href="%2">Advanced Search</a> and checking "Search in Trash".', array(
               1 => $findMembersURL,
               2 => $deleteURL,
-              3 => $cnt
+              3 => $cnt,
             ));
         $cnt++;
       }
@@ -176,7 +176,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
         $deleteURL = CRM_Utils_System::url('civicrm/admin/contribute', 'reset=1');
         $message .= ts('%2. This Membership Type is used in an <a href=\'%1\'>Online Contribution page</a>. Uncheck this membership type in the Memberships tab.', array(
             1 => $deleteURL,
-            2 => $cnt
+            2 => $cnt,
           ));
         throw new CRM_Core_Exception($message);
       }
@@ -305,7 +305,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
     foreach (array(
                'joinDate',
                'startDate',
-               'endDate'
+               'endDate',
              ) as $dateParam) {
       if (!empty($$dateParam)) {
         $$dateParam = CRM_Utils_Date::processDate($$dateParam, NULL, FALSE, 'Y-m-d');
@@ -478,7 +478,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
    *
    * CRM-7297 Membership Upsell - Added $membershipTypeID param to facilitate calculations of dates when membership type changes
    *
-   * @return Array
+   * @return array
    *   array fo the start date, end date and join date of the membership
    */
   public static function getRenewalDatesForMembershipType($membershipId, $changeToday = NULL, $membershipTypeID = NULL, $numRenewTerms = 1) {
@@ -585,7 +585,7 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
    * @param int $orgID
    *   Id of Organization.
    *
-   * @return Array
+   * @return array
    *   array of the details of membership types
    */
   public static function getMembershipTypesByOrg($orgID) {
@@ -603,9 +603,9 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
   /**
    * Retrieve all Membership Types with Member of Contact id
    *
-   * @param array membership types
-   *
-   * @return Array
+   * @param array $membershipTypes
+   *   array of membership type ids
+   * @return array
    *   array of the details of membership types with Member of Contact id
    */
   public static function getMemberOfContactByMemTypes($membershipTypes) {
@@ -752,12 +752,12 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
     }
   }
 
-  /** This function updates all price field value for quick config
+  /**                                                                                                                                                                                                         * This function updates all price field value for quick config
    * price set which has membership type
    *
-   * @param  integer      membership type id
+   * @param  int $membershipTypeId membership type id
    *
-   * @param  integer      financial type id
+   * @param  array $params
    */
   public static function updateAllPriceFieldValue($membershipTypeId, $params) {
     if (!empty($params['minimum_fee'])) {
index 1d14d1ca45a5e2275cade86d5a3b4ab0d81c2d22..6b29e33ee1647ec35587691f55044141bbf4a183 100644 (file)
@@ -392,7 +392,7 @@ class CRM_Member_BAO_Query {
    *
    * @return array|null
    */
-  static function defaultReturnProperties(
+  public static function defaultReturnProperties(
     $mode,
     $includeCustomFields = TRUE
   ) {
index 624411003d56a00046677445bda87570841ec60a..f5b6cca94b2d93d712267764e3f8523432d40c58 100644 (file)
@@ -82,7 +82,7 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
         CRM_Core_DAO::commonRetrieveAll('CRM_Price_DAO_PriceField', 'price_set_id', $priceSetId, $pFIDs, $return = array(
             'html_type',
             'name',
-            'label'
+            'label',
           ));
         foreach ($pFIDs as $pid => $pValue) {
           if ($pValue['html_type'] == 'Radio' && $pValue['name'] == 'membership_amount') {
index 91ae8b9529ddf0cc57f08249eb84255df33557ed..5081749e1716fbb9e32340c5c9138b8f4cc5b627 100644 (file)
@@ -73,7 +73,7 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task {
     if (count($this->_memberIds) > $this->_maxMembers) {
       CRM_Core_Session::setStatus(ts("The maximum number of members you can select for Batch Update is %1. You have selected %2. Please select fewer members from your search results and try again.", array(
             1 => $this->_maxMembers,
-            2 => count($this->_memberIds)
+            2 => count($this->_memberIds),
           )), ts('Batch Update Error'), 'error');
       $validate = TRUE;
     }
@@ -101,7 +101,7 @@ class CRM_Member_Form_Task_PickProfile extends CRM_Member_Form_Task {
 
     $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'),
       array(
-        '' => ts('- select profile -')
+        '' => ts('- select profile -'),
       ) + $profiles, TRUE
     );
     $this->addDefaultButtons(ts('Continue'));
index 315e0506d2a426f3528271c894c95c26cf9b2f5c..aa7f6290ca14bc53c8a2ee66c487eef19605fb22 100644 (file)
@@ -112,7 +112,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
    * @param array $values
    *   The array of values belonging to this line.
    *
-   * @return boolean
+   * @return bool
    */
   public function mapField(&$values) {
     return CRM_Import_Parser::VALID;
@@ -124,7 +124,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
    * @param array $values
    *   The array of values belonging to this line.
    *
-   * @return boolean
+   * @return bool
    *   the result of this processing
    */
   public function preview(&$values) {
@@ -137,7 +137,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
    * @param array $values
    *   The array of values belonging to this line.
    *
-   * @return boolean
+   * @return bool
    *   the result of this processing
    */
   public function summary(&$values) {
@@ -254,7 +254,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
    * @param array $values
    *   The array of values belonging to this line.
    *
-   * @return boolean
+   * @return bool
    *   the result of this processing
    */
   public function import($onDuplicate, &$values) {
@@ -594,7 +594,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
    *
    * @param $formatted
    *
-   * @return Array
+   * @return;
    *   formatted containing date values
    */
   public function formattedDates($calcDates, &$formatted) {
index 6e9f766d92f3de7489f2912449bc9b9ac12a59f8..e8c2ced583bdd16184895cf00119b1dbd80b6382 100644 (file)
@@ -47,8 +47,6 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
 
   /**
    * called when action is browse
-   *
-   * @return null
    */
   public function browse() {
     $links = self::links('all', $this->_isPaymentProcessor, $this->_accessContribution);
@@ -157,7 +155,8 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
       if (CRM_Utils_Array::value('is_current_member', $statusANDType[$dao->id]) // membership is active
         && CRM_Utils_Array::value('relationship_type_id', $statusANDType[$dao->id]) // membership type allows inheritance
         && empty($dao->owner_membership_id)
-      ) { // not an related membership
+      ) {
+        // not an related membership
         $query = "
  SELECT COUNT(m.id)
    FROM civicrm_membership m
@@ -168,7 +167,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
         $max_related = CRM_Utils_Array::value('max_related', $membership[$dao->id]);
         $membership[$dao->id]['related_count'] = ($max_related == '' ? ts('%1 created', array(1 => $num_related)) : ts('%1 out of %2', array(
             1 => $num_related,
-            2 => $max_related
+            2 => $max_related,
           ))
         );
       }
@@ -465,7 +464,7 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
    * @return array
    *   (reference) of action links
    */
-  static function &links(
+  public static function &links(
     $status = 'all',
     $isPaymentProcessor = NULL,
     $accessContribution = NULL,
@@ -578,8 +577,6 @@ class CRM_Member_Page_Tab extends CRM_Core_Page {
    *
    * @param int $contactId
    * @param int $membershipId
-   *
-   * @return null
    */
   public static function associatedContribution($contactId = NULL, $membershipId = NULL) {
     $controller = new CRM_Core_Controller_Simple(
index c3f8ce5e0e6434daf395ea53626a18c10b909407..eef573eccb88c74e1f60262bba48dfdac55ec737 100644 (file)
@@ -44,7 +44,7 @@ class CRM_Member_StateMachine_Search extends CRM_Core_StateMachine {
   /**
    * Class constructor
    */
-  function __construct($controller, $action = CRM_Core_Action::NONE) {
+  public function __construct($controller, $action = CRM_Core_Action::NONE) {
     parent::__construct($controller, $action);
 
     $this->_pages = array();
index f602508865bd0a92f1cfa4f5d77a7a98e74d446a..b2bf44f66528b965590444ded002b59826920139 100644 (file)
@@ -350,7 +350,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0";
    * @param int $id
    *   Campaign page id.
    *
-   * @return null
+   * @return;
    */
   public static function deleteById($id) {
     CRM_Utils_Hook::pre('delete', 'Campaign', $id, CRM_Core_DAO::$_nullArray);
@@ -582,7 +582,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0";
    *
    * @param $is_active
    *
-   * @return null
+   * @return;
    */
   public static function setIsActive($id, $is_active) {
     switch ($is_active) {
@@ -778,7 +778,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0";
    * @param int $id
    *   Pcp block id.
    *
-   * @return Boolean
+   * @return Bool
    */
   public static function getPcpBlockInUse($id) {
     $query = "
@@ -797,7 +797,7 @@ WHERE pcp.id = %1 AND cc.contribution_status_id =1 AND cc.is_test = 0";
    * @param int $profileId
    *   Supporter's profile id.
    *
-   * @return boolean
+   * @return bool
    */
   public static function checkEmailProfile($profileId) {
     $query = "
@@ -847,7 +847,7 @@ WHERE field_name like 'email%' And is_active = 1 And uf_group_id = %1";
    * @param int $pcpId
    * @param $component
    *
-   * @return String
+   * @return string
    */
   public static function getPcpBlockEntityId($pcpId, $component) {
     $entity_table = self::getPcpEntityTable($component);
@@ -872,7 +872,7 @@ WHERE pcp.id = %1";
    *
    * @param $component
    *
-   * @return String
+   * @return string
    */
   public static function getPcpEntityTable($component) {
     $entity_table_map = array(
index 8024e067faa6ec38aa59b48613c323359c2df089..dcd130087786356b31b0cf6138faf3e3d9729465 100644 (file)
@@ -106,7 +106,7 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent {
     $this->add('select', 'target_entity_id',
       ts('Online Contribution Page'),
       array(
-        '' => ts('- select -')
+        '' => ts('- select -'),
       ) +
       CRM_Contribute_PseudoConstant::contributionPage()
     );
@@ -122,7 +122,7 @@ class CRM_PCP_Form_Event extends CRM_Event_Form_ManageEvent {
     if (!empty($pcpBlock->id) && CRM_PCP_BAO_PCP::getPcpBlockInUse($pcpBlock->id)) {
       foreach (array(
                  'target_entity_type',
-                 'target_entity_id'
+                 'target_entity_id',
                ) as $element_name) {
         $element = $this->getElement($element_name);
         $element->freeze();
index 8510fc13f1ed874df8bc915855051ceb75412b63..b276c483a0403818ddcf72a48aae51c015afa464 100644 (file)
@@ -42,10 +42,6 @@ class CRM_PCP_Form_PCP extends CRM_Core_Form {
 
   /**
    * Set variables up before form is built
-   *
-   * @param null
-   *
-   * @return void
    */
   public function preProcess() {
     if ($this->_action & CRM_Core_Action::DELETE) {
@@ -122,8 +118,6 @@ class CRM_PCP_Form_PCP extends CRM_Core_Form {
    * 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
    */
@@ -138,10 +132,6 @@ class CRM_PCP_Form_PCP extends CRM_Core_Form {
 
   /**
    * Build the form object
-   *
-   * @param null
-   *
-   * @return void
    */
   public function buildQuickForm() {
     if ($this->_action & CRM_Core_Action::DELETE) {
@@ -191,22 +181,18 @@ class CRM_PCP_Form_PCP extends CRM_Core_Form {
    *
    * @param array $fields
    *   Posted values of the form.
-   *
-   * @param $files
+   * @param array $files
    * @param CRM_Core_Form $form
    *
-   * @return array
+   * @return array|NULL
    *   list of errors to be posted back to the form
    */
   public static function formRule($fields, $files, $form) {
+    return NULL;
   }
 
   /**
    * Process the form
-   *
-   * @param null
-   *
-   * @return void
    */
   public function postProcess() {
     if ($this->_action & CRM_Core_Action::DELETE) {
index 62e5e829b052cbfceec30759d3641af195ed284d..9d3e48e71d64d375c7462878d5a2b66612d732b7 100644 (file)
@@ -139,7 +139,7 @@ class CRM_PCP_Page_PCPInfo extends CRM_Core_Page {
           'start_date',
           'end_date',
           'registration_start_date',
-          'registration_end_date'
+          'registration_end_date',
         )
       );
     }
index 5376314ca1d39fde97e6ad2b7bcf1b99256a383b..5626f2309c21024f5fc01f20a61a013ba279e285 100644 (file)
@@ -237,7 +237,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     if ($this->_context == 'standalone') {
       $this->addEntityRef('contact_id', ts('Contact'), array(
           'create' => TRUE,
-          'api' => array('extra' => array('email'))
+          'api' => array('extra' => array('email')),
         ), TRUE);
     }
 
@@ -332,9 +332,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     }
     $element = &$this->add('select', 'frequency_unit',
       ts('Frequency'),
-      array(
-        '' => ts('- select -')
-      ) + $freqUnitsDisplay,
+      array('' => ts('- select -')) + $freqUnitsDisplay,
       TRUE
     );
 
@@ -405,9 +403,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
       $pledgePages[$value['entity_id']] = $pages[$value['entity_id']];
     }
     $ele = $this->add('select', 'contribution_page_id', ts('Self-service Payments Page'),
-      array(
-        '' => ts('- select -')
-      ) + $pledgePages
+      array('' => ts('- select -')) + $pledgePages
     );
 
     $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
@@ -637,7 +633,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
         if (count($processors) > 0) {
           $statusMsg .= ' ' . ts("If a payment is due now, you can record <a href='%1'>a check, EFT, or cash payment for this pledge</a> OR <a href='%2'>submit a credit card payment</a>.", array(
                 1 => $contribURL,
-                2 => $creditURL
+                2 => $creditURL,
               ));
         }
         else {
index a33008b6f8a7d8df9e5dc986c4e3fb529d4b4aca..9d36ada167003c64ed68036958f2b919329eded6 100644 (file)
@@ -50,10 +50,8 @@ class CRM_Pledge_Form_Task_Delete extends CRM_Pledge_Form_Task {
 
   /**
    * Build all the data structures needed to build the form
-   *
-   * @return void
    */
-  function preProcess() {
+  public function preProcess() {
     //check for delete
     if (!CRM_Core_Permission::checkActionPermission('CiviPledge', CRM_Core_Action::DELETE)) {
       CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
@@ -87,7 +85,7 @@ class CRM_Pledge_Form_Task_Delete extends CRM_Pledge_Form_Task {
 
     $status = ts('Deleted Pledge(s): %1 (Total Selected: %2) ', array(
         1 => $deletedPledges,
-        2 => count($this->_pledgeIds)
+        2 => count($this->_pledgeIds),
       ));
     CRM_Core_Session::setStatus($status, '', 'info');
   }
index 8f5f3c2db5d79335c3fd83b593e5ee35ce1ff3dd..e3eee49aa7e9b99a64ffa4aab4a03484858cd0ee 100644 (file)
@@ -180,7 +180,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info {
           'query' => 'reset=1&action=add&context=standalone',
           'ref' => 'new-pledge',
           'title' => ts('Pledge'),
-        )
+        ),
       ));
     }
   }
index d1407fe50ad35653f0032104733c708bc1537a96..d940e01e60f9aca5241e6f62f642f61e88002262 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
  * This class is used to retrieve and display a range of
  * contacts that match the given criteria (specifically for
  * results of advanced search options.
- *
  */
 class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
 
@@ -130,7 +128,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
   protected $_query;
 
   /**
-   * Class constructor
+   * Class constructor.
    *
    * @param array $queryParams
    *   Array of parameters for query.
@@ -146,7 +144,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
    *
    * @return \CRM_Pledge_Selector_Search
    */
-  function __construct(
+  public function __construct(
     &$queryParams,
     $action = CRM_Core_Action::NONE,
     $additionalClause = NULL,
@@ -176,8 +174,8 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
 
   /**
    * This method returns the links that are given for each search row.
-   * currently the links added for each row are
    *
+   * Currently the links added for each row are:
    * - View
    * - Edit
    *
@@ -249,7 +247,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
   /**
    * Returns total number of rows for the query.
    *
-   * @param
+   * @param int $action
    *
    * @return int
    *   Total number of rows
@@ -264,7 +262,7 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
   }
 
   /**
-   * Returns all the rows in the given offset and rowCount
+   * Returns all the rows in the given offset and rowCount.
    *
    * @param string $action
    *   The action being performed.
@@ -362,6 +360,8 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
   }
 
   /**
+   * Get qill (display what was searched on).
+   *
    * @inheritDoc
    */
   public function getQILL() {
@@ -369,8 +369,9 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
   }
 
   /**
-   * Returns the column headers as an array of tuples:
-   * (name, sortName (key to the sort array))
+   * Returns the column headers as an array of tuples.
+   *
+   * Keys are name, sortName, key to the sort array
    *
    * @param string $action
    *   The action being performed.
@@ -441,6 +442,8 @@ class CRM_Pledge_Selector_Search extends CRM_Core_Selector_Base {
   }
 
   /**
+   * Get sql query string.
+   *
    * @return string
    */
   public function &getQuery() {
index 6e33a0b1da68ebd613acc5702c182deafa68086a..859063d959e311965923e4d722a514e5a48cc927 100644 (file)
@@ -201,7 +201,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
     if (!empty($fieldOptions['is_full'])) {
       $element->freeze();
     }
-    return;
+    return NULL;
   }
 
   /**
@@ -309,7 +309,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
         $priceVal = implode($seperator, array(
             $customOption[$optionKey][$valueFieldName] + $taxAmount,
             $count,
-            $max_value
+            $max_value,
           ));
 
         $extra = array();
@@ -326,7 +326,8 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
         if (!empty($qf->_membershipBlock) && !empty($qf->_quickConfig) && $field->name == 'other_amount' && empty($qf->_contributionAmount)) {
           $useRequired = 0;
         }
-        elseif (!empty($fieldOptions[$optionKey]['label'])) {      //check for label.
+        elseif (!empty($fieldOptions[$optionKey]['label'])) {
+          //check for label.
           $label = $fieldOptions[$optionKey]['label'];
         }
 
@@ -500,7 +501,7 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField {
 
         $element = &$qf->add('select', $elementName, $label,
           array(
-            '' => ts('- select -')
+            '' => ts('- select -'),
           ) + $selectOption,
           $useRequired && $field->is_required,
           array('price' => json_encode($priceVal))
@@ -622,7 +623,7 @@ WHERE
 
     $dao = CRM_Core_DAO::executeQuery($query, array(
         1 => array($optionGroupName, 'String'),
-        2 => array($optionLabel, 'String')
+        2 => array($optionLabel, 'String'),
       ));
 
     while ($dao->fetch()) {
@@ -636,7 +637,7 @@ WHERE
    * @param int $id
    *   Field Id.
    *
-   * @return boolean
+   * @return bool
    *
    */
   public static function deleteField($id) {
@@ -688,7 +689,6 @@ WHERE
    * @param bool $allowNoneSelection
    *
    */
-
   public static function priceSetValidation($priceSetId, $fields, &$error, $allowNoneSelection = FALSE) {
     // check for at least one positive
     // amount price field should be selected.
index e4c82e6cac7cc4d465168a84773b0351119019e5..cc86953868fdbc3ddbf2e2f2cf6f7bfaaa37b432 100644 (file)
@@ -71,10 +71,6 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
 
   /**
    * Set variables up before form is built
-   *
-   * @param null
-   *
-   * @return void
    */
   public function preProcess() {
 
@@ -98,8 +94,6 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
    * 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
    */
@@ -166,10 +160,6 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
 
   /**
    * Build the form object
-   *
-   * @param null
-   *
-   * @return void
    */
   public function buildQuickForm() {
     // lets trim all the whitespace
@@ -291,9 +281,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
         $js = array('onchange' => "calculateRowValues( $i );");
 
         $this->add('select', 'membership_type_id[' . $i . ']', ts('Membership Type'),
-          array(
-            '' => ' '
-          ) + $membershipTypes, FALSE, $js
+          array('' => ' ') + $membershipTypes, FALSE, $js
         );
         $this->add('text', 'membership_num_terms[' . $i . ']', ts('Number of Terms'), CRM_Utils_Array::value('membership_num_terms', $attributes));
       }
@@ -604,10 +592,6 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
 
   /**
    * Process the form
-   *
-   * @param null
-   *
-   * @return void
    */
   public function postProcess() {
     // store the submitted values in an array
index 8d4303359da287ca77bd726280eeacbe7d5792a9..295b5043c1f3c3a9093ab191a7c092a76de34e85 100644 (file)
@@ -361,7 +361,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
         elseif (!empty($this->_multiRecordFields)
           && (!$this->_multiRecord || !in_array($this->_multiRecord, array(
                 CRM_Core_Action::DELETE,
-                CRM_Core_Action::UPDATE
+                CRM_Core_Action::UPDATE,
               )))
         ) {
           CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header');
@@ -667,8 +667,7 @@ class CRM_Profile_Form extends CRM_Core_Form {
         ) {
           $return = TRUE;
           if (!$statusMessage) {
-            $statusMessage =
-              ts("This profile is configured for contact type '%1'. It cannot be used to edit contacts of other types.",
+            $statusMessage = ts("This profile is configured for contact type '%1'. It cannot be used to edit contacts of other types.",
                 array(1 => $profileSubType ? $profileSubType : $profileType));
           }
         }
@@ -965,24 +964,24 @@ class CRM_Profile_Form extends CRM_Core_Form {
             $duplicateContactsLinks = '<div class="matching-contacts-found">';
             $duplicateContactsLinks .= ts('One matching contact was found. ', array(
                 'count' => count($contactLinks['rows']),
-                'plural' => '%count matching contacts were found.<br />'
+                'plural' => '%count matching contacts were found.<br />',
               ));
             if ($contactLinks['msg'] == 'view') {
               $duplicateContactsLinks .= ts('You can View the existing contact.', array(
                   'count' => count($contactLinks['rows']),
-                  'plural' => 'You can View the existing contacts.'
+                  'plural' => 'You can View the existing contacts.',
                 ));
             }
             else {
               $duplicateContactsLinks .= ts('You can View or Edit the existing contact.', array(
                   'count' => count($contactLinks['rows']),
-                  'plural' => 'You can View or Edit the existing contacts.'
+                  'plural' => 'You can View or Edit the existing contacts.',
                 ));
             }
             $duplicateContactsLinks .= '</div>';
             $duplicateContactsLinks .= '<table class="matching-contacts-actions">';
             $row = '';
-            for ($i = 0; $i < sizeof($contactLinks['rows']); $i++) {
+            for ($i = 0; $i < count($contactLinks['rows']); $i++) {
               $row .= '  <tr>   ';
               $row .= '    <td class="matching-contacts-name"> ';
               $row .= $contactLinks['rows'][$i]['display_name'];
index 2816bf2260bb03b2e8bed25d9327f6b1af6db30c..9a48e63a7becfe30b9354456dd6e43ff5ce4af1d 100644 (file)
@@ -129,17 +129,16 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
   /**
    * Class constructor
    *
-   * @param array $params
-   * @param $customFields
-   * @param string params the params for the where clause
-   *
+   * @param array $params the params for the where clause
+   * @param array $customFields
+   * @param array $ufGroupIds
    * @param bool $map
    * @param bool $editLink
    * @param bool $linkToUF
    *
    * @return \CRM_Profile_Selector_Listings
    */
-  function __construct(
+  public function __construct(
     &$params,
     &$customFields,
     $ufGroupIds = NULL,
@@ -274,8 +273,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
    * @param array $params
    */
   public function getPagerParams($action, &$params) {
-    $status =
-      CRM_Utils_System::isNull($this->_multiRecordTableName) ? ts('Contact %%StatusMessage%%') : ts('Contact Multi Records %%StatusMessage%%');
+    $status = CRM_Utils_System::isNull($this->_multiRecordTableName) ? ts('Contact %%StatusMessage%%') : ts('Contact Multi Records %%StatusMessage%%');
     $params['status'] = $status;
     $params['csvString'] = NULL;
     $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
@@ -341,7 +339,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
               if (in_array($fieldName, array(
                 'phone',
                 'im',
-                'email'
+                'email',
               ))) {
                 if ($type) {
                   $name = "`$locationTypeName-$fieldName-$type`";
@@ -552,7 +550,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
             if (in_array($fieldName, array(
               'phone',
               'im',
-              'email'
+              'email',
             ))) {
               if ($type) {
                 $names[] = "{$locationTypeName}-{$fieldName}-{$type}";
@@ -665,14 +663,14 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
         elseif (in_array($name, array(
           'addressee',
           'email_greeting',
-          'postal_greeting'
+          'postal_greeting',
         ))) {
           $dname = $name . '_display';
           $row[] = $result->$dname;
         }
         elseif (in_array($name, array(
           'birth_date',
-          'deceased_date'
+          'deceased_date',
         ))) {
           $row[] = CRM_Utils_Date::customFormat($result->$name);
         }
@@ -771,10 +769,10 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
           }
 
           if ($isSubmitted) {
-            $this->_multiRecordTableName = $multiRecordTableName =
-              CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name');
+            $this->_multiRecordTableName
+              = $multiRecordTableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name');
             if ($multiRecordTableName) {
-              return;
+              return NULL;
             }
           }
 
@@ -786,14 +784,14 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR
     }
 
     if (!isset($customGroupId) || !$customGroupId) {
-      return;
+      return NULL;
     }
 
     //if the field is in selector and not a searchable field
     //get the proper customvalue table name
     if ($selectorSet) {
-      $this->_multiRecordTableName = $multiRecordTableName =
-        CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name');
+      $this->_multiRecordTableName
+        = $multiRecordTableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name');
     }
   } //func close
 }
index 6f66ecfc7bd787b7b24e4e585fdf401c9bd229c0..b519e19181cba7d0a1d9a47dbdac399f22167a72 100644 (file)
@@ -74,7 +74,7 @@ class CRM_Report_Form extends CRM_Core_Form {
 
   /**
    * The set of all columns in the report. An associative array
-   * with column name as the key and attribues as the value
+   * with column name as the key and attributes as the value
    *
    * @var array
    */
@@ -147,9 +147,6 @@ class CRM_Report_Form extends CRM_Core_Form {
   protected $_tagFilter = FALSE;
 
   /**
-   * <<<<<<< HEAD
-   * Build groups filter
-   * =======
    * specify entity table for tags filter
    *
    */
@@ -158,7 +155,7 @@ class CRM_Report_Form extends CRM_Core_Form {
   /**
    * build groups filter
    *
-   * >>>>>>> 098a61330d0fe12153370741ec98cb1172ece849
+   * @var bool
    */
   protected $_groupFilter = FALSE;
 
@@ -207,6 +204,21 @@ class CRM_Report_Form extends CRM_Core_Form {
   protected $_selectAliases = array();
   protected $_rollup = NULL;
 
+  /**
+   * @var array
+   */
+  protected $_aliases = array();
+
+  /**
+   * @var string
+   */
+  protected $_where;
+
+  /**
+   * @var string
+   */
+  protected $_from;
+
   /**
    * SQL Limit clause
    * @var  string
@@ -228,6 +240,9 @@ class CRM_Report_Form extends CRM_Core_Form {
    * @var integer
    */
   protected $_offsetValue = NULL;
+  /**
+   * @var null
+   */
   protected $_sections = NULL;
   protected $_autoIncludeIndexedFieldsAsOrderBys = 0;
   protected $_absoluteUrl = FALSE;
@@ -272,7 +287,7 @@ class CRM_Report_Form extends CRM_Core_Form {
   protected $_selectedTables;
 
   /**
-   * Outputmode e.g 'print', 'csv', 'pdf'
+   * Output mode e.g 'print', 'csv', 'pdf'
    * @var string
    */
   protected $_outputMode;
@@ -306,6 +321,57 @@ class CRM_Report_Form extends CRM_Core_Form {
    */
   protected $_currencyColumn = NULL;
 
+  /**
+   * @var string
+   */
+  protected $_interval;
+
+  /**
+   * @var bool
+   */
+  protected $_sendmail;
+
+  /**
+   * @var int
+   */
+  protected $_chartId;
+
+  /**
+   * @var int
+   */
+  public $_section;
+
+  /**
+   * @var string Report description.
+   */
+  public $_description;
+
+  /**
+   * @var bool Is an address field selected.
+   *   This was intended to determine if the address table should be joined in
+   *   The isTableSelected function is now preferred for this purpose
+   */
+  protected $_addressField;
+
+  /**
+   * @var bool Is an email field selected.
+   *   This was intended to determine if the email table should be joined in
+   *   The isTableSelected function is now preferred for this purpose
+   */
+  protected $_emailField;
+
+  /**
+   * @var bool Is a phone field selected.
+   *   This was intended to determine if the phone table should be joined in
+   *   The isTableSelected function is now preferred for this purpose
+   */
+  protected $_phoneField;
+
+  /**
+   * @var bool Create new report instance? (or update existing) on save.
+   */
+  protected $_createNew;
+
   /**
    */
   public function __construct() {
@@ -356,19 +422,19 @@ class CRM_Report_Form extends CRM_Core_Form {
   }
 
   public function preProcessCommon() {
-    $this->_force =
-      CRM_Utils_Request::retrieve(
-        'force',
-        'Boolean',
-        CRM_Core_DAO::$_nullObject
-      );
+    $this->_force
+      CRM_Utils_Request::retrieve(
+      'force',
+      'Boolean',
+      CRM_Core_DAO::$_nullObject
+    );
 
-    $this->_dashBoardRowCount =
-      CRM_Utils_Request::retrieve(
-        'rowCount',
-        'Integer',
-        CRM_Core_DAO::$_nullObject
-      );
+    $this->_dashBoardRowCount
+      CRM_Utils_Request::retrieve(
+      'rowCount',
+      'Integer',
+      CRM_Core_DAO::$_nullObject
+    );
 
     $this->_section = CRM_Utils_Request::retrieve('section', 'Integer', CRM_Core_DAO::$_nullObject);
 
@@ -481,8 +547,8 @@ class CRM_Report_Form extends CRM_Core_Form {
   }
 
   public function addBreadCrumb() {
-    $breadCrumbs =
-      array(
+    $breadCrumbs
+      array(
         array(
           'title' => ts('Report Templates'),
           'url' => CRM_Utils_System::url('civicrm/admin/report/template/list', 'reset=1'),
@@ -566,8 +632,8 @@ class CRM_Report_Form extends CRM_Core_Form {
             }
 
             // set alias = table-name, unless already set
-            $alias = isset($field['alias']) ? $field['alias'] : (isset($this->_columns[$tableName]['alias']) ?
-              $this->_columns[$tableName]['alias'] : $tableName
+            $alias = isset($field['alias']) ? $field['alias'] : (
+              isset($this->_columns[$tableName]['alias']) ? $this->_columns[$tableName]['alias'] : $tableName
             );
             $this->_columns[$tableName][$fieldGrp][$fieldName]['alias'] = $alias;
 
@@ -578,8 +644,8 @@ class CRM_Report_Form extends CRM_Core_Form {
 
             // set dbAlias = alias.name, unless already set
             if (!isset($this->_columns[$tableName][$fieldGrp][$fieldName]['dbAlias'])) {
-              $this->_columns[$tableName][$fieldGrp][$fieldName]['dbAlias'] =
-                $alias . '.' .
+              $this->_columns[$tableName][$fieldGrp][$fieldName]['dbAlias']
+                $alias . '.' .
                 $this->_columns[$tableName][$fieldGrp][$fieldName]['name'];
             }
 
@@ -604,8 +670,8 @@ class CRM_Report_Form extends CRM_Core_Form {
                   case CRM_Utils_Type::T_BOOLEAN:
                     $this->_columns[$tableName][$fieldGrp][$fieldName]['operatorType'] = CRM_Report_Form::OP_SELECT;
                     if (!array_key_exists('options', $this->_columns[$tableName][$fieldGrp][$fieldName])) {
-                      $this->_columns[$tableName][$fieldGrp][$fieldName]['options'] =
-                        array(
+                      $this->_columns[$tableName][$fieldGrp][$fieldName]['options']
+                        array(
                           '' => ts('Any'),
                           '0' => ts('No'),
                           '1' => ts('Yes'),
@@ -809,7 +875,7 @@ class CRM_Report_Form extends CRM_Core_Form {
   }
 
   /**
-   * @param $group
+   * @param string $group
    * @param string $grpFieldName
    *
    * @return bool
@@ -836,10 +902,10 @@ class CRM_Report_Form extends CRM_Core_Form {
   /**
    * Setter for $_id
    *
-   * @param int $instanceid
+   * @param int $instanceID
    */
-  public function setID($instanceid) {
-    $this->_id = $instanceid;
+  public function setID($instanceID) {
+    $this->_id = $instanceID;
   }
 
   /**
@@ -1104,10 +1170,8 @@ class CRM_Report_Form extends CRM_Core_Form {
         }
       }
 
-      /* Add searchable custom fields as order-by options, if so requested
-       * (These are already indexed, so allowing to order on them is cheap.)
-       */
-
+      // Add searchable custom fields as order-by options, if so requested
+      // (These are already indexed, so allowing to order on them is cheap.)
 
       if ($this->_autoIncludeIndexedFieldsAsOrderBys &&
         array_key_exists('extends', $table) && !empty($table['extends'])
@@ -1126,8 +1190,8 @@ class CRM_Report_Form extends CRM_Core_Form {
 
     if (!empty($options)) {
       $options = array(
-          '-' => ' - none - ',
-        ) + $options;
+        '-' => ' - none - ',
+      ) + $options;
       for ($i = 1; $i <= 5; $i++) {
         $this->addElement('select', "order_bys[{$i}][column]", ts('Order by Column'), $options);
         $this->addElement('select', "order_bys[{$i}][order]", ts('Order by Order'), array(
@@ -1214,10 +1278,10 @@ class CRM_Report_Form extends CRM_Core_Form {
   }
 
   /**
-   * a formrule function to ensure that fields selected in group_by
+   * A form rule function to ensure that fields selected in group_by
    * (if any) should only be the ones present in display/select fields criteria;
    * note: works if and only if any custom field selected in group_by.
-   * @param $fields
+   * @param array $fields
    * @param array $ignoreFields
    *
    * @return array
@@ -1258,7 +1322,7 @@ class CRM_Report_Form extends CRM_Core_Form {
    * Note: $fieldName param allows inheriting class to build operationPairs
    * specific to a field.
    * @param string $type
-   * @param null $fieldName
+   * @param string $fieldName
    *
    * @return array
    */
@@ -1342,7 +1406,7 @@ class CRM_Report_Form extends CRM_Core_Form {
   }
 
   /**
-   * Adds group filters to _columns (called from _Constuct
+   * Adds group filters to _columns (called from _Construct
    */
   public function buildGroupFilter() {
     $this->_columns['civicrm_group']['filters'] = array(
@@ -1410,18 +1474,18 @@ class CRM_Report_Form extends CRM_Core_Form {
   }
 
   /**
-   * @param $field
-   * @param $op
-   * @param $value
-   * @param $min
-   * @param $max
+   * Generate where clause.
+   * This can be overridden in reports for special treatment of a field
+   *
+   * @param array $field Field specifications
+   * @param string $op Query operator (not an exact match to sql)
+   * @param mixed $value
+   * @param float $min
+   * @param float $max
    *
    * @return null|string
    */
-  function whereClause(
-    &$field, $op,
-    $value, $min, $max
-  ) {
+  public function whereClause(&$field, $op, $value, $min, $max) {
 
     $type = CRM_Utils_Type::typeToString(CRM_Utils_Array::value('type', $field));
     $clause = NULL;
@@ -1488,12 +1552,12 @@ class CRM_Report_Form extends CRM_Core_Form {
           if (CRM_Utils_Array::value('type', $field) ==
             CRM_Utils_Type::T_STRING
           ) {
-            //cycle through selections and esacape values
+            //cycle through selections and escape values
             foreach ($value as $key => $selection) {
               $value[$key] = CRM_Utils_Type::escape($selection, $type);
             }
-            $clause =
-              "( {$field['dbAlias']} $sqlOP ( '" . implode("' , '", $value) .
+            $clause
+              "( {$field['dbAlias']} $sqlOP ( '" . implode("' , '", $value) .
               "') )";
           }
           else {
@@ -1514,8 +1578,8 @@ class CRM_Report_Form extends CRM_Core_Form {
         // mhas == multiple has
         if ($value !== NULL && count($value) > 0) {
           $sqlOP = $this->getSQLOperator($op);
-          $clause =
-            "{$field['dbAlias']} REGEXP '[[:<:]]" . implode('|', $value) .
+          $clause
+            "{$field['dbAlias']} REGEXP '[[:<:]]" . implode('|', $value) .
             "[[:>:]]'";
         }
         break;
@@ -1524,8 +1588,8 @@ class CRM_Report_Form extends CRM_Core_Form {
         // mnot == multiple is not one of
         if ($value !== NULL && count($value) > 0) {
           $sqlOP = $this->getSQLOperator($op);
-          $clause =
-            "( {$field['dbAlias']} NOT REGEXP '[[:<:]]" . implode('|', $value) .
+          $clause
+            "( {$field['dbAlias']} NOT REGEXP '[[:<:]]" . implode('|', $value) .
             "[[:>:]]' OR {$field['dbAlias']} IS NULL )";
         }
         break;
@@ -1585,10 +1649,10 @@ class CRM_Report_Form extends CRM_Core_Form {
       $clause = $this->whereTagClause($field, $value, $op);
     }
     elseif (!empty($field['membership_org']) && $clause) {
-      $clause = $this->whereMembershipOrgClause($field, $value, $op);
+      $clause = $this->whereMembershipOrgClause($value, $op);
     }
     elseif (!empty($field['membership_type']) && $clause) {
-      $clause = $this->whereMembershipTypeClause($field, $value, $op);
+      $clause = $this->whereMembershipTypeClause($value, $op);
     }
     return $clause;
   }
@@ -1596,15 +1660,15 @@ class CRM_Report_Form extends CRM_Core_Form {
   /**
    * @param string $fieldName
    * @param $relative
-   * @param $from
-   * @param $to
+   * @param string $from
+   * @param string $to
    * @param null $type
    * @param null $fromTime
    * @param null $toTime
    *
    * @return null|string
    */
-  function dateClause(
+  public function dateClause(
     $fieldName,
     $relative, $from, $to, $type = NULL, $fromTime = NULL, $toTime = NULL
   ) {
@@ -1636,7 +1700,7 @@ class CRM_Report_Form extends CRM_Core_Form {
   /**
    * @todo - could not find any instances where this is called
    *
-   * @param unknown_type $relative
+   * @param bool $relative
    * @param string $from
    * @param string_type $to
    *
@@ -1667,17 +1731,17 @@ class CRM_Report_Form extends CRM_Core_Form {
   }
 
   /**
-   * @param $relative
-   * @param $from
-   * @param $to
-   * @param null $fromtime
-   * @param null $totime
+   * @param bool $relative
+   * @param string $from
+   * @param string $to
+   * @param string $fromTime
+   * @param string $toTime
    *
    * @return array
    */
-  public function getFromTo($relative, $from, $to, $fromtime = NULL, $totime = NULL) {
-    if (empty($totime)) {
-      $totime = '235959';
+  public function getFromTo($relative, $from, $to, $fromTime = NULL, $toTime = NULL) {
+    if (empty($toTime)) {
+      $toTime = '235959';
     }
     //FIX ME not working for relative
     if ($relative) {
@@ -1687,8 +1751,8 @@ class CRM_Report_Form extends CRM_Core_Form {
       //Take only Date Part, Sometime Time part is also present in 'to'
       $to = substr($dateRange['to'], 0, 8);
     }
-    $from = CRM_Utils_Date::processDate($from, $fromtime);
-    $to = CRM_Utils_Date::processDate($to, $totime);
+    $from = CRM_Utils_Date::processDate($from, $fromTime);
+    $to = CRM_Utils_Date::processDate($to, $toTime);
     return array($from, $to);
   }
 
@@ -1774,7 +1838,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
    * @param $customField
    * @param $fieldValueMap
    *
-   * @return float|string
+   * @return float|string|void
    */
   public function formatCustomValues($value, $customField, $fieldValueMap) {
     if (CRM_Utils_System::isNull($value)) {
@@ -1812,8 +1876,6 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
         }
       case 'Money':
         if ($htmlType == 'Text') {
-
-
           $retValue = CRM_Utils_Money::format($value, NULL, '%a');
           break;
         }
@@ -1922,7 +1984,6 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
   public function fixSubTotalDisplay(&$row, $fields, $subtotal = TRUE) {
     foreach ($row as $colName => $colVal) {
       if (in_array($colName, $fields)) {
-        $row[$colName] = $row[$colName];
       }
       elseif (isset($this->_columnHeaders[$colName])) {
         if ($subtotal) {
@@ -2025,6 +2086,10 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
   // select() method below has been added recently (v3.3), and many of the report templates might
   // still be having their own select() method. We should fix them as and when encountered and move
   // towards generalizing the select() method below.
+
+  /**
+   * Generate the SELECT clause and set class variable $_select
+   */
   public function select() {
     $select = $this->_selectAliases = array();
 
@@ -2165,8 +2230,8 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
             // for graphs and charts -
             if (!empty($this->_params['group_bys_freq'][$fieldName])) {
               $this->_interval = $field['title'];
-              $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['title'] =
-                $field['title'] . ' Beginning';
+              $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['title']
+                $field['title'] . ' Beginning';
               $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['type'] = $field['type'];
               $this->_columnHeaders["{$tableName}_{$fieldName}_start"]['group_by'] = $this->_params['group_bys_freq'][$fieldName];
 
@@ -2241,8 +2306,8 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
               $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);
               $value = CRM_Utils_Array::value("{$fieldName}_value", $this->_params);
               if (is_array($value) && !empty($value)) {
-                $clause =
-                  "(month({$field['dbAlias']}) $op (" . implode(', ', $value) .
+                $clause
+                  "(month({$field['dbAlias']}) $op (" . implode(', ', $value) .
                   '))';
               }
             }
@@ -2290,8 +2355,8 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
       CRM_Core_DAO::$_nullObject
     );
 
-    $this->_sendmail =
-      CRM_Utils_Request::retrieve(
+    $this->_sendmail
+      CRM_Utils_Request::retrieve(
         'sendmail',
         'Boolean',
         CRM_Core_DAO::$_nullObject
@@ -2460,7 +2525,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
       !empty($this->_params['order_bys'])
     ) {
 
-      // Proces order_bys in user-specified order
+      // Process order_bys in user-specified order
       foreach ($this->_params['order_bys'] as $orderBy) {
         $orderByField = array();
         foreach ($this->_columns as $tableName => $table) {
@@ -2586,11 +2651,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
         $ifnulls[] = "ifnull($alias, '') as $alias";
       }
 
-      /* Group (un-limited) report by all aliases and get counts. This might
-       * be done more efficiently when the contents of $sql are known, ie. by
-       * overriding this method in the report class.
-       */
-
+      // Group (un-limited) report by all aliases and get counts. This might
+      // be done more efficiently when the contents of $sql are known, ie. by
+      // overriding this method in the report class.
 
       $query = "select " . implode(", ", $ifnulls) .
         ", count(*) as ct from ($sql) as subquery group by " .
@@ -2717,8 +2780,8 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
             CRM_Utils_Array::value('operatorType', $field) !=
             CRM_Report_Form::OP_MONTH
           ) {
-            list($from, $to) =
-              $this->getFromTo(
+            list($from, $to)
+              $this->getFromTo(
                 CRM_Utils_Array::value("{$fieldName}_relative", $this->_params),
                 CRM_Utils_Array::value("{$fieldName}_from", $this->_params),
                 CRM_Utils_Array::value("{$fieldName}_to", $this->_params),
@@ -2833,8 +2896,8 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
         $attachments = array();
 
         if ($this->_outputMode == 'csv') {
-          $content =
-            $this->_formValues['report_header'] . '<p>' . ts('Report URL') .
+          $content
+            $this->_formValues['report_header'] . '<p>' . ts('Report URL') .
             ": {$url}</p>" . '<p>' .
             ts('The report is attached as a CSV file.') . '</p>' .
             $this->_formValues['report_footer'];
@@ -2859,8 +2922,8 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
             )
           );
           // generate Email Content
-          $content =
-            $this->_formValues['report_header'] . '<p>' . ts('Report URL') .
+          $content
+            $this->_formValues['report_header'] . '<p>' . ts('Report URL') .
             ": {$url}</p>" . '<p>' .
             ts('The report is attached as a PDF file.') . '</p>' .
             $this->_formValues['report_footer'];
@@ -2892,17 +2955,17 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
           //get chart image name
           $chartImg = $this->_chartId . '.png';
           //get image url path
-          $uploadUrl =
-            str_replace('/persist/contribute/', '/persist/', $config->imageUploadURL) .
+          $uploadUrl
+            str_replace('/persist/contribute/', '/persist/', $config->imageUploadURL) .
             'openFlashChart/';
           $uploadUrl .= $chartImg;
           //get image doc path to overwrite
-          $uploadImg =
-            str_replace('/persist/contribute/', '/persist/', $config->imageUploadDir) .
+          $uploadImg
+            str_replace('/persist/contribute/', '/persist/', $config->imageUploadDir) .
             'openFlashChart/' . $chartImg;
           //Load the image
           $chart = imagecreatefrompng($uploadUrl);
-          //convert it into formattd png
+          //convert it into formatted png
           header('Content-type: image/png');
           //overwrite with same image
           imagepng($chart, $uploadImg);
@@ -2931,6 +2994,10 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
     }
   }
 
+  /**
+   * Set store result set indicator to TRUE
+   * @todo explain what this does
+   */
   public function storeResultSet() {
     $this->_storeResultSet = TRUE;
   }
@@ -3009,12 +3076,14 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
 
       $pageId = CRM_Utils_Request::retrieve('crmPID', 'Integer', CRM_Core_DAO::$_nullObject);
 
+      // @todo all http vars should be extracted in the preProcess
+      // - not randomly in the class
       if (!$pageId && !empty($_POST)) {
         if (isset($_POST['PagerBottomButton']) && isset($_POST['crmPID_B'])) {
-          $pageId = max((int) @$_POST['crmPID_B'], 1);
+          $pageId = max((int) $_POST['crmPID_B'], 1);
         }
         elseif (isset($_POST['PagerTopButton']) && isset($_POST['crmPID'])) {
-          $pageId = max((int) @$_POST['crmPID'], 1);
+          $pageId = max((int) $_POST['crmPID'], 1);
         }
         unset($_POST['crmPID_B'], $_POST['crmPID']);
       }
@@ -3137,7 +3206,15 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
                           WHERE entity_table = '$entity_table' AND {$clause} ) ";
   }
 
-  public function whereMembershipOrgClause($field, $value, $op) {
+  /**
+   * Generate membership organization clause.
+   *
+   * @param mixed $value
+   * @param string $op SQL Operator
+   *
+   * @return string
+   */
+  public function whereMembershipOrgClause($value, $op) {
     $sqlOp = $this->getSQLOperator($op);
     if (!is_array($value)) {
       $value = array($value);
@@ -3156,7 +3233,15 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND
                           AND mem_status.is_active = '1' )  ";
   }
 
-  public function whereMembershipTypeClause($field, $value, $op) {
+  /**
+   * Generate Membership Type SQL Clause
+   * @param mixed $value
+   * @param string $op
+   *
+   * @return string
+   *   SQL query string
+   */
+  public function whereMembershipTypeClause($value, $op) {
     $sqlOp = $this->getSQLOperator($op);
     if (!is_array($value)) {
       $value = array($value);
@@ -3495,6 +3580,8 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a
   /**
    * Check for empty order_by configurations and remove them; also set
    * template to hide them.
+   *
+   * @param array $formValues
    */
   public function preProcessOrderBy(&$formValues) {
     // Object to show/hide form elements
@@ -3548,8 +3635,8 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a
    * Fetch array of DAO tables having columns included in SELECT or ORDER BY clause
    * (building the array if it's unset)
    *
-   * @return Array
-   *   >_selectedTables
+   * @return array
+   *   selectedTables
    */
   public function selectedTables() {
     if (!$this->_selectedTables) {
@@ -3980,8 +4067,8 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a
 
       // prepare the directory
       $config = CRM_Core_Config::singleton();
-      $defaultPath =
-        str_replace('/persist/contribute/', '/persist/', $config->imageUploadDir) .
+      $defaultPath
+        str_replace('/persist/contribute/', '/persist/', $config->imageUploadDir) .
         '/openFlashChart/';
       if (!file_exists($defaultPath)) {
         mkdir($defaultPath, 0777, TRUE);
index efb7f9da5e17778e58d3bcf9888e8485ba129ec3..b97050596e77fef977f31ba6ce654ea405cf4fa8 100644 (file)
@@ -512,8 +512,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form {
                         LEFT JOIN civicrm_activity civireport_activity_all_{$activityType} ON ( civireport_activity_all_{$activityType}.id = civireport_case_activity_all_{$activityType}.activity_id AND civireport_activity_all_{$activityType}.activity_type_id = {$activityType})";
 
       $this->_columnHeaders['case_activity_all_dates'] = array(
-        'title' => $this->_caseDetailExtra['case_activity_all_dates']['title'] .
-          ": {$this->caseActivityTypes[$activityType]}",
+        'title' => $this->_caseDetailExtra['case_activity_all_dates']['title'] . ": {$this->caseActivityTypes[$activityType]}",
         'type' => CRM_Utils_Array::value('type', $this->_caseDetailExtra['case_activity_all_dates']),
       );
     }
index 842841c73c741dd2d28fdaa018f01d7709bd7783..cbb686ca214dc585e3a4a218d5e259cf77919168 100644 (file)
@@ -407,8 +407,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
 
     foreach ($this->_component as $val) {
       if (!empty($select[$val])) {
-        $this->_selectComponent[$val] =
-          "SELECT " . implode(', ', $select[$val]) . " ";
+        $this->_selectComponent[$val] = "SELECT " . implode(', ', $select[$val]) . " ";
         unset($select[$val]);
       }
     }
@@ -784,15 +783,12 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
 
       //unset Conmponent id and contact id from display
       foreach ($this->_columnHeadersComponent as $componentTitle => $headers) {
-        $id_header =
-          'civicrm_' . substr_replace($componentTitle, '', -11, 11) . '_' .
+        $id_header = 'civicrm_' . substr_replace($componentTitle, '', -11, 11) . '_' .
           substr_replace($componentTitle, '', -11, 11) . '_id';
-        $contact_header =
-          'civicrm_' . substr_replace($componentTitle, '', -11, 11) .
+        $contact_header = 'civicrm_' . substr_replace($componentTitle, '', -11, 11) .
           '_contact_id';
         if ($componentTitle == 'activity_civireport') {
-          $id_header =
-            'civicrm_' . substr_replace($componentTitle, '', -11, 11) . '_id';
+          $id_header = 'civicrm_' . substr_replace($componentTitle, '', -11, 11) . '_id';
         }
 
         unset($this->_columnHeadersComponent[$componentTitle][$id_header]);
@@ -862,8 +858,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form {
           // handle contribution
           if ($component == 'contribution_civireport') {
             if ($val = CRM_Utils_Array::value('civicrm_contribution_financial_type_id', $row)) {
-              $componentRows[$contactID][$component][$rowNum]['civicrm_contribution_financial_type_id'] =
-                CRM_Contribute_PseudoConstant::financialType($val, FALSE);
+              $componentRows[$contactID][$component][$rowNum]['civicrm_contribution_financial_type_id'] = CRM_Contribute_PseudoConstant::financialType($val, FALSE);
             }
 
             if ($val = CRM_Utils_Array::value('civicrm_contribution_contribution_status_id', $row)) {
index 3422bdc2c9102153a2800731b41d02b9ceb757f0..ddf5cea27248887b501cbe9cefdcd0cb084662fb 100644 (file)
@@ -36,7 +36,7 @@ class CRM_Report_Form_Contact_LoggingDetail extends CRM_Logging_ReportDetail {
   /**
    */
   public function __construct() {
-    $logging = new CRM_Logging_Schema;
+    $logging = new CRM_Logging_Schema();
     $this->tables[] = 'civicrm_contact';
     $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables()));
     $this->tables[] = 'civicrm_email';
index 0f67ecbff30762e4d5952b51a17858291e468260..d8b46dc0559902aa53b73dc3951fe10e2d811c71 100644 (file)
@@ -223,9 +223,9 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
             'title' => ts('Relationship'),
             'operatorType' => CRM_Report_Form::OP_SELECT,
             'options' => array(
-                '' => '- any relationship type -',
-              ) +
-              CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, NULL, TRUE),
+              '' => '- any relationship type -',
+            ) +
+            CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, NULL, TRUE),
             'type' => CRM_Utils_Type::T_INT,
           ),
         ),
@@ -587,8 +587,8 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
           'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_id'],
           $this->_absoluteUrl, $this->_id, $this->_drilldownReport
         );
-        $rows[$rowNum]['civicrm_contact_sort_name_a'] =
-          $rows[$rowNum]['civicrm_contact_sort_name_a'] . ' (' .
+        $rows[$rowNum]['civicrm_contact_sort_name_a']
+          $rows[$rowNum]['civicrm_contact_sort_name_a'] . ' (' .
           $rows[$rowNum]['civicrm_contact_id'] . ')';
         $rows[$rowNum]['civicrm_contact_sort_name_a_link'] = $url;
         $rows[$rowNum]['civicrm_contact_sort_name_a_hover'] = ts("View Contact details for this contact.");
@@ -602,8 +602,8 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
           'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_b_id'],
           $this->_absoluteUrl, $this->_id, $this->_drilldownReport
         );
-        $rows[$rowNum]['civicrm_contact_b_sort_name_b'] =
-          $rows[$rowNum]['civicrm_contact_b_sort_name_b'] . ' (' .
+        $rows[$rowNum]['civicrm_contact_b_sort_name_b']
+          $rows[$rowNum]['civicrm_contact_b_sort_name_b'] . ' (' .
           $rows[$rowNum]['civicrm_contact_b_id'] . ')';
         $rows[$rowNum]['civicrm_contact_b_sort_name_b_link'] = $url;
         $rows[$rowNum]['civicrm_contact_b_sort_name_b_hover'] = ts("View Contact details for this contact.");
@@ -613,8 +613,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form {
       if (array_key_exists('civicrm_relationship_relationship_id', $row) &&
         array_key_exists('civicrm_contact_id', $row)
       ) {
-        $url =
-          "/civicrm/contact/view/rel?reset=1&action=update&rtype=a_b&cid=" .
+        $url = "/civicrm/contact/view/rel?reset=1&action=update&rtype=a_b&cid=" .
           $row['civicrm_contact_id'] . "&id=" .
           $row['civicrm_relationship_relationship_id'];
         $rows[$rowNum]['civicrm_relationship_relationship_id_link'] = $url;
index 279ad17deeb79abbff936a2b43eba30507f8f468..cb5140fc8397941371d5674ea06c762b95be0c4f 100644 (file)
@@ -34,7 +34,7 @@
  */
 class CRM_Report_Form_Contact_Summary extends CRM_Report_Form {
 
-  protected $_summary = NULL;
+  public $_summary = NULL;
 
   protected $_emailField = FALSE;
 
@@ -54,108 +54,108 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form {
   public function __construct() {
     $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
     $this->_columns = array(
-        'civicrm_contact' => array(
-          'dao' => 'CRM_Contact_DAO_Contact',
-          'fields' => array(
-            'sort_name' => array(
-              'title' => ts('Contact Name'),
-              'required' => TRUE,
-              'no_repeat' => TRUE,
-            ),
-            'first_name' => array(
-              'title' => ts('First Name'),
-            ),
-            'middle_name' => array(
-              'title' => ts('Middle Name'),
-            ),
-            'last_name' => array(
-              'title' => ts('Last Name'),
-            ),
-            'id' => array(
-              'no_display' => TRUE,
-              'required' => TRUE,
-            ),
-            'contact_type' => array(
-              'title' => ts('Contact Type'),
-            ),
-            'contact_sub_type' => array(
-              'title' => ts('Contact Subtype'),
-            ),
-            'gender_id' => array(
-              'title' => ts('Gender'),
-            ),
-            'birth_date' => array(
-              'title' => ts('Birth Date'),
-            ),
-            'age' => array(
-              'title' => ts('Age'),
-              'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
-            ),
+      'civicrm_contact' => array(
+        'dao' => 'CRM_Contact_DAO_Contact',
+        'fields' => array(
+          'sort_name' => array(
+            'title' => ts('Contact Name'),
+            'required' => TRUE,
+            'no_repeat' => TRUE,
           ),
-          'filters' => array(
-            'sort_name' => array('title' => ts('Contact Name')),
-            'source' => array(
-              'title' => ts('Contact Source'),
-              'type' => CRM_Utils_Type::T_STRING,
-            ),
-            'id' => array(
-              'title' => ts('Contact ID'),
-              'no_display' => TRUE,
-            ),
-            'gender_id' => array(
-              'title' => ts('Gender'),
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
-            ),
-            'birth_date' => array(
-              'title' => ts('Birth Date'),
-              'operatorType' => CRM_Report_Form::OP_DATE,
-            ),
+          'first_name' => array(
+            'title' => ts('First Name'),
           ),
-          'grouping' => 'contact-fields',
-          'order_bys' => array(
-            'sort_name' => array(
-              'title' => ts('Last Name, First Name'),
-              'default' => '1',
-              'default_weight' => '0',
-              'default_order' => 'ASC',
-            ),
-            'gender_id' => array(
-              'name' => 'gender_id',
-              'title' => ts('Gender'),
-            ),
-            'birth_date' => array(
-              'name' => 'birth_date',
-              'title' => ts('Birth Date'),
-            ),
+          'middle_name' => array(
+            'title' => ts('Middle Name'),
+          ),
+          'last_name' => array(
+            'title' => ts('Last Name'),
+          ),
+          'id' => array(
+            'no_display' => TRUE,
+            'required' => TRUE,
+          ),
+          'contact_type' => array(
+            'title' => ts('Contact Type'),
+          ),
+          'contact_sub_type' => array(
+            'title' => ts('Contact Subtype'),
+          ),
+          'gender_id' => array(
+            'title' => ts('Gender'),
+          ),
+          'birth_date' => array(
+            'title' => ts('Birth Date'),
+          ),
+          'age' => array(
+            'title' => ts('Age'),
+            'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
           ),
         ),
-        'civicrm_email' => array(
-          'dao' => 'CRM_Core_DAO_Email',
-          'fields' => array(
-            'email' => array(
-              'title' => ts('Email'),
-              'no_repeat' => TRUE,
-            ),
+        'filters' => array(
+          'sort_name' => array('title' => ts('Contact Name')),
+          'source' => array(
+            'title' => ts('Contact Source'),
+            'type' => CRM_Utils_Type::T_STRING,
+          ),
+          'id' => array(
+            'title' => ts('Contact ID'),
+            'no_display' => TRUE,
+          ),
+          'gender_id' => array(
+            'title' => ts('Gender'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
           ),
-          'grouping' => 'contact-fields',
-          'order_bys' => array(
-            'email' => array(
-              'title' => ts('Email'),
-            ),
+          'birth_date' => array(
+            'title' => ts('Birth Date'),
+            'operatorType' => CRM_Report_Form::OP_DATE,
+          ),
+        ),
+        'grouping' => 'contact-fields',
+        'order_bys' => array(
+          'sort_name' => array(
+            'title' => ts('Last Name, First Name'),
+            'default' => '1',
+            'default_weight' => '0',
+            'default_order' => 'ASC',
+          ),
+          'gender_id' => array(
+            'name' => 'gender_id',
+            'title' => ts('Gender'),
+          ),
+          'birth_date' => array(
+            'name' => 'birth_date',
+            'title' => ts('Birth Date'),
+          ),
+        ),
+      ),
+      'civicrm_email' => array(
+        'dao' => 'CRM_Core_DAO_Email',
+        'fields' => array(
+          'email' => array(
+            'title' => ts('Email'),
+            'no_repeat' => TRUE,
+          ),
+        ),
+        'grouping' => 'contact-fields',
+        'order_bys' => array(
+          'email' => array(
+            'title' => ts('Email'),
           ),
         ),
-        'civicrm_phone' => array(
-          'dao' => 'CRM_Core_DAO_Phone',
-          'fields' => array(
-            'phone' => NULL,
-            'phone_ext' => array(
-              'title' => ts('Phone Extension'),
-            ),
+      ),
+      'civicrm_phone' => array(
+        'dao' => 'CRM_Core_DAO_Phone',
+        'fields' => array(
+          'phone' => NULL,
+          'phone_ext' => array(
+            'title' => ts('Phone Extension'),
           ),
-          'grouping' => 'contact-fields',
         ),
-      ) + $this->getAddressColumns(array('group_by' => FALSE));
+        'grouping' => 'contact-fields',
+      ),
+    ) + $this->getAddressColumns(array('group_by' => FALSE));
 
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
index 9ae238833fc25203ab98dde10ed3886ded362c23..686e0d92e7674c2a12c6a5b6a1b9b56483b7834f 100644 (file)
@@ -80,131 +80,131 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form {
     }
 
     $this->_columns = array(
-        'civicrm_contact' => array(
-          'dao' => 'CRM_Contact_DAO_Contact',
-          'fields' => array(
-            'sort_name' => array(
-              'title' => ts('Contact Name'),
-              'default' => TRUE,
-              'required' => TRUE,
-              'no_repeat' => TRUE,
-            ),
-            'id' => array(
-              'no_display' => TRUE,
-              'default' => TRUE,
-              'required' => TRUE,
-            ),
-            'contact_type' => array(
-              'title' => ts('Contact Type'),
-            ),
-            'contact_sub_type' => array(
-              'title' => ts('Contact Subtype'),
-            ),
+      'civicrm_contact' => array(
+        'dao' => 'CRM_Contact_DAO_Contact',
+        'fields' => array(
+          'sort_name' => array(
+            'title' => ts('Contact Name'),
+            'default' => TRUE,
+            'required' => TRUE,
+            'no_repeat' => TRUE,
           ),
-          'grouping' => 'contact-fields',
-          'filters' => array(
-            'sort_name' => array('title' => ts('Contact Name')),
-            'id' => array(
-              'title' => ts('Contact ID'),
-              'no_display' => TRUE,
-            ),
+          'id' => array(
+            'no_display' => TRUE,
+            'default' => TRUE,
+            'required' => TRUE,
+          ),
+          'contact_type' => array(
+            'title' => ts('Contact Type'),
+          ),
+          'contact_sub_type' => array(
+            'title' => ts('Contact Subtype'),
           ),
         ),
-        'civicrm_email' => array(
-          'dao' => 'CRM_Core_DAO_Email',
-          'fields' => array(
-            'email' => array(
-              'title' => ts('Email'),
-              'no_repeat' => TRUE,
-            ),
+        'grouping' => 'contact-fields',
+        'filters' => array(
+          'sort_name' => array('title' => ts('Contact Name')),
+          'id' => array(
+            'title' => ts('Contact ID'),
+            'no_display' => TRUE,
           ),
-          'grouping' => 'contact-fields',
         ),
-        'civicrm_phone' => array(
-          'dao' => 'CRM_Core_DAO_Phone',
-          'fields' => array(
-            'phone' => array(
-              'title' => ts('Phone'),
-              'no_repeat' => TRUE,
-            ),
+      ),
+      'civicrm_email' => array(
+        'dao' => 'CRM_Core_DAO_Email',
+        'fields' => array(
+          'email' => array(
+            'title' => ts('Email'),
+            'no_repeat' => TRUE,
           ),
-          'grouping' => 'contact-fields',
         ),
-      ) + $this->addAddressFields(FALSE, FALSE, FALSE, array()) + array(
-        'civicrm_relationship' => array(
-          'dao' => 'CRM_Contact_DAO_Relationship',
-          'fields' => array(
-            'relationship_type_id' => array(
-              'title' => ts('Relationship Type'),
-              'default' => TRUE,
-            ),
-            'contact_id_a' => array('no_display' => TRUE),
-            'contact_id_b' => array('no_display' => TRUE),
+        'grouping' => 'contact-fields',
+      ),
+      'civicrm_phone' => array(
+        'dao' => 'CRM_Core_DAO_Phone',
+        'fields' => array(
+          'phone' => array(
+            'title' => ts('Phone'),
+            'no_repeat' => TRUE,
           ),
-          'filters' => array(
-            'relationship_type_id' => array(
-              'title' => ts('Relationship Type'),
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => $relationTypeOp,
-              'type' => CRM_Utils_Type::T_STRING,
-            ),
+        ),
+        'grouping' => 'contact-fields',
+      ),
+    ) + $this->addAddressFields(FALSE, FALSE, FALSE, array()) + array(
+      'civicrm_relationship' => array(
+        'dao' => 'CRM_Contact_DAO_Relationship',
+        'fields' => array(
+          'relationship_type_id' => array(
+            'title' => ts('Relationship Type'),
+            'default' => TRUE,
           ),
+          'contact_id_a' => array('no_display' => TRUE),
+          'contact_id_b' => array('no_display' => TRUE),
         ),
-      ) + array(
-        'civicrm_contribution' => array(
-          'dao' => 'CRM_Contribute_DAO_Contribution',
-          'fields' => array(
-            'total_amount' => array(
-              'title' => ts('Amount Statistics'),
-              'default' => TRUE,
-              'required' => TRUE,
-              'no_display' => TRUE,
-              'statistics' => array('sum' => ts('Aggregate Amount')),
-            ),
-            'receive_date' => array(
-              'required' => TRUE,
-              'default' => TRUE,
-              'no_display' => TRUE,
-            ),
+        'filters' => array(
+          'relationship_type_id' => array(
+            'title' => ts('Relationship Type'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => $relationTypeOp,
+            'type' => CRM_Utils_Type::T_STRING,
           ),
-          'grouping' => 'contri-fields',
-          'filters' => array(
-            'this_year' => array(
-              'title' => ts('This Year'),
-              'operatorType' => CRM_Report_Form::OP_SELECT,
-              'options' => $optionYear,
-              'default' => '',
-            ),
-            'other_year' => array(
-              'title' => ts('Other Years'),
-              'operatorType' => CRM_Report_Form::OP_SELECT,
-              'options' => $optionYear,
-              'default' => '',
-            ),
-            'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
-            'contribution_status_id' => array(
-              'title' => ts('Contribution Status'),
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
-              'default' => array(1),
-            ),
-            'financial_type_id' => array(
-              'title' => ts('Financial Type'),
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Contribute_PseudoConstant::financialType(),
-            ),
-            'total_amount' => array(
-              'title' => ts('Contribution Amount'),
-            ),
-            'total_sum' => array(
-              'title' => ts('Aggregate Amount'),
-              'type' => CRM_Report_Form::OP_INT,
-              'dbAlias' => 'civicrm_contribution_total_amount_sum',
-              'having' => TRUE,
-            ),
+        ),
+      ),
+    ) + array(
+      'civicrm_contribution' => array(
+        'dao' => 'CRM_Contribute_DAO_Contribution',
+        'fields' => array(
+          'total_amount' => array(
+            'title' => ts('Amount Statistics'),
+            'default' => TRUE,
+            'required' => TRUE,
+            'no_display' => TRUE,
+            'statistics' => array('sum' => ts('Aggregate Amount')),
+          ),
+          'receive_date' => array(
+            'required' => TRUE,
+            'default' => TRUE,
+            'no_display' => TRUE,
           ),
         ),
-      );
+        'grouping' => 'contri-fields',
+        'filters' => array(
+          'this_year' => array(
+            'title' => ts('This Year'),
+            'operatorType' => CRM_Report_Form::OP_SELECT,
+            'options' => $optionYear,
+            'default' => '',
+          ),
+          'other_year' => array(
+            'title' => ts('Other Years'),
+            'operatorType' => CRM_Report_Form::OP_SELECT,
+            'options' => $optionYear,
+            'default' => '',
+          ),
+          'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
+          'contribution_status_id' => array(
+            'title' => ts('Contribution Status'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
+            'default' => array(1),
+          ),
+          'financial_type_id' => array(
+            'title' => ts('Financial Type'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Contribute_PseudoConstant::financialType(),
+          ),
+          'total_amount' => array(
+            'title' => ts('Contribution Amount'),
+          ),
+          'total_sum' => array(
+            'title' => ts('Aggregate Amount'),
+            'type' => CRM_Report_Form::OP_INT,
+            'dbAlias' => 'civicrm_contribution_total_amount_sum',
+            'having' => TRUE,
+          ),
+        ),
+      ),
+    );
 
     $this->_columns['civicrm_contribution']['fields']['civicrm_upto_' .
     $this->_yearStatisticsFrom] = array(
@@ -623,8 +623,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form {
       return $rows;
     }
 
-    $sqlContribution =
-      "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" .
+    $sqlContribution = "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" .
       implode(',', $contactIds) .
       ") AND {$this->_aliases['civicrm_contribution']}.is_test = 0 {$this->_statusClause} {$this->_groupBy} ";
 
@@ -681,8 +680,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form {
     if (!empty($this->_relationshipColumns)) {
       $addRelSelect = ', ' . implode(', ', $this->_relationshipColumns);
     }
-    $sqlRelationship =
-      "SELECT {$this->_aliases['civicrm_relationship']}.relationship_type_id as relationship_type_id, {$this->_aliases['civicrm_relationship']}.contact_id_a as contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b as contact_id_b {$addRelSelect} FROM civicrm_contact {$relContactAlias} {$this->_relationshipFrom} WHERE {$relContactAlias}.id IN (" .
+    $sqlRelationship = "SELECT {$this->_aliases['civicrm_relationship']}.relationship_type_id as relationship_type_id, {$this->_aliases['civicrm_relationship']}.contact_id_a as contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b as contact_id_b {$addRelSelect} FROM civicrm_contact {$relContactAlias} {$this->_relationshipFrom} WHERE {$relContactAlias}.id IN (" .
       implode(',', $contactIds) .
       ") AND {$this->_aliases['civicrm_relationship']}.is_active = 1 {$this->_relationshipWhere} GROUP BY {$this->_aliases['civicrm_relationship']}.contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b";
     $relationshipTypes = CRM_Core_PseudoConstant::relationshipType();
index c1f94073b9cff90dff145f6f512ee49fa7ee582f..e7b5320b467b6fb3d9f37f3f8de94edc43f6a2c1 100644 (file)
@@ -36,7 +36,7 @@ class CRM_Report_Form_Contribute_LoggingDetail extends CRM_Logging_ReportDetail
   /**
    */
   public function __construct() {
-    $logging = new CRM_Logging_Schema;
+    $logging = new CRM_Logging_Schema();
     $this->tables[] = 'civicrm_contribution';
     $this->tables = array_merge($this->tables, array_keys($logging->customDataLogTables()));
 
index 75ca55c5a0acafb7931ac86ca279abf5ff66b768..1fa3a79327deec7a098b52e5b62a7e0d41f5058a 100644 (file)
@@ -70,102 +70,102 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form {
     }
 
     $this->_columns = array(
-        'civicrm_contact' => array(
-          'dao' => 'CRM_Contact_DAO_Contact',
-          'grouping' => 'contact-field',
-          'fields' => array(
-            'sort_name' => array(
-              'title' => ts('Donor Name'),
-              'default' => TRUE,
-              'required' => TRUE,
-            ),
-            'first_name' => array(
-              'title' => ts('First Name'),
-            ),
-            'last_name' => array(
-              'title' => ts('Last Name'),
-            ),
-            'contact_type' => array(
-              'title' => ts('Contact Type'),
-            ),
-            'contact_sub_type' => array(
-              'title' => ts('Contact Subtype'),
-            ),
+      'civicrm_contact' => array(
+        'dao' => 'CRM_Contact_DAO_Contact',
+        'grouping' => 'contact-field',
+        'fields' => array(
+          'sort_name' => array(
+            'title' => ts('Donor Name'),
+            'default' => TRUE,
+            'required' => TRUE,
           ),
-          'filters' => array(
-            'sort_name' => array(
-              'title' => ts('Donor Name'),
-              'operator' => 'like',
-            ),
+          'first_name' => array(
+            'title' => ts('First Name'),
+          ),
+          'last_name' => array(
+            'title' => ts('Last Name'),
+          ),
+          'contact_type' => array(
+            'title' => ts('Contact Type'),
+          ),
+          'contact_sub_type' => array(
+            'title' => ts('Contact Subtype'),
           ),
         ),
-        'civicrm_email' => array(
-          'dao' => 'CRM_Core_DAO_Email',
-          'grouping' => 'contact-field',
-          'fields' => array(
-            'email' => array(
-              'title' => ts('Email'),
-              'default' => TRUE,
-            ),
+        'filters' => array(
+          'sort_name' => array(
+            'title' => ts('Donor Name'),
+            'operator' => 'like',
           ),
         ),
-        'civicrm_phone' => array(
-          'dao' => 'CRM_Core_DAO_Phone',
-          'grouping' => 'contact-field',
-          'fields' => array(
-            'phone' => array(
-              'title' => ts('Phone'),
-              'default' => TRUE,
-            ),
+      ),
+      'civicrm_email' => array(
+        'dao' => 'CRM_Core_DAO_Email',
+        'grouping' => 'contact-field',
+        'fields' => array(
+          'email' => array(
+            'title' => ts('Email'),
+            'default' => TRUE,
           ),
         ),
-      )
-      + $this->addAddressFields()
-      + array(
-        'civicrm_contribution' => array(
-          'dao' => 'CRM_Contribute_DAO_Contribution',
-          'fields' => array(
-            'contact_id' => array(
-              'title' => ts('contactId'),
-              'no_display' => TRUE,
-              'required' => TRUE,
-              'no_repeat' => TRUE,
-            ),
-            'total_amount' => array(
-              'title' => ts('Total Amount'),
-              'no_display' => TRUE,
-              'required' => TRUE,
-              'no_repeat' => TRUE,
-            ),
-            'receive_date' => array(
-              'title' => ts('Year'),
-              'no_display' => TRUE,
-              'required' => TRUE,
-              'no_repeat' => TRUE,
-            ),
+      ),
+      'civicrm_phone' => array(
+        'dao' => 'CRM_Core_DAO_Phone',
+        'grouping' => 'contact-field',
+        'fields' => array(
+          'phone' => array(
+            'title' => ts('Phone'),
+            'default' => TRUE,
+          ),
+        ),
+      ),
+    );
+    $this->_columns += $this->addAddressFields();
+    $this->_columns += array(
+      'civicrm_contribution' => array(
+        'dao' => 'CRM_Contribute_DAO_Contribution',
+        'fields' => array(
+          'contact_id' => array(
+            'title' => ts('contactId'),
+            'no_display' => TRUE,
+            'required' => TRUE,
+            'no_repeat' => TRUE,
+          ),
+          'total_amount' => array(
+            'title' => ts('Total Amount'),
+            'no_display' => TRUE,
+            'required' => TRUE,
+            'no_repeat' => TRUE,
           ),
-          'filters' => array(
-            'yid' => array(
-              'name' => 'receive_date',
-              'title' => ts('This Year'),
-              'operatorType' => CRM_Report_Form::OP_SELECT,
-              'options' => $optionYear,
-              'default' => date('Y'),
-            ),
-            'financial_type_id' => array(
-              'title' => ts('Financial Type'),
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Contribute_PseudoConstant::financialType(),
-            ),
-            'contribution_status_id' => array(
-              'title' => ts('Contribution Status'),
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
-              'default' => array('1'),
-            ),
+          'receive_date' => array(
+            'title' => ts('Year'),
+            'no_display' => TRUE,
+            'required' => TRUE,
+            'no_repeat' => TRUE,
           ),
         ),
-      );
+        'filters' => array(
+          'yid' => array(
+            'name' => 'receive_date',
+            'title' => ts('This Year'),
+            'operatorType' => CRM_Report_Form::OP_SELECT,
+            'options' => $optionYear,
+            'default' => date('Y'),
+          ),
+          'financial_type_id' => array(
+            'title' => ts('Financial Type'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Contribute_PseudoConstant::financialType(),
+          ),
+          'contribution_status_id' => array(
+            'title' => ts('Contribution Status'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
+            'default' => array('1'),
+          ),
+        ),
+      ),
+    );
 
     // If we have a campaign, build out the relevant elements
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
@@ -316,8 +316,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form {
   }
 
   public function groupBy() {
-    $this->_groupBy =
-      "GROUP BY  {$this->_aliases['civicrm_contribution']}.contact_id, " .
+    $this->_groupBy = "GROUP BY  {$this->_aliases['civicrm_contribution']}.contact_id, " .
       self::fiscalYearOffset($this->_aliases['civicrm_contribution'] .
         '.receive_date') . " WITH ROLLUP";
     $this->assign('chartSupported', TRUE);
@@ -380,8 +379,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form {
         $sql = "{$this->_select} {$this->_from} {$this->_where} {$this->_groupBy}";
       }
       else {
-        $sql =
-          "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" .
+        $sql = "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" .
           implode(',', $contactIds) .
           ") AND {$this->_aliases['civicrm_contribution']}.is_test = 0 {$this->_statusClause} {$this->_groupBy} ";
       }
@@ -441,8 +439,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form {
     foreach ($rows as $key => $row) {
       $display['life_time'] = CRM_Utils_Array::value('life_time', $display) +
         $row['civicrm_life_time_total'];
-      $display[$previous_year] =
-        CRM_Utils_Array::value($previous_year, $display) + $row[$previous_year];
+      $display[$previous_year] = CRM_Utils_Array::value($previous_year, $display) + $row[$previous_year];
     }
 
     $config = CRM_Core_Config::Singleton();
index 99918334d68f88e5dd8fbc424fcda55cd2a7349d..7d07560621757db94cc3e8b70a436d6eab47160a 100644 (file)
@@ -149,9 +149,7 @@ class CRM_Report_Form_Contribute_Repeat extends CRM_Report_Form {
             'type' => CRM_Utils_Type::T_MONEY,
             'default' => TRUE,
             'required' => TRUE,
-            'clause' => '
-contribution_civireport1.total_amount_count as contribution1_total_amount_count,
-contribution_civireport1.total_amount_sum as contribution1_total_amount_sum',
+            'clause' => 'contribution_civireport1.total_amount_count as contribution1_total_amount_count, contribution_civireport1.total_amount_sum as contribution1_total_amount_sum',
           ),
           'total_amount2' => array(
             'name' => 'total_amount',
@@ -160,9 +158,7 @@ contribution_civireport1.total_amount_sum as contribution1_total_amount_sum',
             'type' => CRM_Utils_Type::T_MONEY,
             'default' => TRUE,
             'required' => TRUE,
-            'clause' => '
-contribution_civireport2.total_amount_count as contribution2_total_amount_count,
-contribution_civireport2.total_amount_sum as contribution2_total_amount_sum',
+            'clause' => 'contribution_civireport2.total_amount_count as contribution2_total_amount_count, contribution_civireport2.total_amount_sum as contribution2_total_amount_sum',
           ),
         ),
         'grouping' => 'contri-fields',
@@ -397,8 +393,8 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution
 
   public function where() {
     if (!$this->_amountClauseWithAND) {
-      $this->_amountClauseWithAND =
-        "!({$this->_aliases['civicrm_contribution']}1.total_amount_count IS NULL AND {$this->_aliases['civicrm_contribution']}2.total_amount_count IS NULL)";
+      $this->_amountClauseWithAND
+        "!({$this->_aliases['civicrm_contribution']}1.total_amount_count IS NULL AND {$this->_aliases['civicrm_contribution']}2.total_amount_count IS NULL)";
     }
     $clauses = array("atleast_one_amount" => $this->_amountClauseWithAND);
 
@@ -617,8 +613,8 @@ LEFT JOIN civicrm_temp_civireport_repeat2
     //store contributions in array 'contact_sums' for comparison
     $contact_sums = array();
     while ($dao->fetch()) {
-      $contact_sums[$dao->contact_id] =
-        array(
+      $contact_sums[$dao->contact_id]
+        array(
           'contribution1_total_amount_sum' => $dao->contribution1_total_amount_sum,
           'contribution2_total_amount_sum' => $dao->contribution2_total_amount_sum,
         );
@@ -701,16 +697,16 @@ GROUP BY    currency
     $count = $count2 = 0;
     while ($dao->fetch()) {
       if ($dao->amount) {
-        $amount[] =
-          CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" .
+        $amount[]
+          CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" .
           $dao->count . ")";
         $average[] = CRM_Utils_Money::format($dao->avg, $dao->currency);
       }
 
       $count += $dao->count;
       if ($dao->amount2) {
-        $amount2[] =
-          CRM_Utils_Money::format($dao->amount2, $dao->currency) . "(" .
+        $amount2[]
+          CRM_Utils_Money::format($dao->amount2, $dao->currency) . "(" .
           $dao->count . ")";
         $average2[] = CRM_Utils_Money::format($dao->avg2, $dao->currency);
       }
@@ -853,13 +849,13 @@ currency varchar(3)
         $rows[$uid]['change'] = ts('New Donor');
       }
       if ($row['contribution1_total_amount_count']) {
-        $rows[$uid]['contribution1_total_amount_sum'] =
-          $row['contribution1_total_amount_sum'] .
+        $rows[$uid]['contribution1_total_amount_sum']
+          $row['contribution1_total_amount_sum'] .
           " ({$row['contribution1_total_amount_count']})";
       }
       if ($row['contribution2_total_amount_count']) {
-        $rows[$uid]['contribution2_total_amount_sum'] =
-          $row['contribution2_total_amount_sum'] .
+        $rows[$uid]['contribution2_total_amount_sum']
+          $row['contribution2_total_amount_sum'] .
           " ({$row['contribution2_total_amount_count']})";
       }
     }
index b485241b7bc01cfa1a61c206e65b8ff4d1a931e9..3c93823395c0bbcc08bea13c1521b73317e37e12 100644 (file)
@@ -44,112 +44,110 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form {
     'pieChart' => 'Pie Chart',
   );
 
-  /**
-   */
   /**
    */
   public function __construct() {
     $this->_columns = array(
-        'civicrm_contact' => array(
-          'dao' => 'CRM_Contact_DAO_Contact',
-          'fields' => array(
-            'id' => array(
-              'no_display' => TRUE,
-              'required' => TRUE,
-            ),
-            'display_name' => array(
-              'title' => ts('Contact Name'),
-              'required' => TRUE,
-              'no_repeat' => TRUE,
-            ),
-            'first_name' => array(
-              'title' => ts('First Name'),
-            ),
-            'last_name' => array(
-              'title' => ts('Last Name'),
-            ),
-            'contact_type' => array(
-              'title' => ts('Contact Type'),
-            ),
-            'contact_sub_type' => array(
-              'title' => ts('Contact Subtype'),
-            ),
+      'civicrm_contact' => array(
+        'dao' => 'CRM_Contact_DAO_Contact',
+        'fields' => array(
+          'id' => array(
+            'no_display' => TRUE,
+            'required' => TRUE,
+          ),
+          'display_name' => array(
+            'title' => ts('Contact Name'),
+            'required' => TRUE,
+            'no_repeat' => TRUE,
+          ),
+          'first_name' => array(
+            'title' => ts('First Name'),
+          ),
+          'last_name' => array(
+            'title' => ts('Last Name'),
+          ),
+          'contact_type' => array(
+            'title' => ts('Contact Type'),
+          ),
+          'contact_sub_type' => array(
+            'title' => ts('Contact Subtype'),
           ),
         ),
-      )
-      + $this->getAddressColumns()
-      + array(
-        'civicrm_contribution' => array(
-          'dao' => 'CRM_Contribute_DAO_Contribution',
-          'fields' => array(
-            'total_amount' => array(
-              'title' => ts('Amount Statistics'),
-              'required' => TRUE,
-              'statistics' => array(
-                'sum' => ts('Aggregate Amount'),
-                'count' => ts('Donations'),
-                'avg' => ts('Average'),
-              ),
-            ),
-            'currency' => array(
-              'required' => TRUE,
-              'no_display' => TRUE,
+      ),
+    );
+    $this->_columns += $this->getAddressColumns();
+    $this->_columns += array(
+      'civicrm_contribution' => array(
+        'dao' => 'CRM_Contribute_DAO_Contribution',
+        'fields' => array(
+          'total_amount' => array(
+            'title' => ts('Amount Statistics'),
+            'required' => TRUE,
+            'statistics' => array(
+              'sum' => ts('Aggregate Amount'),
+              'count' => ts('Donations'),
+              'avg' => ts('Average'),
             ),
           ),
-          'filters' => array(
-            'receive_date' => array(
-              'default' => 'this.year',
-              'operatorType' => CRM_Report_Form::OP_DATE,
-            ),
-            'currency' => array(
-              'title' => 'Currency',
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
-              'default' => NULL,
-              'type' => CRM_Utils_Type::T_STRING,
-            ),
-            'total_range' => array(
-              'title' => ts('Show no. of Top Donors'),
-              'type' => CRM_Utils_Type::T_INT,
-              'default_op' => 'eq',
-            ),
-            'financial_type_id' => array(
-              'name' => 'financial_type_id',
-              'title' => ts('Financial Type'),
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Contribute_PseudoConstant::financialType(),
-            ),
-            'contribution_status_id' => array(
-              'title' => ts('Contribution Status'),
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
-              'default' => array(1),
-            ),
+          'currency' => array(
+            'required' => TRUE,
+            'no_display' => TRUE,
           ),
         ),
-        'civicrm_email' => array(
-          'dao' => 'CRM_Core_DAO_Email',
-          'fields' => array(
-            'email' => array(
-              'title' => ts('Email'),
-              'default' => TRUE,
-              'no_repeat' => TRUE,
-            ),
+        'filters' => array(
+          'receive_date' => array(
+            'default' => 'this.year',
+            'operatorType' => CRM_Report_Form::OP_DATE,
+          ),
+          'currency' => array(
+            'title' => 'Currency',
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
+            'default' => NULL,
+            'type' => CRM_Utils_Type::T_STRING,
+          ),
+          'total_range' => array(
+            'title' => ts('Show no. of Top Donors'),
+            'type' => CRM_Utils_Type::T_INT,
+            'default_op' => 'eq',
+          ),
+          'financial_type_id' => array(
+            'name' => 'financial_type_id',
+            'title' => ts('Financial Type'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Contribute_PseudoConstant::financialType(),
+          ),
+          'contribution_status_id' => array(
+            'title' => ts('Contribution Status'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
+            'default' => array(1),
           ),
-          'grouping' => 'email-fields',
         ),
-        'civicrm_phone' => array(
-          'dao' => 'CRM_Core_DAO_Phone',
-          'fields' => array(
-            'phone' => array(
-              'title' => ts('Phone'),
-              'default' => TRUE,
-              'no_repeat' => TRUE,
-            ),
+      ),
+      'civicrm_email' => array(
+        'dao' => 'CRM_Core_DAO_Email',
+        'fields' => array(
+          'email' => array(
+            'title' => ts('Email'),
+            'default' => TRUE,
+            'no_repeat' => TRUE,
+          ),
+        ),
+        'grouping' => 'email-fields',
+      ),
+      'civicrm_phone' => array(
+        'dao' => 'CRM_Core_DAO_Phone',
+        'fields' => array(
+          'phone' => array(
+            'title' => ts('Phone'),
+            'default' => TRUE,
+            'no_repeat' => TRUE,
           ),
-          'grouping' => 'phone-fields',
         ),
-      );
+        'grouping' => 'phone-fields',
+      ),
+    );
 
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
index 5882a5e77ae209f29e625de9b6c73559906c0d3b..0c4e7697931e6ddbb20310ef21edf3dc779a815f 100644 (file)
@@ -370,8 +370,7 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event {
       foreach ($rows as $key => $value) {
         if ($value['civicrm_event_id']) {
           $graphRows['totalParticipants'][] = ($rows[$key]['civicrm_line_item_participant_count_count']);
-          $graphRows[$this->_interval][] =
-            substr($rows[$key]['civicrm_event_title'], 0, 12) . "..(" .
+          $graphRows[$this->_interval][] = substr($rows[$key]['civicrm_event_title'], 0, 12) . "..(" .
             $rows[$key]['civicrm_event_id'] . ") ";
           $graphRows['value'][] = ($rows[$key]['civicrm_line_item_participant_count_count']);
         }
index 7e2636ab12b1f7949fb061d6969116322b7fe89c..238fb5128a0a933988ef3e5a8cb749ae4e3480f5 100644 (file)
@@ -381,20 +381,18 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event {
 
     // If we have active campaigns add those elements to both the fields and filters
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
-      $this->_columns['civicrm_participant']['fields']['campaign_id'] =
-        array(
-          'title' => ts('Campaign'),
-          'default' => 'false',
-        );
-      $this->_columns['civicrm_participant']['filters']['campaign_id'] =
-        array(
-          'title' => ts('Campaign'),
-          'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-          'options' => $this->activeCampaigns,
-        );
-      $this->_columns['civicrm_participant']['order_bys']['campaign_id'] =
-        array('title' => ts('Campaign'));
-
+      $this->_columns['civicrm_participant']['fields']['campaign_id'] = array(
+        'title' => ts('Campaign'),
+        'default' => 'false',
+      );
+      $this->_columns['civicrm_participant']['filters']['campaign_id'] = array(
+        'title' => ts('Campaign'),
+        'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+        'options' => $this->activeCampaigns,
+      );
+      $this->_columns['civicrm_participant']['order_bys']['campaign_id'] = array(
+        'title' => ts('Campaign'),
+      );
     }
 
     $this->_currencyColumn = 'civicrm_participant_fee_currency';
@@ -402,6 +400,8 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event {
   }
 
   /**
+   * Searches database for priceset values.
+   *
    * @return array
    */
   public function getPriceLevels() {
@@ -424,8 +424,7 @@ ORDER BY  cv.label
     }
 
     return $elements;
-  } //searches database for priceset values
-
+  }
 
   public function preProcess() {
     parent::preProcess();
@@ -573,8 +572,7 @@ ORDER BY  cv.label
       $this->_where = "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 ";
     }
     else {
-      $this->_where =
-        "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 AND " .
+      $this->_where = "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 AND " .
         implode(' AND ', $clauses);
     }
     if ($this->_aclWhere) {
index 0a5123fd82cf191f105c9bbc6521c55749730a87..c146b146ec3af9e96d00a082ba1b7c480edcad3c 100644 (file)
@@ -242,9 +242,10 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event {
     return $participant_info;
   }
 
-  //build header for table
+  /**
+   * Build header for table.
+   */
   public function buildColumnHeaders() {
-
     $this->_columnHeaders = array();
     foreach ($this->_columns as $tableName => $table) {
       if (array_key_exists('fields', $table)) {
@@ -343,8 +344,7 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event {
     if (!empty($this->_params['charts'])) {
       foreach ($rows as $key => $value) {
         $graphRows['totalAmount'][] = $graphRows['value'][] = CRM_Utils_Array::value('totalAmount', $rows[$key]);
-        $graphRows[$this->_interval][] =
-          substr($rows[$key]['civicrm_event_title'], 0, 12) . "..(" .
+        $graphRows[$this->_interval][] = substr($rows[$key]['civicrm_event_title'], 0, 12) . "..(" .
           $rows[$key]['civicrm_event_id'] . ") ";
       }
 
index f6f2227f54ee925e22ef618a12fe8abd3f94199c..9fcd9dd1e16092087c389ba4be92b0fd66cad11d 100644 (file)
@@ -250,12 +250,12 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
         // are grouped together across price sets but there may be a separate need to group
         // by id so that entries in one price set are distinct from others. Not quite sure what
         // to call the distinction for end users benefit
-          array(
-            'price_field_value_label' => array(
-              'title' => ts('Price Field Value Label'),
-              'name' => 'label',
-            ),
+        array(
+          'price_field_value_label' => array(
+            'title' => ts('Price Field Value Label'),
+            'name' => 'label',
           ),
+        ),
       ),
     );
   }
@@ -596,8 +596,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form {
         'filters' => array(
           'id' => array(
             'title' => ts('Contact ID'),
-          )
-        ,
+          ),
           'sort_name' => array(
             'title' => ts('Contact Name'),
           ),
@@ -1222,7 +1221,7 @@ WHERE   line_item_civireport.id IS NOT NULL
    */
   public function alterNickName($value, &$row) {
     if (empty($row['civicrm_contact_id'])) {
-      return;
+      return NULL;
     }
     $contactID = $row['civicrm_contact_id'];
     return "<div id=contact-{$contactID} class='crm-entity'>
@@ -1374,7 +1373,7 @@ WHERE   line_item_civireport.id IS NOT NULL
    */
   public function alterParticipantStatus($value) {
     if (empty($value)) {
-      return;
+      return NULL;
     }
     return CRM_Event_PseudoConstant::participantStatus($value, FALSE, 'label');
   }
@@ -1386,7 +1385,7 @@ WHERE   line_item_civireport.id IS NOT NULL
    */
   public function alterParticipantRole($value) {
     if (empty($value)) {
-      return;
+      return NULL;
     }
     $roles = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
     $value = array();
index 738e4101ac75fc9436a88e2e8b981c116190f776..a2e1990143d62c43f09d66c73a0cf7062885f7ec 100644 (file)
@@ -530,7 +530,7 @@ SELECT COUNT({$this->_aliases['civicrm_grant']}.id) as count ,
    * @param $awardedGrantsAmount
    * @param bool $customData
    */
-  static function getStatistics(
+  public static function getStatistics(
     &$grantStatistics, $fieldValue, $values,
     $awardedGrants, $awardedGrantsAmount, $customData = FALSE
   ) {
index 4e8746bdd573ae88c4bacb7a196a452a00747258..387abf456675086a9de2696decefdb1e1005a5bb 100644 (file)
@@ -30,7 +30,6 @@
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 class CRM_Report_Form_Membership_Summary extends CRM_Report_Form {
 
@@ -43,12 +42,11 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form {
   );
 
   /**
-   */
-  /**
+   * Constructor function.
    */
   public function __construct() {
     // UI for selecting columns to appear in the report list
-    // array conatining the columns, group_bys and filters build and provided to Form
+    // array containing the columns, group_bys and filters build and provided to Form
     $this->_columns = array(
       'civicrm_contact' => array(
         'dao' => 'CRM_Contact_DAO_Contact',
@@ -139,18 +137,27 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form {
     parent::__construct();
   }
 
+  /**
+   * Pre-process function.
+   */
   public function preProcess() {
     $this->assign('reportTitle', ts('Membership Summary Report'));
     parent::preProcess();
   }
 
   /**
+   * Set default values.
+   *
    * @return array
+   *   Default values.
    */
   public function setDefaultValues() {
     return parent::setDefaultValues();
   }
 
+  /**
+   * Generate select clause.
+   */
   public function select() {
     $select = array();
     $this->_columnHeaders = array();
@@ -179,6 +186,8 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form {
   }
 
   /**
+   * Set form rules.
+   *
    * @param $fields
    * @param $files
    * @param $self
@@ -205,12 +214,12 @@ LEFT  JOIN civicrm_membership_type  {$this->_aliases['civicrm_membership_type']}
 LEFT  JOIN civicrm_contribution  {$this->_aliases['civicrm_contribution']}
        ON {$this->_aliases['civicrm_membership']}.contact_id = {$this->_aliases['civicrm_contribution']}.contact_id
 ";
-    //  include address field if address column is to be included
+    // Include address table if address column is to be included.
     if ($this->_addressField) {
       $this->_from .= "LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']} ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_address']}.contact_id AND {$this->_aliases['civicrm_address']}.is_primary = 1\n";
     }
 
-    // include email field if email column is to be included
+    // Include email table if email column is to be included.
     if ($this->_emailField) {
       $this->_from .= "LEFT JOIN civicrm_email {$this->_aliases['civicrm_email']} ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND {$this->_aliases['civicrm_email']}.is_primary = 1\n";
     }
@@ -259,7 +268,9 @@ LEFT  JOIN civicrm_contribution  {$this->_aliases['civicrm_contribution']}
   }
 
   /**
-   * @param $rows
+   * Generate statistics (bottom section of the report).
+   *
+   * @param array $rows
    *
    * @return array
    */
@@ -363,7 +374,9 @@ LEFT  JOIN civicrm_contribution  {$this->_aliases['civicrm_contribution']}
   }
 
   /**
-   * @param $rows
+   * Make changes to how data is displayed.
+   *
+   * @param array $rows
    */
   public function alterDisplay(&$rows) {
     // custom code to alter rows
@@ -418,12 +431,13 @@ LEFT  JOIN civicrm_contribution  {$this->_aliases['civicrm_contribution']}
       if (array_key_exists('civicrm_contact_sort_name', $row) &&
         array_key_exists('civicrm_contact_id', $row)
       ) {
-        $url = CRM_Utils_System::url('civicrm/report/member/detail',
+        $url = CRM_Utils_System::url(
+          'civicrm/report/member/detail',
           'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_id'],
           $this->_absoluteUrl
         );
-        $rows[$rowNum]['civicrm_contact_sort_name'] =
-          "<a href='$url'>" . $row["civicrm_contact_sort_name"] . '</a>';
+        $rows[$rowNum]['civicrm_contact_sort_name']
+          "<a href='$url'>" . $row["civicrm_contact_sort_name"] . '</a>';
         $entryFound = TRUE;
       }
 
index 8f26e014e3f705b8076de536acd53d4e9b026f54..3d3a6c0f5b252e8346f5b4adc200fe862db95834 100644 (file)
@@ -69,113 +69,113 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form {
     }
 
     $this->_columns = array(
-        'civicrm_contact' => array(
-          'dao' => 'CRM_Contact_DAO_Contact',
-          'fields' => array(
-            'sort_name' => array(
-              'title' => ts('Contact Name'),
-              'required' => TRUE,
-              'no_repeat' => TRUE,
-            ),
+      'civicrm_contact' => array(
+        'dao' => 'CRM_Contact_DAO_Contact',
+        'fields' => array(
+          'sort_name' => array(
+            'title' => ts('Contact Name'),
+            'required' => TRUE,
+            'no_repeat' => TRUE,
           ),
-          'filters' => array(
-            'sort_name' => array('title' => ts('Contact Name')),
-            'id' => array('no_display' => TRUE),
-          ),
-          'grouping' => 'contact-fields',
         ),
-        'civicrm_email' => array(
-          'dao' => 'CRM_Core_DAO_Email',
-          'fields' => array(
-            'email' => array('no_repeat' => TRUE),
-          ),
-          'grouping' => 'contact-fields',
+        'filters' => array(
+          'sort_name' => array('title' => ts('Contact Name')),
+          'id' => array('no_display' => TRUE),
+        ),
+        'grouping' => 'contact-fields',
+      ),
+      'civicrm_email' => array(
+        'dao' => 'CRM_Core_DAO_Email',
+        'fields' => array(
+          'email' => array('no_repeat' => TRUE),
         ),
-        'civicrm_pledge' => array(
-          'dao' => 'CRM_Pledge_DAO_Pledge',
-          'fields' => array(
-            'id' => array(
-              'no_display' => TRUE,
-              'required' => TRUE,
-            ),
-            'contact_id' => array(
-              'no_display' => TRUE,
-              'required' => TRUE,
-            ),
-            'amount' => array(
-              'title' => ts('Pledge Amount'),
-              'required' => TRUE,
-              'type' => CRM_Utils_Type::T_MONEY,
-            ),
-            'currency' => array(
-              'required' => TRUE,
-              'no_display' => TRUE,
-            ),
-            'frequency_unit' => array(
-              'title' => ts('Frequency Unit'),
-            ),
-            'installments' => array(
-              'title' => ts('Installments'),
-            ),
-            'pledge_create_date' => array(
-              'title' => ts('Pledge Made Date'),
-            ),
-            'start_date' => array(
-              'title' => ts('Pledge Start Date'),
-              'type' => CRM_Utils_Type::T_DATE,
-            ),
-            'end_date' => array(
-              'title' => ts('Pledge End Date'),
-              'type' => CRM_Utils_Type::T_DATE,
-            ),
-            'status_id' => array(
-              'title' => ts('Pledge Status'),
-              'required' => TRUE,
-            ),
+        'grouping' => 'contact-fields',
+      ),
+      'civicrm_pledge' => array(
+        'dao' => 'CRM_Pledge_DAO_Pledge',
+        'fields' => array(
+          'id' => array(
+            'no_display' => TRUE,
+            'required' => TRUE,
           ),
-          'filters' => array(
-            'pledge_create_date' => array(
-              'title' => 'Pledge Made Date',
-              'operatorType' => CRM_Report_Form::OP_DATE,
-            ),
-            'pledge_amount' => array(
-              'title' => ts('Pledged Amount'),
-              'operatorType' => CRM_Report_Form::OP_INT,
-            ),
-            'currency' => array(
-              'title' => 'Currency',
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
-              'default' => NULL,
-              'type' => CRM_Utils_Type::T_STRING,
-            ),
-            'sid' => array(
-              'name' => 'status_id',
-              'title' => ts('Pledge Status'),
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Core_OptionGroup::values('contribution_status'),
-            ),
-
+          'contact_id' => array(
+            'no_display' => TRUE,
+            'required' => TRUE,
+          ),
+          'amount' => array(
+            'title' => ts('Pledge Amount'),
+            'required' => TRUE,
+            'type' => CRM_Utils_Type::T_MONEY,
+          ),
+          'currency' => array(
+            'required' => TRUE,
+            'no_display' => TRUE,
+          ),
+          'frequency_unit' => array(
+            'title' => ts('Frequency Unit'),
+          ),
+          'installments' => array(
+            'title' => ts('Installments'),
+          ),
+          'pledge_create_date' => array(
+            'title' => ts('Pledge Made Date'),
+          ),
+          'start_date' => array(
+            'title' => ts('Pledge Start Date'),
+            'type' => CRM_Utils_Type::T_DATE,
+          ),
+          'end_date' => array(
+            'title' => ts('Pledge End Date'),
+            'type' => CRM_Utils_Type::T_DATE,
+          ),
+          'status_id' => array(
+            'title' => ts('Pledge Status'),
+            'required' => TRUE,
           ),
         ),
-        'civicrm_pledge_payment' => array(
-          'dao' => 'CRM_Pledge_DAO_PledgePayment',
-          'fields' => array(
-            'total_paid' => array(
-              'title' => ts('Total Amount Paid'),
-              'type' => CRM_Utils_Type::T_MONEY,
-            ),
-            'balance_due' => array(
-              'title' => ts('Balance Due'),
-              'default' => TRUE,
-              'type' => CRM_Utils_Type::T_MONEY,
-            ),
+        'filters' => array(
+          'pledge_create_date' => array(
+            'title' => 'Pledge Made Date',
+            'operatorType' => CRM_Report_Form::OP_DATE,
+          ),
+          'pledge_amount' => array(
+            'title' => ts('Pledged Amount'),
+            'operatorType' => CRM_Report_Form::OP_INT,
+          ),
+          'currency' => array(
+            'title' => 'Currency',
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
+            'default' => NULL,
+            'type' => CRM_Utils_Type::T_STRING,
+          ),
+          'sid' => array(
+            'name' => 'status_id',
+            'title' => ts('Pledge Status'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Core_OptionGroup::values('contribution_status'),
+          ),
 
+        ),
+      ),
+      'civicrm_pledge_payment' => array(
+        'dao' => 'CRM_Pledge_DAO_PledgePayment',
+        'fields' => array(
+          'total_paid' => array(
+            'title' => ts('Total Amount Paid'),
+            'type' => CRM_Utils_Type::T_MONEY,
+          ),
+          'balance_due' => array(
+            'title' => ts('Balance Due'),
+            'default' => TRUE,
+            'type' => CRM_Utils_Type::T_MONEY,
           ),
         ),
-      )
-      + $this->getAddressColumns(array('group_by' => FALSE))
-      + $this->getPhoneColumns();
+      ),
+    );
+
+    $this->_columns += $this->getAddressColumns(array('group_by' => FALSE)) + $this->getPhoneColumns();
+
     // If we have a campaign, build out the relevant elements
     $this->_tagFilter = TRUE;
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
index a4a9ff39205b0d69744d07af7a3ac6c6b16f3916..59e091b35de64ee68d50e658b4293563a16c6488 100644 (file)
@@ -47,127 +47,127 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form {
    */
   public function __construct() {
     $this->_columns = array(
-        'civicrm_contact' => array(
-          'dao' => 'CRM_Contact_DAO_Contact',
-          'fields' => array(
-            'sort_name' => array(
-              'title' => ts('Contact Name'),
-              'no_repeat' => TRUE,
-            ),
-            'postal_greeting_display' => array('title' => ts('Postal Greeting')),
-            'id' => array(
-              'no_display' => TRUE,
-              'required' => TRUE,
-            ),
+      'civicrm_contact' => array(
+        'dao' => 'CRM_Contact_DAO_Contact',
+        'fields' => array(
+          'sort_name' => array(
+            'title' => ts('Contact Name'),
+            'no_repeat' => TRUE,
           ),
-          'grouping' => 'contact-fields',
-          'group_bys' => array(
-            'id' => array('title' => ts('Contact ID')),
-            'sort_name' => array(
-              'title' => ts('Contact Name'),
-            ),
+          'postal_greeting_display' => array('title' => ts('Postal Greeting')),
+          'id' => array(
+            'no_display' => TRUE,
+            'required' => TRUE,
           ),
         ),
-        'civicrm_email' => array(
-          'dao' => 'CRM_Core_DAO_Email',
-          'fields' => array(
-            'email' => array(
-              'no_repeat' => TRUE,
-              'title' => ts('email'),
-            ),
+        'grouping' => 'contact-fields',
+        'group_bys' => array(
+          'id' => array('title' => ts('Contact ID')),
+          'sort_name' => array(
+            'title' => ts('Contact Name'),
           ),
-          'grouping' => 'contact-fields',
         ),
-        'civicrm_pledge' => array(
-          'dao' => 'CRM_Pledge_DAO_Pledge',
-          'fields' => array(
-            'id' => array(
-              'no_display' => TRUE,
-              'required' => FALSE,
-            ),
-            'currency' => array(
-              'required' => TRUE,
-              'no_display' => TRUE,
-            ),
-            'amount' => array(
-              'title' => ts('Pledge Amount'),
-              'required' => TRUE,
-              'type' => CRM_Utils_Type::T_MONEY,
-              'statistics' => array(
-                'sum' => ts('Aggregate Amount Pledged'),
-                'count' => ts('Pledges'),
-                'avg' => ts('Average'),
-              ),
-            ),
-            'frequency_unit' => array(
-              'title' => ts('Frequency Unit'),
-            ),
-            'installments' => array(
-              'title' => ts('Installments'),
-            ),
-            'pledge_create_date' => array(
-              'title' => ts('Pledge Made Date'),
-            ),
-            'start_date' => array(
-              'title' => ts('Pledge Start Date'),
-              'type' => CRM_Utils_Type::T_DATE,
-            ),
-            'end_date' => array(
-              'title' => ts('Pledge End Date'),
-              'type' => CRM_Utils_Type::T_DATE,
-            ),
-            'status_id' => array(
-              'title' => ts('Pledge Status'),
-            ),
+      ),
+      'civicrm_email' => array(
+        'dao' => 'CRM_Core_DAO_Email',
+        'fields' => array(
+          'email' => array(
+            'no_repeat' => TRUE,
+            'title' => ts('email'),
           ),
-          'filters' => array(
-            'pledge_create_date' => array(
-              'title' => 'Pledge Made Date',
-              'operatorType' => CRM_Report_Form::OP_DATE,
-            ),
-            'pledge_amount' => array(
-              'title' => ts('Pledged Amount'),
-              'operatorType' => CRM_Report_Form::OP_INT,
-            ),
-            'currency' => array(
-              'title' => 'Currency',
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
-              'default' => NULL,
-              'type' => CRM_Utils_Type::T_STRING,
-            ),
-            'sid' => array(
-              'name' => 'status_id',
-              'title' => ts('Pledge Status'),
-              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
-              'options' => CRM_Core_OptionGroup::values('contribution_status'),
-            ),
+        ),
+        'grouping' => 'contact-fields',
+      ),
+      'civicrm_pledge' => array(
+        'dao' => 'CRM_Pledge_DAO_Pledge',
+        'fields' => array(
+          'id' => array(
+            'no_display' => TRUE,
+            'required' => FALSE,
           ),
-          'group_bys' => array(
-            'pledge_create_date' => array(
-              'frequency' => TRUE,
-              'default' => TRUE,
-              'chart' => TRUE,
-            ),
-            'frequency_unit' => array(
-              'title' => ts('Frequency Unit'),
-            ),
-            'status_id' => array(
-              'title' => ts('Pledge Status'),
+          'currency' => array(
+            'required' => TRUE,
+            'no_display' => TRUE,
+          ),
+          'amount' => array(
+            'title' => ts('Pledge Amount'),
+            'required' => TRUE,
+            'type' => CRM_Utils_Type::T_MONEY,
+            'statistics' => array(
+              'sum' => ts('Aggregate Amount Pledged'),
+              'count' => ts('Pledges'),
+              'avg' => ts('Average'),
             ),
           ),
+          'frequency_unit' => array(
+            'title' => ts('Frequency Unit'),
+          ),
+          'installments' => array(
+            'title' => ts('Installments'),
+          ),
+          'pledge_create_date' => array(
+            'title' => ts('Pledge Made Date'),
+          ),
+          'start_date' => array(
+            'title' => ts('Pledge Start Date'),
+            'type' => CRM_Utils_Type::T_DATE,
+          ),
+          'end_date' => array(
+            'title' => ts('Pledge End Date'),
+            'type' => CRM_Utils_Type::T_DATE,
+          ),
+          'status_id' => array(
+            'title' => ts('Pledge Status'),
+          ),
         ),
-        'civicrm_pledge_payment' => array(
-          'dao' => 'CRM_Pledge_DAO_PledgePayment',
-          'fields' => array(
-            'total_paid' => array(
-              'title' => ts('Total Amount Paid'),
-              'type' => CRM_Utils_Type::T_STRING,
-              'dbAlias' => 'sum(pledge_payment_civireport.actual_amount)',
-            ),
+        'filters' => array(
+          'pledge_create_date' => array(
+            'title' => 'Pledge Made Date',
+            'operatorType' => CRM_Report_Form::OP_DATE,
+          ),
+          'pledge_amount' => array(
+            'title' => ts('Pledged Amount'),
+            'operatorType' => CRM_Report_Form::OP_INT,
+          ),
+          'currency' => array(
+            'title' => 'Currency',
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
+            'default' => NULL,
+            'type' => CRM_Utils_Type::T_STRING,
+          ),
+          'sid' => array(
+            'name' => 'status_id',
+            'title' => ts('Pledge Status'),
+            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+            'options' => CRM_Core_OptionGroup::values('contribution_status'),
+          ),
+        ),
+        'group_bys' => array(
+          'pledge_create_date' => array(
+            'frequency' => TRUE,
+            'default' => TRUE,
+            'chart' => TRUE,
+          ),
+          'frequency_unit' => array(
+            'title' => ts('Frequency Unit'),
+          ),
+          'status_id' => array(
+            'title' => ts('Pledge Status'),
+          ),
+        ),
+      ),
+      'civicrm_pledge_payment' => array(
+        'dao' => 'CRM_Pledge_DAO_PledgePayment',
+        'fields' => array(
+          'total_paid' => array(
+            'title' => ts('Total Amount Paid'),
+            'type' => CRM_Utils_Type::T_STRING,
+            'dbAlias' => 'sum(pledge_payment_civireport.actual_amount)',
           ),
         ),
-      ) + $this->addAddressFields();
+      ),
+    ) + $this->addAddressFields();
 
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
index 926ef61845cf74fb301739cc9a5ce2e3090c5b77..313a60076d9c166f570b8e2fd2544ef8ddfa64a8 100644 (file)
@@ -74,7 +74,7 @@ interface CRM_Report_Interface {
    * Retrieve all the values that match the current input parameters
    * Used by the selector
    */
-  function all(
+  public function all(
     $offset = 0, $rowcount = 0, $sort = NULL,
     $includeContactIDs = FALSE
   );
index 7edf71f6ffb75b3e4c46061826664a6520ef22c0..c603af071e93e0e172eac32b1b5ff7f4fda045b3 100644 (file)
@@ -46,36 +46,35 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page {
    * Name of component if report list is filtered
    *
    * @var string
-   **/
+   */
   protected $_compName = NULL;
 
   /**
    * ID of component if report list is filtered
    *
    * @var int
-   **/
+   */
   protected $_compID = NULL;
 
   /**
    * ID of grouping if report list is filtered
    *
    * @var int
-   **/
+   */
   protected $_grouping = NULL;
 
   /**
    * ID of parent report template if list is filtered by template
    *
    * @var int
-   **/
+   */
   protected $_ovID = NULL;
 
-
   /**
    * Title of parent report template if list is filtered by template
    *
    * @var string
-   **/
+   */
   protected $_title = NULL;
 
   /**
index 68a2ed858a51fc418e787180f26d8aad662618b9..48037399b7b6975d08e230e2b4f8188b3e62090a 100644 (file)
@@ -36,6 +36,10 @@ class CRM_SMS_Controller_Send extends CRM_Core_Controller {
 
   /**
    * Class constructor
+   *
+   * @param string $title
+   * @param bool|int $action
+   * @param bool $modal
    */
   public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) {
     parent::__construct($title, $modal, NULL, FALSE, TRUE);
@@ -64,8 +68,7 @@ class CRM_SMS_Controller_Send extends CRM_Core_Controller {
       CRM_Core_BAO_File::uploadNames()
     );
 
-    $config = CRM_Core_Config::singleton();
-    $this->addActions($config->uploadDir,
+    $this->addActions(CRM_Core_Config::singleton()->uploadDir,
       $uploadNames
     );
   }
index c6e532a617e791a82096834c7164f422c092ee3c..59ed8bdf02c1a7e00c5b83b177ce8d02bdd0b4b4 100644 (file)
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id: $
- *
  */
 
 /**
- *
+ * SMS Form.
  */
 class CRM_SMS_Form_Provider extends CRM_Core_Form {
   protected $_id = NULL;
@@ -62,9 +61,7 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form {
   }
 
   /**
-   * Build the form object
-   *
-   * @return void
+   * Build the form object.
    */
   public function buildQuickForm() {
     parent::buildQuickForm();
@@ -99,7 +96,7 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form {
 
     $this->addRule('title', ts('This Title already exists in Database.'), 'objectExists', array(
         'CRM_SMS_DAO_Provider',
-        $this->_id
+        $this->_id,
       ));
 
     $this->add('text', 'username', ts('Username'),
@@ -124,15 +121,8 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form {
   }
 
   /**
-   * This virtual function is used to set the default values of
-   * various form elements
-   *
-   * access        public
+   * Set the default values of various form elements.
    *
-   * @return array
-   *   reference to the array of default values
-   */
-  /**
    * @return array
    */
   public function setDefaultValues() {
@@ -153,8 +143,9 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form {
     $dao = new CRM_SMS_DAO_Provider();
     $dao->id = $this->_id;
 
-    if ($name)
+    if ($name) {
       $dao->name = $name;
+    }
 
     if (!$dao->find(TRUE)) {
       return $defaults;
@@ -166,10 +157,7 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form {
   }
 
   /**
-   * Process the form submission
-   *
-   *
-   * @return void
+   * Process the form submission.
    */
   public function postProcess() {
 
index 57f724a371e6b38bcfa68be75423308713333e7d..c51f4dee7bfd722862834cfd4a5ec98aadc532a4 100644 (file)
@@ -45,7 +45,6 @@ class CRM_SMS_StateMachine_Send extends CRM_Core_StateMachine {
    * @param object $controller
    * @param \const|int $action
    *
-   * @internal param \CRM_SMS_Controller $object
    * @return \CRM_SMS_StateMachine_Send CRM_SMS_StateMachine
    */
   public function __construct($controller, $action = CRM_Core_Action::NONE) {
index cc0fd4dd19d1db6eeb1a7c2b531a237a8347ed32..123af298eeaff19832cdbc6d5cb88fd0432c5298 100644 (file)
@@ -294,7 +294,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
       $defaultLocation = $this->_location_types[$defaultLocationType->id];
       unset($this->_location_types[$defaultLocationType->id]);
       $this->_location_types = array(
-          $defaultLocationType->id => $defaultLocation
+          $defaultLocationType->id => $defaultLocation,
         ) + $this->_location_types;
     }
 
@@ -562,7 +562,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
       $showBestResult = FALSE;
       if (in_array($ufField->field_name, array(
           'country',
-          'state_province'
+          'state_province',
         )) && count($config->countryLimit) > 1
       ) {
         // get state or country field weight if exists
@@ -631,7 +631,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
       'Participant',
       'Contribution',
       'Membership',
-      'Activity'
+      'Activity',
     ))) {
       $individualSubTypes = CRM_Contact_BAO_ContactType::subTypes('Individual');
       foreach ($groupType as $value) {
@@ -677,7 +677,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
    * @param array $errors
    *   Collect errors.
    *
-   * @return Array
+   * @return array
    *   list of errors to be posted back to the form
    */
   public static function formRuleCustomDataExtentColumnValue($customField, $gid, $fieldType, &$errors) {
@@ -687,7 +687,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
       'Contribution',
       'Membership',
       'Activity',
-      'Case'
+      'Case',
     ))) {
       $params = array('id' => $customField->custom_group_id);
       $customGroup = array();
@@ -796,7 +796,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
         'Contribution',
         'Participant',
         'Membership',
-        'Activity'
+        'Activity',
       ))
     ) {
       $errors['in_selector'] = ts("'In Selector' cannot be checked for %1 fields.", array(1 => $entityName));
@@ -988,7 +988,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
             if ($fieldType != $profileType) {
               $errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array(
                   1 => $fieldType,
-                  2 => $profileType
+                  2 => $profileType,
                 ));
             }
           }
@@ -1000,7 +1000,7 @@ class CRM_UF_Form_Field extends CRM_Core_Form {
             ) {
               $errors['field_name'] = ts('Cannot add or update profile field type "%1" with combination of "%2".', array(
                   1 => $fieldType,
-                  2 => $profileType
+                  2 => $profileType,
                 ));
             }
           }
index 18c160a25b64989411679ce437cb49744a00bcaf..5425905ca84cda58310d386bfa0495ef9d52a5e0 100644 (file)
@@ -64,7 +64,7 @@ class CRM_UF_Page_Field extends CRM_Core_Page {
    *
    * @return array
    */
-  function &actionLinks() {
+  public function &actionLinks() {
     if (!isset(self::$_actionLinks)) {
       self::$_actionLinks = array(
         CRM_Core_Action::UPDATE => array(
index db9c0592a55e21a2c28699d98a160985fe18d2d3..0e5a84782b6ff0de4471ab6308c456c9e887877b 100644 (file)
@@ -229,7 +229,8 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
       if (in_array($fieldName, $locationFields)) {
         $result['schema'][$fieldName]['civiIsLocation'] = TRUE;
       }
-      if (in_array($fieldName, array('phone', 'phone_and_ext'))) { // FIXME what about phone_ext?
+      if (in_array($fieldName, array('phone', 'phone_and_ext'))) {
+        // FIXME what about phone_ext?
         $result['schema'][$fieldName]['civiIsPhone'] = TRUE;
       }
     }
index 475e04dd2f228dd5a5dfd8a08a43337130c8dd2b..803bf2e7d2a33339feb964f51013686f983aab90 100644 (file)
@@ -98,7 +98,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form {
    * @param string $method
    * @param null|string $name
    */
-  function __construct(
+  public function __construct(
     $state = NULL,
     $action = CRM_Core_Action::NONE,
     $method = 'post',
@@ -658,7 +658,7 @@ SET    version = '$version'
     if ($upgrade->checkVersionRelease($rev, 'alpha1')) {
       if (!(is_callable(array(
         $versionObject,
-        'verifyPreDBstate'
+        'verifyPreDBstate',
       )))
       ) {
         CRM_Core_Error::fatal("verifyPreDBstate method was not found for $rev");
@@ -678,7 +678,7 @@ SET    version = '$version'
 
     if (is_callable(array(
       $versionObject,
-      $phpFunctionName
+      $phpFunctionName,
     ))) {
       $versionObject->$phpFunctionName($rev, $originalVer, $latestVer);
     }
@@ -689,7 +689,7 @@ SET    version = '$version'
     // set post-upgrade-message if any
     if (is_callable(array(
       $versionObject,
-      'setPostUpgradeMessage'
+      'setPostUpgradeMessage',
     ))) {
       $postUpgradeMessage = file_get_contents($postUpgradeMessageFile);
       $versionObject->setPostUpgradeMessage($postUpgradeMessage, $rev);
@@ -778,7 +778,7 @@ SET    version = '$version'
         $versionObject = $this->incrementalPhpObject($rev);
         if (is_callable(array(
           $versionObject,
-          'setPreUpgradeMessage'
+          'setPreUpgradeMessage',
         ))) {
           $versionObject->setPreUpgradeMessage($preUpgradeMessage, $rev, $currentVer);
         }
index b2cf8f1448a011668fc61a514fce34c1fe5203ec..8f91366a4ec0e2d420161002f7695831badb5242 100644 (file)
@@ -188,7 +188,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de
       }
     }
     // Drop index UI_title for civicrm_price_set
-    $domain = new CRM_Core_DAO_Domain;
+    $domain = new CRM_Core_DAO_Domain();
     $domain->find(TRUE);
     if ($domain->locales) {
       $locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);
@@ -285,7 +285,7 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de
       $dao = CRM_Core_DAO::executeQuery($query);
 
       if (!$dao->N) {
-        $domain = new CRM_Core_DAO_Domain;
+        $domain = new CRM_Core_DAO_Domain();
         $domain->find(TRUE);
 
         if ($domain->locales) {
@@ -433,7 +433,7 @@ WHERE     cpse.price_set_id IS NULL";
       $addTo[2] = $dao->contribution_page_id;
       $options = array(
         'otherAmount' => $dao->is_allow_other_amount,
-        'membership' => $dao->membership_block_id
+        'membership' => $dao->membership_block_id,
       );
       self::createPriceSet($daoName, $addTo, $options);
     }
@@ -655,7 +655,7 @@ WHERE     cpf.price_set_id = %1
           '2' => array('membership_amount', 'String'),
           '3' => array(
             CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $result->membership_id, 'membership_type_id'),
-            'Integer'
+            'Integer',
           ),
         );
         $res = CRM_Core_DAO::executeQuery($sql, $params);
@@ -721,12 +721,12 @@ WHERE     cpf.price_set_id = %1
           if (!empty($defaults)) {
             $lineParams['price_field_id'] = $defaults['id'];
             $lineParams['label'] = $defaults['label'];
-            $lineParams['price_field_value_id'] =
-              CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $defaults['id'], 'id', 'price_field_id');
+            $lineParams['price_field_value_id']
+              CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue', $defaults['id'], 'id', 'price_field_id');
           }
           else {
-            $lineParams['price_field_id'] =
-              CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field', $priceSetId, 'id', 'price_set_id');
+            $lineParams['price_field_id']
+              CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field', $priceSetId, 'id', 'price_set_id');
             $lineParams['label'] = 'Contribution Amount';
           }
           $lineParams['qty'] = 1;
@@ -967,7 +967,7 @@ VALUES
           $dao->start_date,
           $dao->end_date,
           $memStatus,
-          $status
+          $status,
         );
       }
     }
diff --git a/CRM/Upgrade/Incremental/sql/4.6.alpha3.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.6.alpha3.mysql.tpl
new file mode 100644 (file)
index 0000000..bf00120
--- /dev/null
@@ -0,0 +1 @@
+{* file to handle db changes in 4.6.alpha3 during upgrade *}
index 1f0beca7adac0089d7209c93f7f561445599d13b..eb36f2259a38b4bea22859a732a36375c1f4e39a 100644 (file)
@@ -278,7 +278,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p
           $label = ts('Additional Contribution');
           $useRequired = 0;
         }
-        elseif (!empty($fieldOptions[$optionKey]['label'])) {      //check for label.
+        elseif (!empty($fieldOptions[$optionKey]['label'])) {
           $label = $fieldOptions[$optionKey]['label'];
         }
 
@@ -409,9 +409,7 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p
           }
         }
         $element = &$qf->add('select', $elementName, $label,
-          array(
-            '' => ts('- select -')
-          ) + $selectOption,
+          array('' => ts('- select -')) + $selectOption,
           $useRequired && $field->is_required,
           array('price' => json_encode($priceVal))
         );
@@ -510,7 +508,7 @@ WHERE
 
     $dao = CRM_Core_DAO::executeQuery($query, array(
         1 => array($optionGroupName, 'String'),
-        2 => array($optionLabel, 'String')
+        2 => array($optionLabel, 'String'),
       ));
 
     while ($dao->fetch()) {
@@ -524,8 +522,8 @@ WHERE
    * @param int $id
    *   Field Id.
    *
-   * @return boolean
-   *
+   * @return mixed
+   *   Boolean-ish
    */
   public static function deleteField($id) {
     $field = new CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field();
@@ -567,15 +565,9 @@ WHERE
    * Validate the priceset
    *
    * @param int $priceSetId
-   *   , array $fields.
-   *
-   * retrun the error string
-   *
-   * @param $fields
-   * @param $error
-   *
+   * @param array $fields
+   * @param array $error
    */
-
   public static function priceSetValidation($priceSetId, $fields, &$error) {
     // check for at least one positive
     // amount price field should be selected.
index 976729cbc033991569fc10d536fa69cf2c1c9f50..212c23d1f47236b5bdf5b34f02bb44ac87369db6 100644 (file)
@@ -252,7 +252,7 @@ WHERE     ct.id = cp.contribution_type_id AND
    * @param int $id
    *   Price Set id.
    *
-   * @return boolean
+   * @return bool
    *   false if fields exist for this set, true if the
    *   set could be deleted
    *
@@ -767,7 +767,7 @@ WHERE  id = %1";
    *
    * @return void
    */
-  static function buildPriceSet(&$form) {
+  public static function buildPriceSet(&$form) {
     $priceSetId = $form->get('priceSetId');
     $userid = $form->getVar('_userID');
     if (!$priceSetId) {
@@ -778,7 +778,7 @@ WHERE  id = %1";
     $className = CRM_Utils_System::getClassName($form);
     if (in_array($className, array(
       'CRM_Contribute_Form_Contribution',
-      'CRM_Member_Form_Membership'
+      'CRM_Member_Form_Membership',
     ))) {
       $validFieldsOnly = FALSE;
     }
@@ -844,7 +844,7 @@ WHERE  id = %1";
    * check the current Membership
    * having end date null.
    */
-  static function checkCurrentMembership(&$options, $userid) {
+  public static function checkCurrentMembership(&$options, $userid) {
     if (!$userid || empty($options)) {
       return;
     }
@@ -878,7 +878,7 @@ WHERE  id = %1";
    *
    * @return array
    */
-  static function setDefaultPriceSet(&$form, &$defaults) {
+  public static function setDefaultPriceSet(&$form, &$defaults) {
     if (!isset($form->_priceSet) || empty($form->_priceSet['fields'])) {
       return $defaults;
     }
@@ -901,7 +901,7 @@ WHERE  id = %1";
   /**
    * Get field ids of a price set
    *
-   * @param int id Price Set id
+   * @param int $id Price Set id
    *
    * @return array
    *   Array of the field ids
@@ -925,7 +925,7 @@ WHERE  id = %1";
    *
    * @return CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field
    */
-  static function copy($id) {
+  public static function copy($id) {
     $maxId = CRM_Core_DAO::singleValueQuery("SELECT max(id) FROM civicrm_price_set");
 
     $title = ts('[Copy id %1]', array(1 => $maxId + 1));
@@ -972,7 +972,7 @@ WHERE  id = %1";
    *
    * @return bool
    */
-  function checkPermission($sid) {
+  public function checkPermission($sid) {
     if ($sid &&
       self::eventPriceSetDomainID()
     ) {
index f1754944cd7e636e2c5502fa9ee176e85960f916..345765825f1b578e7c7ce3917d2de683448db04e 100644 (file)
@@ -133,10 +133,8 @@ class CRM_Utils_API_HTMLInputCoder extends CRM_Utils_API_AbstractFieldCoder {
   }
 
   /**
-   * @param $values
+   * @param array $values
    * @param bool $castToString
-   *
-   * @return mixed|void
    */
   public function decodeOutput(&$values, $castToString = FALSE) {
     if (is_array($values)) {
index 0468f4d447033729fb848d8cc0befda759a0e865..11c169f204ec90158f8cc82fdd109e6b1b01b56b 100644 (file)
@@ -440,7 +440,7 @@ class CRM_Utils_Array {
    * @param array $array
    *   (optional) Array to be checked for emptiness.
    *
-   * @return boolean
+   * @return bool
    *   True if the array is empty.
    */
   public static function crmIsEmptyArray($array = array()) {
@@ -744,18 +744,18 @@ class CRM_Utils_Array {
    * @return array
    *   Each item is a distinct combination of values from $dimensions.
    *
-   * For example, the product of
-   * {
+   *   For example, the product of
+   *   {
    *   fg => {red, blue},
    *   bg => {white, black}
-   * }
-   * would be
-   * {
+   *   }
+   *   would be
+   *   {
    *   {fg => red, bg => white},
    *   {fg => red, bg => black},
    *   {fg => blue, bg => white},
    *   {fg => blue, bg => black}
-   * }
+   *   }
    */
   public static function product($dimensions, $template = array()) {
     if (empty($dimensions)) {
index 93c301e483884f554988a9d68c66f657be8faea0..a456f4538686f13821092aff335b666a2500d75d 100644 (file)
@@ -719,7 +719,7 @@ class CRM_Utils_Date {
    * 'day' => '25', 'month' => '10',
    *                              'year' => '2007' );
    *
-   * @param array $dayParamsArray of the day, month, year.
+   * @param array $dayParams of the day, month, year.
    *   Array of the day, month, year.
    *                             values.
    * @param string $format
@@ -1437,7 +1437,7 @@ class CRM_Utils_Date {
             $from['Y'] = $now['year'];
             $from['H'] = 00;
             $from['i'] = $to['s'] = 00;
-            $to = self::intervalAdd('month', +1, $from);
+            $to = self::intervalAdd('month', 1, $from);
             $to = self::intervalAdd('second', -1, $to);
             break;
         }
@@ -1537,7 +1537,7 @@ class CRM_Utils_Date {
             $from['M'] = $now['mon'];
             $from['Y'] = $now['year'];
             $from = self::intervalAdd('day', -1 * ($now['wday']) + 7, $from);
-            $to = self::intervalAdd('day', +6, $from);
+            $to = self::intervalAdd('day', 6, $from);
             break;
 
           case 'starting':
@@ -1546,7 +1546,7 @@ class CRM_Utils_Date {
             $from['Y'] = $now['year'];
             $from['H'] = 00;
             $from['i'] = $to['s'] = 00;
-            $to = self::intervalAdd('day', +7, $from);
+            $to = self::intervalAdd('day', 7, $from);
             $to = self::intervalAdd('second', -1, $to);
             break;
         }
@@ -1606,7 +1606,7 @@ class CRM_Utils_Date {
             $to['d'] = $now['mday'];
             $to['M'] = $now['mon'];
             $to['Y'] = $now['year'];
-            $to = self::intervalAdd('day', +1, $to);
+            $to = self::intervalAdd('day', 1, $to);
             $from['d'] = $to['d'];
             $from['M'] = $to['M'];
             $from['Y'] = $to['Y'];
@@ -1618,7 +1618,7 @@ class CRM_Utils_Date {
 
     foreach (array(
                'from',
-               'to'
+               'to',
              ) as $item) {
       if (!empty($$item)) {
         $dateRange[$item] = self::format($$item);
index c1bd5c1f1b8041d2640ac4fde6adc50b5242004c..d9a115e9a2990102dd165cbecdfa134957aa3570 100644 (file)
@@ -44,7 +44,7 @@ class CRM_Utils_File {
    * @param string $name
    *   Name of file.
    *
-   * @return boolean
+   * @return bool
    *   true if file is ascii
    */
   public static function isAscii($name) {
@@ -72,7 +72,7 @@ class CRM_Utils_File {
    * @param string $name
    *   Name of file.
    *
-   * @return boolean
+   * @return bool
    *   true if file is html
    */
   public static function isHtml($name) {
@@ -177,10 +177,10 @@ class CRM_Utils_File {
   }
 
   /**
-   * @param $source
-   * @param $destination
+   * @param string $source
+   * @param string $destination
    */
-  static function copyDir($source, $destination) {
+  public static function copyDir($source, $destination) {
     if ($dh = opendir($source)) {
       @mkdir($destination);
       while (FALSE !== ($file = readdir($dh))) {
@@ -203,7 +203,7 @@ class CRM_Utils_File {
    * @param string $name
    *   Name of file.
    *
-   * @return boolean
+   * @return bool
    *   whether the file was recoded properly
    */
   public static function toUtf8($name) {
@@ -348,7 +348,7 @@ class CRM_Utils_File {
    * @param string $name
    *   Name of file.
    *
-   * @return boolean
+   * @return bool
    *   whether the file can be include()d or require()d
    */
   public static function isIncludable($name) {
index 3d808283dbcee994b1477e14e4a284924fd227c9..86a75fbceb6914583db7b2198d1c0fc9f590c9bd 100644 (file)
@@ -63,7 +63,7 @@ class CRM_Utils_Geocode_Yahoo {
    * @param bool $stateName
    *   This parameter currently has no function.
    *
-   * @return boolean
+   * @return bool
    *   true if we modified the address, false otherwise
    */
   public static function format(&$values, $stateName = FALSE) {
@@ -118,7 +118,7 @@ class CRM_Utils_Geocode_Yahoo {
 
     $add = 'q=' . urlencode('select * from geo.placefinder where ');
 
-    $add .= join(urlencode(' and '), $whereComponents);
+    $add .= implode(urlencode(' and '), $whereComponents);
 
     $add .= "&appid=" . urlencode($config->mapAPIKey);
 
index c3ad47b116b59e1e118b7d237d5e869d25b67be9..48b2529642c3bfebdc5e38aeb6f5067a63149604 100644 (file)
@@ -67,7 +67,7 @@ class CRM_Utils_Hook_Joomla extends CRM_Utils_Hook {
    *
    * @return mixed
    */
-  function invoke(
+  public function invoke(
     $numParams,
     &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
     $fnSuffix
index f7aecb08575d88a98a6d53d92e9713bc284c065a..a454a10bf24dd39be88fb7ea02e98554d824a7c3 100644 (file)
@@ -67,12 +67,12 @@ class CRM_Utils_Hook_Soap extends CRM_Utils_Hook {
    *
    * @return mixed
    */
-  function invoke(
+  public function invoke(
     $numParams,
     &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
     $fnSuffix
   ) {
     // suppress all hok calls during soap
-    return;
+    return NULL;
   }
 }
index d076c10732af2ff69d17e84f04bb9878ab02f2f6..54fda7e2fd8a871932093119ea0378257919bd1b 100644 (file)
@@ -55,8 +55,8 @@ class CRM_Utils_Mail {
    * @param array $params
    *   (by reference).
    *
-   * @return boolean
-   *   true if a mail was sent, else false
+   * @return bool
+   *   TRUE if a mail was sent, else FALSE.
    */
   public static function send(&$params) {
     $returnPath = CRM_Core_BAO_MailSettings::defaultReturnPath();
@@ -91,12 +91,11 @@ class CRM_Utils_Mail {
       $headers = array_merge($headers, $params['headers']);
     }
     $headers['From'] = $params['from'];
-    $headers['To'] =
-      self::formatRFC822Email(
-        CRM_Utils_Array::value('toName', $params),
-        CRM_Utils_Array::value('toEmail', $params),
-        FALSE
-      );
+    $headers['To'] = self::formatRFC822Email(
+      CRM_Utils_Array::value('toName', $params),
+      CRM_Utils_Array::value('toEmail', $params),
+      FALSE
+    );
     $headers['Cc'] = CRM_Utils_Array::value('cc', $params);
     $headers['Bcc'] = CRM_Utils_Array::value('bcc', $params);
     $headers['Subject'] = CRM_Utils_Array::value('subject', $params);
@@ -200,7 +199,7 @@ class CRM_Utils_Mail {
    */
   public static function errorMessage($mailer, $result) {
     $message = '<p>' . ts('An error occurred when CiviCRM attempted to send an email (via %1). If you received this error after submitting on online contribution or event registration - the transaction was completed, but we were unable to send the email receipt.', array(
-        1 => 'SMTP'
+        1 => 'SMTP',
       )) . '</p>' . '<p>' . ts('The mail library returned the following error message:') . '<br /><span class="font-red"><strong>' . $result->getMessage() . '</strong></span></p>' . '<p>' . ts('This is probably related to a problem in your Outbound Email Settings (Administer CiviCRM &raquo; System Settings &raquo; Outbound Email), OR the FROM email address specifically configured for your contribution page or event. Possible causes are:') . '</p>';
 
     if (is_a($mailer, 'Mail_smtp')) {
@@ -211,7 +210,7 @@ class CRM_Utils_Mail {
     }
 
     $message .= '<li>' . ts('The FROM Email Address configured for this feature may not be a valid sender based on your email service provider rules.') . '</li>' . '</ul>' . '<p>' . ts('Check <a href="%1">this page</a> for more information.', array(
-        1 => CRM_Utils_System::docURL2('user/advanced-configuration/email-system-configuration', TRUE)
+        1 => CRM_Utils_System::docURL2('user/advanced-configuration/email-system-configuration', TRUE),
       )) . '</p>';
 
     return $message;
@@ -274,8 +273,8 @@ class CRM_Utils_Mail {
   /**
    * Get the Active outBound email
    *
-   * @return boolean
-   *   true if valid outBound email configuration found, false otherwise
+   * @return bool
+   *   TRUE if valid outBound email configuration found, false otherwise.
    */
   public static function validOutBoundMail() {
     $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
index d13d2e1461fa2b43beab80df8dd5aacd3ceff332..d15ab20ec0750ef4579537b3f299a1fde6e146ae 100644 (file)
@@ -46,12 +46,12 @@ class CRM_Utils_Mail_EmailProcessor {
   /**
    * Process the default mailbox (ie. that is used by civiMail for the bounce)
    *
-   * @return boolean
-   *   always returns true (for the api). at a later stage we should
-   *                 fix this to return true on success / false on failure etc
+   * @return bool
+   *   Always returns true (for the api). at a later stage we should
+   *   fix this to return true on success / false on failure etc.
    */
   public static function processBounces() {
-    $dao = new CRM_Core_DAO_MailSettings;
+    $dao = new CRM_Core_DAO_MailSettings();
     $dao->domain_id = CRM_Core_Config::domainID();
     $dao->is_default = TRUE;
     $dao->find();
@@ -101,7 +101,7 @@ class CRM_Utils_Mail_EmailProcessor {
    * @return void
    */
   public static function processActivities() {
-    $dao = new CRM_Core_DAO_MailSettings;
+    $dao = new CRM_Core_DAO_MailSettings();
     $dao->domain_id = CRM_Core_Config::domainID();
     $dao->is_default = FALSE;
     $dao->find();
@@ -124,7 +124,7 @@ class CRM_Utils_Mail_EmailProcessor {
    * @return void
    */
   public static function process($civiMail = TRUE) {
-    $dao = new CRM_Core_DAO_MailSettings;
+    $dao = new CRM_Core_DAO_MailSettings();
     $dao->domain_id = CRM_Core_Config::domainID();
     $dao->find();
 
@@ -143,8 +143,8 @@ class CRM_Utils_Mail_EmailProcessor {
     // 0 = activities; 1 = bounce;
     $usedfor = $dao->is_default;
 
-    $emailActivityTypeId =
-      (defined('EMAIL_ACTIVITY_TYPE_ID') && EMAIL_ACTIVITY_TYPE_ID) ? EMAIL_ACTIVITY_TYPE_ID : CRM_Core_OptionGroup::getValue(
+    $emailActivityTypeId
+      (defined('EMAIL_ACTIVITY_TYPE_ID') && EMAIL_ACTIVITY_TYPE_ID) ? EMAIL_ACTIVITY_TYPE_ID : CRM_Core_OptionGroup::getValue(
         'activity_type',
         'Inbound Email',
         'name'
index 2694c092f2e7fb18bc9e0e1b6d12ed3104f30f01..1f416f6a024bc1a2b1a32706521c09fb7a84eb6a 100644 (file)
@@ -484,7 +484,7 @@ class CRM_Utils_Migrate_Export {
               'Individual',
               'Organization',
               'Household',
-              'Case'
+              'Case',
             ))) {
             if ($object->extends == 'Event') {
               $key = 'event_type';
index 4cda5c0e1ce20d879dff84268f807baf61d89c7d..6d7e589a2b6c8cb686c4da7b42cacc80776e1103 100644 (file)
@@ -185,7 +185,7 @@ WHERE      g.name IN ( $nameString )
    * @param $whereField
    * @param null $additionalWhereCond
    */
-  function table(
+  public function table(
     &$ids,
     $tableName,
     &$fields,
@@ -590,7 +590,7 @@ WHERE ac.contact_id IN ( $ids )
    * @param null $lastExportTime
    * @param bool $discoverContacts
    */
-  function run(
+  public function run(
     $fileName,
     $lastExportTime = NULL,
     $discoverContacts = FALSE
index 4bb1672441572554a9a280f5ce82fe12ae53c475..916c892938c710ded1e03456647e06650c1a7247 100644 (file)
@@ -90,7 +90,7 @@ class CRM_Utils_Money {
     if (!self::$_currencySymbols) {
       self::$_currencySymbols = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array(
           'keyColumn' => 'name',
-          'labelColumn' => 'symbol'
+          'labelColumn' => 'symbol',
         ));
     }
 
index 1e97062f90dec0a042824c580aba8c9b2d00d427..d20ef8cae1de21baf9afbeccf341f7dd77a51d79 100644 (file)
@@ -301,7 +301,7 @@ class CRM_Utils_PDF_Utils {
    * @param string $author
    * @param string $title
    */
-  static function &pdflib(
+  public static function &pdflib(
     $fileName,
     $searchPath,
     &$values,
index 658a96a202c25a7186fd724156b4c53fc7d83af9..dbe4740e3a721336fed4a0b6f26ebe63b05c8e84 100644 (file)
@@ -468,8 +468,10 @@ class CRM_Utils_REST {
     return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/api/explorer'));
   }
 
-  /** used to load a template "inline", eg. for ajax, without having to build a menu for each template */
-  static function loadTemplate() {
+  /**
+   * used to load a template "inline", eg. for ajax, without having to build a menu for each template
+   */
+  public static function loadTemplate() {
     $request = CRM_Utils_Request::retrieve('q', 'String');
     if (FALSE !== strpos($request, '..')) {
       die ("SECURITY FATAL: the url can't contain '..'. Please report the issue on the forum at civicrm.org");
@@ -522,10 +524,11 @@ class CRM_Utils_REST {
     }
   }
 
-  /** This is a wrapper so you can call an api via json (it returns json too)
+  /**
+   * This is a wrapper so you can call an api via json (it returns json too)
    * http://example.org/civicrm/api/json?entity=Contact&action=Get"&json={"contact_type":"Individual","email.get.email":{}} to take all the emails from individuals
    * works for POST & GET (POST recommended)
-   **/
+   */
   public static function ajaxJson() {
     $requestParams = CRM_Utils_Request::exportValues();
 
@@ -559,8 +562,7 @@ class CRM_Utils_REST {
     if (!is_array($params)) {
       CRM_Utils_JSON::output(array(
           'is_error' => 1,
-          'error_message',
-          'invalid json format: ?{"param_with_double_quote":"value"}'
+          'error_message' => 'invalid json format: ?{"param_with_double_quote":"value"}',
         ));
     }
 
index d99b398a9c3c95375f3f91ac89e68a84bf48fee5..cdefd36e62bbb79431ec77446e9ca121adc64ac1 100644 (file)
@@ -53,7 +53,6 @@ class CRM_Utils_ReCAPTCHA {
   /**
    * Singleton function used to manage this object
    *
-   * @param string the key to permit session scope's
    *
    * @return object
    */
index 012533eb9bb18244f97f8da7ea1da9ad3d1da2cc..f81cb4bfeb249ca3c93e80e411136b32929a0796 100644 (file)
@@ -94,7 +94,7 @@ class CRM_Utils_Recent {
    *
    * @return void
    */
-  static function add(
+  public static function add(
     $title,
     $url,
     $id,
index afa8560aea3ee6657ff84eedabc44e21fa2aa1d4..9ec754374a111a92f6b8b0e193ed4a4a3309ca81 100644 (file)
@@ -53,7 +53,7 @@ class CRM_Utils_SQL_Insert {
   /**
    * Create a new SELECT query
    *
-   * @param string $from
+   * @param string $table
    *   Table-name and optional alias.
    */
   public function __construct($table) {
index eecd779c238ea06f3567ab8895688ae4c0ddaa27..ef81824aac7c4acdaad6927dccf2269a1393cdcb 100644 (file)
@@ -146,7 +146,9 @@ class CRM_Utils_SoapServer {
     return sha1($result[2]);
   }
 
-  /*** MAILER API ***/
+  /**
+   * MAILER API
+   */
   public function mailer_event_bounce($key, $job, $queue, $hash, $body) {
     $this->verify($key);
     $params = array(
index 511b8caa67c57572df549a0a8d9fce5391f52f00..5703bd978de9124a94b82cf6174298c89def280a 100644 (file)
@@ -51,8 +51,7 @@ class CRM_Utils_String {
    * Convert a display name into a potential variable
    * name that we could use in forms/code
    *
-   * @param name Name of the string
-   *
+   * @param $title title of the string
    * @param int $maxLength
    *
    * @return string
@@ -209,7 +208,7 @@ class CRM_Utils_String {
    * @param bool $utf8
    *   Attempt utf8 match on failure (default yes).
    *
-   * @return boolean
+   * @return bool
    *   true if string is ascii
    */
   public static function isAscii($str, $utf8 = TRUE) {
@@ -312,7 +311,7 @@ class CRM_Utils_String {
    * @param string $str
    *   Input string.
    *
-   * @return boolean
+   * @return bool
    */
   public static function isUtf8($str) {
     if (!function_exists(mb_detect_encoding)) {
@@ -342,7 +341,7 @@ class CRM_Utils_String {
    * @param string $url2
    *   The second url to be matched against.
    *
-   * @return boolean
+   * @return bool
    *   true if the urls match, else false
    */
   public static function match($url1, $url2) {
@@ -391,7 +390,7 @@ class CRM_Utils_String {
    * @param string $str
    *   The string to be translated.
    *
-   * @return boolean
+   * @return bool
    */
   public static function strtobool($str) {
     if (!is_scalar($str)) {
@@ -410,7 +409,7 @@ class CRM_Utils_String {
    * @param string $str
    *   The string to be translated.
    *
-   * @return boolean
+   * @return bool
    */
   public static function strtoboolstr($str) {
     if (!is_scalar($str)) {
@@ -571,7 +570,7 @@ class CRM_Utils_String {
    * @return string
    *   the sanitized string
    */
-  static function stripPathChars(
+  public static function stripPathChars(
     $string,
     $search = NULL,
     $replace = NULL
@@ -737,7 +736,7 @@ class CRM_Utils_String {
    * @param bool $case
    *   Boolean indicating whether you want the comparison to be case sensitive or not.
    *
-   * @return boolean
+   * @return bool
    *   TRUE (string are identical); FALSE (strings are not identical)
    */
   public static function compareStr($strOne, $strTwo, $case) {
@@ -771,7 +770,7 @@ class CRM_Utils_String {
    * (because most other odd characters are %-escaped in URLs; and %-escaped
    * strings don't need any extra escaping in HTML).
    *
-   * @param string $url
+   * @param string $htmlUrl
    *   URL with HTML entities.
    * @return string
    *   URL without HTML entities
index d8c637c2e6128a62e36c5d9dc2f1bda7a907d785..1b04f30272b6f681febab80dfeb62209bc5b051d 100644 (file)
@@ -183,7 +183,7 @@ class CRM_Utils_System {
    *
    * @return string
    */
-  static function theme(
+  public static function theme(
     &$content,
     $print = FALSE,
     $maintenance = FALSE
@@ -229,7 +229,7 @@ class CRM_Utils_System {
    * @return string
    *   An HTML string containing a link to the given path.
    */
-  static function url(
+  public static function url(
     $path = NULL,
     $query = NULL,
     $absolute = FALSE,
@@ -261,7 +261,7 @@ class CRM_Utils_System {
    *
    * @return string
    */
-  static function href(
+  public static function href(
     $text, $path = NULL, $query = NULL, $absolute = TRUE,
     $fragment = NULL, $htmlize = TRUE, $frontend = FALSE, $forceBackend = FALSE
   ) {
@@ -427,7 +427,7 @@ class CRM_Utils_System {
    * @param string $message
    *   (optional) The message to provide in the body of the redirect page.
    */
-  static function jsRedirect(
+  public static function jsRedirect(
     $url = NULL,
     $title = NULL,
     $message = NULL
@@ -799,7 +799,7 @@ class CRM_Utils_System {
    * @param bool $output
    * @param string $disposition
    */
-  static function download(
+  public static function download(
     $name, $mimeType, &$buffer,
     $ext = NULL,
     $output = TRUE,
@@ -1300,13 +1300,13 @@ class CRM_Utils_System {
    * @param array $params
    *   An array of parameters (see CRM_Utils_System::docURL2 method for names)
    *
-   * @return string
+   * @return void|string
    *   URL or link to documentation page, based on provided parameters.
    */
   public static function docURL($params) {
 
     if (!isset($params['page'])) {
-      return;
+      return NULL;
     }
 
     if (CRM_Utils_Array::value('resource', $params) == 'wiki') {
@@ -1464,15 +1464,12 @@ class CRM_Utils_System {
     CRM_ACL_BAO_Cache::resetCache();
 
     // reset various static arrays used here
-    CRM_Contact_BAO_Contact::$_importableFields =
-    CRM_Contact_BAO_Contact::$_exportableFields =
-    CRM_Contribute_BAO_Contribution::$_importableFields =
-    CRM_Contribute_BAO_Contribution::$_exportableFields =
-    CRM_Pledge_BAO_Pledge::$_exportableFields =
-    CRM_Contribute_BAO_Query::$_contributionFields =
-    CRM_Core_BAO_CustomField::$_importFields =
-    CRM_Core_BAO_Cache::$_cache =
-    CRM_Core_DAO::$_dbColumnValueCache = NULL;
+    CRM_Contact_BAO_Contact::$_importableFields = CRM_Contact_BAO_Contact::$_exportableFields
+      = CRM_Contribute_BAO_Contribution::$_importableFields
+        = CRM_Contribute_BAO_Contribution::$_exportableFields
+          = CRM_Pledge_BAO_Pledge::$_exportableFields = CRM_Contribute_BAO_Query::$_contributionFields
+            = CRM_Core_BAO_CustomField::$_importFields
+              = CRM_Core_BAO_Cache::$_cache = CRM_Core_DAO::$_dbColumnValueCache = NULL;
 
     CRM_Core_OptionGroup::flushAll();
     CRM_Utils_PseudoConstant::flushAll();
@@ -1642,7 +1639,7 @@ class CRM_Utils_System {
    * @return string
    *   , formatted url.
    */
-  static function languageNegotiationURL(
+  public static function languageNegotiationURL(
     $url,
     $addLanguagePart = TRUE,
     $removeLanguagePart = FALSE
@@ -1664,7 +1661,7 @@ class CRM_Utils_System {
    *   (optional) Sent by contribution/event reg/profile pages which uses a id
    *   specific extra file name if present.
    */
-  static function appendTPLFile(
+  public static function appendTPLFile(
     $fileName,
     &$content,
     $overideFileName = NULL
index 70c95607b6b17fa463a16251a5274c58446c319c..3ec8a101edc9afba3703b7db178a2bef7a8ec00c 100644 (file)
@@ -142,7 +142,7 @@ abstract class CRM_Utils_System_Base {
    * @return string
    *   Formatted url.
    */
-  function languageNegotiationURL(
+  public function languageNegotiationURL(
     $url,
     $addLanguagePart = TRUE,
     $removeLanguagePart = FALSE
@@ -177,7 +177,7 @@ abstract class CRM_Utils_System_Base {
    * @param string $username
    *
    * @throws CRM_Core_Exception
-   * @return int|NULL
+   * @return;
    */
   public function getUfId($username) {
     $className = get_class($this);
@@ -218,9 +218,9 @@ abstract class CRM_Utils_System_Base {
    * @param string $dir
    *
    * @return array
-   * - $url, (Joomla - non admin url)
-   * - $siteName,
-   * - $siteRoot
+   *   - $url, (Joomla - non admin url)
+   *   - $siteName,
+   *   - $siteRoot
    */
   public function getDefaultSiteSettings($dir) {
     $config = CRM_Core_Config::singleton();
@@ -311,7 +311,7 @@ abstract class CRM_Utils_System_Base {
   /**
    * Get currently logged in user uf id.
    *
-   * @return int
+   * @return;
    *   $userID logged in user uf id.
    */
   public function getLoggedInUfID() {
@@ -320,7 +320,7 @@ abstract class CRM_Utils_System_Base {
   /**
    * Get currently logged in user unique identifier - this tends to be the email address or user name.
    *
-   * @return string
+   * @return;
    *   logged in user unique identifier
    */
   public function getLoggedInUniqueIdentifier() {
index 7af9cc659192bd8941b6c233fe4a1af594afee30..52a1f139c9c60fdfc8f56f045c820b12471b2e93 100644 (file)
@@ -416,8 +416,6 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase {
   /**
    * Rewrite various system urls to https
    *
-   * @param null
-   *
    * @return void
    */
   public function mapConfigToSSL() {
@@ -454,10 +452,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase {
    *   Load cms bootstrap?.
    * @param NULL|string $realPath filename of script
    *
-   * @return mixed
-   *   false if no auth
-   *               array(
-   *  contactID, ufID, unique string ) if success
+   * @return mixed false if no auth array(contactID, ufID, unique string ) if success
    */
   public static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) {
     require_once 'DB.php';
@@ -561,7 +556,7 @@ AND    u.status = 1
    * e.g. for drupal: records a watchdog message about the new session, saves the login timestamp,
    * calls hook_user op 'login' and generates a new session.
    *
-   * @param array params
+   * @param array $params
    *
    * FIXME: Document values accepted/required by $params
    */
@@ -815,7 +810,7 @@ AND    u.status = 1
   /**
    * Check is user logged in.
    *
-   * @return boolean
+   * @return bool
    */
   public function isUserLoggedIn() {
     $isloggedIn = FALSE;
index 795b6541de3d053368bc66b9d1a1fa7fa726bc01..01371fe3c8302c7a0e90f9cd6130dd688dc69e9b 100644 (file)
@@ -401,10 +401,6 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
 
   /**
    * Rewrite various system urls to https
-   *
-   * @param null
-   *
-   * @return void
    */
   public function mapConfigToSSL() {
     global $base_url;
@@ -473,7 +469,8 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
       if (!$contactID) {
         return FALSE;
       }
-      else { //success
+      else {
+        //success
         if ($loadCMSBootstrap) {
           $bootStrapParams = array();
           if ($name && $password) {
@@ -515,7 +512,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
    * e.g. for drupal : records a watchdog message about the new session,
    * saves the login timestamp, calls hook_user op 'login' and generates a new session.
    *
-   * @param array params
+   * @param array $params
    *
    * FIXME: Document values accepted/required by $params
    */
@@ -763,7 +760,7 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase {
   /**
    * Check is user logged in.
    *
-   * @return boolean
+   * @return bool
    */
   public function isUserLoggedIn() {
     $isloggedIn = FALSE;
index 525aa5d9743219b8b228f36a61fc1195ee650ca1..c8aa0e2408eee6b60958107547e8c9532e96fb4a 100644 (file)
@@ -56,7 +56,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base {
    * @return void
    */
   public function setTitle($title, $pageTitle) {
-    return;
+    return NULL;
   }
 
   /**
@@ -65,7 +65,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base {
    * @param string $str
    *   The permission to check.
    *
-   * @return boolean
+   * @return bool
    *   true if yes, else false
    */
   public function checkPermission($str) {
@@ -81,7 +81,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base {
    * @return void
    */
   public function appendBreadCrumb($title, $url) {
-    return;
+    return NULL;
   }
 
   /**
@@ -93,7 +93,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base {
    * @return void
    */
   public function addHTMLHead($head) {
-    return;
+    return NULL;
   }
 
   /**
@@ -127,8 +127,6 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base {
   /**
    * Figure out the post url for the form
    *
-   * @param the default action if one is pre-specified
-   *
    * @return string
    *   the url to post the form
    */
@@ -199,7 +197,7 @@ class CRM_Utils_System_Soap extends CRM_Utils_System_Base {
    *   If present, add destination to querystring (works for Drupal only).
    *
    * @throws Exception
-   * @return string
+   * @return;
    *   loginURL for the current CMS
    */
   public function getLoginURL($destination = '') {
index 4c9002373b752394985722bb11aabe2f00366c2e..895b3e2db156f786a0f6e5932b28c4f9e03a2c67 100644 (file)
@@ -59,7 +59,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal {
    * @param null $pageTitle
    */
   public function setTitle($title, $pageTitle = NULL) {
-    return;
+    return NULL;
   }
 
   /**
@@ -103,11 +103,11 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal {
    * @param $breadCrumbs
    */
   public function appendBreadCrumb($breadCrumbs) {
-    return;
+    return NULL;
   }
 
   public function resetBreadCrumb() {
-    return;
+    return NULL;
   }
 
   /**
@@ -122,7 +122,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal {
    * @param string $head
    */
   public function addHTMLHead($head) {
-    return;
+    return NULL;
   }
 
   public function mapConfigToSSL() {
@@ -142,10 +142,10 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal {
   /**
    * @param mix $action
    *
-   * @return string
+   * @return void
    */
   public function postURL($action) {
-    return;
+    return NULL;
   }
 
   /**
@@ -182,7 +182,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal {
    *
    * @return string
    */
-  function url(
+  public function url(
     $path = NULL, $query = NULL, $absolute = FALSE,
     $fragment = NULL, $htmlize = TRUE,
     $frontend = FALSE, $forceBackend = FALSE
@@ -270,7 +270,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal {
    * @param string $message
    */
   public function setMessage($message) {
-    return;
+    return NULL;
   }
 
   public function permissionDenied() {
@@ -289,7 +289,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal {
    *   with the locale or null for none
    */
   /**
-   * @return string
+   * @return void
    */
   public function getUFLocale() {
     return NULL;
@@ -314,8 +314,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal {
    * @param string $destination
    *   If present, add destination to querystring (works for Drupal only).
    *
-   * @throws Exception
-   * @return string
+   * @Throws Exception
    *   loginURL for the current CMS
    */
   public function getLoginURL($destination = '') {
index cbbafa0f4d7357479479214bfff6b6c97e0e16ed..ce7140275c0ba0d95e6fc2f60b100d55f1e1f909 100644 (file)
@@ -109,10 +109,8 @@ class CRM_Utils_Tree {
    *   Name of the node we are searching for.
    * @param array (ref) $parentNode which parent node should we search in ?
    *
-   * @return array(
-   * ref) | false node if found else false
+   * @return array(ref) | false node if found else false
    */
-  //public function &findNode(&$parentNode, $name)
   public function &findNode($name, &$parentNode) {
     // if no parent node specified, please start from root node
     if (!$parentNode) {
@@ -146,10 +144,9 @@ class CRM_Utils_Tree {
    * Check if node is a leaf node.
    * Currently leaf nodes are strings and non-leaf nodes are arrays
    *
-   * @param array (
-   * ref) $node node which needs to checked
+   * @param array $node node which needs to checked
    *
-   * @return boolean
+   * @return bool
    */
   public function isLeafNode(&$node) {
     return (count($node['children']) ? TRUE : FALSE);
@@ -176,7 +173,7 @@ class CRM_Utils_Tree {
    *
    * @param string $parentName
    *   Name of the parent ?.
-   * @param array (ref) - node to be added
+   * @param array (ref) $node - node to be added
    *
    * @return void
    */
@@ -190,10 +187,9 @@ class CRM_Utils_Tree {
   /**
    * Add Data
    *
-   * @param string $parentName
-   *   Name of the parent ?.
-   * @param mixed - data to be added
-   * @param string - key to be used (optional)
+   * @param string $parentName Name of the parent ?.
+   * @param string $childName - key to be used (optional)
+   * @param mixed $data - data to be added
    *
    * @return void
    */
@@ -212,8 +208,6 @@ class CRM_Utils_Tree {
   /**
    * Get Tree
    *
-   * @param none
-   *
    * @return tree
    */
   public function getTree() {
@@ -223,8 +217,6 @@ class CRM_Utils_Tree {
   /**
    * Print the tree
    *
-   * @param none
-   *
    * @return void
    */
   public function display() {
index 49d571c73bdf470bc2c675f8a9e33bfdc593e3cd..ab2ffe6e5ce4d8b463bf934b6e36da25b3e4fb99 100644 (file)
@@ -250,7 +250,9 @@ class CRM_Utils_Type {
         break;
 
       default:
-        CRM_Core_Error::fatal("Cannot recognize $type for $data");
+        CRM_Core_Error::fatal(
+          $type . " is not a recognised (camel cased) data type."
+        );
         break;
     }
 
index f15a93b5a568f14e8410d695771dad2cc3c4ca0b..020738e5fb7871c87e10b6e413fc21a1344cfa06 100644 (file)
@@ -62,7 +62,7 @@ class CRM_Widget_Widget {
    * @param int $contributionPageID
    * @param string $widgetID
    *
-   * @return stdClass
+   * @return object
    */
   public function getContributionPageData($contributionPageID, $widgetID) {
     $config = CRM_Core_Config::singleton();
index f958eb663af1eff6d5ef7374b049e4b54f1206c3..cc5d2dd21fe9cf66a64f98f657dd051249cb6d72 100644 (file)
@@ -84,7 +84,7 @@ class Analyzer {
       $activityStatusGroup = civicrm_api3('option_group', 'get', array('name' => 'activity_status'));
       $activityStatus = array(
         'name' => $status,
-        'option_group_id' => $activityStatusGroup['id']
+        'option_group_id' => $activityStatusGroup['id'],
       );
       $activityStatusID = civicrm_api3('option_value', 'get', $activityStatus);
       $activityStatusID = $activityStatusID['values'][$activityStatusID['id']]['value'];
index 000143abde1a271231f4bea0cbfaf7cb56a3a245..fa56a554c7ff86840275021cc06829b29d44cdb7 100644 (file)
@@ -100,7 +100,7 @@ class Container {
     $dispatcher->addListener('DAO::post-delete', array('\CRM_Core_BAO_RecurringEntity', 'triggerDelete'));
     $dispatcher->addListener('hook_civicrm_unhandled_exception', array(
         'CRM_Core_LegacyErrorHandler',
-        'handleException'
+        'handleException',
       ));
     return $dispatcher;
   }
index 7b2ca2dc64984d12059d965409a1eeaaa9047f98..8e38800620ec14d440b04ae62eb5b4b4c4dd4a44 100644 (file)
@@ -153,7 +153,9 @@ class Manager {
    * @return \Civi\Core\Transaction\Frame
    */
   public function getBaseFrame() {
-    if (empty($this->frames)) return NULL;
+    if (empty($this->frames)) {
+      return NULL;
+    }
     return $this->frames[count($this->frames) - 1];
   }
 
index 68c95cc4b1996a1b61cd0bd7c81badcde2ee98af..9736b5a26d2e2113974f495891322c1bdf4aee58 100644 (file)
@@ -282,7 +282,7 @@ class Requirements {
     $results = array(
       'title' => 'CiviCRM InnoDB support',
       'severity' => $this::REQUIREMENT_ERROR,
-      'details' => 'Could not determine if MySQL has InnoDB support. Assuming none.'
+      'details' => 'Could not determine if MySQL has InnoDB support. Assuming none.',
     );
 
     $conn = @mysql_connect($db_config['host'], $db_config['username'], $db_config['password']);
index 4a23bdd0b49182102b2562cccb69226c41e02687..bb31c023a8cc7f121cb73d16eab93ce823f61446 100644 (file)
@@ -69,7 +69,7 @@ function civicrm_api3_contact_create($params) {
       $defLocType = CRM_Core_BAO_LocationType::getDefault();
       $params['email'] = array(
         1 => array(
-      'email' => $email,
+          'email' => $email,
           'is_primary' => 1,
           'location_type_id' => ($defLocType->id) ? $defLocType->id : 1,
         ),
@@ -80,8 +80,8 @@ function civicrm_api3_contact_create($params) {
   if (!empty($params['home_url'])) {
     $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
     $params['website'] = array(
-    1 => array(
-    'website_type_id' => key($websiteTypes),
+      1 => array(
+        'website_type_id' => key($websiteTypes),
         'url' => $params['home_url'],
       ),
     );
@@ -141,8 +141,6 @@ function _civicrm_api3_contact_create_spec(&$params) {
 /**
  * Retrieve one or more contacts, given a set of search params
  *
- * @param array input parameters
- *
  * @return array
  *   API Result Array
  */
@@ -819,7 +817,7 @@ LIMIT    0, {$limit}
       if ($listCurrentEmployer && !empty($currEmpDetails)) {
         $contactList = array(
           array(
-          'data' => $currEmpDetails['data'],
+            'data' => $currEmpDetails['data'],
             'id'   => $currEmpDetails['id'],
           ),
         );
index bee0711b8d673ee43c68a2337599ffe8905995fc..c207e48457294ccee2c3a8693fac264a0c113453 100644 (file)
@@ -134,13 +134,13 @@ function civicrm_api3_custom_field_get($params) {
  * @param array $errors
  *   Collect validation errors.
  *
- * @return array
+ * @return array|NULL
  *   Validation errors
  * @todo remove this function - not in use but need to review functionality before
  * removing as it might be useful in wrapper layer
  */
 function _civicrm_api3_custom_field_validate_field($fieldName, $value, $fieldDetails, &$errors = array()) {
-  return;
+  return NULL;
   //see comment block
   if (!$value) {
     return $errors;
index 30439814519cabcf1d4368155bfe6d6eb4d542c0..5d2f03fcc4e899f904a735f39009cc1e4b68dadf 100644 (file)
@@ -115,9 +115,7 @@ function civicrm_api3_custom_group_delete($params) {
  *   Array to search on.
  *
  * @return array
- * * {@getfields CustomGroup_get}
- * @example CustomGroupGet.php
- **/
+ */
 function civicrm_api3_custom_group_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
index 249515640d38a8a1d3696d66dd2bb0c3a2a014e5..a39ded5c2dacca19b571a682ee24fb89e38b2a15 100644 (file)
@@ -40,8 +40,7 @@
  */
 
 /**
- * {@getfields EntityTag_get}
- * @example EntityTagGet.php
+ * Get entity tags.
  *
  * @param array $params
  *
@@ -64,9 +63,10 @@ function civicrm_api3_entity_tag_get($params) {
 }
 
 /**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
+ *
+ * The metadata is used for setting defaults, documentation & validation.
  *
- * The metadata is used for setting defaults, documentation & validation
  * @param array $params
  *   Array or parameters determined by getfields.
  */
@@ -76,20 +76,18 @@ function _civicrm_api3_entity_tag_get_spec(&$params) {
 }
 
 /**
+ * Create an entity tag.
  *
  * @param array $params
  *
  * @return array
- * {@getfields EntityTag_create}
- * @example EntityTagCreate.php
  */
 function civicrm_api3_entity_tag_create($params) {
   return _civicrm_api3_entity_tag_common($params, 'add');
 }
 
 /**
- * {@getfields EntityTag_delete}
- * @example EntityTagGet.php
+ * Mark entity tag as removed.
  *
  * @param array $params
  *
@@ -101,7 +99,8 @@ function civicrm_api3_entity_tag_delete($params) {
 }
 
 /**
- * modify metadata
+ * Modify metadata.
+ *
  * @param array $params
  */
 function _civicrm_api3_entity_tag_delete_spec(&$params) {
@@ -110,12 +109,12 @@ function _civicrm_api3_entity_tag_delete_spec(&$params) {
 }
 
 /**
+ * Helper function for formatting tags (part of api v2 legacy).
  *
  * @param array $params
  * @param string $op
  *
  * @return array
- *   <type>
  */
 function _civicrm_api3_entity_tag_common($params, $op = 'add') {
 
index e03110b17295ee762e01ddd387e79b9374f23846..946df5baf5c807904799af1363219407b2a9aa92 100644 (file)
@@ -85,8 +85,8 @@ function civicrm_api3_group_contact_get($params) {
  * @return array
  *   Information about operation results
  *
- * On success, the return array will be structured as follows:
- * <code>array(
+ *   On success, the return array will be structured as follows:
+ *   <code>array(
  *   "is_error" => 0,
  *   "version"  => 3,
  *   "count"    => 3,
@@ -95,15 +95,15 @@ function civicrm_api3_group_contact_get($params) {
  *     "added"       => integer,
  *     "total_count" => integer
  *   )
- * )</code>
+ *   )</code>
  *
- * On failure, the return array will be structured as follows:
- * <code>array(
+ *   On failure, the return array will be structured as follows:
+ *   <code>array(
  *   'is_error' => 1,
  *   'error_message' = string,
  *   'error_data' = mixed or undefined
- * )</code>
- * {@getfields GroupContact_create}
+ *   )</code>
+ *   {@getfields GroupContact_create}
  */
 function civicrm_api3_group_contact_create($params) {
   // Nonstandard bao - doesn't accept ID as a param, so convert id to group_id + contact_id
@@ -160,7 +160,7 @@ function civicrm_api3_group_contact_pending($params) {
  * @param array $params
  * @param string $op
  *
- * @return Array
+ * @return array
  * @todo behaviour is highly non-standard - need to figure out how to make this 'behave'
  * & at the very least return IDs & details of the groups created / changed
  */
@@ -220,8 +220,8 @@ function _civicrm_api3_group_contact_common($params, $op = 'Added') {
       $extraReturnValues['not_removed'] += $nr;
     }
   }
-  $dao = null;// can't pass this by reference
-  return civicrm_api3_create_success(1,$params,'group_contact','create',$dao,$extraReturnValues);
+  $dao = NULL;// can't pass this by reference
+  return civicrm_api3_create_success(1, $params, 'group_contact', 'create', $dao, $extraReturnValues);
 }
 
 /**
index f117aec3004e68a414834b1e79f5f2cdfe21436f..39dcb176af271d56ed8384ff7068a0ae6464ddaa 100644 (file)
@@ -64,7 +64,6 @@ function _civicrm_api3_im_create_spec(&$params) {
  * Deletes an existing IM
  *
  * @param array $params
- * {@getfields im_delete}
  *
  * @return array
  *   API result Array
index 32acc25feea7c03b90fcf555cbdf731436f68639..0fc93821d6e46f071c9410826416a79b253cb40b 100644 (file)
@@ -62,7 +62,8 @@ function _civicrm_api3_job_create_spec(&$params) {
  *   Associative array of property name/value pairs to insert in new job.
  *
  * @return array
- * {@getfields Job_create}
+ *
+ *   {@getfields Job_create}
  */
 function civicrm_api3_job_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -70,10 +71,12 @@ function civicrm_api3_job_create($params) {
 
 /**
  * Retrieve one or more job
- * @param array input parameters
+ *
+ * @param array $params
+ *   input parameters
  * @return array
- *   api result array
- * {@getfields email_get}
+ *
+ *   {@getfields email_get}
  */
 function civicrm_api3_job_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -84,8 +87,6 @@ function civicrm_api3_job_get($params) {
  *
  * @param array $params
  *
- * @return array
- *   API Result Array
  * {@getfields Job_delete}
  */
 function civicrm_api3_job_delete($params) {
@@ -97,13 +98,14 @@ function civicrm_api3_job_delete($params) {
  * and results are handled in the job log.
  *
  * @param array $params
- *   (reference ) input parameters.
+ *   input parameters (unused).
  *
  * @return array
  *   API Result Array
  */
-function civicrm_api3_job_execute(/** @noinspection PhpUnusedParameterInspection */
-  $params) {
+function civicrm_api3_job_execute($params) {
+  // @noinspection PhpUnusedParameterInspection
+
   $facility = new CRM_Core_JobManager();
   $facility->execute(FALSE);
 
@@ -124,7 +126,7 @@ function _civicrm_api3_job_execute_spec(&$params) {
  * Geocode group of contacts based on given params
  *
  * @param array $params
- *   (reference ) input parameters.
+ *   input parameters.
  *
  * @return array
  *   API Result Array
@@ -132,7 +134,6 @@ function _civicrm_api3_job_execute_spec(&$params) {
 function civicrm_api3_job_geocode($params) {
   $gc = new CRM_Utils_Address_BatchUpdate($params);
 
-
   $result = $gc->run();
 
   if ($result['is_error'] == 0) {
@@ -269,9 +270,9 @@ function _civicrm_api3_job_update_greeting_spec(&$params) {
     'type' => CRM_Utils_Type::T_STRING,
   );
   $params['gt'] = array(
-      'api.required' => 1,
-      'title' => 'Greeting Type',
-      'type' => CRM_Utils_Type::T_STRING,
+    'api.required' => 1,
+    'title' => 'Greeting Type',
+    'type' => CRM_Utils_Type::T_STRING,
   );
 }
 
@@ -370,7 +371,7 @@ function civicrm_api3_job_fetch_activities($params) {
     CRM_Utils_Mail_EmailProcessor::processActivities();
     $values = array();
     $lock->release();
-    return civicrm_api3_create_success($values, $params,'mailing','activities');
+    return civicrm_api3_create_success($values, $params, 'mailing', 'activities');
   }
   catch (Exception $e) {
     $lock->release();
@@ -409,11 +410,10 @@ function civicrm_api3_job_process_participant($params) {
  * @param array $params
  *   Input parameters NOT USED.
  *
- * @return boolean
+ * @return bool
  *   true if success, else false
  */
-function civicrm_api3_job_process_membership(/** @noinspection PhpUnusedParameterInspection */
-  $params) {
+function civicrm_api3_job_process_membership($params) {
   $lock = new CRM_Core_Lock('civimail.job.updateMembership');
   if (!$lock->isAcquired()) {
     return civicrm_api3_create_error('Could not acquire lock, another Membership Processing process is running');
@@ -436,7 +436,7 @@ function civicrm_api3_job_process_membership(/** @noinspection PhpUnusedParamete
  * @param array $params
  *   (reference ) input parameters.
  *
- * @return boolean
+ * @return bool
  *   true if success, else false
  */
 function civicrm_api3_job_process_respondent($params) {
@@ -491,9 +491,7 @@ function _civicrm_api3_job_process_batch_merge_spec(&$params) {
   );
   $params['mode'] = array(
     'title' => 'Mode',
-    'description' => 'helps decide how to behave when there are conflicts.
-       A \'safe\' value skips the merge if there are no conflicts.
-       Does a force merge otherwise.',
+    'description' => 'helps decide how to behave when there are conflicts. A \'safe\' value skips the merge if there are no conflicts. Does a force merge otherwise.',
     'type' => CRM_Utils_Type::T_STRING,
   );
   $params['auto_flip'] = array(
@@ -542,18 +540,15 @@ function civicrm_api3_job_run_payment_cron($params) {
  * This api cleans up all the old session entries and temp tables. We recommend that sites run this on an hourly basis
  *
  * @param array $params
- *   (reference ) - sends in various config parameters to decide what needs to be cleaned.
- *
- * @return boolean
- *   true if success, else false
+ *   Sends in various config parameters to decide what needs to be cleaned.
  */
 function civicrm_api3_job_cleanup($params) {
-  $session   = CRM_Utils_Array::value('session', $params, true );
-  $tempTable = CRM_Utils_Array::value('tempTables', $params, true );
-  $jobLog    = CRM_Utils_Array::value('jobLog', $params, true );
-  $prevNext  = CRM_Utils_Array::value('prevNext', $params, true );
-  $dbCache   = CRM_Utils_Array::value('dbCache', $params, false);
-  $memCache  = CRM_Utils_Array::value('memCache', $params, false);
+  $session   = CRM_Utils_Array::value('session', $params, TRUE);
+  $tempTable = CRM_Utils_Array::value('tempTables', $params, TRUE);
+  $jobLog    = CRM_Utils_Array::value('jobLog', $params, TRUE);
+  $prevNext  = CRM_Utils_Array::value('prevNext', $params, TRUE);
+  $dbCache   = CRM_Utils_Array::value('dbCache', $params, FALSE);
+  $memCache  = CRM_Utils_Array::value('memCache', $params, FALSE);
 
   if ($session || $tempTable || $prevNext) {
     CRM_Core_BAO_Cache::cleanup($session, $tempTable, $prevNext);
@@ -578,8 +573,8 @@ function civicrm_api3_job_cleanup($params) {
  * @return array
  * @throws \API_Exception
  */
-function civicrm_api3_job_disable_expired_relationships(/** @noinspection PhpUnusedParameterInspection */
-  $params) {
+function civicrm_api3_job_disable_expired_relationships($params) {
+  /** @noinspection PhpUnusedParameterInspection */
   $result = CRM_Contact_BAO_Relationship::disableExpiredRelationships();
   if (!$result) {
     throw new API_Exception('Failed to disable all expired relationships.');
@@ -605,7 +600,7 @@ function civicrm_api3_job_group_rebuild($params) {
 
   $limit = CRM_Utils_Array::value('limit', $params, 0);
 
-  CRM_Contact_BAO_GroupContactCache::loadAll(null, $limit);
+  CRM_Contact_BAO_GroupContactCache::loadAll(NULL, $limit);
   $lock->release();
 
   return civicrm_api3_create_success();
index 7bc6be0ae629fa72e0174fde468fdc7f5977d55d..f85074236ae22355e6be4971fca5204a2497a774 100755 (executable)
@@ -41,7 +41,7 @@
  *
  * @param array $params
  * @return array API Success Array
- * API Success Array
+ *    API Success Array
  * @throws \API_Exception
  * @throws \Civi\API\Exception\UnauthorizedException
  */
@@ -206,7 +206,7 @@ function civicrm_api3_mailing_event_bounce($params) {
     return civicrm_api3_create_success($params);
   }
   else {
-    throw new API_Exception(ts('Queue event could not be found'),'no_queue_event
+    throw new API_Exception(ts('Queue event could not be found'), 'no_queue_event
       ');
   }
 }
@@ -573,31 +573,31 @@ function civicrm_api3_mailing_stats($params) {
     switch ($detail) {
       case 'Delivered':
         $stats[$params['mailing_id']] += array(
-          $detail =>  CRM_Mailing_Event_BAO_Delivered::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
+          $detail => CRM_Mailing_Event_BAO_Delivered::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
         );
         break;
 
       case 'Bounces':
         $stats[$params['mailing_id']] += array(
-          $detail =>  CRM_Mailing_Event_BAO_Bounce::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
+          $detail => CRM_Mailing_Event_BAO_Bounce::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
         );
         break;
 
       case 'Unsubscribers':
         $stats[$params['mailing_id']] += array(
-          $detail =>  CRM_Mailing_Event_BAO_Unsubscribe::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']),
+          $detail => CRM_Mailing_Event_BAO_Unsubscribe::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']),
         );
         break;
 
       case 'Unique Clicks':
         $stats[$params['mailing_id']] += array(
-          $detail =>  CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']),
+          $detail => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, NULL, $params['date']),
         );
         break;
 
       case 'Opened':
         $stats[$params['mailing_id']] += array(
-          $detail =>  CRM_Mailing_Event_BAO_Opened::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
+          $detail => CRM_Mailing_Event_BAO_Opened::getTotalCount($params['mailing_id'], $params['job_id'], FALSE, $params['date']),
         );
         break;
     }
index eca1e3403247cf2a0c34f208c0853170035f7296..60a34522e4c2c72c9aa3a42ac3f2da7ee4a327f0 100644 (file)
  * @subpackage API_MailerGroup
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
- * Handle a confirm event
+ * Handle a confirm event.
  *
  * @param array $params
  *   Associative array of property.
@@ -46,7 +45,6 @@
  * @throws Exception
  * @return array
  *   api result array
- * {@getfields mailing_event_confirm_create}
  */
 function civicrm_api3_mailing_event_confirm_create($params) {
 
@@ -63,9 +61,10 @@ function civicrm_api3_mailing_event_confirm_create($params) {
 }
 
 /**
- * Adjust Metadata for Create action
+ * Adjust Metadata for Create action.
+ *
+ * The metadata is used for setting defaults, documentation & validation.
  *
- * The metadata is used for setting defaults, documentation & validation
  * @param array $params
  *   Array or parameters determined by getfields.
  */
index aa3bdf7d897dc9982b991273619bc16a6f754e83..d0db0ed9773a2be52446ff6a3941694b44009ada 100644 (file)
  * @subpackage API_MailerGroup
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 
 /**
- * Subscribe from mailing group
+ * Subscribe from mailing group.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'survey'
  *
  * @return array
  *   api result array
- * {@getfields mailing_event_subscribe_create}
  */
 function civicrm_api3_mailing_event_resubscribe_create($params) {
 
@@ -67,9 +63,10 @@ function civicrm_api3_mailing_event_resubscribe_create($params) {
 }
 
 /**
- * Adjust Metadata for Create action
+ * Adjust Metadata for Create action.
+ *
+ * The metadata is used for setting defaults, documentation & validation.
  *
- * The metadata is used for setting defaults, documentation & validation
  * @param array $params
  *   Array or parameters determined by getfields.
  */
index 9d1a70270669bb022c44e01e1f5fe0579c7d3d89..0315d351fe440c2f0191249e1c596df1d33c6c6f 100644 (file)
@@ -66,8 +66,8 @@ function _civicrm_api3_mailing_job_create_spec(&$params) {
  *   Array of one or more valid.
  *
  * @return array
- *   API return Array of matching mailing jobs
- * {@getfields mailing_job_get}
+ *   API return Array of matching mailing jobs.
+ *   {@getfields mailing_job_get}
  */
 function civicrm_api3_mailing_job_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index d16aff5ec8adefe789de517dbdd6ab64c39d06c7..dfc3ca78d710c79c8d2fd393daf6fa312b18899f 100644 (file)
@@ -46,7 +46,7 @@
  *
  * @return array
  *   api result
- * {@getfields membership_delete}
+ *   {@getfields membership_delete}
  */
 function civicrm_api3_membership_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -63,7 +63,7 @@ function civicrm_api3_membership_delete($params) {
  *
  * @return array
  *   Array of newly created membership property values.
- * {@getfields membership_create}
+ *   {@getfields membership_create}
  */
 function civicrm_api3_membership_create($params) {
   // check params for membership id during update
@@ -112,10 +112,10 @@ function civicrm_api3_membership_create($params) {
   // Fixme: This code belongs in the BAO
   $action = CRM_Core_Action::ADD;
   // we need user id during add mode
-    $ids = array();
-    if (!empty($params['contact_id'])) {
-      $ids['userId'] = $params['contact_id'];
-    }
+  $ids = array();
+  if (!empty($params['contact_id'])) {
+    $ids['userId'] = $params['contact_id'];
+  }
   //for edit membership id should be present
   if (!empty($params['id'])) {
     $ids['membership'] = $params['id'];
@@ -202,7 +202,7 @@ function civicrm_api3_membership_get($params) {
     $params['status_id'] = array('IN' => CRM_Member_BAO_MembershipStatus::getMembershipStatusCurrent());
   }
 
-  $options = _civicrm_api3_get_options_from_params($params, TRUE,'membership', 'get');
+  $options = _civicrm_api3_get_options_from_params($params, TRUE, 'membership', 'get');
   if ($options['is_count']) {
     return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
   }
@@ -218,7 +218,7 @@ function civicrm_api3_membership_get($params) {
     return civicrm_api3_create_success($membershipValues, $params, 'membership', 'get');
   }
 
-  $members =  _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID);
+  $members = _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID);
   return civicrm_api3_create_success($members, $params, 'membership', 'get');
 }
 
index 5683f8593ae9e5d3527b345e1e3639e9482b61a4..7b534d3f51dd5b2052def8b43b5877eaa4f220a8 100644 (file)
@@ -59,9 +59,8 @@ function _civicrm_api3_message_template_create_spec(&$params) {
 /**
  * @param array $params
  *
- * @return boolean
- *   | error  true if successfull, error otherwise
- * {@getfields message_template_delete}
+ * @return bool
+ *   API result array
  */
 function civicrm_api3_message_template_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 82542c550fd7ccfc1ba965fc21fef24f13632d1d..47d64a93457ffa994880bc15eb13672e8c0e95fe 100644 (file)
@@ -93,7 +93,8 @@ function civicrm_api3_note_delete($params) {
  * @return array
  *   array of properties,
  *   if error an array with an error id and error message
- * {@getfields note_get}
+ *
+ *   {@getfields note_get}
  */
 function civicrm_api3_note_get($params) {
 
index 1fc5136caadc6eb6613717dc60b5a70ea3376c8a..81d001b35122fc536d0ccea58ecfe593b9b2359f 100644 (file)
@@ -51,8 +51,7 @@ function _civicrm_api3_option_group_create_spec(&$params) {
  *
  * @return array
  *   API Result Array
- *                message otherwise
- * {@getfields OptionGroup_delete}
+ *   {@getfields OptionGroup_delete}
  */
 function civicrm_api3_option_group_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 73c41662ee31367a666665168c6daaa142afc8bf..340a29d03ed9c7801601a87e4f4c38d5046daa7a 100644 (file)
@@ -131,9 +131,7 @@ function civicrm_api3_pledge_payment_get($params) {
  * Gets field for civicrm_pledge_payment functions
  *
  * @param array $params
- *
- * @return array
- *   fields valid for other functions
+ *   Modifiable list of fields allowed for the PledgePayment.get action.
  */
 function civicrm_api3_pledge_payment_get_spec(&$params) {
   $params['option.create_new'] = array('title' => "Create new field rather than update an unpaid payment");
index 8417fad60c46387b648e2ba4daf2d41bd7da9aa1..c41b04b7ce8514dd1bba977cfd450c47a2d18160 100644 (file)
  * @package CiviCRM_APIv3
  * @subpackage API_ActivityProfile
  * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: ActivityProfile.php 30486 2011-05-20 16:12:09Z rajan $
+ * @version $Id: Profile.php 30486 2011-05-20 16:12:09Z rajan $
  *
  */
 
 /**
  * Retrieve Profile field values.
  *
- * @param array $params
- *   Associative array of property name/value.
- *                             pairs to get profile field values
- *
- * @throws API_Exception
- * @return array
- *
  * NOTE this api is not standard & since it is tested we need to honour that
  * but the correct behaviour is for it to return an id indexed array as this supports
  * multiple instances - if a  single profile is passed in we will not return a normal api result array
  * in order to avoid breaking code. (This could still be confusing :-( but we have to keep the tested behaviour working
  *
  * Note that if contact_id is empty an array of defaults is returned
+ *
+ * @param array $params
+ *   Associative array of property name/value.
+ *   pairs to get profile field values
+ *
+ * @throws API_Exception
+ * @return array
  */
 function civicrm_api3_profile_get($params) {
   $nonStandardLegacyBehaviour = is_numeric($params['profile_id']) ? TRUE : FALSE;
index 7f7573040bf2b6edc0e336e4c53e9565bf092325..c64305b2d03d636aabacdd48aa68c283e4ebfcdf 100644 (file)
@@ -55,7 +55,7 @@ function _civicrm_api3_uf_group_create_spec(&$params) {
  *
  * @return array
  *   API result array
- * {@getfields UFGroup_create}
+ *   {@getfields UFGroup_create}
  * @example UFGroupCreate.php
  */
 function civicrm_api3_uf_group_create($params) {
@@ -72,7 +72,7 @@ function civicrm_api3_uf_group_create($params) {
  *
  * @return array
  *   Array of matching profiles
- * {@getfields UFGroup_get}
+ *   {@getfields UFGroup_get}
  * @example UFGroupGet.php
  */
 function civicrm_api3_uf_group_get($params) {
index d57dbb770baf88c07d5fa25e1364a5bd1d2f5caa..77359bc33288e703540556079996b84636a4ce1b 100644 (file)
@@ -57,7 +57,7 @@ function civicrm_api3_uf_match_get($params) {
  *
  * @return array
  *   api result array
- * {@getfields uf_match_create}
+ *   {@getfields uf_match_create}
  */
 function civicrm_api3_uf_match_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -86,7 +86,7 @@ function _civicrm_api3_uf_match_create_spec(&$params) {
  *
  * @return array
  *   api result array
- * {@getfields uf_match_create}
+ *   {@getfields uf_match_create}
  */
 function civicrm_api3_uf_match_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
index 7deeab9744d0c79df0e7ec8631c60651ffc7b110..0e04b694b7cae66b654f25db2bb6c9b12ca5fc5a 100644 (file)
@@ -54,10 +54,6 @@ function _civicrm_api3_initialize() {
  *   String DAO to check for required fields (create functions only).
  * @param array $keyoptions
  *   List of required fields options. One of the options is required.
- *
- * @return null
- *   or throws error if there the required fields not present
- * @
  */
 function civicrm_api3_verify_one_mandatory($params, $daoName = NULL, $keyoptions = array()) {
   $keys = array(array());
@@ -77,12 +73,6 @@ function civicrm_api3_verify_one_mandatory($params, $daoName = NULL, $keyoptions
  * @param array $keys
  *   List of required fields. A value can be an array denoting that either this or that is required.
  * @param bool $verifyDAO
- *
- * @throws API_Exception
- * @return null
- *   or throws error if there the required fields not present
- *
- * @todo see notes on _civicrm_api3_check_required_fields regarding removing $daoName param
  */
 function civicrm_api3_verify_mandatory($params, $daoName = NULL, $keys = array(), $verifyDAO = TRUE) {
 
@@ -527,7 +517,8 @@ function _civicrm_api3_get_using_query_object($entity, $params, $additional_opti
     $getCount,
     $skipPermissions
   );
-  if ($getCount) { // only return the count of contacts
+  if ($getCount) {
+    // only return the count of contacts
     return $entities;
   }
 
@@ -542,14 +533,15 @@ function _civicrm_api3_get_using_query_object($entity, $params, $additional_opti
  * @param array $params
  * @param string $mode
  * @param string $entity
- * @return array(CRM_Core_DAO|CRM_Contact_BAO_Query)
+ * @return array
+ *   [CRM_Core_DAO|CRM_Contact_BAO_Query]
  */
 function _civicrm_api3_get_query_object($params, $mode, $entity) {
-  $options          = _civicrm_api3_get_options_from_params($params, TRUE, $entity, 'get');
-  $sort             = CRM_Utils_Array::value('sort', $options, NULL);
-  $offset           = CRM_Utils_Array::value('offset', $options);
-  $rowCount         = CRM_Utils_Array::value('limit', $options);
-  $inputParams      = CRM_Utils_Array::value('input_params', $options, array());
+  $options = _civicrm_api3_get_options_from_params($params, TRUE, $entity, 'get');
+  $sort = CRM_Utils_Array::value('sort', $options, NULL);
+  $offset = CRM_Utils_Array::value('offset', $options);
+  $rowCount = CRM_Utils_Array::value('limit', $options);
+  $inputParams = CRM_Utils_Array::value('input_params', $options, array());
   $returnProperties = CRM_Utils_Array::value('return', $options, NULL);
   if (empty($returnProperties)) {
     $returnProperties = CRM_Contribute_BAO_Query::defaultReturnProperties($mode);
@@ -824,9 +816,11 @@ function _civicrm_api3_apply_options_to_dao(&$params, &$dao, $entity) {
 /**
  * build fields array. This is the array of fields as it relates to the given DAO
  * returns unique fields as keys by default but if set but can return by DB fields
- * @param $bao
+ *
+ * @param CRM_Core_DAO $bao
  * @param bool $unique
- * @return
+ *
+ * @return array
  */
 function _civicrm_api3_build_fields_array(&$bao, $unique = TRUE) {
   $fields = $bao->fields();
@@ -848,9 +842,10 @@ function _civicrm_api3_build_fields_array(&$bao, $unique = TRUE) {
 /**
  * build fields array. This is the array of fields as it relates to the given DAO
  * returns unique fields as keys by default but if set but can return by DB fields
+ *
  * @param CRM_Core_DAO $bao
  *
- * @return mixed
+ * @return array
  */
 function _civicrm_api3_get_unique_name_array(&$bao) {
   $fields = $bao->fields();
@@ -871,7 +866,6 @@ function _civicrm_api3_get_unique_name_array(&$bao) {
  * @param bool $autoFind
  *
  * @return array
- *
  */
 function _civicrm_api3_dao_to_array($dao, $params = NULL, $uniqueFields = TRUE, $entity = "", $autoFind = TRUE) {
   $result = array();
@@ -916,9 +910,9 @@ function _civicrm_api3_dao_to_array($dao, $params = NULL, $uniqueFields = TRUE,
  * && it can take custom fields & there is the string 'custom' in their return request we get them all, they are filtered on the way out
  * @todo filter so only required fields are queried
  *
- * @param array $params
  * @param string $entity
  *   Entity name in CamelCase.
+ * @param array $params
  *
  * @return bool
  */
@@ -941,8 +935,6 @@ function _civicrm_api3_custom_fields_are_required($entity, $params) {
  * @param array $values
  *   (reference) array.
  * @param array|bool $uniqueFields
- *
- * @return array
  */
 function _civicrm_api3_object_to_array(&$dao, &$values, $uniqueFields = FALSE) {
 
@@ -1413,7 +1405,8 @@ function _civicrm_api3_validate_fields($entity, $action, &$params, $fields, $err
         _civicrm_api3_validate_date($params, $fieldName, $fieldInfo);
         break;
 
-    case 32://blob
+      case 32:
+        //blob
         _civicrm_api3_validate_html($params, $fieldName, $fieldInfo);
         break;
 
@@ -1426,7 +1419,7 @@ function _civicrm_api3_validate_fields($entity, $action, &$params, $fields, $err
         if (strpos($op, 'NULL') !== FALSE || strpos($op, 'EMPTY') !== FALSE) {
           break;
         }
-        foreach((array)$fieldValue as $fieldvalue) {
+        foreach ((array) $fieldValue as $fieldvalue) {
           if (!CRM_Utils_Rule::money($fieldvalue) && !empty($fieldvalue)) {
             throw new Exception($fieldName . " is  not a valid amount: " . $params[$fieldName]);
           }
@@ -1527,7 +1520,8 @@ function _civicrm_api3_getValidDate($dateValue, $fieldName, $fieldType) {
  * @throws \API_Exception
  */
 function _civicrm_api3_validate_constraint(&$fieldValue, &$fieldName, &$fieldInfo) {
-  $dao = new $fieldInfo['FKClassName'];
+  $daoName = $fieldInfo['FKClassName'];
+  $dao = new $daoName();
   $dao->id = $fieldValue;
   $dao->selectAdd();
   $dao->selectAdd('id');
@@ -1746,7 +1740,7 @@ function _civicrm_api_get_custom_fields($entity, &$params) {
 /**
  * Translate the custom field data_type attribute into a std 'type'
  * @param $dataType
- * @return
+ * @return int
  */
 function _getStandardTypeFromCustomDataType($dataType) {
   $mapping = array(
@@ -1801,8 +1795,7 @@ function _civicrm_api3_swap_out_aliases(&$apiRequest, $fields) {
       && $uniqueName
       && $field != $uniqueName
       && array_key_exists($uniqueName, $apiRequest['params'])
-      )
-    {
+    ) {
       $apiRequest['params'][$field] = CRM_Utils_Array::value($values['uniqueName'], $apiRequest['params']);
       // note that it would make sense to unset the original field here but tests need to be in place first
     }
@@ -1834,8 +1827,9 @@ function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $ent
     if (!is_numeric($fieldValue) && is_scalar($fieldValue)) {
       $realContactId = _civicrm_api3_resolve_contactID($fieldValue);
       if ('unknown-user' === $realContactId) {
-        throw new API_Exception("\"$fieldName\" \"{$fieldValue}\" cannot be resolved to a contact ID", 2002, array('error_field' => $fieldName,"type"=>"integer"));
-      } elseif (is_numeric($realContactId)) {
+        throw new API_Exception("\"$fieldName\" \"{$fieldValue}\" cannot be resolved to a contact ID", 2002, array('error_field' => $fieldName, "type" => "integer"));
+      }
+      elseif (is_numeric($realContactId)) {
         $fieldValue = $realContactId;
       }
     }
@@ -1851,10 +1845,10 @@ function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $ent
     }
 
     // Check our field length
-    if(is_string($fieldValue) && !empty($fieldInfo['maxlength']) && strlen($fieldValue) > $fieldInfo['maxlength']
+    if (is_string($fieldValue) && !empty($fieldInfo['maxlength']) && strlen($fieldValue) > $fieldInfo['maxlength']
       ) {
       throw new API_Exception( $fieldValue . " is " . strlen($fieldValue) . " characters  - longer than $fieldName length" . $fieldInfo['maxlength'] . ' characters',
-        2100, array('field' => $fieldName, "max_length"=>$fieldInfo['maxlength'])
+        2100, array('field' => $fieldName, "max_length" => $fieldInfo['maxlength'])
       );
     }
   }
@@ -1912,7 +1906,7 @@ function _civicrm_api3_validate_html(&$params, &$fieldName, $fieldInfo) {
   }
   if ($fieldValue) {
     if (!CRM_Utils_Rule::xssString($fieldValue)) {
-      throw new API_Exception('Illegal characters in input (potential scripting attack)', array("field"=>$fieldName,"error_code"=>"xss"));
+      throw new API_Exception('Illegal characters in input (potential scripting attack)', array("field" => $fieldName, "error_code" => "xss"));
     }
   }
 }
@@ -2023,9 +2017,9 @@ function _civicrm_api3_api_match_pseudoconstant(&$fieldValue, $entity, $fieldNam
 /**
  * Validate & swap a single option value for a field
  *
- * @param string $value: field value
- * @param array $options: array of options for this field
- * @param string $fieldName: field name used in api call (not necessarily the canonical name)
+ * @param string $value field value
+ * @param array $options array of options for this field
+ * @param string $fieldName field name used in api call (not necessarily the canonical name)
  * @throws API_Exception
  */
 function _civicrm_api3_api_match_pseudoconstant_value(&$value, $options, $fieldName) {
@@ -2116,7 +2110,7 @@ function _civicrm_api3_deprecation_check($entity, $result = array()) {
  *
  * @param array $params
  * @param string $fieldName
- * @return string|int|boolean|date|null
+ * @return mixed
  */
 function _civicrm_api3_field_value_check(&$params, $fieldName) {
   $fieldValue = CRM_Utils_Array::value($fieldName, $params);
index c29eb0559c14faabaf0fb9a4df1bfde4aa5a2b85..481bb045ef76586bff418c0aa581c3b6ad946243 100644 (file)
@@ -30,6 +30,9 @@
  * in order to correct the condition where a contribution row is linked to > 1 membership.
  */
 
+/**
+ * Initialization
+ */
 function initialize() {
   session_start();
   if (!function_exists('drush_get_context')) {
index 9d23e4dd7e8bd78321955497dcc948c91c4ed9f1..d1db53c541d28b48bddc9c2690c3de4ba558a623 100644 (file)
  * In addition, there are several additional classes that inherit
  * civicrm_cli to do more precise functions.
  *
- **/
+ */
 
 /**
  * base class for doing all command line operations via civicrm
  * used by cli.php
- **/
+ */
 class civicrm_cli {
   // required values that must be passed
   // via the command line
@@ -312,18 +312,18 @@ class civicrm_cli {
 /**
  * class used by csv/export.php to export records from
  * the database in a csv file format.
- **/
+ */
 class civicrm_cli_csv_exporter extends civicrm_cli {
   var $separator = ',';
 
   /**
    */
-  function __construct() {
+  public function __construct() {
     $this->_required_arguments = array('entity');
     parent::initialize();
   }
 
-  function run() {
+  public function run() {
     $out = fopen("php://output", 'w');
     fputcsv($out, $this->columns, $this->separator, '"');
 
@@ -355,20 +355,20 @@ class civicrm_cli_csv_exporter extends civicrm_cli {
  * and civicrm_cli_csv_deleter to add or delete
  * records based on those found in a csv file
  * passed to the script.
- **/
+ */
 class civicrm_cli_csv_file extends civicrm_cli {
   var $header;
   var $separator = ',';
 
   /**
    */
-  function __construct() {
+  public function __construct() {
     $this->_required_arguments = array('entity', 'file');
     $this->_additional_arguments = array('f' => 'file');
     parent::initialize();
   }
 
-  function run() {
+  public function run() {
     $this->row = 1;
     $handle = fopen($this->_file, "r");
 
@@ -400,7 +400,7 @@ class civicrm_cli_csv_file extends civicrm_cli {
       $this->processLine($params);
     }
     fclose($handle);
-    return;
+    return NULL;
   }
 
   /* return a params as expected */
@@ -409,7 +409,7 @@ class civicrm_cli_csv_file extends civicrm_cli {
    *
    * @return array
    */
-  function convertLine($data) {
+  public function convertLine($data) {
     $params = array();
     foreach ($this->header as $i => $field) {
       //split any multiselect data, denoted with CRM_Core_DAO::VALUE_SEPARATOR
@@ -428,12 +428,12 @@ class civicrm_cli_csv_file extends civicrm_cli {
  * class for processing records to add
  * used by csv/import.php
  *
- **/
+ */
 class civicrm_cli_csv_importer extends civicrm_cli_csv_file {
   /**
    * @param array $params
    */
-  function processline($params) {
+  public function processline($params) {
     $result = civicrm_api($this->_entity, 'Create', $params);
     if ($result['is_error']) {
       echo "\nERROR line " . $this->row . ": " . $result['error_message'] . "\n";
@@ -448,12 +448,12 @@ class civicrm_cli_csv_importer extends civicrm_cli_csv_file {
  * class for processing records to delete
  * used by csv/delete.php
  *
- **/
+ */
 class civicrm_cli_csv_deleter extends civicrm_cli_csv_file {
   /**
    * @param array $params
    */
-  function processline($params) {
+  public function processline($params) {
     $result = civicrm_api($this->_entity, 'Delete', $params);
     if ($result['is_error']) {
       echo "\nERROR line " . $this->row . ": " . $result['error_message'] . "\n";
index eb0b85ec5fb745a7dd65dd8fd862f3f6e321df6f..030939085ce3a75f1df8a9c83b50e93190e8eecc 100644 (file)
@@ -31,7 +31,7 @@
  * php bin/csv/delete.php -e <entity> --file /path/to/csv/file [ -s site.org ]
  * e.g.: php bin/csv/delete.php -e Contact --file /tmp/delete.csv
  *
- **/
+ */
 
 require_once dirname(__DIR__) . '/cli.class.php';
 
index 030aec5ce0c50883820ac301318b184702f7a60e..5c67e9eaad347d1cda9a0c2e12eb14bf14b6bdd1 100644 (file)
@@ -273,8 +273,6 @@ WHERE      {$whereClause}
       }
     }
   }
-
-  return;
 }
 
 run();
index 5261c2ee39ba299fedf1860cfe39ebb67252e40b..eb31a8328feff404465bf7f24a6ecfb3d2fb230d 100755 (executable)
@@ -23,12 +23,13 @@ if [ "$1" = '-h' ] || [ "$1" = '--help' ]; then
   echo
   echo "Usage: setup.sh [options] [schema file] [database data file] [database name] [database user] [database password] [database host] [database port] [additional args]"
   echo "[options] is a mix of zero or more of following:"
-  echo "  -a     (All)       Implies -Dgsdf (default)"
-  echo "  -D     (Download)  Download depdencies"
-  echo "  -g     (GenCode)   Generate DAO files, SQL files, etc"
-  echo "  -s     (Schema)    Load new schema in DB"
-  echo "  -d     (Data)      Load default data in DB"
-  echo "  -f     (Flush)     Flush caches and settings"
+  echo "  -a     (All)            Implies -Dgsef (default)"
+  echo "  -D     (Download)       Download dependencies"
+  echo "  -g     (GenCode)        Generate DAO files, SQL files, etc"
+  echo "  -s     (Schema)         Load new schema in DB"
+  echo "  -d     (Data-Plain)     Load basic dataset in DB"
+  echo "  -e     (Data-Examples)  Load example dataset in DB"
+  echo "  -f     (Flush)          Flush caches and settings"
   echo
   echo "Example: Perform a full setup"
   echo "   setup.sh -a"
@@ -37,7 +38,7 @@ if [ "$1" = '-h' ] || [ "$1" = '--help' ]; then
   echo "   setup.sh -Dg"
   echo
   echo "Example: Keep the existing code but reset the DB"
-  echo "   setup.sh -sdf"
+  echo "   setup.sh -sef"
   exit 0
 fi
 
@@ -50,8 +51,9 @@ DO_GENCODE=
 DO_SCHEMA=
 DO_DATA=
 DO_FLUSH=
+DEFAULT_DATA=
 
-while getopts "aDgsdf" opt; do
+while getopts "aDgsdef" opt; do
   case $opt in
     a)
       DO_DOWNLOAD=1
@@ -75,6 +77,12 @@ while getopts "aDgsdf" opt; do
       ;;
     d)
       DO_DATA=1
+      DEFAULT_DATA=civicrm_data.mysql
+      FOUND_ACTION=1
+      ;;
+    e)
+      DO_DATA=1
+      DEFAULT_DATA=civicrm_generated.mysql
       FOUND_ACTION=1
       ;;
     f)
@@ -97,6 +105,7 @@ if [ -z "$FOUND_ACTION" ]; then
   DO_SCHEMA=1
   DO_DATA=1
   DO_FLUSH=1
+  DEFAULT_DATA=civicrm_generated.mysql
 fi
 
 shift $((OPTIND-1))
@@ -180,10 +189,11 @@ fi
 
 if [ -n "$DO_DATA" ]; then
   pushd "$CALLEDPATH/../sql"
-    # load civicrm_generated.mysql sample data unless special DBLOAD is passed
+    # load default data set unless system is configured with override
     if [ -z $DBLOAD ]; then
-        echo; echo Populating database with example data - civicrm_generated.mysql
-        $MYSQLCMD < civicrm_generated.mysql
+        echo;
+        echo "Populating database with dataset - $DEFAULT_DATA"
+        $MYSQLCMD < "$DEFAULT_DATA"
     else
         echo; echo Populating database with required data - civicrm_data.mysql
         $MYSQLCMD < civicrm_data.mysql
index 8bb75fb8bc3848b09ba6da1dd1268ffefd2d8ae7..a379d104126c0bfa37d0c738435289de3d8cfffb 100644 (file)
   float:right;
 }
 #crm-container .widget-icon.close-icon {
+  background-position: -80px -128px;
   float:right;
 }
 #crm-container .widget-icon:hover {
index 5bec5dc5d75de31a51bae91a3435957a45fb66dc..42ad1d61f9e119efa5c7848030eed566157772dc 100644 (file)
@@ -50,11 +50,7 @@ else {
 global $installType;
 $installType = strtolower($_SESSION['civicrm_install_type']);
 
-if (!in_array($installType, array(
-  'drupal',
-  'wordpress'
-))
-) {
+if (!in_array($installType, array('drupal', 'wordpress'))) {
   $errorTitle = "Oops! Unsupported installation mode";
   $errorMsg = "";
   errorDisplayPage($errorTitle, $errorMsg);
@@ -93,7 +89,7 @@ if ($installType == 'drupal') {
     $errorMsg = "Please untar (uncompress) your downloaded copy of CiviCRM in the <strong>" . implode(CIVICRM_DIRECTORY_SEPARATOR, array(
         'sites',
         'all',
-        'modules'
+        'modules',
       )) . "</strong> directory below your Drupal root directory. Refer to the online " . $docLink . " for more information.";
     errorDisplayPage($errorTitle, $errorMsg);
   }
@@ -175,7 +171,7 @@ if ($alreadyInstalled) {
     $errorMsg = "CiviCRM has already been installed in this Drupal site. <ul><li>To <strong>start over</strong>, you must delete or rename the existing CiviCRM settings file - <strong>civicrm.settings.php</strong> - from <strong>" . implode(CIVICRM_DIRECTORY_SEPARATOR, array(
         '[your Drupal root directory]',
         'sites',
-        $siteDir
+        $siteDir,
       )) . "</strong>.</li><li>To <strong>upgrade an existing installation</strong>, refer to the online " . $docLink . ".</li></ul>";
   }
   elseif ($installType == 'wordpress') {
@@ -286,7 +282,7 @@ class InstallRequirements {
    * @param $databaseConfig
    * @param $dbName
    */
-  function checkdatabase($databaseConfig, $dbName) {
+  public function checkdatabase($databaseConfig, $dbName) {
     if ($this->requireFunction('mysql_connect',
       array(
         "PHP Configuration",
@@ -404,7 +400,7 @@ class InstallRequirements {
   /**
    * Check everything except the database
    */
-  function check() {
+  public function check() {
     global $crmPath, $installType;
 
     $this->errors = NULL;
@@ -413,7 +409,7 @@ class InstallRequirements {
       "PHP Configuration",
       "PHP5 installed",
       NULL,
-      "PHP version " . phpversion()
+      "PHP version " . phpversion(),
     ));
 
     // Check that we can identify the root folder successfully
@@ -443,7 +439,7 @@ class InstallRequirements {
         array(
           "File permissions",
           "$dir folder exists",
-          "There is no $dir folder"
+          "There is no $dir folder",
         ), TRUE
       );
     }
@@ -503,7 +499,7 @@ class InstallRequirements {
     $this->requireServerVariables(array('SCRIPT_NAME', 'HTTP_HOST', 'SCRIPT_FILENAME'), array(
       "Webserver config",
       "Recognised webserver",
-      "You seem to be using an unsupported webserver.  The server variables SCRIPT_NAME, HTTP_HOST, SCRIPT_FILENAME need to be set."
+      "You seem to be using an unsupported webserver.  The server variables SCRIPT_NAME, HTTP_HOST, SCRIPT_FILENAME need to be set.",
     ));
 
     // Check for MySQL support
@@ -542,7 +538,7 @@ class InstallRequirements {
    * @param $recommended
    * @param $testDetails
    */
-  function requireMemory($min, $recommended, $testDetails) {
+  public function requireMemory($min, $recommended, $testDetails) {
     $this->testing($testDetails);
     $mem = $this->getPHPMemory();
 
@@ -563,7 +559,7 @@ class InstallRequirements {
   /**
    * @return float
    */
-  function getPHPMemory() {
+  public function getPHPMemory() {
     $memString = ini_get("memory_limit");
 
     switch (strtolower(substr($memString, -1))) {
@@ -581,7 +577,7 @@ class InstallRequirements {
     }
   }
 
-  function listErrors() {
+  public function listErrors() {
     if ($this->errors) {
       echo "<p>The following problems are preventing me from installing CiviCRM:</p>";
       foreach ($this->errors as $error) {
@@ -593,7 +589,7 @@ class InstallRequirements {
   /**
    * @param null $section
    */
-  function showTable($section = NULL) {
+  public function showTable($section = NULL) {
     if ($section) {
       $tests = $this->tests[$section];
       echo "<table class=\"testResults\" width=\"100%\">";
@@ -621,7 +617,7 @@ class InstallRequirements {
    *
    * @return bool
    */
-  function requireFunction($funcName, $testDetails) {
+  public function requireFunction($funcName, $testDetails) {
     $this->testing($testDetails);
 
     if (!function_exists($funcName)) {
@@ -636,7 +632,7 @@ class InstallRequirements {
   /**
    * @param $testDetails
    */
-  function checkXCache($testDetails) {
+  public function checkXCache($testDetails) {
     if (function_exists('xcache_isset') &&
       ini_get('xcache.size') > 0
     ) {
@@ -650,7 +646,7 @@ class InstallRequirements {
    * @param $testDetails
    * @param null $maxVersion
    */
-  function requirePHPVersion($minVersion, $testDetails, $maxVersion = NULL) {
+  public function requirePHPVersion($minVersion, $testDetails, $maxVersion = NULL) {
 
     $this->testing($testDetails);
 
@@ -682,7 +678,7 @@ class InstallRequirements {
    * @param $testDetails
    * @param bool $absolute
    */
-  function requireFile($filename, $testDetails, $absolute = FALSE) {
+  public function requireFile($filename, $testDetails, $absolute = FALSE) {
     $this->testing($testDetails);
     if (!$absolute) {
       $filename = $this->getBaseDir() . $filename;
@@ -696,7 +692,7 @@ class InstallRequirements {
   /**
    * @param $testDetails
    */
-  function requireNoPathSeparator($testDetails) {
+  public function requireNoPathSeparator($testDetails) {
     $this->testing($testDetails);
     if (substr_count($this->getBaseDir(), PATH_SEPARATOR)) {
       $this->error($testDetails);
@@ -707,7 +703,7 @@ class InstallRequirements {
    * @param string $filename
    * @param $testDetails
    */
-  function requireNoFile($filename, $testDetails) {
+  public function requireNoFile($filename, $testDetails) {
     $this->testing($testDetails);
     $filename = $this->getBaseDir() . $filename;
     if (file_exists($filename)) {
@@ -720,7 +716,7 @@ class InstallRequirements {
    * @param string $filename
    * @param $testDetails
    */
-  function moveFileOutOfTheWay($filename, $testDetails) {
+  public function moveFileOutOfTheWay($filename, $testDetails) {
     $this->testing($testDetails);
     $filename = $this->getBaseDir() . $filename;
     if (file_exists($filename)) {
@@ -736,7 +732,7 @@ class InstallRequirements {
    * @param $testDetails
    * @param bool $absolute
    */
-  function requireWriteable($filename, $testDetails, $absolute = FALSE) {
+  public function requireWriteable($filename, $testDetails, $absolute = FALSE) {
     $this->testing($testDetails);
     if (!$absolute) {
       $filename = $this->getBaseDir() . $filename;
@@ -761,7 +757,7 @@ class InstallRequirements {
    * @param string $moduleName
    * @param $testDetails
    */
-  function requireApacheModule($moduleName, $testDetails) {
+  public function requireApacheModule($moduleName, $testDetails) {
     $this->testing($testDetails);
     if (!in_array($moduleName, apache_get_modules())) {
       $this->error($testDetails);
@@ -774,7 +770,7 @@ class InstallRequirements {
    * @param $password
    * @param $testDetails
    */
-  function requireMysqlConnection($server, $username, $password, $testDetails) {
+  public function requireMysqlConnection($server, $username, $password, $testDetails) {
     $this->testing($testDetails);
     $conn = @mysql_connect($server, $username, $password);
 
@@ -791,7 +787,7 @@ class InstallRequirements {
    * @param $server
    * @param $testDetails
    */
-  function requireMySQLServer($server, $testDetails) {
+  public function requireMySQLServer($server, $testDetails) {
     $this->testing($testDetails);
     $conn = @mysql_connect($server, NULL, NULL);
 
@@ -808,7 +804,7 @@ class InstallRequirements {
    * @param $version
    * @param $testDetails
    */
-  function requireMySQLVersion($version, $testDetails) {
+  public function requireMySQLVersion($version, $testDetails) {
     $this->testing($testDetails);
 
     if (!mysql_get_server_info()) {
@@ -836,7 +832,7 @@ class InstallRequirements {
    * @param $database
    * @param $testDetails
    */
-  function requireMySQLInnoDB($server, $username, $password, $database, $testDetails) {
+  public function requireMySQLInnoDB($server, $username, $password, $database, $testDetails) {
     $this->testing($testDetails);
     $conn = @mysql_connect($server, $username, $password);
     if (!$conn) {
@@ -871,7 +867,7 @@ class InstallRequirements {
    * @param $database
    * @param $testDetails
    */
-  function requireMySQLTempTables($server, $username, $password, $database, $testDetails) {
+  public function requireMySQLTempTables($server, $username, $password, $database, $testDetails) {
     $this->testing($testDetails);
     $conn = @mysql_connect($server, $username, $password);
     if (!$conn) {
@@ -901,7 +897,7 @@ class InstallRequirements {
    * @param $database
    * @param $testDetails
    */
-  function requireMySQLTrigger($server, $username, $password, $database, $testDetails) {
+  public function requireMySQLTrigger($server, $username, $password, $database, $testDetails) {
     $this->testing($testDetails);
     $conn = @mysql_connect($server, $username, $password);
     if (!$conn) {
@@ -941,7 +937,7 @@ class InstallRequirements {
    * @param $database
    * @param $testDetails
    */
-  function requireMySQLLockTables($server, $username, $password, $database, $testDetails) {
+  public function requireMySQLLockTables($server, $username, $password, $database, $testDetails) {
     $this->testing($testDetails);
     $conn = @mysql_connect($server, $username, $password);
     if (!$conn) {
@@ -980,7 +976,6 @@ class InstallRequirements {
     }
 
     $result = mysql_query('DROP TEMPORARY TABLE civicrm_install_temp_table_test');
-    return;
   }
 
   /**
@@ -989,7 +984,7 @@ class InstallRequirements {
    * @param $password
    * @param $testDetails
    */
-  function requireMySQLAutoIncrementIncrementOne($server, $username, $password, $testDetails) {
+  public function requireMySQLAutoIncrementIncrementOne($server, $username, $password, $testDetails) {
     $this->testing($testDetails);
     $conn = @mysql_connect($server, $username, $password);
     if (!$conn) {
@@ -1023,7 +1018,7 @@ class InstallRequirements {
    * @param $minValueKB
    * @param $testDetails
    */
-  function requireMySQLThreadStack($server, $username, $password, $database, $minValueKB, $testDetails) {
+  public function requireMySQLThreadStack($server, $username, $password, $database, $minValueKB, $testDetails) {
     $this->testing($testDetails);
     $conn = @mysql_connect($server, $username, $password);
     if (!$conn) {
@@ -1060,7 +1055,7 @@ class InstallRequirements {
    * @param $testDetails
    * @param bool $onlyRequire
    */
-  function requireDatabaseOrCreatePermissions(
+  public function requireDatabaseOrCreatePermissions(
     $server,
     $username,
     $password,
@@ -1101,7 +1096,7 @@ class InstallRequirements {
    * @param $varNames
    * @param $errorMessage
    */
-  function requireServerVariables($varNames, $errorMessage) {
+  public function requireServerVariables($varNames, $errorMessage) {
     //$this->testing($testDetails);
     foreach ($varNames as $varName) {
       if (!$_SERVER[$varName]) {
@@ -1122,7 +1117,7 @@ class InstallRequirements {
    *
    * @return bool
    */
-  function isRunningApache($testDetails) {
+  public function isRunningApache($testDetails) {
     $this->testing($testDetails);
     if (function_exists('apache_get_modules') || stristr($_SERVER['SERVER_SIGNATURE'], 'Apache')) {
       return TRUE;
@@ -1135,14 +1130,14 @@ class InstallRequirements {
   /**
    * @return string
    */
-  function getBaseDir() {
+  public function getBaseDir() {
     return dirname($_SERVER['SCRIPT_FILENAME']) . CIVICRM_DIRECTORY_SEPARATOR;
   }
 
   /**
    * @param $testDetails
    */
-  function testing($testDetails) {
+  public function testing($testDetails) {
     if (!$testDetails) {
       return;
     }
@@ -1161,7 +1156,7 @@ class InstallRequirements {
   /**
    * @param $testDetails
    */
-  function error($testDetails) {
+  public function error($testDetails) {
     $section = $testDetails[0];
     $test = $testDetails[1];
 
@@ -1172,7 +1167,7 @@ class InstallRequirements {
   /**
    * @param $testDetails
    */
-  function warning($testDetails) {
+  public function warning($testDetails) {
     $section = $testDetails[0];
     $test = $testDetails[1];
 
@@ -1183,15 +1178,15 @@ class InstallRequirements {
   /**
    * @return int
    */
-  function hasErrors() {
-    return sizeof($this->errors);
+  public function hasErrors() {
+    return count($this->errors);
   }
 
   /**
    * @return int
    */
-  function hasWarnings() {
-    return sizeof($this->warnings);
+  public function hasWarnings() {
+    return count($this->warnings);
   }
 }
 
@@ -1205,7 +1200,7 @@ class Installer extends InstallRequirements {
    * @param $password
    * @param $database
    */
-  function createDatabaseIfNotExists($server, $username, $password, $database) {
+  public function createDatabaseIfNotExists($server, $username, $password, $database) {
     $conn = @mysql_connect($server, $username, $password);
 
     if (@mysql_select_db($database)) {
@@ -1227,7 +1222,7 @@ class Installer extends InstallRequirements {
    *
    * @return mixed
    */
-  function install($config) {
+  public function install($config) {
     global $installDirPath;
 
     // create database if does not exists
@@ -1431,9 +1426,8 @@ function civicrm_install_set_drupal_perms() {
     foreach (array_diff($perms, $allPerms) as $perm) {
       watchdog('civicrm',
         'Cannot grant the %perm permission because it does not yet exist.',
-        array(
-          '%perm' => $perm
-        ), WATCHDOG_ERROR
+        array('%perm' => $perm),
+        WATCHDOG_ERROR
       );
     }
     $perms = array_intersect($perms, $allPerms);
index 15718c677d19d0dc7a4d95cdb5bec96e94aa8855..68d1101ba0529e27738eaeee146206feb0817630 100644 (file)
@@ -55,7 +55,7 @@ p.error {
 p.warning {
   padding: 0.5em;
   background-color: #e70;
-  border: 1px #A70 solid;
+  border: 1px #a70 solid;
   color: white;
   clear: both;
 }
index c9c31e33e1fa0992dc98441e3bfc7dfbcf03a3e6..132090d2dc0f0520c4b91f875ea5b5afd16e0e16 100644 (file)
@@ -66,8 +66,7 @@ return array(
     'is_contact' => 0,
     'description' => "Set this value to Yes if you want CiviCRM error/debugging messages to also appear in Drupal error logs",
     'prefetch' => 1,
-    'help_text' => "Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS' error log.
-In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal's watchdog enabled)",
+    'help_text' => "Set this value to Yes if you want CiviCRM error/debugging messages the appear in your CMS' error log. In the case of Drupal, this will cause all CiviCRM error messages to appear in the watchdog (assuming you have Drupal's watchdog enabled)",
   ),
   'backtrace' => array(
     'group_name' => 'Developer Preferences',
index f101e5514a06b0abcb2c7b091ee3ed0198013189..959933e377726765d07d6afe3c9e19fe278fb0e1 100644 (file)
@@ -391,7 +391,7 @@ UNLOCK TABLES;
 
 LOCK TABLES `civicrm_domain` WRITE;
 /*!40000 ALTER TABLE `civicrm_domain` DISABLE KEYS */;
-INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `config_backend`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES (1,'Default Domain Name',NULL,NULL,'4.6.alpha2',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
+INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `config_backend`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES (1,'Default Domain Name',NULL,NULL,'4.6.alpha3',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
 /*!40000 ALTER TABLE `civicrm_domain` ENABLE KEYS */;
 UNLOCK TABLES;
 
index ac956e111210ac0bc74b324c4bdd222d9364132f..d4e37310a55abd741d2a4ca04d4d2253e0b8c5fb 100644 (file)
@@ -9,7 +9,7 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B
   /**
    * @param $formValues
    */
-  function __construct(&$formValues) {
+  public function __construct(&$formValues) {
     parent::__construct($formValues);
   }
 
@@ -20,7 +20,7 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B
    *   Modifiable.
    * @return void
    */
-  function buildForm(&$form) {
+  public function buildForm(&$form) {
     CRM_Utils_System::setTitle(ts('My Search Title'));
 
     $form->add('text',
@@ -52,7 +52,7 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B
    *   - summary: string
    *   - total: numeric
    */
-  function summary() {
+  public function summary() {
     return NULL;
     // return array(
     //   'summary' => 'This is a summary',
@@ -65,7 +65,7 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B
    *
    * @return array, keys are printable column headers and values are SQL column names
    */
-  function &columns() {
+  public function &columns() {
     // return by reference
     $columns = array(
       ts('Contact ID') => 'contact_id',
@@ -86,7 +86,7 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B
    *
    * @return string, sql
    */
-  function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE) {
+  public function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE) {
     // delegate to $this->sql(), $this->select(), $this->from(), $this->where(), etc.
     return $this->sql($this->select(), $offset, $rowcount, $sort, $includeContactIDs, NULL);
   }
@@ -96,7 +96,7 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B
    *
    * @return string, sql fragment with SELECT arguments
    */
-  function select() {
+  public function select() {
     return "
       contact_a.id           as contact_id  ,
       contact_a.contact_type as contact_type,
@@ -110,7 +110,7 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B
    *
    * @return string, sql fragment with FROM and JOIN clauses
    */
-  function from() {
+  public function from() {
     return "
       FROM      civicrm_contact contact_a
       LEFT JOIN civicrm_address address ON ( address.contact_id       = contact_a.id AND
@@ -128,7 +128,7 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B
    *
    * @return string, sql fragment with conditional expressions
    */
-  function where($includeContactIDs = FALSE) {
+  public function where($includeContactIDs = FALSE) {
     $params = array();
     $where = "contact_a.contact_type   = 'Household'";
 
@@ -172,7 +172,7 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B
    *
    * @return string, template path (findable through Smarty template path)
    */
-  function templateFile() {
+  public function templateFile() {
     return 'CRM/Contact/Form/Search/Custom.tpl';
   }
 
@@ -183,7 +183,7 @@ class test_extension_manager_searchtest extends CRM_Contact_Form_Search_Custom_B
    *   Modifiable SQL result row.
    * @return void
    */
-  function alterRow(&$row) {
+  public function alterRow(&$row) {
     $row['sort_name'] .= ' ( altered )';
   }
 
index 29f4df4ecd97402ebb505bd54318b54b1341ec26..9f30e106ef7012ac0f5a54fe2196c7c9362de9da 100644 (file)
@@ -47,7 +47,7 @@ class AllTests extends CiviTestSuite {
    */
   private static function getInstance() {
     if (is_null(self::$instance)) {
-      self::$instance = new self;
+      self::$instance = new self();
     }
     return self::$instance;
   }
index 3efc29f025015935255db0262a2baf509241af9b..e3f8bb0ba301847cd799777c20b45f3c90cc3b5b 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Activity_AllTests extends CiviTestSuite {
    */
   private static function getInstance() {
     if (is_null(self::$instance)) {
-      self::$instance = new self;
+      self::$instance = new self();
     }
     return self::$instance;
   }
index c63f8c95c08b4f1a1570ce4a1a808e449caaecec..f910defe84efe7fce7026d8be5b3d70ddddcba05 100644 (file)
@@ -47,7 +47,7 @@ class CRM_AllTests extends CiviTestSuite {
    */
   private static function getInstance() {
     if (is_null(self::$instance)) {
-      self::$instance = new self;
+      self::$instance = new self();
     }
     return self::$instance;
   }
index 09f083bd1b619e24833d15cd2940cecb32c77ca3..1705f48b5e570b36f6ba2626aea71e354a7f9125 100644 (file)
@@ -40,7 +40,7 @@ require_once 'api/api.php';
  * @package CiviCRM
  */
 class CRM_Bridge_OG_DrupalTest extends CiviUnitTestCase {
-  /*
+  /**
    * Test that one (ane only one) role (option value) is deleted by the updateCiviACLRole function
    */
   public function testACLRoleDeleteFunctionality() {
index a3e808f1ee1e39a742d91e91b0e6f23affec5443..f7471db476722b1664cc92ac2106c7fef9bb47cf 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Contacts_AllTests extends CiviTestSuite {
    */
   private static function getInstance() {
     if (is_null(self::$instance)) {
-      self::$instance = new self;
+      self::$instance = new CiviTestSuite();
     }
     return self::$instance;
   }
index 192482f65cb6815a4042069316f7183393e7f188..19860615f94b1cb7826cab0dfb3442472e3dda44 100644 (file)
@@ -7,26 +7,31 @@ require_once 'CiviTest/Custom.php';
  * Class CRM_Contact_BAO_ContactTest
  */
 class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
+
+  /**
+   * Set up function.
+   */
   public function setUp() {
     parent::setUp();
   }
 
   /**
-   * Test case for add( )
+   * Test case for add( ).
+   *
    * test with empty params.
    */
   public function testAddWithEmptyParams() {
     $params = array();
     $contact = CRM_Contact_BAO_Contact::add($params);
 
-    //Now check Contact object
+    // Now check Contact object.
     $this->assertNull($contact);
   }
 
   /**
-   * Test case for add( )
-   * test with names
-   * (create and update modes)
+   * Test case for add( ).
+   *
+   * Test with names (create and update modes)
    */
   public function testAddWithNames() {
     $firstName = 'Shane';
@@ -39,14 +44,14 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
 
     $contact = CRM_Contact_BAO_Contact::add($params);
 
-    //Now check $contact is object of contact DAO..
+    // Now check $contact is object of contact DAO.
     $this->assertInstanceOf('CRM_Contact_DAO_Contact', $contact, 'Check for created object');
     $this->assertEquals($firstName, $contact->first_name, 'Check for first name creation.');
     $this->assertEquals($lastName, $contact->last_name, 'Check for last name creation.');
 
     $contactId = $contact->id;
 
-    //update and change first name and last name, using add( )
+    // Update and change first name and last name, using add( ).
     $firstName = 'Jane';
     $params = array(
       'first_name' => $firstName,
@@ -56,7 +61,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
 
     $contact = CRM_Contact_BAO_Contact::add($params);
 
-    //Now check $contact is object of contact DAO..
+    // Now check $contact is object of contact DAO.
     $this->assertInstanceOf('CRM_Contact_DAO_Contact', $contact, 'Check for created object');
     $this->assertEquals($firstName, $contact->first_name, 'Check for updated first name.');
 
@@ -65,25 +70,22 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for add( )
-   * test with all contact params
-   * (creat and update modes)
+   * Test case for add.
+   *
+   * Test with all contact params
+   * (create and update modes)
    */
   public function testAddWithAll() {
-    //take the common contact params
+    // Take the common contact params.
     $params = $this->contactParams();
 
     unset($params['location']);
     $prefComm = $params['preferred_communication_method'];
-
-    //create the contact using add()
     $contact = CRM_Contact_BAO_Contact::add($params);
     $contactId = $contact->id;
 
-    //Now check $contact is object of contact DAO..
     $this->assertInstanceOf('CRM_Contact_DAO_Contact', $contact, 'Check for created object');
 
-    //Now check values of object with params.
     $this->assertEquals($params['first_name'], $contact->first_name, 'Check for first name creation.');
     $this->assertEquals($params['last_name'], $contact->last_name, 'Check for last name creation.');
     $this->assertEquals($params['middle_name'], $contact->middle_name, 'Check for middle name creation.');
@@ -121,7 +123,6 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     }
     $this->assertAttributesEquals($checkPrefComm, $prefComm);
 
-    //now update the contact using add( )
     $updateParams = array(
       'contact_type' => 'Individual',
       'first_name' => 'Jane',
@@ -162,14 +163,11 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
 
     $prefComm = $updateParams['preferred_communication_method'];
     $updateParams['contact_id'] = $contactId;
-    //create the contact using add()
     $contact = CRM_Contact_BAO_Contact::create($updateParams);
     $contactId = $contact->id;
 
-    //Now check $contact is object of contact DAO..
     $this->assertInstanceOf('CRM_Contact_DAO_Contact', $contact, 'Check for created object');
 
-    //Now check values of object with params.
     $this->assertEquals($updateParams['first_name'], $contact->first_name, 'Check for first name creation.');
     $this->assertEquals($updateParams['last_name'], $contact->last_name, 'Check for last name creation.');
     $this->assertEquals($updateParams['middle_name'], $contact->middle_name, 'Check for middle name creation.');
@@ -211,13 +209,11 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     }
     $this->assertAttributesEquals($checkPrefComm, $prefComm);
 
-    //cleanup DB by deleting the contact
     Contact::delete($contactId);
   }
 
   /**
-   * Test case for add( )
-   * test with All contact types.
+   * Test case for add( ) with All contact types.
    */
   public function testAddWithAllContactTypes() {
     $firstName = 'Bill';
@@ -289,8 +285,9 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for create( )
-   * test with missing params.
+   * Test case for create.
+   *
+   * Test with missing params.
    */
   public function testCreateWithEmptyParams() {
     $params = array(
@@ -304,8 +301,9 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for create( )
-   * test with all params.
+   * Test case for create.
+   *
+   * Test with all params.
    * ( create and update modes ).
    */
   public function testCreateWithAll() {
@@ -484,23 +482,24 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     );
     $compareParams = array('phone' => '9766323895');
     $this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
-    //As we are not updating note
-    //Now check DB for New Note
-    $noteId = $this->assertDBNotNull('CRM_Core_DAO_Note', $updateParams['note'], 'id', 'note',
+    // As we are not updating note.
+    // Now check DB for New Note.
+    $this->assertDBNotNull('CRM_Core_DAO_Note', $updateParams['note'], 'id', 'note',
       'Database check for New created note '
     );
 
-    //delete all notes related to contact
+    // Delete all notes related to contact.
     CRM_Core_BAO_Note::cleanContactNotes($contactId);
 
-    //cleanup DB by deleting the contact
+    // Cleanup DB by deleting the contact.
     Contact::delete($contactId);
     $this->quickCleanup(array('civicrm_contact', 'civicrm_note'));
   }
 
   /**
-   * Test case for resolveDefaults( )
-   * test all pseudoConstant, stateProvince, country.
+   * Test case for resolveDefaults( ).
+   *
+   * Test all pseudoConstant, stateProvince, country.
    */
   public function testResolveDefaults() {
     $params = array(
@@ -536,8 +535,9 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for retrieve( )
-   * test with all values.
+   * Test case for retrieve( ).
+   *
+   * Test with all values.
    */
   public function testRetrieve() {
     //take the common contact params
@@ -635,7 +635,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for deleteContact( )
+   * Test case for deleteContact( ).
    */
   public function testDeleteContact() {
     $contactParams = $this->contactParams();
@@ -719,9 +719,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for createProfileContac( )
-   * test with all params.
-   * ( create and update modes )
+   * Test case for createProfileContact.
    */
   public function testCreateProfileContact() {
     $fields = CRM_Contact_BAO_Contact::exportableFields('Individual');
@@ -1112,7 +1110,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for getContactDetails( )
+   * Test case for getContactDetails( ).
    */
   public function testGetContactDetails() {
     //get the contact params
@@ -1138,8 +1136,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for
-   * importableFields( ) and exportableFields( )
+   * Test case for importableFields( ) and exportableFields( ).
    */
   public function testFields() {
     $allImpFileds = CRM_Contact_BAO_Contact::importableFields('All');
@@ -1164,7 +1161,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for getPrimaryEmail( )
+   * Test case for getPrimaryEmail.
    */
   public function testGetPrimaryEmail() {
     //get the contact params
@@ -1187,7 +1184,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for getPrimaryOpenId( )
+   * Test case for getPrimaryOpenId( ).
    */
   public function testGetPrimaryOpenId() {
     //get the contact params
@@ -1211,7 +1208,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for matchContactOnEmail( )
+   * Test case for matchContactOnEmail( ).
    */
   public function testMatchContactOnEmail() {
     //get the contact params
@@ -1232,7 +1229,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for getContactType( )
+   * Test case for getContactType( ).
    */
   public function testGetContactType() {
     //get the contact params
@@ -1251,7 +1248,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for displayName( )
+   * Test case for displayName( ).
    */
   public function testDisplayName() {
     //get the contact params
@@ -1278,7 +1275,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test case for getDisplayAndImage( )
+   * Test case for getDisplayAndImage( ).
    */
   public function testGetDisplayAndImage() {
     //get the contact params
@@ -1306,25 +1303,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
     Contact::delete($contactId);
   }
 
-  //    /**
-  //     * test logged in user has permissions for
-  //     * various  operation types
-  //     */
-  //    function testPermissionedContact()
-  //    {
-  //        $contactId = Contact::createIndividual();
-  //        require_once 'CRM/Contact/BAO/Contact/Permission.php';
-  //        $userViewPermission = CRM_Contact_BAO_Contact_Permission::allow($contactId);
-  //        $this->assertEquals( $userViewPermission, true, 'Check user for view contact permission.' );
-  //
-  //        $userEditPermission = CRM_Contact_BAO_Contact_Permission::allow($contactId, CRM_Core_Permission::EDIT);
-  //        $this->assertEquals( $userEditPermission, true, 'Check user for edit contact permission.' );
-  //
-  //        Contact::delete($contactId);
-  //    }
-
   /**
-   * Build common params
+   * Build common params.
    */
   private function contactParams() {
 
@@ -1422,9 +1402,9 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Ensure that created_date and modified_date are set
+   * Ensure that created_date and modified_date are set.
    */
-  public function testTimestamps_contact() {
+  public function testTimestampContact() {
     $test = $this;
     $this->_testTimestamps(array(
       'UPDATE' => function ($contactId) use ($test) {
@@ -1433,16 +1413,16 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
           'contact_type' => 'Individual',
           'contact_id' => $contactId,
         );
-        $contact = CRM_Contact_BAO_Contact::add($params);
-        $test->assertInstanceOf('CRM_Contact_DAO_Contact', $contact, 'Check for created object');
+      $contact = CRM_Contact_BAO_Contact::add($params);
+      $test->assertInstanceOf('CRM_Contact_DAO_Contact', $contact, 'Check for created object');
       },
     ));
   }
 
   /**
-   * Ensure that civicrm_contact.modified_date is updated when manipulating a phone record
+   * Ensure that civicrm_contact.modified_date is updated when manipulating a phone record.
    */
-  public function testTimestamps_email() {
+  public function testTimestampsEmail() {
     $test = $this;
     $this->_testTimestamps(array(
       'INSERT' => function ($contactId) use ($test) {
@@ -1474,9 +1454,9 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Ensure that civicrm_contact.modified_date is updated when manipulating an email
+   * Ensure that civicrm_contact.modified_date is updated when manipulating an email.
    */
-  public function testTimestamps_phone() {
+  public function testTimestampsPhone() {
     $test = $this;
     $this->_testTimestamps(array(
       'INSERT' => function ($contactId) use ($test) {
@@ -1508,10 +1488,11 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
   }
 
   /**
-   * Ensure that civicrm_contact.modified_date is updated when contact-related
-   * custom data
+   * Ensure that civicrm_contact.modified_date is updated correctly.
+   *
+   * Looking at it when contact-related custom data is updated.
    */
-  public function testTimestamps_custom() {
+  public function testTimestampsCustom() {
     $customGroup = Custom::createGroup(array(), 'Individual');
     $this->assertNotNull($customGroup);
     $fields = array(
index e24db3a3aa102ddaadb00fea15ce8855322e7720..57d3bad04d59d48ed734036f91b5099d38dd7bc4 100644 (file)
@@ -69,7 +69,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase {
    * @return CRM_Contact_Form_Search_Custom_GroupTestDataProvider
    */
   public function dataProvider() {
-    return new CRM_Contact_Form_Search_Custom_GroupTestDataProvider;
+    return new CRM_Contact_Form_Search_Custom_GroupTestDataProvider();
   }
 
   public function setUp() {
index 269822447d0b2f9ac33254f7e0223a715b6bd877..c8bcca8fa507d2ec1b6e4731d6658ab9c224b40c 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Contribute_AllTests extends CiviTestSuite {
    */
   private static function getInstance() {
     if (is_null(self::$instance)) {
-      self::$instance = new self;
+      self::$instance = new self();
     }
     return self::$instance;
   }
index 76f4a7bd5f21b562ef20245e0f02f379eaf907f4..c37c52a490456fe6d0ecd44e2caa35100fd75777 100644 (file)
@@ -32,10 +32,11 @@ require_once 'CiviTest/CiviUnitTestCase.php';
  * Class CRM_Core_BAO_ActionScheduleTest
  */
 class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
+
   /**
    * @var object see CiviTest/CiviMailUtils
    */
-  var $mut;
+  public $mut;
 
   public function setUp() {
     parent::setUp();
@@ -43,7 +44,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     require_once 'CiviTest/CiviMailUtils.php';
     $this->mut = new CiviMailUtils($this, TRUE);
 
-    $this->fixtures['rolling_membership'] = array(// createTestObject
+    $this->fixtures['rolling_membership'] = array(
       'membership_type_id' => array(
         'period_type' => 'rolling',
         'duration_unit' => 'month',
@@ -56,7 +57,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'is_override' => 0,
     );
 
-    $this->fixtures['rolling_membership_past'] = array(// createTestObject
+    $this->fixtures['rolling_membership_past'] = array(
       'membership_type_id' => array(
         'period_type' => 'rolling',
         'duration_unit' => 'month',
@@ -69,25 +70,25 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'is_override' => 'NULL',
     );
 
-    $this->fixtures['phonecall'] = array(// createTestObject
+    $this->fixtures['phonecall'] = array(
       'status_id' => 1,
       'activity_type_id' => 2,
       'activity_date_time' => '20120615100000',
       'is_current_revision' => 1,
       'is_deleted' => 0,
     );
-    $this->fixtures['contact'] = array(// API
+    $this->fixtures['contact'] = array(
       'is_deceased' => 0,
       'contact_type' => 'Individual',
       'email' => 'test-member@example.com',
     );
-    $this->fixtures['contact_birthdate'] = array(// API
+    $this->fixtures['contact_birthdate'] = array(
       'is_deceased' => 0,
       'contact_type' => 'Individual',
       'email' => 'test-bday@example.com',
       'birth_date' => '20050707',
     );
-    $this->fixtures['sched_activity_1day'] = array(// create()
+    $this->fixtures['sched_activity_1day'] = array(
       'name' => 'One_Day_Phone_Call_Notice',
       'title' => 'One Day Phone Call Notice',
       'limit_to' => '1',
@@ -147,7 +148,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'start_action_unit' => 'day',
       'subject' => '1-Day (repeating)',
     );
-    $this->fixtures['sched_membership_join_2week'] = array(// create()
+    $this->fixtures['sched_membership_join_2week'] = array(
       'name' => 'sched_membership_join_2week',
       'title' => 'sched_membership_join_2week',
       'absolute_date' => '',
@@ -176,7 +177,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'start_action_unit' => 'week',
       'subject' => 'subject sched_membership_join_2week',
     );
-    $this->fixtures['sched_membership_end_2week'] = array(// create()
+    $this->fixtures['sched_membership_end_2week'] = array(
       'name' => 'sched_membership_end_2week',
       'title' => 'sched_membership_end_2week',
       'absolute_date' => '',
@@ -206,7 +207,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'subject' => 'subject sched_membership_end_2week',
     );
 
-    $this->fixtures['sched_membership_end_2month'] = array(// create()
+    $this->fixtures['sched_membership_end_2month'] = array(
       'name' => 'sched_membership_end_2month',
       'title' => 'sched_membership_end_2month',
       'absolute_date' => '',
@@ -236,7 +237,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'subject' => 'subject sched_membership_end_2month',
     );
 
-    $this->fixtures['sched_contact_bday_yesterday'] = array(// create()
+    $this->fixtures['sched_contact_bday_yesterday'] = array(
       'name' => 'sched_contact_bday_yesterday',
       'title' => 'sched_contact_bday_yesterday',
       'absolute_date' => '',
@@ -266,7 +267,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'subject' => 'subject sched_contact_bday_yesterday',
     );
 
-    $this->fixtures['sched_contact_bday_anniv'] = array(// create()
+    $this->fixtures['sched_contact_bday_anniv'] = array(
       'name' => 'sched_contact_bday_anniv',
       'title' => 'sched_contact_bday_anniv',
       'absolute_date' => '',
@@ -296,7 +297,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'subject' => 'subject sched_contact_bday_anniv',
     );
 
-    $this->fixtures['sched_contact_grad_tomorrow'] = array(// create()
+    $this->fixtures['sched_contact_grad_tomorrow'] = array(
       'name' => 'sched_contact_grad_tomorrow',
       'title' => 'sched_contact_grad_tomorrow',
       'absolute_date' => '',
@@ -325,7 +326,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'subject' => 'subject sched_contact_grad_tomorrow',
     );
 
-    $this->fixtures['sched_contact_grad_anniv'] = array(// create()
+    $this->fixtures['sched_contact_grad_anniv'] = array(
       'name' => 'sched_contact_grad_anniv',
       'title' => 'sched_contact_grad_anniv',
       'absolute_date' => '',
@@ -353,7 +354,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'start_action_unit' => 'week',
       'subject' => 'subject sched_contact_grad_anniv',
     );
-    $this->fixtures['sched_membership_end_2month_repeat_twice_4_weeks'] = array(// create()
+    $this->fixtures['sched_membership_end_2month_repeat_twice_4_weeks'] = array(
       'name' => 'sched_membership_end_2month',
       'title' => 'sched_membership_end_2month',
       'absolute_date' => '',
@@ -382,7 +383,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
       'start_action_unit' => 'month',
       'subject' => 'subject sched_membership_end_2month',
     );
-    $this->fixtures['sched_membership_end_limit_to_none'] = array(// create()
+    $this->fixtures['sched_membership_end_limit_to_none'] = array(
       'name' => 'limit to none',
       'title' => 'limit to none',
       'absolute_date' => '',
@@ -417,6 +418,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
   /**
    * Tears down the fixture, for example, closes a network connection.
+   *
    * This method is called after a test is executed.
    */
   public function tearDown() {
@@ -425,11 +427,16 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $this->mut->clearMessages();
     $this->mut->stop();
     unset($this->mut);
-    $this->quickCleanup(array('civicrm_action_schedule', 'civicrm_action_log', 'civicrm_membership', 'civicrm_email'));
+    $this->quickCleanup(array(
+      'civicrm_action_schedule',
+      'civicrm_action_log',
+      'civicrm_membership',
+      'civicrm_email',
+    ));
     $this->_tearDown();
   }
 
-  public function testActivityDateTime_Match_NonRepeatableSchedule() {
+  public function testActivityDateTimeMatchNonRepeatableSchedule() {
     $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($this->fixtures['sched_activity_1day']);
     $this->assertTrue(is_numeric($actionScheduleDao->id));
 
@@ -445,22 +452,25 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $activityContact->save();
 
     $this->assertCronRuns(array(
-      array(// Before the 24-hour mark, no email
+      array(
+        // Before the 24-hour mark, no email
         'time' => '2012-06-14 04:00:00',
         'recipients' => array(),
       ),
-      array(// After the 24-hour mark, an email
+      array(
+        // After the 24-hour mark, an email
         'time' => '2012-06-14 15:00:00',
         'recipients' => array(array('test-member@example.com')),
       ),
-      array(// Run cron again; message already sent
+      array(
+        // Run cron again; message already sent
         'time' => '',
         'recipients' => array(),
       ),
     ));
   }
 
-  public function testActivityDateTime_Match_RepeatableSchedule() {
+  public function testActivityDateTimeMatchRepeatableSchedule() {
     $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($this->fixtures['sched_activity_1day_r']);
     $this->assertTrue(is_numeric($actionScheduleDao->id));
 
@@ -476,19 +486,23 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $activityContact->save();
 
     $this->assertCronRuns(array(
-      array(// Before the 24-hour mark, no email
+      array(
+        // Before the 24-hour mark, no email
         'time' => '012-06-14 04:00:00',
         'recipients' => array(),
       ),
-      array(// After the 24-hour mark, an email
+      array(
+        // After the 24-hour mark, an email
         'time' => '2012-06-14 15:00:00',
         'recipients' => array(array('test-member@example.com')),
       ),
-      array(// Run cron 4 hours later; first message already sent
+      array(
+        // Run cron 4 hours later; first message already sent
         'time' => '2012-06-14 20:00:00',
         'recipients' => array(),
       ),
-      array(// Run cron 6 hours later; send second message
+      array(
+        // Run cron 6 hours later; send second message.
         'time' => '2012-06-14 21:00:01',
         'recipients' => array(array('test-member@example.com')),
       ),
@@ -505,7 +519,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
    * For contacts/members which match schedule based on join date,
    * an email should be sent.
    */
-  public function testMembershipJoinDate_Match() {
+  public function testMembershipJoinDateMatch() {
     $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership'], array('status_id' => 1)));
     $this->assertTrue(is_numeric($membership->id));
     $result = $this->callAPISuccess('Email', 'create', array(
@@ -523,11 +537,13 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
     // start_date=2012-03-15 ; schedule is 2 weeks after start_date
     $this->assertCronRuns(array(
-      array(// Before the 2-week mark, no email
+      array(
+        // Before the 2-week mark, no email.
         'time' => '2012-03-28 01:00:00',
         'recipients' => array(),
       ),
-      array(// After the 2-week mark, send an email
+      array(
+        // After the 2-week mark, send an email.
         'time' => '2012-03-29 01:00:00',
         'recipients' => array(array('test-member@example.com')),
       ),
@@ -535,10 +551,12 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
   }
 
   /**
+   * Test end date email sent.
+   *
    * For contacts/members which match schedule based on join date,
    * an email should be sent.
    */
-  public function testMembershipJoinDate_NonMatch() {
+  public function testMembershipJoinDateNonMatch() {
     $membership = $this->createTestObject('CRM_Member_DAO_Membership', $this->fixtures['rolling_membership']);
     $this->assertTrue(is_numeric($membership->id));
     $result = $this->callAPISuccess('Email', 'create', array(
@@ -557,7 +575,8 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
     // start_date=2012-03-15 ; schedule is 2 weeks after start_date
     $this->assertCronRuns(array(
-      array(// After the 2-week mark, don't send email because we have different membership type
+      array(
+        // After the 2-week mark, don't send email because we have different membership type.
         'time' => '2012-03-29 01:00:00',
         'recipients' => array(),
       ),
@@ -565,9 +584,9 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test that the first and SECOND notifications are sent out
+   * Test that the first and SECOND notifications are sent out.
    */
-  public function testMembershipEndDate_Repeat() {
+  public function testMembershipEndDateRepeat() {
     // creates membership with end_date = 20120615
     $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership'], array('status_id' => 2)));
     $result = $this->callAPISuccess('Email', 'create', array(
@@ -582,11 +601,13 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
     // end_date=2012-06-15 ; schedule is 2 weeks before end_date
     $this->assertCronRuns(array(
-      array(// After the 2-week mark, send an email
+      array(
+        // After the 2-week mark, send an email.
         'time' => '2012-08-15 01:00:00',
         'recipients' => array(array('test-member@example.com')),
       ),
-      array(// After the 2-week mark, send an email
+      array(
+        // After the 2-week mark, send an email.
         'time' => '2012-09-12 01:00:00',
         'recipients' => array(array('test-member@example.com')),
       ),
@@ -594,11 +615,13 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
   }
 
   /**
+   * Test behaviour when date changes.
+   *
    * Test that the first notification is sent but the second is NOT sent if the end date changes in
    * between
    *  see CRM-15376
    */
-  public function testMembershipEndDate_Repeat_ChangedEndDate_CRM_15376() {
+  public function testMembershipEndDateRepeatChangedEndDate_CRM_15376() {
     // creates membership with end_date = 20120615
     $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership'], array('status_id' => 2)));
     $this->callAPISuccess('Email', 'create', array(
@@ -612,16 +635,18 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $this->callAPISuccess('action_schedule', 'create', $actionSchedule);
     // end_date=2012-06-15 ; schedule is 2 weeks before end_date
     $this->assertCronRuns(array(
-      array(// After the 2-week mark, send an email
+      array(
+        // After the 2-week mark, send an email.
         'time' => '2012-08-15 01:00:00',
         'recipients' => array(array('test-member@example.com')),
       ),
     ));
 
-    //extend membership - reminder should NOT go out
+    // Extend membership - reminder should NOT go out.
     $this->callAPISuccess('membership', 'create', array('id' => $membership->id, 'end_date' => '2014-01-01'));
     $this->assertCronRuns(array(
-      array(// After the 2-week mark, send an email
+      array(
+        // After the 2-week mark, send an email.
         'time' => '2012-09-12 01:00:00',
         'recipients' => array(),
       ),
@@ -629,10 +654,12 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
   }
 
   /**
+   * Test membership end date email sends.
+   *
    * For contacts/members which match schedule based on end date,
    * an email should be sent.
    */
-  public function testMembershipEndDate_Match() {
+  public function testMembershipEndDateMatch() {
     // creates membership with end_date = 20120615
     $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership'], array('status_id' => 2)));
     $this->assertTrue(is_numeric($membership->id));
@@ -649,12 +676,15 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
     // end_date=2012-06-15 ; schedule is 2 weeks before end_date
     $this->assertCronRuns(array(
-      array(// Before the 2-week mark, no email
+      array(
+        // Before the 2-week mark, no email.
         'time' => '2012-05-31 01:00:00',
-        // 'time' => '2012-06-01 01:00:00', // FIXME: Is this the right boundary?
+        // 'time' => '2012-06-01 01:00:00',
+        // FIXME: Is this the right boundary?
         'recipients' => array(),
       ),
-      array(// After the 2-week mark, send an email
+      array(
+        // After the 2-week mark, send an email.
         'time' => '2012-06-01 01:00:00',
         'recipients' => array(array('test-member@example.com')),
       ),
@@ -663,10 +693,12 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
 
   /**
+   * Test membership end date email.
+   *
    * For contacts/members which match schedule based on end date,
    * an email should be sent.
    */
-  public function testMembershipEndDate_NoMatch() {
+  public function testMembershipEndDateNoMatch() {
     // creates membership with end_date = 20120615
     $membership = $this->createTestObject('CRM_Member_DAO_Membership', array_merge($this->fixtures['rolling_membership_past'], array('status_id' => 3)));
     $this->assertTrue(is_numeric($membership->id));
@@ -683,55 +715,62 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
     // end_date=2012-06-15 ; schedule is 2 weeks before end_date
     $this->assertCronRuns(array(
-      array(// Before the 2-week mark, no email
+      array(
+        // Before the 2-week mark, no email.
         'time' => '2012-05-31 01:00:00',
-        // 'time' => '2012-06-01 01:00:00', // FIXME: Is this the right boundary?
+        // 'time' => '2012-06-01 01:00:00',
+        // FIXME: Is this the right boundary?
         'recipients' => array(),
       ),
-      array(// After the 2-week mark, send an email
+      array(
+        // After the 2-week mark, send an email.
         'time' => '2013-05-01 01:00:00',
         'recipients' => array(),
       ),
     ));
   }
 
-  public function testContactBirthDate_noAnniv() {
+  public function testContactBirthDateNoAnniv() {
     $contact = $this->callAPISuccess('Contact', 'create', $this->fixtures['contact_birthdate']);
     $this->_testObjects['CRM_Contact_DAO_Contact'][] = $contact['id'];
     $actionSchedule = $this->fixtures['sched_contact_bday_yesterday'];
     $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule);
     $this->assertTrue(is_numeric($actionScheduleDao->id));
     $this->assertCronRuns(array(
-      array(// On the birthday, no email
+      array(
+        // On the birthday, no email.
         'time' => '2005-07-07 01:00:00',
         'recipients' => array(),
       ),
-      array(// The next day, send an email
+      array(
+        // The next day, send an email.
         'time' => '2005-07-08 20:00:00',
         'recipients' => array(array('test-bday@example.com')),
       ),
     ));
   }
 
-  public function testContactBirthDate_Anniv() {
+  public function testContactBirthDateAnniversary() {
     $contact = $this->callAPISuccess('Contact', 'create', $this->fixtures['contact_birthdate']);
     $this->_testObjects['CRM_Contact_DAO_Contact'][] = $contact['id'];
     $actionSchedule = $this->fixtures['sched_contact_bday_anniv'];
     $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule);
     $this->assertTrue(is_numeric($actionScheduleDao->id));
     $this->assertCronRuns(array(
-      array(// On some random day, no email
+      array(
+        // On some random day, no email.
         'time' => '2014-03-07 01:00:00',
         'recipients' => array(),
       ),
-      array(// On the eve of their 9th birthday, send an email
+      array(
+        // On the eve of their 9th birthday, send an email.
         'time' => '2014-07-06 20:00:00',
         'recipients' => array(array('test-bday@example.com')),
       ),
     ));
   }
 
-  public function testContactCustomDate_noAnniv() {
+  public function testContactCustomDateNoAnniv() {
     $group = array(
       'title' => 'Test_Group',
       'name' => 'test_group',
@@ -757,11 +796,13 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule);
     $this->assertTrue(is_numeric($actionScheduleDao->id));
     $this->assertCronRuns(array(
-      array(// On some random day, no email
+      array(
+        // On some random day, no email.
         'time' => '2014-03-07 01:00:00',
         'recipients' => array(),
       ),
-      array(// On the eve of their graduation, send an email
+      array(
+        // On the eve of their graduation, send an email.
         'time' => '2013-12-15 20:00:00',
         'recipients' => array(array('test-member@example.com')),
       ),
@@ -770,7 +811,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
   }
 
   /**
-   * Check that limit_to + an empty recipients doesn't sent to multiple contacts
+   * Check that limit_to + an empty recipients doesn't sent to multiple contacts.
    */
   public function testMembershipLimitToNone() {
     // creates membership with end_date = 20120615
@@ -793,7 +834,8 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
     // end_date=2012-06-15 ; schedule is 2 weeks before end_date
     $this->assertCronRuns(array(
-      array(// Before the 2-week mark, no email
+      array(
+        // Before the 2-week mark, no email.
         'time' => '2012-05-31 01:00:00',
         // 'time' => '2012-06-01 01:00:00', // FIXME: Is this the right boundary?
         'recipients' => array(),
@@ -802,7 +844,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
   }
 
 
-  public function testContactCustomDate_Anniv() {
+  public function testContactCustomDateAnniv() {
     $group = array(
       'title' => 'Test_Group now',
       'name' => 'test_group_now',
@@ -829,11 +871,13 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule);
     $this->assertTrue(is_numeric($actionScheduleDao->id));
     $this->assertCronRuns(array(
-      array(// On some random day, no email
+      array(
+        // On some random day, no email.
         'time' => '2014-03-07 01:00:00',
         'recipients' => array(),
       ),
-      array(// A week after their 5th anniversary of graduation, send an email
+      array(
+        // A week after their 5th anniversary of graduation, send an email.
         'time' => '2018-12-23 20:00:00',
         'recipients' => array(array('test-member@example.com')),
       ),
@@ -848,7 +892,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
   // TODO // function testEventNameEndDate_Match() { }
 
   /**
-   * Run a series of cron jobs and make an assertion about email deliveries
+   * Run a series of cron jobs and make an assertion about email deliveries.
    *
    * @param array $cronRuns
    *   array specifying when to run cron and what messages to expect; each item is an array with keys:
@@ -871,6 +915,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
   /**
    * Sets up the fixture, for example, opens a network connection.
+   *
    * This method is called before a test is executed.
    */
   protected function _setUp() {
@@ -879,6 +924,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
   /**
    * Tears down the fixture, for example, closes a network connection.
+   *
    * This method is called after a test is executed.
    */
   protected function _tearDown() {
@@ -888,13 +934,16 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
 
   /**
    * This is a wrapper for CRM_Core_DAO::createTestObject which tracks
-   * created entities and provides for brainless clenaup.
+   * created entities and provides for brainless cleanup.
    *
    * @see CRM_Core_DAO::createTestObject
+   *
    * @param $daoName
    * @param array $params
    * @param int $numObjects
    * @param bool $createOnly
+   *
+   * @return array|NULL|object
    */
   function createTestObject($daoName, $params = array(), $numObjects = 1, $createOnly = FALSE) {
     $objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly);
index 57cff4d4fd0e51693685346c417cc8354828eeea..f7fc6ebc2433342494c982557eeb432606a35a1c 100644 (file)
@@ -56,21 +56,21 @@ class CRM_Core_Config_MailerTest extends CiviUnitTestCase {
   public function testHookAlterMailer() {
     $test = $this;
     $mockMailer = new CRM_Utils_FakeObject(array(
-      'send' => function ($recipients, $headers, $body) use ($test) {
-        $test->calls['send']++;
-        $test->assertEquals(array('to@example.org'), $recipients);
-        $test->assertEquals('Subject Example', $headers['Subject']);
-      },
+    'send' => function ($recipients, $headers, $body) use ($test) {
+      $test->calls['send']++;
+      $test->assertEquals(array('to@example.org'), $recipients);
+      $test->assertEquals('Subject Example', $headers['Subject']);
+    },
     ));
 
     CRM_Utils_Hook::singleton()->setHook('civicrm_alterMailer',
-      function (&$mailer, $driver, $params) use ($test, $mockMailer) {
-        $test->calls['civicrm_alterMailer']++;
-        $test->assertTrue(is_string($driver) && !empty($driver));
-        $test->assertTrue(is_array($params));
-        $test->assertTrue(is_callable(array($mailer, 'send')));
-        $mailer = $mockMailer;
-      }
+    function (&$mailer, $driver, $params) use ($test, $mockMailer) {
+      $test->calls['civicrm_alterMailer']++;
+      $test->assertTrue(is_string($driver) && !empty($driver));
+      $test->assertTrue(is_array($params));
+      $test->assertTrue(is_callable(array($mailer, 'send')));
+      $mailer = $mockMailer;
+    }
     );
 
     $params = array();
index 4b1e8c7b22fa9710816a78975b319d28f2c7a5f6..3ce716b9bb5c619b4bd7cb4e840a27b12e49fb47 100644 (file)
@@ -75,7 +75,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase {
     $paypalIPN->main();
     $contribution = $this->callAPISuccess('contribution', 'get', array(
         'contribution_recur_id' => $this->_contributionRecurID,
-        'sequential' => 1
+        'sequential' => 1,
       ));
     $this->assertEquals(2, $contribution['count']);
     $this->assertEquals('secondone', $contribution['values'][1]['trxn_id']);
@@ -102,17 +102,17 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase {
     $this->assertEquals(strtotime('+ 1 year', strtotime($membershipEndDate)), strtotime($this->callAPISuccessGetValue('membership', array('return' => 'end_date'))));
     $contribution = $this->callAPISuccess('contribution', 'get', array(
         'contribution_recur_id' => $this->_contributionRecurID,
-        'sequential' => 1
+        'sequential' => 1,
       ));
     $this->assertEquals(2, $contribution['count']);
     $this->assertEquals('secondone', $contribution['values'][1]['trxn_id']);
     $this->callAPISuccessGetCount('line_item', array(
         'entity_id' => $this->ids['membership'],
-        'entity_table' => 'civicrm_membership'
+        'entity_table' => 'civicrm_membership',
       ), 2);
     $this->callAPISuccessGetSingle('line_item', array(
         'contribution_id' => $contribution['values'][1]['id'],
-        'entity_table' => 'civicrm_membership'
+        'entity_table' => 'civicrm_membership',
       ));
     $this->callAPISuccessGetSingle('membership_payment', array('contribution_id' => $contribution['values'][1]['id']));
 
@@ -141,7 +141,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase {
     $paypalIPN->main();
     $contribution = $this->callAPISuccess('contribution', 'get', array(
         'contribution_recur_id' => $this->_contributionRecurID,
-        'sequential' => 1
+        'sequential' => 1,
       ));
     $this->assertEquals(1, $contribution['count']);
     $this->assertEquals('secondone', $contribution['values'][0]['trxn_id']);
@@ -321,11 +321,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase {
       'amount_per_cycle' => '15.00',
       'mc_gross' => '15.00',
       'payment_date' => '03:59:05 Jul 14, 2013 PDT',
-      'rp_invoice_id' => 'i=' . $this->_invoiceID
-        . '&m=contribute&c='
-        . $this->_contactID
-        . '&r=' . $this->_contributionRecurID
-        . '&b=' . $this->_contributionID . '&p=' . $this->_contributionPageID,
+      'rp_invoice_id' => 'i=' . $this->_invoiceID . '&m=contribute&c=' . $this->_contactID . '&r=' . $this->_contributionRecurID . '&b=' . $this->_contributionID . '&p=' . $this->_contributionPageID,
       'payment_status' => 'Completed',
       'business' => 'nowhere@civicrm.org',
       'last_name' => 'Roberty',
index 980d0ae60d72e48a6cb9cedf06b0100185023cb0..e0a204b820bc102fc9a285dce29d12a25a600612 100644 (file)
@@ -205,19 +205,19 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase {
 
     CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_COMMIT, array($this, '_preCommit'), array(
         'qwe',
-        'rty'
+        'rty',
       ));
     CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, array($this, '_postCommit'), array(
         'uio',
-        'p[]'
+        'p[]',
       ));
     CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_ROLLBACK, array(
         $this,
-        '_preRollback'
+        '_preRollback',
       ), array('asd', 'fgh'));
     CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_ROLLBACK, array(
         $this,
-        '_postRollback'
+        '_postRollback',
       ), array('jkl', ';'));
 
     CRM_Core_DAO::executeQuery('UPDATE civicrm_contact SET id = 100 WHERE id = 100');
@@ -233,19 +233,19 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase {
 
     CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_COMMIT, array($this, '_preCommit'), array(
         'ewq',
-        'ytr'
+        'ytr',
       ));
     CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, array($this, '_postCommit'), array(
         'oiu',
-        '][p'
+        '][p',
       ));
     CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_PRE_ROLLBACK, array(
         $this,
-        '_preRollback'
+        '_preRollback',
       ), array('dsa', 'hgf'));
     CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_ROLLBACK, array(
         $this,
-        '_postRollback'
+        '_postRollback',
       ), array('lkj', ';'));
 
     CRM_Core_DAO::executeQuery('UPDATE civicrm_contact SET id = 100 WHERE id = 100');
@@ -395,8 +395,7 @@ class CRM_Core_TransactionTest extends CiviUnitTestCase {
    *   See assertContactsMix.
    * @param string $outcome
    *   'rollback'|'implicit-commit'|'explicit-commit' how to finish transaction.
-   * @return int
-   *   cid
+   * @return void
    */
   public function runBatch($nesting, $callbacks, $existsByOffset, $outcome) {
     if ($nesting != 'reuse-tx' && $nesting != 'nest-tx') {
index 2eee6875bf6345ee07f4baa3c0dfdf4dc20b1eb9..f4db10030f6a1ff25156598d2c6cfe065227cc71 100644 (file)
@@ -44,24 +44,23 @@ class CRM_Extension_Container_AllTests extends CiviTestSuite {
   private static $instance = NULL;
 
   /**
+   * Get instance.
    */
   private static function getInstance() {
     if (is_null(self::$instance)) {
-      self::$instance = new self;
+      self::$instance = new self();
     }
     return self::$instance;
   }
 
   /**
-   *  Build test suite dynamically
+   * Build test suite dynamically.
    */
   public static function suite() {
     $inst = self::getInstance();
     return $inst->implSuite(__FILE__);
   }
 }
-// class CRM_Core_AllTests
-
 // -- set Emacs parameters --
 // Local variables:
 // mode: php;
index 0aa6e64bb7fcba50813822e5af35a78474a616ab..2d0582179d3c14bbfdb790a63dbe4c7c8e9589d9 100644 (file)
@@ -37,12 +37,12 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase {
     $this->_permissionedDisabledGroup = $this->groupCreate(array(
         'title' => 'pick-me-disabled',
         'is_active' => 0,
-        'name' => 'pick-me-disabled'
+        'name' => 'pick-me-disabled',
       ));
     $this->_permissionedGroup = $this->groupCreate(array(
         'title' => 'pick-me-active',
         'is_active' => 1,
-        'name' => 'pick-me-active'
+        'name' => 'pick-me-active',
       ));
     $this->groupCreate(array('title' => 'not-me-disabled', 'is_active' => 0, 'name' => 'not-me-disabled'));
     $this->groupCreate(array('title' => 'not-me-active', 'is_active' => 1, 'name' => 'not-me-active'));
index 0052ed6483b073ce871b214062ea7ac91a3f3209..baf41b6a947caab5331ec284770810d0ea78152a 100644 (file)
@@ -11,7 +11,7 @@ class CRM_Mailing_BAO_QueryTest extends CiviUnitTestCase {
    * @return CRM_Mailing_BAO_QueryTestDataProvider
    */
   public function dataProvider() {
-    return new CRM_Mailing_BAO_QueryTestDataProvider;
+    return new CRM_Mailing_BAO_QueryTestDataProvider();
   }
 
   public function setUp() {
index 269a5a6e51ab494889b1eefda66549578f518c18..a717716f0ab0cbf19ca7119066620df6f9e83a91 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Member_AllTests extends CiviTestSuite {
    */
   private static function getInstance() {
     if (is_null(self::$instance)) {
-      self::$instance = new self;
+      self::$instance = new self();
     }
     return self::$instance;
   }
index 461211f168558208adf3f07472a5261208f948be..244aada9270cee16fe38b74e87f6f1639e7662e4 100644 (file)
@@ -37,9 +37,9 @@ class CRM_Member_BAO_MembershipStatusTest extends CiviUnitTestCase {
     parent::setUp();
   }
 
-  /* check function add()
-     *
-     */
+  /**
+   * Check function add()
+   */
   public function testAdd() {
     $params = array(
       'name' => 'pending',
index 6766f001656a943699515b843f8f2f9890338ecb..a6d31bd7e5a9ec04e4e6fcecc6a96d83e720182a 100644 (file)
@@ -519,18 +519,17 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $config = CRM_Core_Config::singleton();
     $config->keyDisable = TRUE;
 
-    $membershipRenewal = new CRM_Core_Form;
-    $membershipRenewal->controller = new CRM_Core_Controller;
+    $membershipRenewal = new CRM_Core_Form();
+    $membershipRenewal->controller = new CRM_Core_Controller();
     $isTestMembership = 0;
-    $MembershipRenew =
-      CRM_Member_BAO_Membership::renewMembershipFormWrapper(
-        $contactId,
-        $this->_membershipTypeID,
-        $isTestMembership,
-        $membershipRenewal,
-        NULL,
-        NULL
-      );
+    $MembershipRenew = CRM_Member_BAO_Membership::renewMembershipFormWrapper(
+      $contactId,
+      $this->_membershipTypeID,
+      $isTestMembership,
+      $membershipRenewal,
+      NULL,
+      NULL
+    );
     $endDate = date("Y-m-d", strtotime($membership->end_date . " +1 year"));
 
     $this->assertDBNotNull('CRM_Member_BAO_MembershipLog',
@@ -601,8 +600,8 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase {
     $config = CRM_Core_Config::singleton();
     $config->keyDisable = TRUE;
 
-    $membershipRenewal = new CRM_Core_Form;
-    $membershipRenewal->controller = new CRM_Core_Controller;
+    $membershipRenewal = new CRM_Core_Form();
+    $membershipRenewal->controller = new CRM_Core_Controller();
     $MembershipRenew = CRM_Member_BAO_Membership::renewMembershipFormWrapper($contactId, $this->_membershipTypeID, $isTestMembership = 0, $membershipRenewal, NULL, NULL);
 
     $this->assertDBNotNull('CRM_Member_BAO_MembershipLog',
index 502233b3cc6fd201adc9fb403b0b5d4f4f35076d..a9c20abb56a1d682497a6eba3d5854648886b429 100644 (file)
@@ -63,9 +63,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
     $this->contactDelete($this->_indiviContactID);
   }
 
-  /* check function add()
-     *
-     */
+  /**
+   * check function add()
+   *
+   */
   public function testAdd() {
     $ids = array();
     $params = array(
@@ -93,9 +94,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
     $this->membershipTypeDelete(array('id' => $membershipType->id));
   }
 
-  /* check function retrive()
-     *
-     */
+  /**
+   * check function retrive()
+   *
+   */
   public function testRetrieve() {
     $ids = array();
     $params = array(
@@ -120,9 +122,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
     $this->membershipTypeDelete(array('id' => $membershipType->id));
   }
 
-  /* check function isActive()
-     *
-     */
+  /**
+   * check function isActive()
+   *
+   */
   public function testSetIsActive() {
     $ids = array();
     $params = array(
@@ -152,9 +155,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
     $this->membershipTypeDelete(array('id' => $membership->id));
   }
 
-  /* check function del()
-     *
-     */
+  /**
+   * check function del()
+   *
+   */
   public function testdel() {
     $ids = array();
     $params = array(
@@ -178,9 +182,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
     $this->assertEquals($result, TRUE, 'Verify membership deleted.');
   }
 
-  /* check function convertDayFormat( )
-     *
-     */
+  /**
+   * check function convertDayFormat( )
+   *
+   */
   public function testConvertDayFormat() {
     $ids = array();
     $params = array(
@@ -208,9 +213,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
     $this->membershipTypeDelete(array('id' => $membership->id));
   }
 
-  /* check function getMembershipTypes( )
-     *
-     */
+  /**
+   * check function getMembershipTypes( )
+   *
+   */
   public function testGetMembershipTypes() {
     $ids = array();
     $params = array(
@@ -233,9 +239,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
     $this->membershipTypeDelete(array('id' => $membership->id));
   }
 
-  /* check function getMembershipTypeDetails( )
-     *
-     */
+  /**
+   * check function getMembershipTypeDetails( )
+   *
+   */
   public function testGetMembershipTypeDetails() {
     $ids = array();
     $params = array(
@@ -260,9 +267,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
     $this->membershipTypeDelete(array('id' => $membership->id));
   }
 
-  /* check function getDatesForMembershipType( )
-     *
-     */
+  /**
+   * check function getDatesForMembershipType( )
+   *
+   */
   public function testGetDatesForMembershipType() {
     $ids = array();
     $params = array(
@@ -286,9 +294,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
     $this->membershipTypeDelete(array('id' => $membership->id));
   }
 
-  /* check function getRenewalDatesForMembershipType( )
-     *
-     */
+  /**
+   * check function getRenewalDatesForMembershipType( )
+   *
+   */
   public function testGetRenewalDatesForMembershipType() {
     $ids = array();
     $params = array(
@@ -329,9 +338,10 @@ class CRM_Member_BAO_MembershipTypeTest extends CiviUnitTestCase {
     $this->membershipTypeDelete(array('id' => $membershipType->id));
   }
 
-  /* check function getMembershipTypesByOrg( )
-     *
-     */
+  /**
+   * check function getMembershipTypesByOrg( )
+   *
+   */
   public function testGetMembershipTypesByOrg() {
     $ids = array();
     $params = array(
index 9be7a535e37d8c1d91d22bb687d9c8a5b6a1c3ef..d293c830dc205f4a1e58e591da87b0c90eb0ff54 100644 (file)
@@ -222,7 +222,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array(),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
     $this->assertType('array', $rc,
       'In line ' . __LINE__
@@ -258,7 +258,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '3'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = call_user_func(array('CRM_Member_Form_Membership', 'formRule'),
       $params, $files, $obj
     );
@@ -287,7 +287,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '3'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
     $this->assertType('array', $rc,
       'In line ' . __LINE__
@@ -314,7 +314,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '3'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
     $this->assertType('array', $rc,
       'In line ' . __LINE__
@@ -340,7 +340,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '13'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
     $this->assertType('array', $rc);
     $this->assertTrue(array_key_exists('status_id', $rc));
@@ -359,7 +359,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'is_override' => TRUE,
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
     $this->assertType('array', $rc,
       'In line ' . __LINE__
@@ -383,7 +383,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '3'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
 
     //  Should have found no valid membership status
@@ -408,7 +408,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '3'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
 
     //  Should have found New membership status
@@ -429,7 +429,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '3'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
 
     //  Should have found New membership status
@@ -450,7 +450,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '3'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
 
     //  Should have found Current membership status
@@ -471,7 +471,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '3'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
 
     //  Should have found Grace membership status
@@ -492,7 +492,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '3'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
 
     //  Should have found Expired membership status
@@ -513,7 +513,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase {
       'membership_type_id' => array('23', '7'),
     );
     $files = array();
-    $obj = new CRM_Member_Form_Membership;
+    $obj = new CRM_Member_Form_Membership();
     $rc = $obj->formRule($params, $files, $obj);
 
     //  Should have found Current membership status
index 5df3bacd4931bb54e012f39ca42e09352dd617bc..0854f71ba582ad98f835cc6229a94d2234555081 100644 (file)
@@ -47,7 +47,7 @@ class CRM_Pledge_AllTests extends CiviTestSuite {
    */
   private static function getInstance() {
     if (is_null(self::$instance)) {
-      self::$instance = new self;
+      self::$instance = new self();
     }
     return self::$instance;
   }
index 574dd79f0a7d612a2634e280fb239647945a55cf..34967e5648bd5df6cb8f0927901262ac401da236 100644 (file)
@@ -8,157 +8,201 @@ require_once 'CiviTest/CiviUnitTestCase.php';
 class CRM_Utils_QueryFormatterTest extends CiviUnitTestCase {
 
   public function dataProvider() {
-    $cases = array(); // array(0=>$inputText, 1=>$language, 2=>$options, 3=>$expectedText)
+    // Array(0=>$inputText, 1=>$language, 2=>$options, 3=>$expectedText).
+    $cases = array();
 
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_LIKE,
       CRM_Utils_QueryFormatter::MODE_NONE,
-      '%first second%'
+      '%first second%',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_LIKE,
       CRM_Utils_QueryFormatter::MODE_PHRASE,
-      '%first second%'
+      '%first second%',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_LIKE,
       CRM_Utils_QueryFormatter::MODE_WILDPHRASE,
-      '%first second%'
+      '%first second%',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_LIKE,
       CRM_Utils_QueryFormatter::MODE_WILDWORDS,
-      '%first%second%'
+      '%first%second%',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_LIKE,
       CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX,
-      '%first%second%'
+      '%first%second%',
     );
 
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_FTS,
       CRM_Utils_QueryFormatter::MODE_NONE,
-      'first second'
+      'first second',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_FTS,
       CRM_Utils_QueryFormatter::MODE_PHRASE,
-      '"first second"'
+      '"first second"',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_FTS,
       CRM_Utils_QueryFormatter::MODE_WILDPHRASE,
-      '"*first second*"'
+      '"*first second*"',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_FTS,
       CRM_Utils_QueryFormatter::MODE_WILDWORDS,
-      '*first* *second*'
+      '*first* *second*',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_FTS,
       CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX,
-      'first* second*'
+      'first* second*',
     );
 
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL,
       CRM_Utils_QueryFormatter::MODE_NONE,
-      '+first +second'
+      '+first +second',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL,
       CRM_Utils_QueryFormatter::MODE_PHRASE,
-      '+"first second"'
+      '+"first second"',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL,
       CRM_Utils_QueryFormatter::MODE_WILDPHRASE,
-      '+"*first second*"'
+      '+"*first second*"',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL,
       CRM_Utils_QueryFormatter::MODE_WILDWORDS,
-      '+*first* +*second*'
+      '+*first* +*second*',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL,
       CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX,
-      '+first* +second*'
+      '+first* +second*',
     );
 
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SOLR,
       CRM_Utils_QueryFormatter::MODE_NONE,
-      'first second'
+      'first second',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SOLR,
       CRM_Utils_QueryFormatter::MODE_PHRASE,
-      '"first second"'
+      '"first second"',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SOLR,
       CRM_Utils_QueryFormatter::MODE_WILDPHRASE,
-      '"*first second*"'
+      '"*first second*"',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SOLR,
       CRM_Utils_QueryFormatter::MODE_WILDWORDS,
-      '*first* *second*'
+      '*first* *second*',
     );
     $cases[] = array(
       'first second',
       CRM_Utils_QueryFormatter::LANG_SOLR,
       CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX,
-      'first* second*'
+      'first* second*',
     );
 
-    // if user supplies wildcards, then ignore mode
+    // If user supplies wildcards, then ignore mode.
     foreach (array(
                CRM_Utils_QueryFormatter::MODE_NONE,
                CRM_Utils_QueryFormatter::MODE_WILDPHRASE,
                CRM_Utils_QueryFormatter::MODE_WILDWORDS,
-               CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX
+               CRM_Utils_QueryFormatter::MODE_WILDWORDS_SUFFIX,
              ) as $mode) {
-      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, $mode, 'first% second');
-      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SQL_FTS, $mode, 'first* second');
-      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, $mode, '+first* +second');
-      $cases[] = array('first% second', CRM_Utils_QueryFormatter::LANG_SOLR, $mode, 'first* second');
-      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SQL_LIKE, $mode, 'first second%');
-      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SQL_FTS, $mode, 'first second*');
-      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL, $mode, '+first +second*');
-      $cases[] = array('first second%', CRM_Utils_QueryFormatter::LANG_SOLR, $mode, 'first second*');
+      $cases[] = array(
+        'first% second',
+        CRM_Utils_QueryFormatter::LANG_SQL_LIKE,
+        $mode,
+        'first% second',
+      );
+      $cases[] = array(
+        'first% second',
+        CRM_Utils_QueryFormatter::LANG_SQL_FTS,
+        $mode,
+        'first* second',
+      );
+      $cases[] = array(
+        'first% second',
+        CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL,
+        $mode,
+        '+first* +second',
+      );
+      $cases[] = array(
+        'first% second',
+        CRM_Utils_QueryFormatter::LANG_SOLR,
+        $mode,
+        'first* second',
+      );
+      $cases[] = array(
+        'first second%',
+        CRM_Utils_QueryFormatter::LANG_SQL_LIKE,
+        $mode,
+        'first second%',
+      );
+      $cases[] = array(
+        'first second%',
+        CRM_Utils_QueryFormatter::LANG_SQL_FTS,
+        $mode,
+        'first second*',
+      );
+      $cases[] = array(
+        'first second%',
+        CRM_Utils_QueryFormatter::LANG_SQL_FTSBOOL,
+        $mode,
+        '+first +second*',
+      );
+      $cases[] = array(
+        'first second%',
+        CRM_Utils_QueryFormatter::LANG_SOLR,
+        $mode,
+        'first second*',
+      );
     }
 
     return $cases;
   }
 
   /**
-   * @param $text
-   * @param $language
-   * @param $mode
-   * @param $expectedText
+   * Test format.
+   *
+   * @param string $text
+   * @param string $language
+   * @param string $mode
+   * @param string $expectedText
+   *
    * @dataProvider dataProvider
    */
   public function testFormat($text, $language, $mode, $expectedText) {
index dc1a56b1cf3df3303eba6286af133dd354468e82..9a69193d4584d29c95477c93c58f0857403bf4a4 100644 (file)
@@ -47,7 +47,7 @@ class Civi_AllTests extends CiviTestSuite {
    */
   private static function getInstance() {
     if (is_null(self::$instance)) {
-      self::$instance = new self;
+      self::$instance = new self();
     }
     return self::$instance;
   }
index e0c46fbca4ea4506f7348033bc5d687bc78ffbab..dc64f5d407cfdcd0a962f7faf1e62dd21e533c5e 100644 (file)
@@ -37,7 +37,7 @@ class AuthorizeNet extends PHPUnit_Framework_Testcase {
    * @param int $id
    *   Id of the PayPal Pro payment processor.
    *   to be deleted
-   * @return boolean
+   * @return bool
    *   true if payment processor deleted, false otherwise
    */
   public function delete($id) {
index ff12960746175a26e09d70927c411ec8a3ea75ca..dc056dbc1c14cadcba2658e912cce789b2a0afb8 100644 (file)
@@ -150,7 +150,7 @@ class CiviDBAssert {
    * @param $expectedValue
    * @param string $message
    */
-  function assertDBCompareValue(
+  public function assertDBCompareValue(
     &$testCase, $daoName, $searchValue, $returnColumn, $searchColumn,
     $expectedValue, $message
   ) {
index e16a0232d0cd67ff385833f4d8970310d3ffc98f..3584c546f564e63ee1a0dd07160f6f40c8c3cc69 100755 (executable)
@@ -189,7 +189,8 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
     // also load the class loader
     require_once 'CRM/Core/ClassLoader.php';
     CRM_Core_ClassLoader::singleton()->register();
-    if (function_exists('_civix_phpunit_setUp')) { // FIXME: loosen coupling
+    if (function_exists('_civix_phpunit_setUp')) {
+      // FIXME: loosen coupling
       _civix_phpunit_setUp();
     }
   }
@@ -679,7 +680,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
    * @param $expectedValue
    * @param $message
    */
-  function assertDBCompareValue(
+  public function assertDBCompareValue(
     $daoName, $searchValue, $returnColumn, $searchColumn,
     $expectedValue, $message
   ) {
@@ -1024,7 +1025,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
       'debug' => 1,
     );
     $result = $this->civicrm_api($entity, 'getcount', $params);
-    if (!is_integer($result) || !empty($result['is_error']) || isset($result['values'])) {
+    if (!is_int($result) || !empty($result['is_error']) || isset($result['values'])) {
       throw new Exception('Invalid getcount result : ' . print_r($result, TRUE) . " type :" . gettype($result));
     }
     if (is_int($count)) {
@@ -1176,7 +1177,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
     );
     $params = array('contact_type' => $contact_type);
     foreach ($samples[$contact_type] as $key => $values) {
-      $params[$key] = $values[$seq % sizeof($values)];
+      $params[$key] = $values[$seq % count($values)];
     }
     if ($contact_type == 'Individual') {
       $params['email'] = strtolower(
@@ -1214,7 +1215,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
    *   Contact ID to delete
    */
   public function contactDelete($contactID) {
-    $domain = new CRM_Core_BAO_Domain;
+    $domain = new CRM_Core_BAO_Domain();
     $domain->contact_id = $contactID;
     if (!$domain->find(TRUE)) {
       $this->callAPISuccess('contact', 'delete', array(
@@ -1304,7 +1305,6 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   public function membershipDelete($membershipID) {
     $deleteParams = array('id' => $membershipID);
     $result = $this->callAPISuccess('Membership', 'Delete', $deleteParams);
-    return;
   }
 
   /**
@@ -1332,7 +1332,6 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
       return;
     }
     $result = $this->callAPISuccess('MembershipStatus', 'Delete', array('id' => $membershipStatusID));
-    return;
   }
 
   /**
@@ -1811,7 +1810,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   /**
    * Delete a Location Type
    *
-   * @param int location type id
+   * @param int locationTypeId
    */
   public function locationTypeDelete($locationTypeId) {
     $locationType = new CRM_Core_DAO_LocationType();
@@ -1852,8 +1851,8 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
    *
    * @param int $groupID
    * @param int $totalCount
-   * @return int groupId of created group
-   * groupId of created group
+   * @return int
+   *    groupId of created group
    */
   public function groupContactCreate($groupID, $totalCount = 10) {
     $params = array('group_id' => $groupID);
@@ -1929,7 +1928,8 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase {
   /**
    * Delete a UF Join Entry
    *
-   * @param array with missing uf_group_id
+   * @param array $params
+   *   with missing uf_group_id
    */
   public function ufjoinDelete($params = NULL) {
     if ($params === NULL) {
index 970722131e400084195fd792c79595c07eda0c61..a35dc0487bcaf5384456d0fd8b559f63895da0b4 100644 (file)
@@ -47,24 +47,28 @@ class HelloTest extends PHPUnit_Framework_TestCase {
   var $abc;
 
   /**
-   * @param null $name
+   * @param string|null $name
    */
   public function __construct($name = NULL) {
     parent::__construct($name);
   }
 
-  // called before the test functions will be executed
-  // this function is defined in PHPUnit_TestCase and overwritten
-  // here
+  /**
+   * Called before the test functions will be executed
+   * this function is defined in PHPUnit_TestCase and overwritten
+   * here
+   */
   public function setUp() {
     // create a new instance of String with the
     // string 'abc'
     $this->abc = "hello";
   }
 
-  // called after the test functions are executed
-  // this function is defined in PHPUnit_TestCase and overwritten
-  // here
+  /**
+   * Called after the test functions are executed
+   * this function is defined in PHPUnit_TestCase and overwritten
+   * here.
+   */
   public function tearDown() {
     // delete your instance
     unset($this->abc);
index 3b32266cfe2357a71bc7511f8dab03e58110e090..88f42e0a64fcb0a92064795cead4c65489833c71 100644 (file)
@@ -50,7 +50,7 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase {
       'edit-2-access-all-cases-and-activities',
       'edit-2-access-my-cases-and-activities',
       'edit-2-administer-civicase',
-      'edit-2-delete-in-civicase'
+      'edit-2-delete-in-civicase',
     );
     $this->changePermissions($permission);
 
index 1ca265c8befce943ef69e78fb7ed985b4be51f59..fd119a6d797f5f1b29a113d804a05c67ce01d320 100644 (file)
@@ -68,7 +68,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
       'edit-2-access-all-cases-and-activities',
       'edit-2-access-my-cases-and-activities',
       'edit-2-administer-civicase',
-      'edit-2-delete-in-civicase'
+      'edit-2-delete-in-civicase',
     );
     $this->changePermissions($permission);
 
@@ -142,7 +142,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
 
     // verify if custom data is present
     $this->openCiviPage('case', 'reset=1');
-    $this->clickLink("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[9]/span/a[text()='Manage']");
+    $this->clickLink("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[9]/span/a[1][text()='Manage']");
 
     $this->clickAjaxLink("css=#{$customGrp1} .crm-accordion-header", "css=#{$customGrp1} a.button");
     $cusId_1 = 'custom_' . $customId[0] . '_1';
@@ -209,7 +209,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
       $this->openCiviPage("admin/custom/group/field", array(
           'reset' => 1,
           'action' => 'browse',
-          'gid' => $customGrpId1
+          'gid' => $customGrpId1,
         ));
       $custom1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr[1]/td[8]/span/a[text()='Edit Field']/@href"));
       $custom1 = $custom1[1];
@@ -241,7 +241,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
       $this->openCiviPage("admin/custom/group/field", array(
           'reset' => 1,
           'action' => 'browse',
-          'gid' => $customGrpId1
+          'gid' => $customGrpId1,
         ));
       $custom1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr[1]/td[8]/span/a[text()='Edit Field']/@href"));
       $custom1 = $custom1[1];
@@ -268,7 +268,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
           'action' => 'delete',
           'reset' => '1',
           'gid' => $customGrpId1,
-          'id' => $cValue
+          'id' => $cValue,
         ));
       $this->clickLink("_qf_DeleteField_next-bottom");
     }
@@ -314,7 +314,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
       'edit-2-access-all-cases-and-activities',
       'edit-2-access-my-cases-and-activities',
       'edit-2-administer-civicase',
-      'edit-2-delete-in-civicase'
+      'edit-2-delete-in-civicase',
     );
     $this->changePermissions($permission);
 
index 35883bb5c04a14bb8b6d494a573095bc64893828..6d870b741430328ed22716ca28900dd962791b01 100644 (file)
@@ -35,8 +35,8 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase {
     parent::setUp();
   }
 
-  /*
-   * test individual pane seperatly.
+  /**
+   * Test individual pane seperatly.
    */
   public function testIndividualPanes() {
     $this->webtestLogin();
@@ -61,8 +61,8 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase {
     }
   }
 
-  /*
-   * test by selecting all panes at a time.
+  /**
+   * Test by selecting all panes at a time.
    */
   public function testAllPanes() {
     $this->webtestLogin();
@@ -89,7 +89,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase {
   /**
    * @param array $openedPanes
    */
-  function _checkOpenedPanes($openedPanes = array()) {
+  public function _checkOpenedPanes($openedPanes = array()) {
     if (!$this->isTextPresent('None found.')) {
       $this->click('css=div.crm-advanced_search_form-accordion div.crm-accordion-header');
     }
@@ -111,7 +111,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase {
    * @param $paneRef
    * @param array $selectFields
    */
-  function _selectPaneFields($paneRef, $selectFields = array()) {
+  public function _selectPaneFields($paneRef, $selectFields = array()) {
     $pane = $this->_advanceSearchPanes($paneRef);
 
     $this->click("css=div.crm-accordion-wrapper {$pane['headerLocator']}");
@@ -173,227 +173,186 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase {
 
     if (!isset($_advance_search_panes) || empty($_advance_search_panes)) {
       $_advance_search_panes = array(
-        'location' =>
-          array(
-            'headerLocator' => 'div#location',
-            'bodyLocator' => 'select#country',
-            'title' => 'Address Fields',
-            'fields' =>
-              array(
-                'Location Type' =>
-                  array(
-                    'type' => 'multiselect2',
-                    'locator' => 'location_type',
-                    'values' => array(array('Home', 'Work')),
-                  ),
-                'Country' =>
-                  array(
-                    'type' => 'select',
-                    'locator' => 'country',
-                    'values' => array('United States'),
-                  ),
-                'State' =>
-                  array(
-                    'type' => 'multiselect2',
-                    'locator' => 'state_province',
-                    'values' => array(array('Alabama', 'California', 'New Jersey', 'New York')),
-                  ),
+        'location' => array(
+          'headerLocator' => 'div#location',
+          'bodyLocator' => 'select#country',
+          'title' => 'Address Fields',
+          'fields' => array(
+            'Location Type' => array(
+              'type' => 'multiselect2',
+              'locator' => 'location_type',
+              'values' => array(array('Home', 'Work')),
+            ),
+            'Country' => array(
+              'type' => 'select',
+              'locator' => 'country',
+              'values' => array('United States'),
+            ),
+            'State' => array(
+              'type' => 'multiselect2',
+              'locator' => 'state_province',
+              'values' => array(
+                array('Alabama', 'California', 'New Jersey', 'New York'),
               ),
+            ),
           ),
-        'custom' =>
-          array(
-            'headerLocator' => 'div#custom',
-            'bodyLocator' => 'div#constituent_information',
-            'title' => 'Custom Data',
-            'fields' =>
-              array(
-                'Marital Status' =>
-                  array(
-                    'type' => 'select',
-                    'locator' => 'custom_2',
-                    'values' => array('Single'),
-                  ),
-              ),
+        ),
+        'custom' => array(
+          'headerLocator' => 'div#custom',
+          'bodyLocator' => 'div#constituent_information',
+          'title' => 'Custom Data',
+          'fields' => array(
+            'Marital Status' => array(
+              'type' => 'select',
+              'locator' => 'custom_2',
+              'values' => array('Single'),
+            ),
           ),
-        'activity' =>
-          array(
-            'headerLocator' => 'div#activity',
-            'bodyLocator' => 'input#activity_subject',
-            'title' => 'Activities',
-            'fields' =>
-              array(
-                'Activity Type' =>
-                  array(
-                    'type' => 'checkbox',
-                    'values' => array(
-                      'activity_type_id[6]',
-                      'activity_type_id[3]',
-                      'activity_type_id[5]',
-                      'activity_type_id[7]'
-                    ),
-                  ),
-                'Activity Subject' =>
-                  array(
-                    'type' => 'text',
-                    'locator' => 'activity_subject',
-                    'values' => array('Test Subject'),
-                  ),
-                'Activity Status' =>
-                  array(
-                    'type' => 'checkbox',
-                    'values' => array('activity_status[1]', 'activity_status[2]'),
-                  ),
+        ),
+        'activity' => array(
+          'headerLocator' => 'div#activity',
+          'bodyLocator' => 'input#activity_subject',
+          'title' => 'Activities',
+          'fields' => array(
+            'Activity Type' => array(
+              'type' => 'checkbox',
+              'values' => array(
+                'activity_type_id[6]',
+                'activity_type_id[3]',
+                'activity_type_id[5]',
+                'activity_type_id[7]',
               ),
+            ),
+            'Activity Subject' => array(
+              'type' => 'text',
+              'locator' => 'activity_subject',
+              'values' => array('Test Subject'),
+            ),
+            'Activity Status' => array(
+              'type' => 'checkbox',
+              'values' => array('activity_status[1]', 'activity_status[2]'),
+            ),
           ),
-        'relationship' =>
-          array(
-            'headerLocator' => 'div#relationship',
-            'bodyLocator' => 'select#relation_type_id',
-            'title' => 'Relationships',
-            'fields' =>
-              array(
-                'Relation Type' =>
-                  array(
-                    'type' => 'select',
-                    'locator' => 'relation_type_id',
-                    'values' => array('Employee of'),
-                  ),
-                'Relation Target' =>
-                  array(
-                    'type' => 'text',
-                    'locator' => 'relation_target_name',
-                    'values' => array('Test Contact'),
-                  ),
-              ),
+        ),
+        'relationship' => array(
+          'headerLocator' => 'div#relationship',
+          'bodyLocator' => 'select#relation_type_id',
+          'title' => 'Relationships',
+          'fields' => array(
+            'Relation Type' => array(
+              'type' => 'select',
+              'locator' => 'relation_type_id',
+              'values' => array('Employee of'),
+            ),
+            'Relation Target' => array(
+              'type' => 'text',
+              'locator' => 'relation_target_name',
+              'values' => array('Test Contact'),
+            ),
           ),
-        'demographics' =>
-          array(
-            'headerLocator' => 'div#demographics',
-            'bodyLocator' => 'input#birth_date_low_display',
-            'title' => 'Demographics',
-            'fields' =>
-              array(
-                'Birth Date Range' =>
-                  array(
-                    'type' => 'select',
-                    'locator' => 'birth_date_relative',
-                    'values' => array('Choose Date Range'),
-                  ),
-                'Birth Date from' =>
-                  array(
-                    'type' => 'date',
-                    'locator' => 'birth_date_low',
-                    'values' => array('10 September 1980'),
-                  ),
-                'Birth Date to' =>
-                  array(
-                    'type' => 'date',
-                    'locator' => 'birth_date_high',
-                    'values' => array('10 September 2000'),
-                  ),
-              ),
+        ),
+        'demographics' => array(
+          'headerLocator' => 'div#demographics',
+          'bodyLocator' => 'input#birth_date_low_display',
+          'title' => 'Demographics',
+          'fields' => array(
+            'Birth Date Range' => array(
+              'type' => 'select',
+              'locator' => 'birth_date_relative',
+              'values' => array('Choose Date Range'),
+            ),
+            'Birth Date from' => array(
+              'type' => 'date',
+              'locator' => 'birth_date_low',
+              'values' => array('10 September 1980'),
+            ),
+            'Birth Date to' => array(
+              'type' => 'date',
+              'locator' => 'birth_date_high',
+              'values' => array('10 September 2000'),
+            ),
           ),
-        'note' =>
-          array(
-            'headerLocator' => 'div#notes',
-            'bodyLocator' => 'input#note',
-            'title' => 'Notes',
-            'fields' =>
-              array(
-                'note' =>
-                  array(
-                    'type' => 'text',
-                    'locator' => 'css=div#notes-search input#note',
-                    'values' => array('Test Note'),
-                  ),
-              ),
+        ),
+        'note' => array(
+          'headerLocator' => 'div#notes',
+          'bodyLocator' => 'input#note',
+          'title' => 'Notes',
+          'fields' => array(
+            'note' => array(
+              'type' => 'text',
+              'locator' => 'css=div#notes-search input#note',
+              'values' => array('Test Note'),
+            ),
           ),
-        'change_log' =>
-          array(
-            'headerLocator' => 'div#changeLog',
-            'bodyLocator' => 'input#changed_by',
-            'title' => 'Change Log',
-            'fields' =>
-              array(
-                'Modified By' =>
-                  array(
-                    'type' => 'text',
-                    'locator' => 'changed_by',
-                    'values' => array('Test User'),
-                  ),
-              ),
+        ),
+        'change_log' => array(
+          'headerLocator' => 'div#changeLog',
+          'bodyLocator' => 'input#changed_by',
+          'title' => 'Change Log',
+          'fields' => array(
+            'Modified By' => array(
+              'type' => 'text',
+              'locator' => 'changed_by',
+              'values' => array('Test User'),
+            ),
           ),
-        'contribution' =>
-          array(
-            'headerLocator' => 'div#CiviContribute',
-            'bodyLocator' => 'select#financial_type_id',
-            'title' => 'Contributions',
-            'fields' =>
-              array(
-                'Amount from' =>
-                  array(
-                    'type' => 'text',
-                    'locator' => 'contribution_amount_low',
-                    'values' => array('10'),
-                  ),
-                'Amount to' =>
-                  array(
-                    'type' => 'text',
-                    'locator' => 'contribution_amount_high',
-                    'values' => array('1000'),
-                  ),
-                'Financial Type' =>
-
-                  array(
-                    'type' => 'select',
-                    'locator' => 'financial_type_id',
-                    'values' => array('Donation'),
-                  ),
-                'Contribution Status' =>
-                  array(
-                    'type' => 'checkbox',
-                    'values' => array('contribution_status_id[1]', 'contribution_status_id[2]'),
-                  ),
-              ),
+        ),
+        'contribution' => array(
+          'headerLocator' => 'div#CiviContribute',
+          'bodyLocator' => 'select#financial_type_id',
+          'title' => 'Contributions',
+          'fields' => array(
+            'Amount from' => array(
+              'type' => 'text',
+              'locator' => 'contribution_amount_low',
+              'values' => array('10'),
+            ),
+            'Amount to' => array(
+              'type' => 'text',
+              'locator' => 'contribution_amount_high',
+              'values' => array('1000'),
+            ),
+            'Financial Type' => array(
+              'type' => 'select',
+              'locator' => 'financial_type_id',
+              'values' => array('Donation'),
+            ),
+            'Contribution Status' => array(
+              'type' => 'checkbox',
+              'values' => array('contribution_status_id[1]', 'contribution_status_id[2]'),
+            ),
           ),
-        'membership' =>
-          array(
-            'headerLocator' => 'div#CiviMember',
-            'bodyLocator' => 'input#member_source',
-            'title' => 'Memberships',
-            'fields' =>
-              array(
-                'Membership Type' =>
-                  array(
-                    'type' => 'checkbox',
-                    'values' => array('member_membership_type_id[1]', 'member_membership_type_id[2]'),
-                  ),
-                'Membership Status' =>
-                  array(
-                    'type' => 'checkbox',
-                    'values' => array('member_status_id[1]', 'member_status_id[2]'),
-                  ),
-              ),
+        ),
+        'membership' => array(
+          'headerLocator' => 'div#CiviMember',
+          'bodyLocator' => 'input#member_source',
+          'title' => 'Memberships',
+          'fields' => array(
+            'Membership Type' => array(
+              'type' => 'checkbox',
+              'values' => array('member_membership_type_id[1]', 'member_membership_type_id[2]'),
+            ),
+            'Membership Status' => array(
+              'type' => 'checkbox',
+              'values' => array('member_status_id[1]', 'member_status_id[2]'),
+            ),
           ),
-        'event' =>
-          array(
-            'headerLocator' => 'div#CiviEvent',
-            'bodyLocator' => 'input#event_id',
-            'title' => 'Events',
-            'fields' =>
-              array(
-                'Participant Status' =>
-                  array(
-                    'type' => 'checkbox',
-                    'values' => array('participant_status_id[1]', 'participant_status_id[2]'),
-                  ),
-                'Participant Role' =>
-                  array(
-                    'type' => 'checkbox',
-                    'values' => array('participant_role_id[1]', 'participant_role_id[2]'),
-                  ),
-              ),
+        ),
+        'event' => array(
+          'headerLocator' => 'div#CiviEvent',
+          'bodyLocator' => 'input#event_id',
+          'title' => 'Events',
+          'fields' => array(
+            'Participant Status' => array(
+              'type' => 'checkbox',
+              'values' => array('participant_status_id[1]', 'participant_status_id[2]'),
+            ),
+            'Participant Role' => array(
+              'type' => 'checkbox',
+              'values' => array('participant_role_id[1]', 'participant_role_id[2]'),
+            ),
           ),
+        ),
       );
     }
 
index 362b31a3a4fecd3229a41dc77e43a200d4a6981f..f9d47100b834b9426a2c2d53f03bf5486792e126 100644 (file)
@@ -358,9 +358,9 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
 
     // fill in Receipt details
     $this->type('thankyou_title', "Thank-you Page Title $hash");
-    $this->click("xpath=//form[@id='ThankYou']/div[2]/table[1]/tbody/tr[2]/td[2]/div/a/span");
+    $this->click("thankyou_text-plain");
     $this->fillRichTextField('thankyou_text', 'This is thankyou message for ' . $pageTitle, 'CKEditor');
-    $this->click("xpath=//form[@id='ThankYou']/div[2]/table[1]/tbody/tr[3]/td[2]/div/a/span");
+    $this->click("thankyou_footer-plain");
     $this->fillRichTextField('thankyou_footer', 'This is thankyou footer message for ' . $pageTitle, 'CKEditor');
     $this->click('is_email_receipt');
     $this->waitForElementPresent('bcc_receipt');
@@ -397,8 +397,8 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $this->type('title', $pageTitle);
     $this->click('_qf_SearchContribution_refresh');
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->isElementPresent("xpath=//table[@id='option11_wrapper']/tbody/tr/td/strong[text()='$pageTitle']");
-    $this->waitForElementPresent("xpath=//table[@id='option11']/tbody/tr/td[4]/div[@class='crm-contribution-page-configure-actions']/span[text()='Configure']");
+    $this->isElementPresent("xpath=//table[@class='display dataTable no-footer']/tbody/tr/td[1]/strong[text()='$pageTitle']");
+    $this->waitForElementPresent("xpath=//table[@class='display dataTable no-footer']/tbody/tr/td[4]/div[@class='crm-contribution-page-configure-actions']/span[text()='Configure']");
     $this->click("xpath=//table[@id='option11']/tbody/tr/td[4]/div[@class='crm-contribution-page-configure-actions']/span[text()='Configure']");
     $this->waitForElementPresent("xpath=//table[@id='option11']/tbody/tr/td[4]/div[@class='crm-contribution-page-configure-actions']/span[text()='Configure']/ul[@class='panel']/li[8]/a[@title='Premiums']");
     $this->click("xpath=//table[@id='option11']/tbody/tr/td[4]/div[@class='crm-contribution-page-configure-actions']/span[text()='Configure']/ul[@class='panel']/li[8]/a[@title='Premiums']");
index 49d3d28a39d38655d21dd5695bd83d363b4ae96b..625e98459773b7670e41e45c062e77e701c328b9 100644 (file)
@@ -259,7 +259,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
     //logout
     $this->webtestLogout();
     $amountLabel = 'Total Amount';
-    $amountValue = '0.00';
+    $amountValue = '1.00';
     //Open Live Contribution Page
     $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom");
 
index 03ddaf7a1a9897ed3b77dd3590269b82cb5f85e1..761763706a685c79be12a532441779fa2b4a76da 100755 (executable)
@@ -119,8 +119,8 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
       'is_deductible' => 1,
     );
     $this->addeditFinancialType($financialType);
-    $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='" . $financialType['name'] . "']/../td[7]/span/a[text()='Accounts']");
-    $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='" . $financialType['name'] . "']/../td[7]/span/a[text()='Accounts']");
+    $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td/div[text()='" . $financialType['name'] . "']/../../td[7]/span/a[text()='Accounts']");
+    $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td/div[text()='" . $financialType['name'] . "']/../../td[7]/span/a[text()='Accounts']");
     $this->waitForElementPresent("xpath=//a[@id='newfinancialTypeAccount']");
     $this->clickAjaxLink("xpath=//a[@id='newfinancialTypeAccount']", "_qf_FinancialTypeAccount_cancel-botttom");
     $this->select("account_relationship", "label=Premiums Inventory Account is");
@@ -174,10 +174,10 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
 
     //Assertions
     $actualAmount = $this->_getPremiumActualCost($contId, $to, $from, $cost2, "'civicrm_contribution'");
-    $this->assertEquals($actualAmount, $cost2, "Verify actual cost for changed premium");
+    $this->assertEquals($actualAmount,null,"Verify actual cost for changed premium");
 
     $deletedAmount = $this->_getPremiumActualCost($contId, $from, $to, $cost, "'civicrm_contribution'");
-    $this->assertEquals($deletedAmount, $cost, "Verify actual cost for deleted premium");
+    $this->assertEquals($deletedAmount, null, "Verify actual cost for deleted premium");
   }
 
   public function testDeletePremium() {
@@ -190,8 +190,8 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
       'is_deductible' => 1,
     );
     $this->addeditFinancialType($financialType);
-    $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='" . $financialType['name'] . "']/../td[7]/span/a[text()='Accounts']");
-    $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[text()='" . $financialType['name'] . "']/../td[7]/span/a[text()='Accounts']");
+    $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td/div[text()='" . $financialType['name'] . "']/../../td[7]/span/a[text()='Accounts']");
+    $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td/div[text()='" . $financialType['name'] . "']/../../td[7]/span/a[text()='Accounts']");
     $this->waitForElementPresent("xpath=//a[@id='newfinancialTypeAccount']");
     $this->clickLink("xpath=//a[@id='newfinancialTypeAccount']", "_qf_FinancialTypeAccount_cancel-botttom", FALSE);
 
@@ -239,7 +239,7 @@ class WebTest_Contribute_UpdateContributionTest extends CiviSeleniumTestCase {
 
     //Assertions
     $actualAmount = $this->_getPremiumActualCost($contId, $from, $to, NULL, "'civicrm_contribution'");
-    $this->assertEquals($actualAmount, $cost, "Verify actual cost for deleted premium");
+    $this->assertEquals($actualAmount, null, "Verify actual cost for deleted premium");
   }
 
   public function testChangePaymentInstrument() {
index 0da4aba3efa76f46f8237bfacb2ee1a57cd539fd..4f54d09b1473407c051b1a1754a90b71357f2fb6 100644 (file)
@@ -263,8 +263,8 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->click('link=Fees');
     $this->waitForElementPresent('_qf_Fee_upload_done-bottom');
     $this->click('CIVICRM_QFID_1_is_monetary');
-    $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
-    $this->select('financial_type_id', 'label=Event Fee');
+    $this->click("xpath=//tbale[@id='paymentProcessor']/tbody/tr[1]/td[2]/label[text()='$processorName']");
+    $this->select('financial_type_id','label=Event Fee');
     $this->select('price_set_id', 'label=' . $setTitle);
 
     // intro text for registration page
index 86d75c8dd9cc3921315b1887e55588726abc51e6..80162f73d47fc1ebc90db8114b7005fde160aee8 100644 (file)
@@ -270,7 +270,9 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
   }
 
   /**
-   * @param $customGrpId1
+   * Get custom field ID.
+   *
+   * @param int $customGrpId1
    *
    * @return array
    */
@@ -410,14 +412,16 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
   }
 
   /**
-   * @param $profilefield
+   * Test profile creation.
+   *
+*@param $profileField
    * @param int $location
    * @param $type
    *
    * @return null
    */
-  public function _testCreateProfile($profilefield, $location = 0, $type) {
-    $locationfields = array(
+  public function _testCreateProfile($profileField, $location = 0, $type) {
+    $locationFields = array(
       'supplemental_address_1',
       'supplemental_address_2',
       'city',
@@ -429,22 +433,22 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     );
 
     // Add new profile.
-    $profilename = "Profile_" . substr(sha1(rand()), 0, 7);
+    $profileName = "Profile_" . substr(sha1(rand()), 0, 7);
     $this->openCiviPage("admin/uf/group", "reset=1");
     $this->click('newCiviCRMProfile-top');
     $this->waitForElementPresent('_qf_Group_next-top');
 
     //Name of profile
-    $this->type('title', $profilename);
+    $this->type('title', $profileName);
     $this->click('uf_group_type_Profile');
     $this->click('_qf_Group_next-top');
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $profileId = $this->urlArg('gid');
 
     //Add field to profile_testCreateProfile
-    foreach ($profilefield as $key => $value) {
+    foreach ($profileField as $key => $value) {
       $this->openCiviPage("admin/uf/group/field/add", "reset=1&action=add&gid=$profileId");
-      if (in_array($value, $locationfields)) {
+      if (in_array($value, $locationFields)) {
         $this->select("field_name[0]", "value={$type}");
         $this->select("field_name[1]", "value={$value}");
         $this->select("field_name[2]", "value={$location}");
@@ -555,6 +559,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
   }
 
   /**
+   * Test adding multiple profiles.
+   *
    * @param int $profileId
    *
    * @return null
@@ -711,7 +717,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     $this->type("city-Primary", "primecity");
     $this->type("phone-Primary-1", "98667764");
     $this->type("postal_code-Primary", "6548");
-
+    $this->waitForElementPresent('nick_name');
     $this->type("nick_name", "Nick1");
     $this->type("url-1", "http://www.part.com");
 
index 6c5bec75fb69fd3e8b35c449087cfa9e929a5244..a5dee0120ccaa94e565e23cd28527daa64a9eba1 100644 (file)
@@ -41,7 +41,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase {
       'edit-1-profile-listings-and-forms',
       'edit-1-access-all-custom-data',
       'edit-1-register-for-events',
-      'edit-1-make-online-contributions'
+      'edit-1-make-online-contributions',
     );
     $this->changePermissions($permission);
 
index 9a945dcda01fe67693a44cf8c5cc10f1f52bb504..cded96ef4d5ec65096fde362f9ba65a3a3e1fd33 100644 (file)
@@ -230,7 +230,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
     // build forward url
     $forwardUrl = array(
       "mailing/forward",
-      "reset=1&jid={$eventQueue->job_id}&qid={$eventQueue->id}&h={$eventQueue->hash}"
+      "reset=1&jid={$eventQueue->job_id}&qid={$eventQueue->id}&h={$eventQueue->hash}",
     );
     $this->openCiviPage($forwardUrl[0], $forwardUrl[1], NULL);
 
@@ -433,7 +433,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
       'Replies',
       'Bounces',
       'Unsubscribe Requests',
-      'Opt-out Requests'
+      'Opt-out Requests',
     );
 
     //check for report and adv search links
@@ -448,95 +448,85 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
     $this->verifyText("xpath=//table//tr[td[1]/text()='Subject']/descendant::td[2]", preg_quote("Test subject $mailingName for Webtest"));
 
     // after asserts do clicks and confirm filters
-    $criteriaCheck =
-      array(
-        'Intended Recipients' =>
-          array(
-            'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest"),
-            'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest"),
-          ),
-        'Successful Deliveries' =>
-          array(
-            'report' => array(
-              'report_name' => 'Mailing Details',
-              'Mailing' => "Mailing $mailingName Webtest",
-              "Delivery Status" => " Successful"
-            ),
-            'search' => array(
-              'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
-              'Mailing Delivery -' => "Successful"
-            ),
-          ),
-        'Tracked Opens' =>
-          array(
-            'report' => array('report_name' => 'Mail Opened', 'Mailing' => "Mailing $mailingName Webtest"),
-            'search' => array(
-              'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
-              'Mailing: Trackable Opens -' => "Opened"
-            ),
-          ),
-        'Click-throughs' =>
-          array(
-            'report' => array('report_name' => 'Mail Clickthroughs', 'Mailing' => "Mailing $mailingName Webtest"),
-            'search' => array(
-              'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
-              'Mailing: Trackable URL Clicks -' => "Clicked"
-            ),
-          ),
-        'Forwards' =>
-          array(
-            'report' => array(
-              'report_name' => 'Mailing Details',
-              'Mailing' => "Mailing $mailingName Webtest",
-              'Forwarded' => 'Is equal to Yes'
-            ),
-            'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Forwards"),
-          ),
-        'Replies' =>
-          array(
-            'report' => array(
-              'report_name' => 'Mailing Details',
-              'Mailing' => "Mailing $mailingName Webtest",
-              'Replied' => 'Is equal to Yes'
-            ),
-            'search' => array(
-              'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
-              'Mailing: Trackable Replies -' => "Replied"
-            ),
-          ),
-        'Bounces' =>
-          array(
-            'report' => array('report_name' => 'Mail Bounces', 'Mailing' => "Mailing $mailingName Webtest"),
-            'search' => array(
-              'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
-              'Mailing Delivery -' => "Bounced"
-            ),
-          ),
-        'Unsubscribe Requests' =>
-          array(
-            'report' => array(
-              'report_name' => 'Mailing Details',
-              'Mailing' => "Mailing $mailingName Webtest",
-              'Unsubscribed' => 'Is equal to Yes'
-            ),
-            'search' => array(
-              'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
-              'Mailing: -' => "Unsubscribe Requests"
-            ),
-          ),
-        'Opt-out Requests' =>
-          array(
-            'report' => array(
-              'report_name' => 'Mailing Details',
-              'Mailing' => "Mailing $mailingName Webtest",
-              'Opted-out' => 'Is equal to Yes'
-            ),
-            'search' => array(
-              'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
-              'Mailing: -' => "Opt-out Requests"
-            ),
-          ),
-      );
+    $criteriaCheck = array(
+      'Intended Recipients' => array(
+        'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest"),
+        'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest"),
+      ),
+      'Successful Deliveries' => array(
+        'report' => array(
+          'report_name' => 'Mailing Details',
+          'Mailing' => "Mailing $mailingName Webtest",
+          "Delivery Status" => " Successful",
+        ),
+        'search' => array(
+          'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+          'Mailing Delivery -' => "Successful",
+        ),
+      ),
+      'Tracked Opens' => array(
+        'report' => array('report_name' => 'Mail Opened', 'Mailing' => "Mailing $mailingName Webtest"),
+        'search' => array(
+          'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+          'Mailing: Trackable Opens -' => "Opened",
+        ),
+      ),
+      'Click-throughs' => array(
+        'report' => array('report_name' => 'Mail Clickthroughs', 'Mailing' => "Mailing $mailingName Webtest"),
+        'search' => array(
+          'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+          'Mailing: Trackable URL Clicks -' => "Clicked",
+        ),
+      ),
+      'Forwards' => array(
+        'report' => array(
+          'report_name' => 'Mailing Details',
+          'Mailing' => "Mailing $mailingName Webtest",
+          'Forwarded' => 'Is equal to Yes',
+        ),
+        'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Forwards"),
+      ),
+      'Replies' => array(
+        'report' => array(
+          'report_name' => 'Mailing Details',
+          'Mailing' => "Mailing $mailingName Webtest",
+          'Replied' => 'Is equal to Yes',
+        ),
+        'search' => array(
+          'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+          'Mailing: Trackable Replies -' => "Replied",
+        ),
+      ),
+      'Bounces' => array(
+        'report' => array('report_name' => 'Mail Bounces', 'Mailing' => "Mailing $mailingName Webtest"),
+        'search' => array(
+          'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+          'Mailing Delivery -' => "Bounced",
+        ),
+      ),
+      'Unsubscribe Requests' => array(
+        'report' => array(
+          'report_name' => 'Mailing Details',
+          'Mailing' => "Mailing $mailingName Webtest",
+          'Unsubscribed' => 'Is equal to Yes',
+        ),
+        'search' => array(
+          'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+          'Mailing: -' => "Unsubscribe Requests",
+        ),
+      ),
+      'Opt-out Requests' => array(
+        'report' => array(
+          'report_name' => 'Mailing Details',
+          'Mailing' => "Mailing $mailingName Webtest",
+          'Opted-out' => 'Is equal to Yes',
+        ),
+        'search' => array(
+          'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+          'Mailing: -' => "Opt-out Requests",
+        ),
+      ),
+    );
     $this->criteriaCheck($criteriaCheck, $mailingReportUrl);
   }
 
index 644e606cb5bc6a32b6fe1ec6e93fb61fc49cdf66..56fe2c620d1fd661d28f468d99e2b25651ea5cc5 100644 (file)
@@ -313,7 +313,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa
     foreach (array(
                'joinDate',
                'startDate',
-               'endDate'
+               'endDate',
              ) as $date) {
       $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
     }
@@ -403,7 +403,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa
     foreach (array(
                'joinDate',
                'startDate',
-               'endDate'
+               'endDate',
              ) as $date) {
       $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
     }
index e7395a4f18ee4c064ee984257cbdaa70e0fc3f8d..584346cd8393d877c7d0cfdc2c297e758a5c73a4 100644 (file)
@@ -185,10 +185,10 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase {
     // Is status message correct?
     $this->waitForText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added.");
 
-    $this->waitForElementPresent("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']");
+    $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Renew']");
 
     // click through to the Membership Renewal Link
-    $this->click("xpath=//div[@id='memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']");
+    $this->click("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Renew']");
 
     $this->waitForElementPresent('_qf_MembershipRenewal_cancel-bottom');
 
index 52bb99629074570d8748fe73cf21655e9dda768e..238915dd74c31d8528b5cc43324439ecf462a465 100644 (file)
@@ -325,7 +325,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     foreach (array(
                'joinDate',
                'startDate',
-               'endDate'
+               'endDate',
              ) as $date) {
       $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
     }
@@ -450,7 +450,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     foreach (array(
                'joinDate',
                'startDate',
-               'endDate'
+               'endDate',
              ) as $date) {
       $$date = CRM_Utils_Date::customFormat($$date, $configVars->dateformatFull);
     }
index ec624c6b269bf48006236d2fb5ea570376de52ea..e1194fc14873a3d4d50f4c46888edc9158d8fe01 100644 (file)
@@ -250,7 +250,7 @@ class WebTest_Member_StandaloneAddTest extends CiviSeleniumTestCase {
     $test = $this;
     $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl,
       function () use ($test) {
-        $test->select('membership_type_id_0', 'value=1');
+      $test->select('membership_type_id_0', 'value=1');
       }
     );
   }
index 00e69530be6bee90cbb6ebfb44d7b830e4b40186..accd8a4faa709b6d2616d1cd32b83a4e4d94c8f4 100644 (file)
@@ -41,7 +41,7 @@ class WebTest_Profile_DedupeTest extends CiviSeleniumTestCase {
       'edit-1-profile-create',
       'edit-1-profile-edit',
       'edit-1-profile-listings',
-      'edit-1-profile-view'
+      'edit-1-profile-view',
     );
     $this->changePermissions($permission);
 
index 034fcfb51cbfc8386e0f0f2fdf06df4817b311c6..f1d51b8279c8062d1e7c5c17a4c34aa19ccee101 100644 (file)
@@ -50,7 +50,7 @@ class WebTest_Release_ReleaseTestCase extends CiviSeleniumTestCase {
    * @param string $dataName
    * @param array $browser
    */
-  function __construct($name = NULL, array$data = array(), $dataName = '', array$browser = array()) {
+  public function __construct($name = NULL, array$data = array(), $dataName = '', array$browser = array()) {
     parent::__construct($name, $data, $dataName, $browser);
 
     require_once 'CiviTest/ReleaseTestSettings.php';
index c6ebfcd16ac87af64b31df647f398f4c3d271935..322eb374d03607bc1e67615c2bd04d384010ba7c 100644 (file)
@@ -177,6 +177,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
 
     //visit the logging contact summary report
     $this->openCiviPage('report/logging/contact/summary', 'reset=1');
+    $this->waitForElementPresent('altered_contact_value');
     $this->type('altered_contact_value', $firstName);
     $this->click("_qf_LoggingSummary_submit");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -189,28 +190,28 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
       array(
         "log_type" => "Relationship",
         "altered_contact" => "{$firstName} {$lastName} [Employee of]",
-        "action" => "Update"
+        "action" => "Update",
       ),
       array(
         "log_type" => "Relationship",
         "altered_contact" => "{$firstName} {$lastName} [Employee of]",
-        "action" => "Insert"
+        "action" => "Insert",
       ),
       array(
         "log_type" => "Relationship",
         "altered_contact" => "{$firstName} {$lastName} [Employee of]",
-        "action" => "Delete"
+        "action" => "Delete",
       ),
       //group data check
       array(
         "log_type" => "Group",
         "altered_contact" => "{$firstName} {$lastName} [Case Resources]",
-        "action" => "Added"
+        "action" => "Added",
       ),
       array(
         "log_type" => "Group",
         "altered_contact" => "{$firstName} {$lastName} [Case Resources]",
-        "action" => "Removed"
+        "action" => "Removed",
       ),
       //note data check
       array("log_type" => "Note", "altered_contact" => "{$firstName} {$lastName}", "action" => "Update"),
@@ -221,30 +222,30 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
       array(
         "log_type" => "Tag",
         "altered_contact" => "{$firstName} {$lastName} [Government Entity]",
-        "action" => "Insert"
+        "action" => "Insert",
       ),
       array("log_type" => "Tag", "altered_contact" => "{$firstName} {$lastName} [Company]", "action" => "Delete"),
       //case data check
       array(
         "log_type" => "Case",
         "altered_contact" => "{$firstName} {$lastName} [Housing Support]",
-        "action" => "Update"
+        "action" => "Update",
       ),
       array(
         "log_type" => "Case",
         "altered_contact" => "{$firstName} {$lastName} [Housing Support]",
-        "action" => "Insert"
+        "action" => "Insert",
       ),
       //case activity check
       array(
         "log_type" => "Activity",
         "altered_contact" => "{$firstName} {$lastName} [Interview]",
-        "action" => "Update"
+        "action" => "Update",
       ),
       array(
         "log_type" => "Activity",
         "altered_contact" => "{$firstName} {$lastName} [Interview]",
-        "action" => "Insert"
+        "action" => "Insert",
       ),
     );
     $this->verifyReportData($data);
@@ -255,12 +256,12 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
       array(
         'field' => 'Sort Name',
         'changed_from' => "{$lastName}, {$originalFirstName}",
-        'changed_to' => "{$lastName}, {$firstName}"
+        'changed_to' => "{$lastName}, {$firstName}",
       ),
       array(
         'field' => 'Display Name',
         'changed_from' => "{$originalFirstName} {$lastName}",
-        'changed_to' => "{$firstName} {$lastName}"
+        'changed_to' => "{$firstName} {$lastName}",
       ),
       array('field' => 'First Name', 'changed_from' => $originalFirstName, 'changed_to' => $firstName),
       // array('field' => 'Email Greeting', 'changed_from' => "Dear {$originalFirstName}", 'changed_to' => "Dear {$firstName}"),
@@ -313,8 +314,8 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
       array(
         "log_type" => "Contact",
         "altered_contact" => "{$firstName} {$lastName}",
-        "action" => "Delete (to trash)"
-      )
+        "action" => "Delete (to trash)",
+      ),
     );
     $this->verifyReportData($contactDataDelete);
 
index 32e8ad642547f0ad567e4a4aa9bd5e169cab71c8..65aca47531a33c687696809fc2b69f9edfcee280 100644 (file)
@@ -341,11 +341,11 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
 
     $result = $this->callAPIAndDocument('activity', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
     $result = $this->callAPISuccess('activity', 'get', array(
-        'id' => $result['id'],
-        'version' => $this->_apiversion,
-        'return.assignee_contact_id' => 1,
-        'return.target_contact_id' => 1
-      ));
+      'id' => $result['id'],
+      'version' => $this->_apiversion,
+      'return.assignee_contact_id' => 1,
+      'return.target_contact_id' => 1,
+    ));
 
     $this->assertEquals($this->_contactID, $result['values'][$result['id']]['assignee_contact_id'][0], 'in line ' . __LINE__);
     $this->assertEquals($this->_contactID, $result['values'][$result['id']]['target_contact_id'][0], 'in line ' . __LINE__);
@@ -371,10 +371,10 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
     $params['custom_' . $ids['custom_field_id']] = "custom string";
     $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__);
     $result = $this->callAPISuccess($this->_entity, 'get', array(
-        'return.custom_' . $ids['custom_field_id'] => 1,
-        'version' => 3,
-        'id' => $result['id']
-      ));
+      'return.custom_' . $ids['custom_field_id'] => 1,
+      'version' => 3,
+      'id' => $result['id'],
+    ));
     $this->assertEquals("custom string", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
 
     $this->customFieldDelete($ids['custom_field_id']);
@@ -408,9 +408,9 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
 
     $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, $subfile, 'Create');
     $result = $this->callAPIAndDocument($this->_entity, 'get', array(
-        'return.custom_' . $customField['id'] => 1,
-        'id' => $result['id']
-      ), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet', 'get');
+      'return.custom_' . $customField['id'] => 1,
+      'id' => $result['id'],
+    ), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet', 'get');
 
     $this->assertEquals('Anderson, Anthony', $result['values'][$result['id']]['custom_' . $customField['id']], ' in line ' . __LINE__);
     $this->assertEquals($this->_contactID, $result['values'][$result['id']]['custom_' . $customField['id'] . "_id"], ' in line ' . __LINE__);
@@ -590,18 +590,18 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
     $activity = $this->callAPISuccess('Activity', 'Create', $params);
 
     $activityget = $this->callAPISuccess('Activity', 'get', array(
-        'id' => $activity['id'],
-        'target_contact_id' => $contact2,
-        'return.target_contact_id' => 1
-      ));
+      'id' => $activity['id'],
+      'target_contact_id' => $contact2,
+      'return.target_contact_id' => 1,
+    ));
     $this->assertEquals($activity['id'], $activityget['id'], 'In line ' . __LINE__);
     $this->assertEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0], 'In line ' . __LINE__);
 
     $activityget = $this->callAPISuccess('activity', 'get', array(
-        'target_contact_id' => $this->_contactID,
-        'return.target_contact_id' => 1,
-        'id' => $activity['id']
-      ));
+      'target_contact_id' => $this->_contactID,
+      'return.target_contact_id' => 1,
+      'id' => $activity['id'],
+    ));
     if ($activityget['count'] > 0) {
       $this->assertNotEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0], 'In line ' . __LINE__);
     }
@@ -633,7 +633,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
     $this->assertEquals(0, $result['count'], 'No activities of status 1 should exist');
     $result = $this->callAPISuccess('Activity', 'Get', array(
       'version' => $this->_apiversion,
-      'status_id' => '2'
+      'status_id' => '2',
     ));
     $this->assertEquals(0, $result['count'], 'No activities of status 1 should exist');
 
@@ -890,10 +890,10 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
 
     $activityId = $result['id'];
     $result = $this->callAPISuccess($this->_entity, 'get', array(
-        'return.custom_' . $ids['custom_field_id'] => 1,
-        'version' => 3,
-        'id' => $result['id']
-      ));
+      'return.custom_' . $ids['custom_field_id'] => 1,
+      'version' => 3,
+      'id' => $result['id'],
+    ));
     $this->assertEquals("custom string", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
     $this->assertEquals("2009-10-18 00:00:00", $result['values'][$result['id']]['activity_date_time'], ' in line ' . __LINE__);
     $fields = $this->callAPISuccess('activity', 'getfields', array('version' => $this->_apiversion));
@@ -914,10 +914,10 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess('Activity', 'Create', $params);
 
     $result = $this->callAPISuccess($this->_entity, 'get', array(
-        'return.custom_' . $ids['custom_field_id'] => 1,
-        'version' => 3,
-        'id' => $result['id']
-      ));
+      'return.custom_' . $ids['custom_field_id'] => 1,
+      'version' => 3,
+      'id' => $result['id'],
+    ));
     $this->assertEquals("Updated my test data", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
   }
 
@@ -1130,7 +1130,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase {
       ),
       'api.activity.create' => array(
         'subject' => 'send letter',
-        'activity_type_id' => '$value.api.activity_type.create.values.0.value'
+        'activity_type_id' => '$value.api.activity_type.create.values.0.value',
       ),
     ));
 
index 5fecd0634bd24c53f540a83afd5175925e7fa618..5c93c7cd62093181bc7594610938005992875223 100644 (file)
@@ -50,6 +50,9 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   protected $_ids = array();
   protected $_pageParams = array();
 
+  /**
+   * Setup function.
+   */
   public function setUp() {
     parent::setUp();
 
@@ -91,10 +94,16 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     );
   }
 
+  /**
+   * Clean up after each test.
+   */
   public function tearDown() {
     $this->quickCleanUpFinancialEntities();
   }
 
+  /**
+   * Test Get.
+   */
   public function testGetContribution() {
     $p = array(
       'contact_id' => $this->_individualId,
@@ -122,8 +131,9 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
     $this->assertEquals(1, $contribution['count']);
     $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
-    // note there was an assertion converting financial_type_id to 'Donation' which wasn't working.
-    // passing back a string rather than an id seems like an error / cruft - & if it is to be introduced we should discuss
+    // Note there was an assertion converting financial_type_id to 'Donation' which wasn't working.
+    // Passing back a string rather than an id seems like an error/cruft.
+    // If it is to be introduced we should discuss.
     $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], 1);
     $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
     $this->assertEquals($contribution['values'][$contribution['id']]['non_deductible_amount'], 10.00);
@@ -133,34 +143,34 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 78910);
     $this->assertEquals($contribution['values'][$contribution['id']]['contribution_source'], 'SSF');
     $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status'], 'Completed');
-    //create a second contribution - we are testing that 'id' gets the right contribution id (not the contact id)
+    // Create a second contribution - we are testing that 'id' gets the right contribution id (not the contact id).
     $p['trxn_id'] = '3847';
     $p['invoice_id'] = '3847';
 
     $contribution2 = $this->callAPISuccess('contribution', 'create', $p);
 
-    // now we have 2 - test getcount
+    // Now we have 2 - test getcount.
     $contribution = $this->callAPISuccess('contribution', 'getcount', array());
     $this->assertEquals(2, $contribution);
-    //test id only format
+    // Test id only format.
     $contribution = $this->callAPISuccess('contribution', 'get', array(
       'id' => $this->_contribution['id'],
       'format.only_id' => 1,
     ));
-    $this->assertEquals($this->_contribution['id'], $contribution, print_r($contribution, TRUE) . " in line " . __LINE__);
-    //test id only format
+    $this->assertEquals($this->_contribution['id'], $contribution, print_r($contribution, TRUE));
+    // Test id only format.
     $contribution = $this->callAPISuccess('contribution', 'get', array(
       'id' => $contribution2['id'],
       'format.only_id' => 1,
     ));
     $this->assertEquals($contribution2['id'], $contribution);
-    //test id as field
+    // Test id as field.
     $contribution = $this->callAPISuccess('contribution', 'get', array(
       'id' => $this->_contribution['id'],
     ));
     $this->assertEquals(1, $contribution['count']);
 
-    //test get by contact id works
+    // Test get by contact id works.
     $contribution = $this->callAPISuccess('contribution', 'get', array('contact_id' => $this->_individualId));
 
     $this->assertEquals(2, $contribution['count']);
@@ -173,7 +183,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   }
 
   /**
-   * We need to ensure previous tested behaviour still works as part of the api contract
+   * We need to ensure previous tested behaviour still works as part of the api contract.
    */
   public function testGetContributionLegacyBehaviour() {
     $p = array(
@@ -211,7 +221,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 78910);
     $this->assertEquals($contribution['values'][$contribution['id']]['contribution_source'], 'SSF');
     $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status'], 'Completed');
-    //create a second contribution - we are testing that 'id' gets the right contribution id (not the contact id)
+
+    // Create a second contribution - we are testing that 'id' gets the right contribution id (not the contact id).
     $p['trxn_id'] = '3847';
     $p['invoice_id'] = '3847';
 
@@ -225,7 +236,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       'id' => $this->_contribution['id'],
       'format.only_id' => 1,
     ));
-    $this->assertEquals($this->_contribution['id'], $contribution, print_r($contribution, TRUE) . " in line " . __LINE__);
+    $this->assertEquals($this->_contribution['id'], $contribution, print_r($contribution, TRUE));
     //test id only format
     $contribution = $this->callAPISuccess('contribution', 'get', array(
       'id' => $contribution2['id'],
@@ -261,23 +272,6 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     );
     $this->callAPISuccess('contribution', 'create', $params);
   }
-  /*
-   * ensure we continue to support contribution_type_id as part of the api commitment to
-   * stability
-   *///////////////// civicrm_contribution_
-
-  public function testCreateLegacyBehaviour() {
-    $params = array(
-      'contribution_id' => FALSE,
-      'contact_id' => 1,
-      'total_amount' => 1,
-      'check_permissions' => FALSE,
-      'contribution_type_id' => 3,
-    );
-    $contribution = $this->callAPISuccess('contribution', 'create', $params);
-    $contribution = $this->callAPISuccess('contribution', 'getsingle', array('id' => $contribution['id']));
-    $this->assertEquals(3, $contribution['financial_type_id']);
-  }
 
   /**
    * Check with complete array + custom field
@@ -299,11 +293,12 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     ));
     $this->customFieldDelete($ids['custom_field_id']);
     $this->customGroupDelete($ids['custom_group_id']);
-    $this->assertEquals("custom string", $check['values'][$check['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
+    $this->assertEquals("custom string", $check['values'][$check['id']]['custom_' . $ids['custom_field_id']]);
   }
 
   /**
-   * Check with complete array + custom field
+   * Check with complete array + custom field.
+   *
    * Note that the test is written on purpose without any
    * variables specific to participant so it can be replicated into other entities
    * and / or moved to the automated test suite
@@ -463,9 +458,9 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       'contribution_payment_instrument' => 'Cash',
     ));
     $this->assertArrayHasKey('payment_instrument', $contribution['values'][0]);
-    $this->assertEquals('Cash',$contribution['values'][0]['payment_instrument']);
-    $this->assertEquals(1,$contribution['count']);
-    $contribution = $this->callAPISuccess('contribution','get',array('sequential' => 1, 'payment_instrument' => 'Cash'));
+    $this->assertEquals('Cash', $contribution['values'][0]['payment_instrument']);
+    $this->assertEquals(1, $contribution['count']);
+    $contribution = $this->callAPISuccess('contribution', 'get',array('sequential' => 1, 'payment_instrument' => 'Cash'));
     $this->assertArrayHasKey('payment_instrument', $contribution['values'][0]);
     $this->assertEquals('Cash',$contribution['values'][0]['payment_instrument']);
     $this->assertEquals(1, $contribution['count']);
@@ -532,9 +527,9 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   }
 
   /**
-   * Create test with unique field name on source
+   * Create test with unique field name on source.
    */
-  public function testCreateContributionSourceInvalidContac() {
+  public function testCreateContributionSourceInvalidContact() {
 
     $params = array(
       'contact_id' => 999,
@@ -575,7 +570,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test note created correctly
+   * Test note created correctly.
    */
   public function testCreateContributionWithNote() {
     $description = "Demonstrates creating contribution with Note Entity";
@@ -634,29 +629,28 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   }
 
   /**
-   * This is the test for creating soft credits - however a 'get' is not yet possible via API
-   * as the current BAO functions are contact-centric (from what I can find)
+   * This is the test for creating soft credits.
    */
-  public function testCreateContributionWithSoftCredt() {
+  public function testCreateContributionWithSoftCredit() {
     $description = "Demonstrates creating contribution with SoftCredit";
     $subfile = "ContributionCreateWithSoftCredit";
     $contact2 = $this->callAPISuccess('Contact', 'create', array(
       'display_name' => 'superman',
       'contact_type' => 'Individual',
     ));
-    $softparams = array(
+    $softParams = array(
       'contact_id' => $contact2['id'],
       'amount' => 50,
       'soft_credit_type_id' => 3,
     );
 
-    $params = $this->_params + array('soft_credit' => array(1 => $softparams));
+    $params = $this->_params + array('soft_credit' => array(1 => $softParams));
     $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
     $result = $this->callAPISuccess('contribution', 'get', array('return' => 'soft_credit', 'sequential' => 1));
 
-    $this->assertEquals($softparams['contact_id'], $result['values'][0]['soft_credit'][1]['contact_id']);
-    $this->assertEquals($softparams['amount'], $result['values'][0]['soft_credit'][1]['amount']);
-    $this->assertEquals($softparams['soft_credit_type_id'], $result['values'][0]['soft_credit'][1]['soft_credit_type']);
+    $this->assertEquals($softParams['contact_id'], $result['values'][0]['soft_credit'][1]['contact_id']);
+    $this->assertEquals($softParams['amount'], $result['values'][0]['soft_credit'][1]['amount']);
+    $this->assertEquals($softParams['soft_credit_type_id'], $result['values'][0]['soft_credit'][1]['soft_credit_type']);
 
     $this->callAPISuccess('contribution', 'delete', array('id' => $contribution['id']));
     $this->callAPISuccess('contact', 'delete', array('id' => $contact2['id']));
@@ -670,8 +664,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       'contact_type' => 'Individual',
     ));
     $params = $this->_params + array(
-        'soft_credit_to' => $contact2['id'],
-      );
+      'soft_credit_to' => $contact2['id'],
+    );
     $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
     $result = $this->callAPISuccess('contribution', 'get', array('return' => 'soft_credit', 'sequential' => 1));
 
@@ -692,8 +686,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
       'contact_type' => 'Individual',
     ));
     $params = $this->_params + array(
-        'honor_contact_id' => $contact2['id'],
-      );
+      'honor_contact_id' => $contact2['id'],
+    );
     $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
     $result = $this->callAPISuccess('contribution', 'get', array('return' => 'soft_credit', 'sequential' => 1));
 
@@ -708,7 +702,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   }
 
   /**
-   *  Test  using example code
+   * Test using example code.
    */
   public function testContributionCreateExample() {
     //make sure at least on page exists since there is a truncate in tear down
@@ -772,7 +766,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
 
   /**
-   * Function tests that additional financial records are created when online contribution is created
+   * Function tests that additional financial records are created when online contribution is created.
    */
   public function testCreateContributionOnline() {
     CRM_Financial_BAO_PaymentProcessor::create($this->_processorParams);
@@ -804,6 +798,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   }
 
   /**
+   * Check handling of financial type.
+   *
    * In the interests of removing financial type / contribution type checks from
    * legacy format function lets test that the api is doing this for us
    */
@@ -814,6 +810,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   }
 
   /**
+   * Check handling of financial type.
+   *
    * In the interests of removing financial type / contribution type checks from
    * legacy format function lets test that the api is doing this for us
    */
@@ -824,8 +822,9 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   }
 
   /**
-   * Function tests that additional financial records are created when online contribution with pay later option
-   * is created
+   * Tests that additional financial records are created.
+   *
+   * Checks when online contribution with pay later option is created
    */
   public function testCreateContributionPayLaterOnline() {
     CRM_Financial_BAO_PaymentProcessor::create($this->_processorParams);
@@ -889,7 +888,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   }
 
   /**
-   * Test that BAO defaults work
+   * Test that BAO defaults work.
    */
   public function testCreateBAODefaults() {
     unset($this->_params['contribution_source_id'], $this->_params['payment_instrument_id']);
@@ -1154,7 +1153,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
     $this->assertEquals($contribution['values'][$contributionID]['contact_id'], $this->_individualId);
     $this->assertEquals($contribution['values'][$contributionID]['total_amount'], 110.00);
-    $this->assertEquals($contribution['values'][$contributionID]['financial_type_id'],$this->_financialTypeId );
+    $this->assertEquals($contribution['values'][$contributionID]['financial_type_id'], $this->_financialTypeId);
     $this->assertEquals($contribution['values'][$contributionID]['instrument_id'], $old_payment_instrument);
     $this->assertEquals($contribution['values'][$contributionID]['non_deductible_amount'], 10.00);
     $this->assertEquals($contribution['values'][$contributionID]['fee_amount'], $old_fee_amount);
@@ -1168,7 +1167,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
     );
     $result = $this->callAPISuccess('contribution', 'delete', $params);
-    $this->assertAPISuccess($result, 'in line' . __LINE__);
+    $this->assertAPISuccess($result);
   }
 
   ///////////////// civicrm_contribution_delete methods
@@ -1587,7 +1586,7 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
     $params['contribution_source'] = $params['source'];
     unset($params['source']);
     foreach ($params as $key => $value) {
-      $this->assertEquals($value, $values[$key], $key . " value: $value doesn't match " . print_r($values, TRUE) . 'in line' . __LINE__);
+      $this->assertEquals($value, $values[$key], $key . " value: $value doesn't match " . print_r($values, TRUE));
     }
   }
 
index 60b50f7d7a1f015ad3fc9b9a6a4d2122fcd94855..a4bb9e14eaf5b4124db21b207767f25702e885bc 100644 (file)
@@ -132,7 +132,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
 
   /**
    * Check for Each data type: loop through available form input types
-   **/
+   */
   public function testCustomFieldCreateAllAvailableFormInputs() {
     $gid = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'testAllFormInputs'));
 
@@ -242,11 +242,11 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
 
     $this->assertTrue(is_numeric($optionGroupID) && ($optionGroupID > 0));
     $optionGroup = $this->callAPISuccess('option_group', 'getsingle', array(
-      'id' => $optionGroupID
+      'id' => $optionGroupID,
     ));
     $this->assertEquals($optionGroup['title'], 'Country');
     $optionValueCount = $this->callAPISuccess('option_value', 'getcount', array(
-      'option_group_id' => $optionGroupID
+      'option_group_id' => $optionGroupID,
     ));
     $this->assertEquals(0, $optionValueCount);
   }
@@ -451,14 +451,14 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase {
     $contactGroup = $this->customGroupCreate(array('extends' => 'Contact', 'title' => 'test_group_c'));
     $contactField = $this->customFieldCreate(array(
         'custom_group_id' => $contactGroup['id'],
-        'label' => 'For Contacts'
+        'label' => 'For Contacts',
       ));
     $indivGroup = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'test_group_i'));
     $indivField = $this->customFieldCreate(array('custom_group_id' => $indivGroup['id'], 'label' => 'For Individuals'));
     $activityGroup = $this->customGroupCreate(array('extends' => 'Activity', 'title' => 'test_group_a'));
     $activityField = $this->customFieldCreate(array(
         'custom_group_id' => $activityGroup['id'],
-        'label' => 'For Activities'
+        'label' => 'For Activities',
       ));
 
     // Check getfields
index d4bcb4dd9d0a097878f0f4750ec20709c2416faf..4be15d85f51db86016ed18530caae643f1ec9720 100755 (executable)
@@ -82,19 +82,19 @@ class api_v3_MailingTest extends CiviUnitTestCase {
     $contactIDs['a'] = $this->individualCreate(array(
         'email' => 'include.me@example.org',
         'first_name' => 'Includer',
-        'last_name' => 'Person'
+        'last_name' => 'Person',
       ));
     $contactIDs['b'] = $this->individualCreate(array(
         'email' => 'exclude.me@example.org',
-        'last_name' => 'Excluder'
+        'last_name' => 'Excluder',
       ));
     $this->callAPISuccess('GroupContact', 'create', array(
         'group_id' => $groupIDs['a'],
-        'contact_id' => $contactIDs['a']
+        'contact_id' => $contactIDs['a'],
       ));
     $this->callAPISuccess('GroupContact', 'create', array(
         'group_id' => $groupIDs['b'],
-        'contact_id' => $contactIDs['b']
+        'contact_id' => $contactIDs['b'],
       ));
     // END SAMPLE DATA
 
@@ -179,7 +179,7 @@ class api_v3_MailingTest extends CiviUnitTestCase {
     $contactIDs['include_me'] = $this->individualCreate(array(
         'email' => 'include.me@example.org',
         'first_name' => 'Includer',
-        'last_name' => 'Person'
+        'last_name' => 'Person',
       ));
     $contactIDs['exclude_me'] = $this->individualCreate(array(
         'email' => 'exclude.me@example.org',
@@ -187,15 +187,15 @@ class api_v3_MailingTest extends CiviUnitTestCase {
       ));
     $this->callAPISuccess('GroupContact', 'create', array(
         'group_id' => $groupIDs['inc'],
-        'contact_id' => $contactIDs['include_me']
+        'contact_id' => $contactIDs['include_me'],
       ));
     $this->callAPISuccess('GroupContact', 'create', array(
         'group_id' => $groupIDs['inc'],
-        'contact_id' => $contactIDs['exclude_me']
+        'contact_id' => $contactIDs['exclude_me'],
       ));
     $this->callAPISuccess('GroupContact', 'create', array(
         'group_id' => $groupIDs['exc'],
-        'contact_id' => $contactIDs['exclude_me']
+        'contact_id' => $contactIDs['exclude_me'],
       ));
 
     $params = $this->_params;
@@ -241,7 +241,7 @@ class api_v3_MailingTest extends CiviUnitTestCase {
     $contactIDs['alice'] = $this->individualCreate(array(
         'email' => 'alice@example.org',
         'first_name' => 'Alice',
-        'last_name' => 'Person'
+        'last_name' => 'Person',
       ));
 
     $mail = $this->callAPISuccess('mailing', 'create', $this->_params);
@@ -266,29 +266,29 @@ class api_v3_MailingTest extends CiviUnitTestCase {
     $contactIDs['alice'] = $this->individualCreate(array(
         'email' => 'alice@example.org',
         'first_name' => 'Alice',
-        'last_name' => 'Person'
+        'last_name' => 'Person',
       ));
     $contactIDs['bob'] = $this->individualCreate(array(
         'email' => 'bob@example.org',
         'first_name' => 'Bob',
-        'last_name' => 'Person'
+        'last_name' => 'Person',
       ));
     $contactIDs['carol'] = $this->individualCreate(array(
         'email' => 'carol@example.org',
         'first_name' => 'Carol',
-        'last_name' => 'Person'
+        'last_name' => 'Person',
       ));
     $this->callAPISuccess('GroupContact', 'create', array(
         'group_id' => $groupIDs['inc'],
-        'contact_id' => $contactIDs['alice']
+        'contact_id' => $contactIDs['alice'],
       ));
     $this->callAPISuccess('GroupContact', 'create', array(
         'group_id' => $groupIDs['inc'],
-        'contact_id' => $contactIDs['bob']
+        'contact_id' => $contactIDs['bob'],
       ));
     $this->callAPISuccess('GroupContact', 'create', array(
         'group_id' => $groupIDs['inc'],
-        'contact_id' => $contactIDs['carol']
+        'contact_id' => $contactIDs['carol'],
       ));
     // END SAMPLE DATA
 
index 55c452bcad62a510465993cdaa0a7290f1383b57..d1873c6b120436aca98f6b0462522c0a1637cfda 100644 (file)
@@ -101,8 +101,6 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     $this->customGroupDelete($ids['custom_group_id']);
   }
 
-  /*
-   */
   public function testgetfieldspledge() {
     $result = $this->callAPISuccess('pledge', 'getfields', array('action' => 'get'));
     $this->assertEquals(1, $result['values']['next_pay_date']['api.return']);
@@ -184,7 +182,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     $this->assertEquals($oldPledge['id'], $earlyPledge['id'], ' check correct pledge returned ' . __LINE__);
   }
 
-  /*
+  /**
    * create 2 pledges - see if we can get by status id
    */
   public function testGetOverduePledge() {
@@ -207,7 +205,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
   }
 
 
-  /*
+  /**
    * create 2 pledges - see if we can get by status id
    */
   public function testSortParamPledge() {
@@ -264,7 +262,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     $pledge = $this->callAPISuccess('pledge', 'delete', $pledgeID);
   }
 
-  /*
+  /**
    * Test that pledge with weekly schedule calculates dates correctly
    */
   public function testCreatePledgeWeeklySchedule() {
@@ -279,7 +277,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     //ensure that correct number of payments created & last payment has the right date
     $payments = $this->callAPISuccess('PledgePayment', 'Get', array(
       'pledge_id' => $pledge['id'],
-      'sequential' => 1
+      'sequential' => 1,
     ));
     $this->assertEquals($payments['count'], 5, 'In line ' . __LINE__);
     $this->assertEquals('2011-07-06 00:00:00', $payments['values'][4]['scheduled_date'], 'In line ' . __LINE__);
@@ -331,10 +329,10 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     $pledge = $this->callAPISuccess('pledge', 'delete', $pledgeID);
   }
 
-  /*
-  * test that using original_installment_amount rather than pledge_original_installment_amount works
-  * Pledge field behaviour is a bit random & so pledge has come to try to handle both unique & non -unique fields
-  */
+  /**
+   * test that using original_installment_amount rather than pledge_original_installment_amount works
+   * Pledge field behaviour is a bit random & so pledge has come to try to handle both unique & non -unique fields
+   */
   public function testCreatePledgeWithNonUnique() {
     $params = $this->_params;
     $params['original_installment_amount'] = $params['pledge_original_installment_amount'];
@@ -468,7 +466,6 @@ class api_v3_PledgeTest extends CiviUnitTestCase {
     $pledge = $this->callAPISuccess('pledge', 'delete', $new_params);
   }
 
-  ///////////////// civicrm_pledge_delete methods
   public function testDeleteEmptyParamsPledge() {
     $pledge = $this->callAPIFailure('pledge', 'delete', array(), 'Mandatory key(s) missing from params array: id');
   }
index 26101bc05a8b1ae271dd17c1dffa1add59cf8bdd..676314cc5f1fcf7f16b3bca348632adf9a031243 100644 (file)
@@ -44,10 +44,6 @@ class api_v3_ProductTest extends CiviUnitTestCase {
     );
   }
 
-  //  function tearDown() {
-  //    $this->quickCleanup(array('civicrm_product'), TRUE);
-  //  }
-
   public function testGetFields() {
     $fields = $this->callAPISuccess($this->_entity, 'getfields', array('action' => 'create'));
     $this->assertArrayHasKey('period_type', $fields['values']);
index 21b9467fc77fe0eacd8977e41100071703773c3f..37e5bb3e151a102ac3ef67aff09963466d68ed27 100644 (file)
@@ -176,13 +176,13 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
         'contact_id' => $contactId,
         'street_address' => '25 Big Street',
         'city' => 'big city',
-        'location_type_id' => 5
+        'location_type_id' => 5,
       ));
     $this->callAPISuccess('email', 'create', array(
         'contact_id' => $contactId,
         'email' => 'big@once.com',
         'location_type_id' => 2,
-        'is_billing' => 1
+        'is_billing' => 1,
       ));
 
     $expected = current($individual);
@@ -309,7 +309,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     $this->_addCustomFieldToProfile($this->_profileID);
     $result = $this->callAPIAndDocument('profile', 'getfields', array(
         'action' => 'submit',
-        'profile_id' => $this->_profileID
+        'profile_id' => $this->_profileID,
       ), __FUNCTION__, __FILE__,
       'demonstrates retrieving profile fields passing in an id');
     $this->assertArrayKeyExists('first_name', $result['values']);
@@ -327,7 +327,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess('profile', 'getfields', array(
         'action' => 'submit',
         'profile_id' => 'participant_status',
-        'get_options' => 'all'
+        'get_options' => 'all',
       )
     );
     $this->assertTrue(array_key_exists('participant_status_id', $result['values']));
@@ -343,7 +343,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     $result = $this->callAPISuccess('profile', 'getfields', array(
         'action' => 'submit',
         'profile_id' => 'membership_batch_entry',
-        'get_options' => 'all'
+        'get_options' => 'all',
       )
     );
     $this->assertTrue(array_key_exists('total_amount', $result['values']));
@@ -351,7 +351,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     $this->assertEquals(array(
         'contribution_type_id',
         'contribution_type',
-        'financial_type'
+        'financial_type',
       ), $result['values']['financial_type_id']['api.aliases']);
     $this->assertTrue(!array_key_exists('financial_type', $result['values']));
     $this->assertEquals(12, $result['values']['receive_date']['type']);
@@ -368,7 +368,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
       $result = $this->callAPISuccess('profile', 'getfields', array(
           'action' => 'submit',
           'profile_id' => $profileID,
-          'get_options' => 'all'
+          'get_options' => 'all',
         )
       );
     }
@@ -475,11 +475,11 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     $profileFields = $this->callAPISuccess('profile', 'getfields', array(
         'get_options' => 'all',
         'action' => 'submit',
-        'profile_id' => 'membership_batch_entry'
+        'profile_id' => 'membership_batch_entry',
       ));
     $getoptions = $this->callAPISuccess('membership', 'getoptions', array(
         'field' => 'membership_type',
-        'context' => 'validate'
+        'context' => 'validate',
       ));
     $this->assertEquals(array_keys($membershipTypes['values']), array_keys($getoptions['values']));
     $this->assertEquals(array_keys($membershipTypes['values']), array_keys($profileFields['values']['membership_type_id']['options']));
@@ -492,7 +492,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
   public function testMembershipGetFieldsOrder() {
     $result = $this->callAPISuccess('profile', 'getfields', array(
         'action' => 'submit',
-        'profile_id' => 'membership_batch_entry'
+        'profile_id' => 'membership_batch_entry',
       ));
     $weight = 1;
     foreach ($result['values'] as $fieldName => $field) {
@@ -716,7 +716,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     foreach (array(
                'email',
                'phone',
-               'address'
+               'address',
              ) as $fieldType) {
       $typeValues = array_pop($result['values'][$fieldType]);
       foreach ($expected[$fieldType] as $field => $value) {
@@ -933,7 +933,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase {
     $this->uFFieldCreate(array(
         'uf_group_id' => $profileID,
         'field_name' => 'custom_' . $ids['custom_field_id'],
-        'contact_type' => 'Contact'
+        'contact_type' => 'Contact',
       ));
   }
 }
index 30213f51bf6c99fa666da3aa34f5af0fa9a512c3..fa1146ff655b379e298f3ae6e7e96dbdcb5e3e47 100644 (file)
@@ -65,13 +65,16 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
     'Survey' => 'CiviCampaign',
   );
 
-  /* they are two types of missing APIs:
-       - Those that are to be implemented
-         (in some future version when someone steps in -hint hint-). List the entities in toBeImplemented[ {$action} ]
-       Those that don't exist
-         and that will never exist (eg an obsoleted Entity
-         they need to be returned by the function toBeSkipped_{$action} (because it has to be a static method and therefore couldn't access a this->toBeSkipped)
-    */
+  /**
+   * Set up function.
+   *
+   * There are two types of missing APIs:
+   * Those that are to be implemented
+   * (in some future version when someone steps in -hint hint-). List the entities in toBeImplemented[ {$action} ]
+   * Those that don't exist
+   * and that will never exist (eg an obsoleted Entity
+   * they need to be returned by the function toBeSkipped_{$action} (because it has to be a static method and therefore couldn't access a this->toBeSkipped)
+   */
   public function setUp() {
     parent::setUp();
     $this->enableCiviCampaign();
@@ -83,7 +86,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
       'Extension',
       'ReportTemplate',
       'System',
-      'Setting'
+      'Setting',
     );
     $this->toBeImplemented['create'] = array(
       'SurveyRespondant',
@@ -94,7 +97,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
       'CustomSearch',
       'Extension',
       'ReportTemplate',
-      'System'
+      'System',
     );
     $this->toBeImplemented['delete'] = array(
       'MembershipPayment',
@@ -104,9 +107,14 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
       'UFMatch',
       'Extension',
       'LocationType',
-      'System'
+      'System',
+    );
+    $this->onlyIDNonZeroCount['get'] = array(
+      'ActivityType',
+      'Entity',
+      'Domain',
+      'Setting',
     );
-    $this->onlyIDNonZeroCount['get'] = array('ActivityType', 'Entity', 'Domain', 'Setting');
     $this->deprecatedAPI = array('Location', 'ActivityType', 'SurveyRespondant');
     $this->deletableTestObjects = array();
   }
@@ -120,11 +128,14 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
   }
 
   /**
-   * @param null $skip
+   * Generate list of all entities.
+   *
+   * @param array $skip
+   *   Entities to skip.
    *
    * @return array
    */
-  public static function entities($skip = NULL) {
+  public static function entities($skip = array()) {
     // The order of operations in here is screwy. In the case where SYNTAX_CONFORMANCE_ENTITIES is
     // defined, we should be able to parse+return it immediately. However, some weird dependency
     // crept into the system where civicrm_api('Entity','get') must be called as part of entities()
@@ -149,6 +160,8 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
   }
 
   /**
+   * Get list of entities for get test.
+   *
    * @return array
    */
   public static function entities_get() {
@@ -157,6 +170,8 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
   }
 
   /**
+   * Get entities for create tests.
+   *
    * @return array
    */
   public static function entities_create() {
@@ -225,6 +240,8 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
   }
 
   /**
+   * Get entities to be skipped on get tests.
+   *
    * @param bool $sequential
    *
    * @return array
@@ -235,7 +252,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
       'MailingEventConfirm',
       'MailingEventResubscribe',
       'MailingEventUnsubscribe',
-      'Location'
+      'Location',
     );
     if ($sequential === TRUE) {
       return $entitiesWithoutGet;
@@ -248,6 +265,8 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
   }
 
   /**
+   * Get entities to be skipped for get call.
+   *
    * Mailing Contact Just doesn't support id. We have always insisted on finding a way to
    * support id in API but in this case the underlying tables are crying out for a restructure
    * & it just doesn't make sense, on the otherhand Event need id to be existant as pseudo property
@@ -298,7 +317,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase {
       'Domain',
       'Profile',
       'CustomValue',
-      'Setting'
+      'Setting',
     );
     if ($sequential === TRUE) {
       return $entitiesWithout;
index 50ea90226281d05909ad01f037bab5e8a20dbd07..fa401b3d622d5a740803a6e66db3271de6935f54 100644 (file)
@@ -54,7 +54,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase {
       )
     );
     $this->_apiversion = 3;
-    $op = new PHPUnit_Extensions_Database_Operation_Insert;
+    $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute(
       $this->_dbconn,
       $this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')
index 30432e32f9f385682e0e7f9d4dddda14c1a3065a..2d3c575784dfb0aa1ed60886c988cb8d5d5bd22a 100644 (file)
@@ -56,7 +56,7 @@ class api_v3_UFMatchTest extends CiviUnitTestCase {
       )
     );
     $this->_contactId = $this->individualCreate();
-    $op = new PHPUnit_Extensions_Database_Operation_Insert;
+    $op = new PHPUnit_Extensions_Database_Operation_Insert();
     $op->execute(
       $this->_dbconn,
       $this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')
index 217bb6ff279d357311142aa4d79cdb59c9181cf5..2cb738bf5cae3c0647b6a29dcf2c4cd545b12a8a 100644 (file)
@@ -1,41 +1,59 @@
 {literal}<?php{/literal}
 /**
- * Test Generated example of using {$fnPrefix} {$action} API
- *{if $description} {$description}{/if}
+ * @file
+ * Test Generated API Example.
+ * See bottom of this file for more detail.
+ */
+
+/**
+ * Test Generated example of using {$fnPrefix} {$action} API.
+ *
+{if $description}
+ * {$description}
+{/if}
  *
+ * @return array
+ *   API result array
  */
-function {$function}_example(){literal}{{/literal}
-$params = {$params|@print_array};
+function {$function}_example() {literal}{{/literal}
+  $params = {$params|@print_array};
 {literal}
-try{{/literal}
-  $result = civicrm_api3('{$fnPrefix}', '{$action}', $params);
-{literal}}
-catch (CiviCRM_API3_Exception $e) {
-  // handle error here
-  $errorMessage = $e->getMessage();
-  $errorCode = $e->getErrorCode();
-  $errorData = $e->getExtraParams();
-  return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
-}{/literal}
+  try{{/literal}
+    $result = civicrm_api3('{$fnPrefix}', '{$action}', $params);
+{literal}  }
+  catch (CiviCRM_API3_Exception $e) {
+    // Handle error here.
+    $errorMessage = $e->getMessage();
+    $errorCode = $e->getErrorCode();
+    $errorData = $e->getExtraParams();
+    return array(
+      'error' => $errorMessage,
+      'error_code' => $errorCode,
+      'error_data' => $errorData,
+    );
+  }{/literal}
 
-return $result;
+  return $result;
 {literal}}{/literal}
 
 /**
- * Function returns array of result expected from previous function
+ * Function returns array of result expected from previous function.
+ *
+ * @return array
+ *   API result array
  */
-function {$function}_expectedresult(){literal}{{/literal}
+function {$function}_expectedresult() {literal}{{/literal}
 
   $expectedResult = {$result|@print_array};
 
   return $expectedResult;
 {literal}}{/literal}
 
-
-/*
-* This example has been generated from the API test suite. The test that created it is called
-*
-* {$testfunction} and can be found in
+/**
+* This example has been generated from the API test suite.
+* The test that created it is called
+* {$testfunction}
+* and can be found in
 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/{$filename}
 *
 * You can see the outcome of the API tests at
index f79c84c590470dcf1e984642b8d11e9e48a0c7aa..fc1d0f1ec9c7f97cb077e6c36bb7a7d90895ecd8 100644 (file)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="iso-8859-1" ?>
 <version>
-  <version_no>4.6.alpha2</version_no>
+  <version_no>4.6.alpha3</version_no>
 </version>