Commit 4c9b6178 authored by totten's avatar totten
Browse files

INFRA-132 - Change "else if" to "elseif"

parent 4f99ca55
......@@ -1738,7 +1738,7 @@ WHERE contact_id = $contactId
if ($dao->record_type_id == $targetID) {
$activities[$dao->activity_id]['targets'][$contactId] = $contactId;
}
else if ($dao->record_type_id == $assigneeID) {
elseif ($dao->record_type_id == $assigneeID) {
$activities[$dao->activity_id]['asignees'][$contactId] = $contactId;
}
else {
......
......@@ -244,11 +244,11 @@ class CRM_Activity_BAO_Query {
$query->_where[$grouping][] = " civicrm_activity_contact.record_type_id = $sourceID";
$query->_qill[$grouping][] = ts('Activity created by');
}
else if ($values[2] == 2) {
elseif ($values[2] == 2) {
$query->_where[$grouping][] = " civicrm_activity_contact.record_type_id = $assigneeID";
$query->_qill[$grouping][] = ts('Activity assigned to');
}
else if ($values[2] == 3) {
elseif ($values[2] == 3) {
$query->_where[$grouping][] = " civicrm_activity_contact.record_type_id = $targetID";
$query->_qill[$grouping][] = ts('Activity targeted to');
}
......
......@@ -158,7 +158,7 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form {
if ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_done") {
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey'));
}
else if ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_next") {
elseif ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_next") {
$subPage = CRM_Campaign_Form_Survey_TabHeader::getNextTab($this);
CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/survey/configure/{$subPage}",
"action=update&reset=1&id={$this->_surveyId}"));
......
......@@ -257,7 +257,7 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
FALSE, NULL, FALSE
);
}
else if ($type == $pdfActivityType ) {
elseif ($type == $pdfActivityType ) {
$url = CRM_Utils_System::url('civicrm/activity/pdf/add',
"action=add&context=standalone&reset=1&cid={$this->_contactID}&caseid={$this->_caseID}&atype=$type",
FALSE, NULL, FALSE );
......
......@@ -941,7 +941,7 @@ WHERE id={$id}; ";
str_replace('\\', '/', $absolutePath)
);
}
else if ($config->userFramework == 'WordPress') {
elseif ($config->userFramework == 'WordPress') {
$userFrameworkBaseURL = trim(str_replace('/wp-admin/', '', $config->userFrameworkBaseURL));
$customFileUploadDirectory = strstr(str_replace('\\', '/', $absolutePath), '/wp-content/');
$relativePath = $userFrameworkBaseURL . $customFileUploadDirectory;
......@@ -2244,7 +2244,7 @@ ORDER BY civicrm_email.is_primary DESC";
}
}
}
else if (in_array($key,
elseif (in_array($key,
array(
'nick_name',
'job_title',
......
......@@ -382,7 +382,7 @@ WHERE (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR
// if result is already validated, and url has cs, set the flag.
$session->set('authSrc', CRM_Core_Permission::AUTH_SRC_CHECKSUM);
}
else if (($session->get('authSrc') & CRM_Core_Permission::AUTH_SRC_CHECKSUM) == CRM_Core_Permission::AUTH_SRC_CHECKSUM) {
elseif (($session->get('authSrc') & CRM_Core_Permission::AUTH_SRC_CHECKSUM) == CRM_Core_Permission::AUTH_SRC_CHECKSUM) {
// if checksum wasn't present in REQUEST OR checksum result validated as FALSE,
// and flag was already set exactly as AUTH_SRC_CHECKSUM, unset it.
$session->set('authSrc', CRM_Core_Permission::AUTH_SRC_UNKNOWN);
......
......@@ -306,12 +306,12 @@ WHERE id IN ( $groupIDs )
if ($groupID == NULL) {
$invoked = TRUE;
}
else if (is_array($groupID)) {
elseif (is_array($groupID)) {
foreach ($groupID as $gid) {
unset(self::$_alreadyLoaded[$gid]);
}
}
else if ($groupID && array_key_exists($groupID, self::$_alreadyLoaded)) {
elseif ($groupID && array_key_exists($groupID, self::$_alreadyLoaded)) {
unset(self::$_alreadyLoaded[$groupID]);
}
......
......@@ -1311,7 +1311,7 @@ class CRM_Contact_BAO_Query {
if (isset($this->_rowCountClause)) {
$select = "SELECT {$this->_rowCountClause}";
}
else if (isset($this->_distinctComponentClause)) {
elseif (isset($this->_distinctComponentClause)) {
// we add distinct to get the right count for components
// for the more complex result set, we use GROUP BY the same id
// CRM-9630
......@@ -1478,11 +1478,11 @@ class CRM_Contact_BAO_Query {
$fromRange = 'event_start_date_low';
$toRange = 'event_end_date_high';
}
else if ($id == 'case_from_relative') {
elseif ($id == 'case_from_relative') {
$fromRange = 'case_from_start_date_low';
$toRange = 'case_from_start_date_high';
}
else if ($id == 'case_to_relative') {
elseif ($id == 'case_to_relative') {
$fromRange = 'case_to_end_date_low';
$toRange = 'case_to_end_date_high';
}
......@@ -2756,7 +2756,7 @@ class CRM_Contact_BAO_Query {
if (strpos($op, 'NULL') !== FALSE || strpos($op, 'EMPTY') !== FALSE) {
$this->_where[$grouping][] = self::buildClause($alias, $op, $value, 'String');
}
else if (is_array($value)) {
elseif (is_array($value)) {
foreach ($value as $k => $v) {
if (!empty($k)) {
$clause[$k] = "($alias $op '%" . CRM_Core_DAO::VALUE_SEPARATOR . CRM_Utils_Type::escape($k, 'String') . CRM_Core_DAO::VALUE_SEPARATOR . "%')";
......@@ -3666,7 +3666,7 @@ WHERE id IN ( $groupIDs )
if ($op == '=') {
$op = 'IN';
}
else if ($op == '!=') {
elseif ($op == '!=') {
$op = 'NOT IN';
}
else {
......@@ -3722,7 +3722,7 @@ WHERE id IN ( $groupIDs )
if (in_array($op, array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) {
$value = NULL;
}
else if (!is_array($value)) {
elseif (!is_array($value)) {
// force the state to be an array
// check if its in the mapper format!
$values = self::parseSearchBuilderString($value);
......@@ -3749,7 +3749,7 @@ WHERE id IN ( $groupIDs )
if ($op == '=') {
$op = 'IN';
}
else if ($op == '!=') {
elseif ($op == '!=') {
$op = 'NOT IN';
}
else {
......@@ -3759,7 +3759,7 @@ WHERE id IN ( $groupIDs )
if (in_array($op, array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) {
$stateClause = "civicrm_address.state_province_id $op";
}
else if ($inputFormat == 'id') {
elseif ($inputFormat == 'id') {
if ($op != 'NOT IN') {
$op = 'IN';
}
......@@ -5490,7 +5490,7 @@ AND displayRelType.is_active = 1
if ($dataType == 'Integer' && !is_numeric($v)) {
return FALSE;
}
else if ($dataType == 'String' && !is_string($v)) {
elseif ($dataType == 'String' && !is_string($v)) {
return FALSE;
}
$returnValues[] = trim($v);
......
......@@ -82,10 +82,10 @@ class CRM_Contact_Controller_Search extends CRM_Core_Controller {
if (strpos($qString, 'basic') !== FALSE) {
$path = 'civicrm/contact/search/basic';
}
else if (strpos($qString, 'builder') !== FALSE) {
elseif (strpos($qString, 'builder') !== FALSE) {
$path = 'civicrm/contact/search/builder';
}
else if (
elseif (
strpos($qString, 'custom') !== FALSE &&
isset($_REQUEST['csid'])
) {
......
......@@ -154,7 +154,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search {
$c->buildAdvancedSearchPaneForm($this);
$this->_paneTemplatePath[$type] = $c->getAdvancedSearchPaneTemplatePath();
}
else if (in_array($type, $hookPanes)) {
elseif (in_array($type, $hookPanes)) {
CRM_Contact_BAO_Query_Hook::singleton()->buildAdvancedSearchPaneForm($this, $type);
CRM_Contact_BAO_Query_Hook::singleton()->setAdvancedSearchPaneTemplatePath($this->_paneTemplatePath, $type);
}
......
......@@ -152,7 +152,7 @@ $sqlStatement
CRM_Core_DAO::executeQuery($sql);
}
}
else if ($tableName == 'file') {
elseif ($tableName == 'file') {
$searcher = CRM_Core_BAO_File::getSearchService();
if (!($searcher && CRM_Core_Permission::check('access uploaded files'))) {
continue;
......
......@@ -1148,7 +1148,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
if (array_key_exists($customFieldID, $addressCustomFields) && CRM_Utils_Date::convertToDefaultDate($params[$key][0], $dateType, $key)) {
$value = $params[$key][0][$key];
}
else if (CRM_Utils_Date::convertToDefaultDate($params, $dateType, $key)) {
elseif (CRM_Utils_Date::convertToDefaultDate($params, $dateType, $key)) {
$value = $params[$key];
}
else {
......
......@@ -2871,7 +2871,7 @@ WHERE contribution_id = %1 ";
self::updateFinancialAccounts($params, 'changePaymentInstrument');
}
}
else if ((!CRM_Utils_System::isNull($params['contribution']->payment_instrument_id) ||
elseif ((!CRM_Utils_System::isNull($params['contribution']->payment_instrument_id) ||
!CRM_Utils_System::isNull($params['prevContribution']->payment_instrument_id)) &&
$params['contribution']->payment_instrument_id != $params['prevContribution']->payment_instrument_id
) {
......@@ -2880,7 +2880,7 @@ WHERE contribution_id = %1 ";
$params['total_amount'] = $params['trxnParams']['total_amount'] = $trxnParams['total_amount'];
self::updateFinancialAccounts($params, 'changePaymentInstrument');
}
else if (!CRM_Utils_System::isNull($params['contribution']->check_number) &&
elseif (!CRM_Utils_System::isNull($params['contribution']->check_number) &&
$params['contribution']->check_number != $params['prevContribution']->check_number
) {
// another special case when check number is changed, create new financial records
......@@ -3612,7 +3612,7 @@ WHERE con.id = {$contributionId}
if (!isset($params['financial_type_id'])) {
$params['financial_type_id'] = $prevContributionValue->financial_type_id;
}
else if (isset($params['financial_type_id']) && !array_key_exists($params['financial_type_id'], $taxRates)) {
elseif (isset($params['financial_type_id']) && !array_key_exists($params['financial_type_id'], $taxRates)) {
// Assisn tax Amount on update of contrbution
if (!empty($prevContributionValue->tax_amount)) {
$params['tax_amount'] = 'null';
......@@ -3648,7 +3648,7 @@ WHERE con.id = {$contributionId}
}
$params['total_amount'] = $params['total_amount'] + $params['tax_amount'];
}
else if (isset($params['api.line_item.create'])) {
elseif (isset($params['api.line_item.create'])) {
// Update total amount of contribution using lineItem
$taxAmountArray = array();
foreach ($params['api.line_item.create'] as $key => $value) {
......
......@@ -383,13 +383,13 @@ class CRM_Contribute_BAO_Query {
$query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1;
$query->_tables['civicrm_contribution_soft'] = $query->_whereTables['civicrm_contribution_soft'] = 1;
}
else if ($value == 'both_related') {
elseif ($value == 'both_related') {
$query->_where[$grouping][] = "contribution_search_scredit_combined.filter_id IS NOT NULL";
$query->_qill[$grouping][] = ts('Contributions OR Soft Credits? - Soft Credits with related Hard Credit');
$query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1;
$query->_tables['civicrm_contribution_soft'] = $query->_whereTables['civicrm_contribution_soft'] = 1;
}
else if ($value == 'both') {
elseif ($value == 'both') {
$query->_qill[$grouping][] = ts('Contributions OR Soft Credits? - Both');
$query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1;
$query->_tables['civicrm_contribution_soft'] = $query->_whereTables['civicrm_contribution_soft'] = 1;
......
......@@ -898,7 +898,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
$this->_params, $ufFields
);
}
else if (!empty($this->_membershipContactID) && $contactID != $this->_membershipContactID) {
elseif (!empty($this->_membershipContactID) && $contactID != $this->_membershipContactID) {
// this is an onbehalf renew case for inherited membership. For e.g a permissioned member of household,
// store current user id as related contact for later use for mailing / activity..
$this->_values['related_contact'] = $contactID;
......
......@@ -78,7 +78,7 @@ class CRM_Contribute_Form_Contribution_OnBehalfOf {
$form->_relatedOrganizationFound = TRUE;
}
}
else if (!empty($form->_employers)) {
elseif (!empty($form->_employers)) {
// not a renewal case and _employers list is not empty
$form->_relatedOrganizationFound = TRUE;
}
......
......@@ -423,7 +423,7 @@ class CRM_Contribute_Form_UpdateBilling extends CRM_Core_Form {
if ( $userID && $status) {
$session->setStatus($status, $msgTitle, $msgType);
}
else if (!$userID) {
elseif (!$userID) {
if ($status)
CRM_Utils_System::setUFMessage($status);
$result = (int) ($updateSubscription && isset($ctype));
......
......@@ -309,7 +309,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form {
if ( $userID && $status) {
CRM_Core_Session::setStatus($status, $msgTitle, $msgType);
}
else if (!$userID) {
elseif (!$userID) {
if ($status)
CRM_Utils_System::setUFMessage($status);
// keep result as 1, since we not displaying anything on the redirected page anyway
......
......@@ -353,7 +353,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
if ($context == 'advanced') {
$url = CRM_Utils_System::url('civicrm/contact/search/advanced', $extraParams);
}
else if ($searchContext) {
elseif ($searchContext) {
$url = CRM_Utils_System::url("civicrm/$searchContext/search", $extraParams);
}
else {
......
......@@ -402,7 +402,7 @@ class CRM_Core_BAO_ConfigSetting {
$config->imageUploadDir
);
}
else if ($config->userFramework == 'WordPress') {
elseif ($config->userFramework == 'WordPress') {
$url = preg_replace(
'|wp-content/plugins/civicrm/civicrm/|',
'',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment