From ae5ffbb75cf5b11a3af6d2e3e63de84803b2801a Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 14 Jan 2015 18:59:26 -0800 Subject: [PATCH] INFRA-132 - Batch 14 (g) --- CRM/Activity/Form/Task/AddToTag.php | 6 +- CRM/Contact/BAO/Contact/Utils.php | 23 +- CRM/Contact/Form/Edit/TagsAndGroups.php | 2 +- CRM/Contact/Form/Task/Delete.php | 10 +- CRM/Contact/Form/Task/HookSample.php | 1 - CRM/Contact/Import/Form/Summary.php | 2 +- CRM/Contact/Import/Parser.php | 15 +- CRM/Contribute/BAO/Contribution/Utils.php | 10 +- CRM/Core/BAO/File.php | 4 +- CRM/Core/BAO/OptionGroup.php | 6 +- CRM/Core/BAO/PrevNextCache.php | 10 +- CRM/Extension/Downloader.php | 2 +- CRM/Extension/Manager.php | 1 - CRM/Financial/BAO/PaymentProcessorType.php | 6 +- CRM/Financial/Form/FinancialAccount.php | 6 +- CRM/Group/Form/Edit.php | 14 +- CRM/Logging/ReportSummary.php | 225 +++++++++--------- CRM/Logging/Schema.php | 22 +- CRM/Mailing/Event/BAO/Unsubscribe.php | 2 +- CRM/Member/Page/Tab.php | 11 +- CRM/PCP/Form/PCP.php | 20 +- CRM/Pledge/Form/Pledge.php | 12 +- CRM/Price/Form/Field.php | 18 +- CRM/Report/Form/Contact/Detail.php | 15 +- CRM/Report/Form/Contribute/Lybunt.php | 15 +- CRM/Report/Form/Contribute/TopDonor.php | 182 +++++++------- CRM/Report/Form/Event/ParticipantListing.php | 34 ++- CRM/Report/Page/InstanceList.php | 11 +- CRM/UF/Page/Field.php | 2 +- CRM/Upgrade/Form.php | 10 +- CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php | 22 +- CRM/Utils/API/HTMLInputCoder.php | 4 +- CRM/Utils/File.php | 14 +- CRM/Utils/Hook/Joomla.php | 2 +- CRM/Utils/Mail.php | 23 +- CRM/Utils/Mail/EmailProcessor.php | 16 +- CRM/Utils/System/Drupal6.php | 11 +- api/v3/CustomGroup.php | 4 +- api/v3/MessageTemplate.php | 5 +- api/v3/PledgePayment.php | 4 +- install/template.css | 2 +- tests/phpunit/CRM/Group/Page/AjaxTest.php | 4 +- .../phpunit/CRM/Member/BAO/MembershipTest.php | 25 +- tests/phpunit/CRM/Pledge/AllTests.php | 2 +- .../WebTest/Case/CaseCustomFieldsTest.php | 10 +- .../WebTest/Release/ReleaseTestCase.php | 2 +- tests/phpunit/api/v3/CustomFieldTest.php | 10 +- tests/phpunit/api/v3/ProductTest.php | 4 - 48 files changed, 383 insertions(+), 478 deletions(-) diff --git a/CRM/Activity/Form/Task/AddToTag.php b/CRM/Activity/Form/Task/AddToTag.php index b7d825aac1..6fc196e5fc 100644 --- a/CRM/Activity/Form/Task/AddToTag.php +++ b/CRM/Activity/Form/Task/AddToTag.php @@ -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 = ''; CRM_Core_Session::setStatus($status, ts("Added Tag %1", array(1 => $this->_tags[$key])), 'success', array('expires' => 0)); diff --git a/CRM/Contact/BAO/Contact/Utils.php b/CRM/Contact/BAO/Contact/Utils.php index 0fc398c8c0..7c9a4b8742 100644 --- a/CRM/Contact/BAO/Contact/Utils.php +++ b/CRM/Contact/BAO/Contact/Utils.php @@ -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]; diff --git a/CRM/Contact/Form/Edit/TagsAndGroups.php b/CRM/Contact/Form/Edit/TagsAndGroups.php index 65979724a9..de0b5d3e93 100644 --- a/CRM/Contact/Form/Edit/TagsAndGroups.php +++ b/CRM/Contact/Form/Edit/TagsAndGroups.php @@ -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, diff --git a/CRM/Contact/Form/Task/Delete.php b/CRM/Contact/Form/Task/Delete.php index 61a4bb795c..0bde6dccdb 100644 --- a/CRM/Contact/Form/Task/Delete.php +++ b/CRM/Contact/Form/Task/Delete.php @@ -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'); diff --git a/CRM/Contact/Form/Task/HookSample.php b/CRM/Contact/Form/Task/HookSample.php index 7cd440096a..0f07630447 100644 --- a/CRM/Contact/Form/Task/HookSample.php +++ b/CRM/Contact/Form/Task/HookSample.php @@ -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()) { diff --git a/CRM/Contact/Import/Form/Summary.php b/CRM/Contact/Import/Form/Summary.php index 4522a0e363..d46087cc38 100644 --- a/CRM/Contact/Import/Form/Summary.php +++ b/CRM/Contact/Import/Form/Summary.php @@ -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)); diff --git a/CRM/Contact/Import/Parser.php b/CRM/Contact/Import/Parser.php index fddfc8f8bb..81ac494bb5 100644 --- a/CRM/Contact/Import/Parser.php +++ b/CRM/Contact/Import/Parser.php @@ -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 diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index 8a99a5aa22..75bd26eb26 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -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); } diff --git a/CRM/Core/BAO/File.php b/CRM/Core/BAO/File.php index f78231f258..140b433a03 100644 --- a/CRM/Core/BAO/File.php +++ b/CRM/Core/BAO/File.php @@ -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, diff --git a/CRM/Core/BAO/OptionGroup.php b/CRM/Core/BAO/OptionGroup.php index 03a04f4e2e..88bbcba978 100644 --- a/CRM/Core/BAO/OptionGroup.php +++ b/CRM/Core/BAO/OptionGroup.php @@ -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(); diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php index 00c0882de6..4c2ba15d98 100644 --- a/CRM/Core/BAO/PrevNextCache.php +++ b/CRM/Core/BAO/PrevNextCache.php @@ -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(); diff --git a/CRM/Extension/Downloader.php b/CRM/Extension/Downloader.php index 6610b13ae7..2e7fed3a04 100644 --- a/CRM/Extension/Downloader.php +++ b/CRM/Extension/Downloader.php @@ -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) { diff --git a/CRM/Extension/Manager.php b/CRM/Extension/Manager.php index dc9109ed17..a94397f6b1 100644 --- a/CRM/Extension/Manager.php +++ b/CRM/Extension/Manager.php @@ -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); diff --git a/CRM/Financial/BAO/PaymentProcessorType.php b/CRM/Financial/BAO/PaymentProcessorType.php index 4cf903e662..354d5ad0bd 100644 --- a/CRM/Financial/BAO/PaymentProcessorType.php +++ b/CRM/Financial/BAO/PaymentProcessorType.php @@ -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(); diff --git a/CRM/Financial/Form/FinancialAccount.php b/CRM/Financial/Form/FinancialAccount.php index 9f0c13ef02..a3b9edd0b8 100644 --- a/CRM/Financial/Form/FinancialAccount.php +++ b/CRM/Financial/Form/FinancialAccount.php @@ -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?')); diff --git a/CRM/Group/Form/Edit.php b/CRM/Group/Form/Edit.php index 0062ef2839..a6908ab4ad 100644 --- a/CRM/Group/Form/Edit.php +++ b/CRM/Group/Form/Edit.php @@ -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( diff --git a/CRM/Logging/ReportSummary.php b/CRM/Logging/ReportSummary.php index db82501a6a..7487f06b46 100644 --- a/CRM/Logging/ReportSummary.php +++ b/CRM/Logging/ReportSummary.php @@ -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']) ) { diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index a4902c1461..6bc0dbd3dd 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -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(); diff --git a/CRM/Mailing/Event/BAO/Unsubscribe.php b/CRM/Mailing/Event/BAO/Unsubscribe.php index a442d3ce31..438afc6394 100755 --- a/CRM/Mailing/Event/BAO/Unsubscribe.php +++ b/CRM/Mailing/Event/BAO/Unsubscribe.php @@ -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) { diff --git a/CRM/Member/Page/Tab.php b/CRM/Member/Page/Tab.php index 6e9f766d92..e8c2ced583 100644 --- a/CRM/Member/Page/Tab.php +++ b/CRM/Member/Page/Tab.php @@ -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( diff --git a/CRM/PCP/Form/PCP.php b/CRM/PCP/Form/PCP.php index 8510fc13f1..b276c483a0 100644 --- a/CRM/PCP/Form/PCP.php +++ b/CRM/PCP/Form/PCP.php @@ -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) { diff --git a/CRM/Pledge/Form/Pledge.php b/CRM/Pledge/Form/Pledge.php index 5376314ca1..5626f2309c 100644 --- a/CRM/Pledge/Form/Pledge.php +++ b/CRM/Pledge/Form/Pledge.php @@ -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 check, EFT, or cash payment for this pledge OR submit a credit card payment.", array( 1 => $contribURL, - 2 => $creditURL + 2 => $creditURL, )); } else { diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index e4c82e6cac..cc86953868 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -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 diff --git a/CRM/Report/Form/Contact/Detail.php b/CRM/Report/Form/Contact/Detail.php index 842841c73c..cbb686ca21 100644 --- a/CRM/Report/Form/Contact/Detail.php +++ b/CRM/Report/Form/Contact/Detail.php @@ -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)) { diff --git a/CRM/Report/Form/Contribute/Lybunt.php b/CRM/Report/Form/Contribute/Lybunt.php index 34bfc24113..1fa3a79327 100644 --- a/CRM/Report/Form/Contribute/Lybunt.php +++ b/CRM/Report/Form/Contribute/Lybunt.php @@ -119,9 +119,9 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { ), ), ), - ) - + $this->addAddressFields() - + array( + ); + $this->_columns += $this->addAddressFields(); + $this->_columns += array( 'civicrm_contribution' => array( 'dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array( @@ -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(); diff --git a/CRM/Report/Form/Contribute/TopDonor.php b/CRM/Report/Form/Contribute/TopDonor.php index b485241b7b..3c93823395 100644 --- a/CRM/Report/Form/Contribute/TopDonor.php +++ b/CRM/Report/Form/Contribute/TopDonor.php @@ -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; diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index 7e2636ab12..238fb5128a 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -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) { diff --git a/CRM/Report/Page/InstanceList.php b/CRM/Report/Page/InstanceList.php index 7edf71f6ff..c603af071e 100644 --- a/CRM/Report/Page/InstanceList.php +++ b/CRM/Report/Page/InstanceList.php @@ -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; /** diff --git a/CRM/UF/Page/Field.php b/CRM/UF/Page/Field.php index 18c160a25b..5425905ca8 100644 --- a/CRM/UF/Page/Field.php +++ b/CRM/UF/Page/Field.php @@ -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( diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index 475e04dd2f..803bf2e7d2 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -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); } diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php index 1f0beca7ad..eb36f2259a 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php @@ -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. diff --git a/CRM/Utils/API/HTMLInputCoder.php b/CRM/Utils/API/HTMLInputCoder.php index f1754944cd..345765825f 100644 --- a/CRM/Utils/API/HTMLInputCoder.php +++ b/CRM/Utils/API/HTMLInputCoder.php @@ -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)) { diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index c1bd5c1f1b..d9a115e9a2 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -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) { diff --git a/CRM/Utils/Hook/Joomla.php b/CRM/Utils/Hook/Joomla.php index c3ad47b116..48b2529642 100644 --- a/CRM/Utils/Hook/Joomla.php +++ b/CRM/Utils/Hook/Joomla.php @@ -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 diff --git a/CRM/Utils/Mail.php b/CRM/Utils/Mail.php index d076c10732..54fda7e2fd 100644 --- a/CRM/Utils/Mail.php +++ b/CRM/Utils/Mail.php @@ -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 = '

' . 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', )) . '

' . '

' . ts('The mail library returned the following error message:') . '
' . $result->getMessage() . '

' . '

' . ts('This is probably related to a problem in your Outbound Email Settings (Administer CiviCRM » System Settings » Outbound Email), OR the FROM email address specifically configured for your contribution page or event. Possible causes are:') . '

'; if (is_a($mailer, 'Mail_smtp')) { @@ -211,7 +210,7 @@ class CRM_Utils_Mail { } $message .= '
  • ' . ts('The FROM Email Address configured for this feature may not be a valid sender based on your email service provider rules.') . '
  • ' . '' . '

    ' . ts('Check this page 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), )) . '

    '; 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, diff --git a/CRM/Utils/Mail/EmailProcessor.php b/CRM/Utils/Mail/EmailProcessor.php index d13d2e1461..d15ab20ec0 100644 --- a/CRM/Utils/Mail/EmailProcessor.php +++ b/CRM/Utils/Mail/EmailProcessor.php @@ -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' diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php index 795b6541de..01371fe3c8 100644 --- a/CRM/Utils/System/Drupal6.php +++ b/CRM/Utils/System/Drupal6.php @@ -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; diff --git a/api/v3/CustomGroup.php b/api/v3/CustomGroup.php index 3043981451..5d2f03fcc4 100644 --- a/api/v3/CustomGroup.php +++ b/api/v3/CustomGroup.php @@ -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); } diff --git a/api/v3/MessageTemplate.php b/api/v3/MessageTemplate.php index 5683f8593a..7b534d3f51 100644 --- a/api/v3/MessageTemplate.php +++ b/api/v3/MessageTemplate.php @@ -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); diff --git a/api/v3/PledgePayment.php b/api/v3/PledgePayment.php index 73c41662ee..340a29d03e 100644 --- a/api/v3/PledgePayment.php +++ b/api/v3/PledgePayment.php @@ -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"); diff --git a/install/template.css b/install/template.css index 15718c677d..68d1101ba0 100644 --- a/install/template.css +++ b/install/template.css @@ -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; } diff --git a/tests/phpunit/CRM/Group/Page/AjaxTest.php b/tests/phpunit/CRM/Group/Page/AjaxTest.php index 0aa6e64bb7..2d0582179d 100644 --- a/tests/phpunit/CRM/Group/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Group/Page/AjaxTest.php @@ -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')); diff --git a/tests/phpunit/CRM/Member/BAO/MembershipTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTest.php index 6766f00165..a6d31bd7e5 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTest.php @@ -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', diff --git a/tests/phpunit/CRM/Pledge/AllTests.php b/tests/phpunit/CRM/Pledge/AllTests.php index 5df3bacd49..0854f71ba5 100644 --- a/tests/phpunit/CRM/Pledge/AllTests.php +++ b/tests/phpunit/CRM/Pledge/AllTests.php @@ -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; } diff --git a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php index 065347fbef..fd119a6d79 100644 --- a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php +++ b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php @@ -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); @@ -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); diff --git a/tests/phpunit/WebTest/Release/ReleaseTestCase.php b/tests/phpunit/WebTest/Release/ReleaseTestCase.php index 034fcfb51c..f1d51b8279 100644 --- a/tests/phpunit/WebTest/Release/ReleaseTestCase.php +++ b/tests/phpunit/WebTest/Release/ReleaseTestCase.php @@ -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'; diff --git a/tests/phpunit/api/v3/CustomFieldTest.php b/tests/phpunit/api/v3/CustomFieldTest.php index 60b50f7d7a..a4bb9e14ea 100644 --- a/tests/phpunit/api/v3/CustomFieldTest.php +++ b/tests/phpunit/api/v3/CustomFieldTest.php @@ -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 diff --git a/tests/phpunit/api/v3/ProductTest.php b/tests/phpunit/api/v3/ProductTest.php index 26101bc05a..676314cc5f 100644 --- a/tests/phpunit/api/v3/ProductTest.php +++ b/tests/phpunit/api/v3/ProductTest.php @@ -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']); -- 2.25.1