Commit 0db6c3e1 authored by totten's avatar totten
Browse files

INFRA-132 - Put "else" and "catch" on new line

parent af321125
......@@ -166,7 +166,8 @@ WHERE modified_date IS NULL
CRM_Core_Transaction::addCallback(CRM_Core_Transaction::PHASE_POST_COMMIT, function(){
CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache");
});
} else {
}
else {
CRM_Core_DAO::singleValueQuery("TRUNCATE TABLE civicrm_acl_contact_cache");
}
}
......
......@@ -235,7 +235,8 @@ class CRM_Activity_Page_AJAX {
$rel['email'] = '';
$rel['source'] = 'caseRoles';
$caseRelationships[] = $rel;
} else {
}
else {
foreach($value as $clientRole) {
$relClient = array();
$relClient['relation'] = 'Client';
......
......@@ -179,7 +179,8 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
try {
CRM_Extension_System::singleton()->getManager()->uninstall(array($this->_key));
CRM_Core_Session::setStatus("", ts('Extension Uninstalled'), "success");
} catch (CRM_Extension_Exception_DependencyException $e) {
}
catch (CRM_Extension_Exception_DependencyException $e) {
// currently only thrown for payment-processor dependencies
CRM_Core_Session::setStatus(ts('Cannot uninstall this extension - there is at least one payment processor using the payment processor type provided by it.'), ts('Uninstall Error'), 'error');
}
......@@ -207,7 +208,8 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
));
if (! CRM_Utils_Array::value('is_error', $result, FALSE)) {
CRM_Core_Session::setStatus("", ts('Extension Upgraded'), "success");
} else {
}
else {
CRM_Core_Session::setStatus($result['error_message'], ts('Extension Upgrade Failed'), "error");
}
}
......
......@@ -124,7 +124,8 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
$apiRequest = \Civi\API\Request::create($fields['api_entity'], $fields['api_action'], array('version' => 3), NULL);
try {
$apiKernel->resolve($apiRequest);
} catch (\Civi\API\Exception\NotImplementedException $e) {
}
catch (\Civi\API\Exception\NotImplementedException $e) {
$errors['api_action'] = ts('Given API command is not defined.');
}
......
......@@ -415,7 +415,8 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
if ($this->_id && !array_key_exists('filter', $params)) {
if ($this->_gName == 'participant_role') {
$params['filter'] = 0;
} else {
}
else {
$params['filter'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'filter', 'id');
}
}
......
......@@ -91,7 +91,8 @@ class CRM_Admin_Form_Setting_Smtp extends CRM_Admin_Form_Setting {
if ($buttonName == $this->_testButtonName) {
if ($formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_DISABLED) {
CRM_Core_Session::setStatus(ts('You have selected "Disable Outbound Email". A test email can not be sent.'), ts("Email Disabled"), "error");
} elseif ( $formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB ) {
}
elseif ( $formValues['outBound_option'] == CRM_Mailing_Config::OUTBOUND_OPTION_REDIRECT_TO_DB ) {
CRM_Core_Session::setStatus(ts('You have selected "Redirect to Database". A test email can not be sent.'), ts("Email Disabled"), "error");
}
else {
......
......@@ -108,7 +108,8 @@ class CRM_Admin_Page_Admin extends CRM_Core_Page {
$adminPanel[$groupId]['show'] = $v['show'];
$adminPanel[$groupId]['hide'] = $v['hide'];
$adminPanel[$groupId]['title'] = $title;
} else {
}
else {
$adminPanel[$groupId] = array();
$adminPanel[$groupId]['show'] = '';
$adminPanel[$groupId]['hide'] = '';
......
......@@ -160,7 +160,8 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic {
foreach($keys as $key) {
try {
$obj = $mapper->keyToInfo($key);
} catch (CRM_Extension_Exception $ex) {
}
catch (CRM_Extension_Exception $ex) {
CRM_Core_Session::setStatus(ts('Failed to read extension (%1). Please refresh the extension list.', array(1 => $key)));
continue;
}
......@@ -298,7 +299,8 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic {
$extensionRow = (array) $obj;
try {
$extensionRow['path'] = $mapper->keyToBasePath($obj->key);
} catch (CRM_Extension_Exception $e) {
}
catch (CRM_Extension_Exception $e) {
$extensionRow['path'] = '';
}
$extensionRow['status'] = $manager->getStatus($obj->key);
......
......@@ -101,7 +101,8 @@ class CRM_Campaign_Form_Survey_Delete extends CRM_Core_Form {
CRM_Campaign_BAO_Survey::del($this->_surveyId);
CRM_Core_Session::setStatus('', ts("'%1' survey has been deleted.", array(1 => $this->_surveyTitle)), 'success');
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey'));
} else {
}
else {
CRM_Core_Error::fatal(ts('Delete action is missing expected survey ID.'));
}
}
......
......@@ -334,7 +334,8 @@ class CRM_Campaign_Page_DashBoard extends CRM_Core_Page {
if ($surveysData[$sid]['result_id']) {
$resultSet = '<a href= "javascript:displayResultSet( ' . $sid . ',' . "'" . $surveysData[$sid]['title'] . "'" . ', ' . $surveysData[$sid]['result_id'] . ' )" title="' . ts('view result set').'">' . ts('Result Set') . '</a>';
$surveysData[$sid]['result_id'] = $resultSet;
} else {
}
else {
$resultUrl = CRM_Utils_System::url("civicrm/survey/configure/results", "action=update&id={$sid}&reset=1");
$surveysData[$sid]['result_id'] = "<a href='{$resultUrl}' class='status-warning'>(" . ts('Incomplete. Click to configure result set.') . ')</a>';
}
......
......@@ -91,7 +91,8 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType {
protected function assignTestValue($fieldName, &$fieldDef, $counter) {
if ($fieldName == 'definition') {
$this->{$fieldName} = "<CaseType><name>TestCaseType{$counter}</name></CaseType>";
} else {
}
else {
parent::assignTestValue($fieldName, $fieldDef, $counter);
}
}
......
......@@ -144,7 +144,8 @@ class CRM_Case_PseudoConstant extends CRM_Core_PseudoConstant {
public static function caseType($column = 'title', $onlyActive = TRUE) {
if ($onlyActive) {
$condition = " is_active = 1 ";
} else {
}
else {
$condition = NULL;
}
$caseType = NULL;
......
......@@ -98,7 +98,8 @@ class CRM_Case_XMLRepository {
$fileXml = $this->retrieveFile($caseType);
if ($fileXml) {
$this->xml[$caseType] = $fileXml;
} else {
}
else {
return FALSE;
}
}
......
......@@ -381,7 +381,8 @@ WHERE (( contact_id_a = %1 AND contact_id_b = %2 AND is_permission_a_b = 1 ) OR
if ($checkSumValidationResult && $form && CRM_Utils_Request::retrieve('cs', 'String', $form, FALSE)) {
// 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) {
}
else if (($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);
......
......@@ -854,7 +854,8 @@ Group By componentId";
if (!in_array($field, $skipFields)){
if (isset($masterAddress->$field)) {
$values[$field] = $masterAddress->$field;
} else {
}
else {
$values[$field] = '';
}
}
......
......@@ -305,11 +305,13 @@ WHERE id IN ( $groupIDs )
if ($groupID == NULL) {
$invoked = TRUE;
} else if (is_array($groupID)) {
}
else if (is_array($groupID)) {
foreach ($groupID as $gid) {
unset(self::$_alreadyLoaded[$gid]);
}
} else if ($groupID && array_key_exists($groupID, self::$_alreadyLoaded)) {
}
else if ($groupID && array_key_exists($groupID, self::$_alreadyLoaded)) {
unset(self::$_alreadyLoaded[$groupID]);
}
......
......@@ -167,7 +167,8 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
if ($params) {
if (!empty($params['customSearchID'])) {
// this has not yet been implemented
} else {
}
else {
return CRM_Contact_BAO_Query::getWhereClause($params, NULL, $tables, $whereTables);
}
}
......
......@@ -88,7 +88,8 @@ class CRM_Contact_Form_Task_Delete extends CRM_Contact_Form_Task {
if ($cid) {
if (!CRM_Contact_BAO_Contact_Permission::allow($cid, CRM_Core_Permission::EDIT)) {
CRM_Core_Error::fatal(ts('You do not have permission to delete this contact. Note: you can delete contacts if you can edit them.'));
} elseif (CRM_Contact_BAO_Contact::checkDomainContact($cid)) {
}
elseif (CRM_Contact_BAO_Contact::checkDomainContact($cid)) {
CRM_Core_Error::fatal(ts('This contact is a special one for the contact information associated with the CiviCRM installation for this domain. No one is allowed to delete it because the information is used for special system purposes.'));
}
......
......@@ -415,7 +415,8 @@ class CRM_Contact_Form_Task_SMSCommon {
}
$status .= '</ul>';
CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array('count' => count($sent), 'plural' => '%count Messages Not Sent')), 'info');
} else {
}
else {
//Display the name and number of contacts for those sms is not sent.
$smsNotSent = array_diff_assoc($allContactIds, $contactIds);
......
......@@ -227,7 +227,8 @@ class CRM_Contact_Page_View extends CRM_Core_Page {
// Check if this is default domain contact CRM-10482
if (CRM_Contact_BAO_Contact::checkDomainContact($this->_contactId)) {
$this->assign('domainContact', TRUE);
} else {
}
else {
$this->assign('domainContact', FALSE);
}
......
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