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");
}
}
$rel['email'] = '';
$rel['source'] = 'caseRoles';
$caseRelationships[] = $rel;
- } else {
+ }
+ else {
foreach($value as $clientRole) {
$relClient = array();
$relClient['relation'] = 'Client';
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');
}
));
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");
}
}
$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.');
}
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');
}
}
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 {
$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'] = '';
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;
}
$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);
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.'));
}
}
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>';
}
protected function assignTestValue($fieldName, &$fieldDef, $counter) {
if ($fieldName == 'definition') {
$this->{$fieldName} = "<CaseType><name>TestCaseType{$counter}</name></CaseType>";
- } else {
+ }
+ else {
parent::assignTestValue($fieldName, $fieldDef, $counter);
}
}
public static function caseType($column = 'title', $onlyActive = TRUE) {
if ($onlyActive) {
$condition = " is_active = 1 ";
- } else {
+ }
+ else {
$condition = NULL;
}
$caseType = NULL;
$fileXml = $this->retrieveFile($caseType);
if ($fileXml) {
$this->xml[$caseType] = $fileXml;
- } else {
+ }
+ else {
return FALSE;
}
}
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);
if (!in_array($field, $skipFields)){
if (isset($masterAddress->$field)) {
$values[$field] = $masterAddress->$field;
- } else {
+ }
+ else {
$values[$field] = '';
}
}
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]);
}
if ($params) {
if (!empty($params['customSearchID'])) {
// this has not yet been implemented
- } else {
+ }
+ else {
return CRM_Contact_BAO_Query::getWhereClause($params, NULL, $tables, $whereTables);
}
}
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.'));
}
}
$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);
// 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);
}
$query->_qill[$grouping][] = ts('Contributions OR Soft Credits? - Soft Credits Only');
$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') {
+ }
+ else if ($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') {
+ }
+ else if ($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;
if (in_array(self::$_contribOrSoftCredit, array("only_scredits", "both_related", "both"))) {
$from .= " $side JOIN civicrm_contact civicrm_contact_d ON (civicrm_contribution.contact_id = civicrm_contact_d.id )
AND contribution_search_scredit_combined.scredit_id IS NOT NULL";
- } else {
+ }
+ else {
$from .= " $side JOIN civicrm_contact civicrm_contact_d ON (civicrm_contribution_soft.contact_id = civicrm_contact_d.id )";
}
break;
if ($billingModePaymentProcessors && count($this->_paymentProcessors) == $billingModePaymentProcessors) {
$allAreBillingModeProcessors = TRUE;
- } else {
+ }
+ else {
$allAreBillingModeProcessors = FALSE;
}
$unit .= "(s)";
}
$form->assign('frequency_unit', $unit);
- } else {
+ }
+ else {
$form->assign('one_frequency_unit', FALSE);
$units = array();
$frequencyUnits = CRM_Core_OptionGroup::values('recur_frequency_units');
if ($this->_membershipBlock['is_separate_payment'] && !empty($params['separate_amount'])) {
$this->set('amount', $params['separate_amount']);
- } else {
+ }
+ else {
$this->set('amount', $params['amount']);
}
// if _membershipContactID belongs to employers list, we can say:
$form->_relatedOrganizationFound = TRUE;
}
- } else if (!empty($form->_employers)) {
+ }
+ else if (!empty($form->_employers)) {
// not a renewal case and _employers list is not empty
$form->_relatedOrganizationFound = TRUE;
}
}
if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$this->assign('lineItem', $this->_lineItem);
- } else {
+ }
+ else {
if (is_array($membershipTypeID)) {
$membershipTypeID = current($membershipTypeID);
}
$this->assign('membershipContactID', $this->_membershipContactID);
$this->assign('membershipContactName', $employers[$this->_membershipContactID]['name']);
$validMembership = TRUE;
- } else {
+ }
+ else {
$membershipType = new CRM_Member_BAO_MembershipType();
$membershipType->id = $membership->membership_type_id;
if ($membershipType->find(TRUE)) {
$yearlyChart = TRUE;
if (!empty($config->fiscalYearStart) && ($config->fiscalYearStart['M'] !== 1 || $config->fiscalYearStart['d'] !== 1)) {
$values['xLabelAngle'] = 45;
- } else {
+ }
+ else {
$values['xLabelAngle'] = 0;
}
}
$defaults['product_id'] = $dao->product_id;
$defaults['financial_type_id'] = $dao->financial_type_id;
$defaults['weight'] = $dao->weight;
- } else {
+ }
+ else {
$dao = new CRM_Contribute_DAO_Product();
$dao->id = key($this->_products);
$dao->find(TRUE);
$params['image'] = $this->_resizeImage($imageFile, "_full", 200, 200);
$params['thumbnail'] = $this->_resizeImage($imageFile, "_thumb", 50, 50);
}
- } else {
+ }
+ else {
$error = TRUE;
$params['image'] = $config->resourceBase . 'i/contribute/default_premium.jpg';
$params['thumbnail'] = $config->resourceBase . 'i/contribute/default_premium_thumb.jpg';
}
- } elseif ($value == 'thumbnail') {
+ }
+ elseif ($value == 'thumbnail') {
$params['image'] = $params['imageUrl'];
$params['thumbnail'] = $params['thumbnailUrl'];
- } elseif ($value == 'default_image') {
+ }
+ elseif ($value == 'default_image') {
$url = parse_url($config->userFrameworkBaseURL);
$params['image'] = $config->resourceBase . 'i/contribute/default_premium.jpg';
$params['thumbnail'] = $config->resourceBase . 'i/contribute/default_premium_thumb.jpg';
- } else {
+ }
+ else {
$params['image'] = "";
$params['thumbnail'] = "";
}
$image = imagecreatetruecolor($width, $height);
if($imageInfo['mime'] == 'image/gif') {
$source = imagecreatefromgif($filename);
- } elseif($imageInfo['mime'] == 'image/png') {
+ }
+ elseif($imageInfo['mime'] == 'image/png') {
$source = imagecreatefrompng($filename);
- } else {
+ }
+ else {
$source = imagecreatefromjpeg($filename);
}
$contactIds = $contributionContactIds = array();
$query->_rowCountClause = " count(civicrm_contribution.id)";
$query->_groupByComponentClause = " GROUP BY contribution_search_scredit_combined.id, contribution_search_scredit_combined.contact_id, contribution_search_scredit_combined.scredit_id ";
- } else {
+ }
+ else {
$query->_distinctComponentClause = ' civicrm_contribution.id';
$query->_groupByComponentClause = ' GROUP BY civicrm_contribution.id ';
}
$userID = $session->get('userID');
if ( $userID && $status) {
$session->setStatus($status, $msgTitle, $msgType);
- } else if (!$userID) {
+ }
+ else if (!$userID) {
if ($status)
CRM_Utils_System::setUFMessage($status);
$result = (int) ($updateSubscription && isset($ctype));
$userID = $session->get('userID');
if ( $userID && $status) {
CRM_Core_Session::setStatus($status, $msgTitle, $msgType);
- } else if (!$userID) {
+ }
+ else if (!$userID) {
if ($status)
CRM_Utils_System::setUFMessage($status);
// keep result as 1, since we not displaying anything on the redirected page anyway
if ($this->_includeSoftCredits) {
$this->_query->_rowCountClause = " count(civicrm_contribution.id)";
$this->_query->_groupByComponentClause = " GROUP BY contribution_search_scredit_combined.id, contribution_search_scredit_combined.contact_id, contribution_search_scredit_combined.scredit_id ";
- } else {
+ }
+ else {
$this->_query->_distinctComponentClause = " civicrm_contribution.id";
$this->_query->_groupByComponentClause = " GROUP BY civicrm_contribution.id ";
}
if ($isSmartGroup) {
$join[] = "INNER JOIN civicrm_group_contact_cache grp ON {$contactField} = grp.contact_id";
$where[] = "grp.group_id IN ({$actionSchedule->group_id})";
- } else {
+ }
+ else {
$join[] = "INNER JOIN civicrm_group_contact grp ON {$contactField} = grp.contact_id AND grp.status = 'Added'";
$where[] = "grp.group_id IN ({$actionSchedule->group_id})";
}
if ($isSmartGroup) {
$addGroup = " INNER JOIN civicrm_group_contact_cache grp ON c.id = grp.contact_id";
$addWhere = " grp.group_id IN ({$actionSchedule->group_id})";
- } else {
+ }
+ else {
$addGroup = " INNER JOIN civicrm_group_contact grp ON c.id = grp.contact_id AND grp.status = 'Added'";
$addWhere = " grp.group_id IN ({$actionSchedule->group_id})";
}
if (!empty($form->_bltID) && array_key_exists("email-{$form->_bltID}", $fields)) {
// this is a transaction related page
$emailName = 'email-' . $form->_bltID;
- } else {
+ }
+ else {
// find the email field in a profile page
foreach ($fields as $name => $dontCare) {
if (substr($name, 0, 5) == 'email') {
else {
$result["{$dao->id}"]["{$fieldID}"] = $dao->$fieldName;
}
- } else {
+ }
+ else {
$result["{$fieldID}_{$dao->id}"] = $dao->$fieldName;
}
}
LEFT JOIN civicrm_entity_file AS CEF ON ( CEF.file_id = CF.id )
WHERE CF.id = %2";
- } else {
+ }
+ else {
$sql = "
SELECT CF.id as cfID,
CF.uri as uri,
$domain->find(TRUE);
if ($domain->config_backend) {
$values = unserialize($domain->config_backend);
- } else {
+ }
+ else {
$values = array();
}
$spec = self::getSettingSpecification(NULL, array('name' => $name), $domainID);
if ($configTemplate) {
echo "Generating civicrm.config.php\n";
copy($configTemplate, '../civicrm.config.php');
- } else {
+ }
+ else {
throw new Exception("Failed to locate template for civicrm.config.php");
}
}
if (is_a($task, 'CRM_Core_CodeGen_ITask')) {
$task->setConfig($this);
$task->run();
- } else {
+ }
+ else {
echo "Bad news: we tried to run a codegen task of an unrecognized type: {$component}\n";
exit();
}
$this->beautifier->setOutputFile($outpath);
$this->beautifier->process();
$this->beautifier->save();
- } else {
+ }
+ else {
file_put_contents($outpath, $renderedContents);
}
}
$this->userPermissionClass->upgradePermissions(
CRM_Core_Permission::basicPermissions()
);
- } else {
+ }
+ else {
// Cannot store permissions -- warn if any modules require them
$modules_with_perms = array();
foreach ($module_files as $module_file) {
if (!defined('CIVICRM_DSN')) {
if (function_exists('mysql_real_escape_string')) {
return mysql_real_escape_string($string);
- } else {
+ }
+ else {
throw new CRM_Core_Exception("Cannot generate SQL. \"mysql_real_escape_string\" is missing. Have you installed PHP \"mysql\" extension?");
}
}
if ($FKClassName != NULL) {
$object->assignTestFK($fieldName, $fieldDef, $params);
continue;
- } else {
+ }
+ else {
$object->assignTestValue($fieldName, $fieldDef, $counter);
}
}
public static function handleUnhandledException($exception) {
try {
CRM_Utils_Hook::unhandledException($exception);
- } catch (Exception $other) {
+ }
+ catch (Exception $other) {
// if the exception-handler generates an exception, then that sucks! oh, well. carry on.
CRM_Core_Error::debug_var('handleUnhandledException_nestedException', self::formatTextException($other));
}
if ( defined( 'CIVICRM_DEBUG_LOG_QUERY' ) ) {
if ( CIVICRM_DEBUG_LOG_QUERY == 'backtrace' ) {
CRM_Core_Error::backtrace( $string, TRUE );
- } else if ( CIVICRM_DEBUG_LOG_QUERY ) {
+ }
+ else if ( CIVICRM_DEBUG_LOG_QUERY ) {
CRM_Core_Error::debug_var( 'Query', $string, FALSE, TRUE );
}
}
$ei = $ei->getCause();
}
$msg .= $e->toHtml();
- } else {
+ }
+ else {
$msg .= '<p><b>' . get_class($e) . ': "' . htmlentities($e->getMessage()) . '"</b></p>';
$msg .= '<pre>' . htmlentities(self::formatBacktrace($e->getTrace())) . '</pre>';
}
if ($displayTime) {
$this->addDateTime($name . $from, $label, $required, array('formatType' => $dateFormat));
$this->addDateTime($name . $to, ts('To:'), $required, array('formatType' => $dateFormat));
- } else {
+ }
+ else {
$this->addDate($name . $from, $label, $required, array('formatType' => $dateFormat));
$this->addDate($name . $to, ts('To:'), $required, array('formatType' => $dateFormat));
}
if (!$options) {
$targetField->setAttribute('placeholder', $targetField->getAttribute('data-none-prompt'));
}
- } else {
+ }
+ else {
$targetField->setAttribute('placeholder', $targetField->getAttribute('data-empty-prompt'));
$targetField->setAttribute('disabled', 'disabled');
}
try {
$init = IDS_Init::init($configFile);
$ids = new IDS_Monitor($_REQUEST, $init);
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
// might be an old stale copy of Config.IDS.ini
// lets try to rebuild it again and see if it works
$configFile = self::createConfigFile(TRUE);
self::hackStandalone($args);
$item = self::getItem($args);
return self::runItem($item);
- } else {
+ }
+ else {
// Symfony-based invocation path
require_once CIVICRM_SYMFONY_PATH . '/app/bootstrap.php.cache';
require_once CIVICRM_SYMFONY_PATH . '/app/AppKernel.php';
if (preg_match(':^text/html:', $response->headers->get('Content-Type'))) {
// let the CMS handle the trappings
return $response->getContent();
- } else {
+ }
+ else {
$response->send();
exit();
}
if (is_array($args)) {
// get the menu items
$path = implode('/', $args);
- } else {
+ }
+ else {
$path = $args;
}
$item = CRM_Core_Menu::get($path);
if ($declarations !== NULL) {
$this->declarations = self::cleanDeclarations($declarations);
- } else {
+ }
+ else {
$this->declarations = NULL;
}
}
$this->onApiError($dao->entity_type, 'getsingle', $params, $result);
}
return $result;
- } else {
+ }
+ else {
return NULL;
}
}
foreach ($decls as $moduleName => $todos) {
if (isset($this->moduleIndex[TRUE][$moduleName])) {
$this->reconcileEnabledModule($this->moduleIndex[TRUE][$moduleName], $todos);
- } elseif (isset($this->moduleIndex[FALSE][$moduleName])) {
+ }
+ elseif (isset($this->moduleIndex[FALSE][$moduleName])) {
// do nothing -- module should get swept up later
- } else {
+ }
+ else {
throw new Exception("Entity declaration references invalid or inactive module name [$moduleName]");
}
}
// update existing entity; remove from $todos
$this->updateExistingEntity($dao, $todos[$dao->name]);
unset($todos[$dao->name]);
- } else {
+ }
+ else {
// remove stale entity; not in $todos
$this->removeStaleEntity($dao);
}
$trxn_id = str_replace( 'test', '', $trxn_id );
$trxn_id = intval($trxn_id) + 1;
$params['trxn_id'] = sprintf('test%08d', $trxn_id);
- } else {
+ }
+ else {
$params['trxn_id'] = $eWAYResponse->TransactionNumber();
}
*/
}
if ($targetDao->option_group_id == $this->getTargetOptionGroupId()) {
return parent::findReferences($targetDao);
- } else {
+ }
+ else {
return NULL;
}
}
}
if ($targetDao->option_group_id == $this->getTargetOptionGroupId()) {
return parent::getReferenceCount($targetDao);
- } else {
+ }
+ else {
return NULL;
}
}
$filePath = $this->getPath($ext, $file);
if ($filePath && is_readable($filePath)) {
$stringsByFile[$file] = CRM_Utils_JS::parseStrings(file_get_contents($filePath));
- } else {
+ }
+ else {
$stringsByFile[$file] = array();
}
$this->cache->set($ext, $stringsByFile);
$this->pushScope($vars);
try {
$result = $this->fetch($resource_name);
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
// simulate try { ... } finally { ... }
$this->popScope();
throw $e;
public function addTemplateDir($path) {
if ( is_array( $this->template_dir ) ) {
array_unshift( $this->template_dir, $path );
- } else {
+ }
+ else {
$this->template_dir = array( $path, $this->template_dir );
}
if ($region) {
$result = $region->render($content, CRM_Utils_Array::value('allowCmsOverride', $params, TRUE));
return $result;
- } else {
+ }
+ else {
return $content;
}
}
if (array_key_exists('file', $params)) {
$res->addScriptFile($params['ext'], $params['file'], $params['weight'], $params['region']);
- } elseif (array_key_exists('url', $params)) {
+ }
+ elseif (array_key_exists('url', $params)) {
$res->addScriptUrl($params['url'], $params['weight'], $params['region']);
- } else {
+ }
+ else {
CRM_Core_Error::debug_var('crmScript_params', $params);
throw new Exception("crmScript requires url or ext+file");
}
if (array_key_exists('file', $params)) {
$res->addStyleFile($params['ext'], $params['file'], $params['weight'], $params['region']);
- } elseif (array_key_exists('url', $params)) {
+ }
+ elseif (array_key_exists('url', $params)) {
$res->addStyleUrl($params['url'], $params['weight'], $params['region']);
- } else {
+ }
+ else {
CRM_Core_Error::debug_var('crmStyle_params', $params);
throw new Exception("crmStyle requires url or ext+file");
}
public function run($callable) {
try {
$callable($this);
- } catch (Exception $ex) {
+ }
+ catch (Exception $ex) {
$this->rollback()->commit();
throw $ex;
}
$urlGroupId = CRM_Utils_Request::retrieve('groupID', 'Positive', CRM_Core_DAO::$_nullObject);
if ( isset($typeCheck) && $urlGroupId) {
$form->_groupID = $urlGroupId;
- } else {
+ }
+ else {
$form->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $form);
}
if ($other_sub_types = CRM_Utils_array::value('contact_sub_type', $migrationInfo['other_details'])) {
if ($main_sub_types = CRM_Utils_array::value('contact_sub_type', $migrationInfo['main_details'])) {
$submitted['contact_sub_type'] = array_unique( array_merge($main_sub_types, $other_sub_types));
- } else {
+ }
+ else {
$submitted['contact_sub_type'] = $other_sub_types;
}
}
if ($currentEmloyerId = CRM_Utils_Array::value('current_employer_id', $submitted)) {
if (!CRM_Utils_System::isNull($currentEmloyerId)) {
$submitted['current_employer'] = $submitted['current_employer_id'];
- } else {
+ }
+ else {
$submitted['current_employer'] = '';
}
unset($submitted['current_employer_id']);
}
}
}
- } else {
+ }
+ else {
$imgFile = 'No template directories defined anywhere??';
}
if ($this->_quickConfig && !empty($params['total_amount']) &&
$params['status_id'] != array_search('Partially paid', $participantStatus)) {
$params['fee_amount'] = $params['total_amount'];
- } else {
+ }
+ else {
//fix for CRM-3086
$params['fee_amount'] = $params['amount'];
}
if (array_key_exists('email-5', $this->_params)) {
$mail = 'email-5';
- } else {
+ }
+ else {
foreach ($this->_params as $name => $dontCare) {
if (substr($name, 0, 5) == 'email') {
$mail = $name;
if ($participantNum) {
$prefix1 = 'additional';
$prefix2 = 'additional_';
- } else {
+ }
+ else {
$prefix1 = '';
$prefix2 = '';
}
if ($billingModePaymentProcessors && count($this->_paymentProcessors) == $billingModePaymentProcessors) {
$allAreBillingModeProcessors = TRUE;
- } else {
+ }
+ else {
$allAreBillingModeProcessors = FALSE;
}
&& !$this->_values['event']['is_confirm_enabled']
) {
$buttonLabel = ts('Register >>');
- } else {
+ }
+ else {
$buttonLabel = ts('Continue >>');
}
}
if (in_array($this->_value, $events)) {
return true;
- } else {
+ }
+ else {
return false;
}
break;
$discountId= CRM_Core_BAO_Discount::findSet($this->_id, 'civicrm_event');
if ($discountId) {
$priceSetId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Discount', $discountId, 'price_set_id');
- } else {
+ }
+ else {
$priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $this->_id);
}
try {
$newInfo = CRM_Extension_Info::loadFromFile($filename);
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
CRM_Core_Session::setStatus(ts('Failed reading data from %1 during installation', array(1 => $filename)), ts('Installation Error'), 'error');
return FALSE;
}
$statuses = $this->getStatuses();
if (array_key_exists($key, $statuses)) {
return $statuses[$key];
- } else {
+ }
+ else {
return self::STATUS_UNKNOWN;
}
}
try {
$path = $this->fullContainer->getPath($dao->full_name);
$codeExists = !empty($path) && is_dir($path);
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$codeExists = FALSE;
}
if ($dao->is_active) {
$this->statuses[$dao->full_name] = $codeExists ? self::STATUS_INSTALLED : self::STATUS_INSTALLED_MISSING;
- } else {
+ }
+ else {
$this->statuses[$dao->full_name] = $codeExists ? self::STATUS_DISABLED : self::STATUS_DISABLED_MISSING;
}
}
$info = $this->mapper->keyToInfo($key); // throws Exception
if (array_key_exists($info->type, $this->typeManagers)) {
return array($info, $this->typeManagers[$info->type]);
- } else {
+ }
+ else {
throw new CRM_Extension_Exception("Unrecognized extension type: " . $info->type);
}
}
if ($info) {
if (array_key_exists($info->type, $this->typeManagers)) {
return array($info, $this->typeManagers[$info->type]);
- } else {
+ }
+ else {
throw new CRM_Extension_Exception("Unrecognized extension type: " . $info->type);
}
- } else {
+ }
+ else {
throw new CRM_Extension_Exception("Failed to reconstruct missing extension: " . $key);
}
}
$dao->file = $info->file;
$dao->is_active = 1;
return (bool) ($dao->update());
- } else {
+ }
+ else {
return $this->_createExtensionEntry($info);
}
}
if ($dao->find(TRUE)) {
if (CRM_Core_BAO_Extension::del($dao->id)) {
CRM_Core_Session::setStatus(ts('Selected option value has been deleted.'), ts('Deleted'), 'success');
- } else {
+ }
+ else {
throw new CRM_Extension_Exception("Failed to remove extension entry");
}
} // else: post-condition already satisified
if ($dao->find(TRUE)) {
$info = new CRM_Extension_Info($dao->full_name, $dao->type, $dao->name, $dao->label, $dao->file);
return $info;
- } else {
+ }
+ else {
return NULL;
}
}
private function callHook(CRM_Extension_Info $info, $hookName) {
try {
$file = $this->mapper->keyToPath($info->key);
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
return;
}
if (!file_exists($file)) {
if (! file_exists($file)) {
CRM_Core_Session::setStatus(ts('Failed to load file (%3) for payment processor (%1) while running "%2"', array(1 => $info->key, 2 => $method, 3 => $file)), '', 'error');
return;
- } else {
+ }
+ else {
require_once $file;
}
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
CRM_Core_Session::setStatus(ts('Failed to determine file path for payment processor (%1) while running "%2"', array(1 => $info->key, 2 => $method)), '', 'error');
return;
}
$this->cacheKey = $cacheKey;
if ($civicrmUrl) {
$this->civicrmUrl = rtrim($civicrmUrl, '/');
- } else {
+ }
+ else {
$config = CRM_Core_Config::singleton();
$this->civicrmUrl = rtrim($config->resourceBase, '/');
}
if ($civicrmPath) {
$this->civicrmPath = rtrim($civicrmPath, '/');
- } else {
+ }
+ else {
global $civicrm_root;
$this->civicrmPath = rtrim($civicrm_root, '/');
}
if ($fresh || !array_key_exists($key, $this->infos)) {
try {
$this->infos[$key] = CRM_Extension_Info::loadFromFile($this->container->getPath($key) . DIRECTORY_SEPARATOR . CRM_Extension_Info::FILENAME);
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
// file has more detailed info, but we'll fallback to DB if it's missing -- DB has enough info to uninstall
$this->infos[$key] = CRM_Extension_System::singleton()->getManager()->createInfoFromDB($key);
if (!$this->infos[$key]) {
'prefix' => $dao->file,
'filePath' => $this->keyToPath($dao->full_name),
);
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
// Putting a stub here provides more consistency
// in how getActiveModuleFiles when racing between
// dirty file-removals and cache-clears.
if (! self::$singleton || $fresh) {
if (self::$singleton) {
self::$singleton = new CRM_Extension_System(self::$singleton->parameters);
- } else {
+ }
+ else {
self::$singleton = new CRM_Extension_System();
}
}
if ($this->defaultContainer === NULL) {
if ($this->parameters['extensionsDir']) {
$this->defaultContainer = new CRM_Extension_Container_Default($this->parameters['extensionsDir'], $this->parameters['extensionsURL'], $this->getCache(), 'default');
- } else {
+ }
+ else {
$this->defaultContainer = FALSE;
}
}
'group' => 'ext',
'prefetch' => TRUE,
));
- } else {
+ }
+ else {
$this->cache = new CRM_Utils_Cache_ArrayCache(array());
}
}
if ($pcomponent == 'event') {
$this->_entityTable = 'civicrm_event';
$isShare = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_entityId, 'is_share');
- } else {
+ }
+ else {
$isShare = CRM_Utils_Array::value('is_share', $values);
}
// Tell Form.tpl whether to include SocialNetwork.tpl for social media sharing
$this->assign('linkTextUrl', $linkTextUrl);
$this->assign('linkText', $linkText);
}
- } else if ( $this->_entityTable == 'civicrm_event' ) {
+ }
+ else if ( $this->_entityTable == 'civicrm_event' ) {
// If this is tell a friend after registering for an event, give donor link to create their own fundraising page
require_once 'CRM/PCP/BAO/PCP.php';
if ( $linkText = CRM_PCP_BAO_PCP::getPcpBlockStatus( $defaults['entity_id'], $defaults['entity_table'] ) ) {
}
elseif (substr($table, 0, 14) == 'civicrm_value_') {
list($titles[$table], $values[$table]) = $this->titlesAndValuesForCustomDataTable($table);
- } else {
+ }
+ else {
$titles[$table] = $values[$table] = array();
}
}
if ($civiTableSpecs[$col]['DATA_TYPE'] != CRM_Utils_Array::value('DATA_TYPE', $logTableSpecs[$col])) {
// if data-type is different, surely consider the column
$diff['MODIFY'][] = $col;
- } else if ($civiTableSpecs[$col]['IS_NULLABLE'] != CRM_Utils_Array::value('IS_NULLABLE', $logTableSpecs[$col]) &&
+ }
+ else if ($civiTableSpecs[$col]['IS_NULLABLE'] != CRM_Utils_Array::value('IS_NULLABLE', $logTableSpecs[$col]) &&
$logTableSpecs[$col]['IS_NULLABLE'] == 'NO') {
// if is-null property is different, and log table's column is NOT-NULL, surely consider the column
$diff['MODIFY'][] = $col;
- } else if ($civiTableSpecs[$col]['COLUMN_DEFAULT'] != CRM_Utils_Array::value('COLUMN_DEFAULT', $logTableSpecs[$col]) &&
+ }
+ else if ($civiTableSpecs[$col]['COLUMN_DEFAULT'] != CRM_Utils_Array::value('COLUMN_DEFAULT', $logTableSpecs[$col]) &&
!strstr($civiTableSpecs[$col]['COLUMN_DEFAULT'], 'TIMESTAMP')) {
// if default property is different, and its not about a timestamp column, consider it
$diff['MODIFY'][] = $col;
'return' => array("msg_html", "id", "msg_title", "msg_subject"),
'id' => array('>' => 58),
));
- } else {
+ }
+ else {
// CiviMail UI
$emailAdd = civicrm_api3('Email', 'get', array(
'sequential' => 1,
if (isset($isArchived)) {
if ($isArchived) {
$clauses[] = "civicrm_mailing.is_archived = 1";
- } else {
+ }
+ else {
$clauses[] = "(civicrm_mailing.is_archived IS NULL OR civicrm_mailing.is_archived = 0)";
}
}
$month = substr($membershipTypeDetails['fixed_period_start_day'], 0, strlen($membershipTypeDetails['fixed_period_start_day']) - 2);
$day = substr($membershipTypeDetails['fixed_period_start_day'], -2);
$year += 1;
- } else {
+ }
+ else {
$year = $year + ($numRenewTerms * $membershipTypeDetails['duration_interval']);
}
break;
if (isset($value['tax_amount']) && isset($value['tax_rate'])) {
if (isset($dataArray[$value['tax_rate']])) {
$dataArray[$value['tax_rate']] = $dataArray[$value['tax_rate']] + CRM_Utils_Array::value('tax_amount', $value);
- } else {
+ }
+ else {
$dataArray[$value['tax_rate']] = CRM_Utils_Array::value('tax_amount', $value);
}
}
if ( $customFields[$customFieldID]['data_type'] == 'Date' ) {
CRM_Contact_Import_Parser_Contact::formatCustomDate($params, $formatted, $dateType, $key);
unset($params[$key]);
- } else if ( $customFields[$customFieldID]['data_type'] == 'Boolean' ) {
+ }
+ else if ( $customFields[$customFieldID]['data_type'] == 'Boolean' ) {
$params[$key] = CRM_Utils_String::strtoboolstr($val);
}
}
( strtolower($customValue) == strtolower(trim($v1)) )) {
if ( $type == 'CheckBox' ) {
$values[$key][$customValue] = 1;
- } else {
+ }
+ else {
$values[$key][] = $customValue;
}
}
if (CRM_Utils_Array::value( $index, CRM_Utils_Array::value('option_financial_type_id', $params))) {
$options['financial_type_id'] = $params['option_financial_type_id'][$index];
- } elseif (!empty($params['financial_type_id'])) {
+ }
+ elseif (!empty($params['financial_type_id'])) {
$options['financial_type_id'] = $params['financial_type_id'];
}
if ($opIds = CRM_Utils_Array::value('option_id', $params)) {
if ($opId = CRM_Utils_Array::value($index, $opIds)) {
$optionsIds['id'] = $opId;
- } else {
+ }
+ else {
$optionsIds['id'] = NULL;
}
}
if (empty($noneSelectedPriceFields)) {
$error['_qf_default'] = ts('Please select at least one option from price set.');
}
- } else {
+ }
+ else {
$error['_qf_default'] = ts('Please select at least one option from price set.');
}
}
if ($this->_multiRecord) {
if ($this->_multiRecord != CRM_Core_Action::ADD) {
$this->_recordId = CRM_Utils_Request::retrieve('recordId', 'Positive', $this);
- } else {
+ }
+ else {
$this->_recordId = NULL;
$this->set('recordId', NULL);
}
CRM_Core_Error::fatal(ts('The requested Profile (gid=%1) requires record id while performing this action',
array(1 => $this->_gid)
));
- } elseif (empty($this->_multiRecordFields)) {
+ }
+ elseif (empty($this->_multiRecordFields)) {
CRM_Core_Error::fatal(ts('No Multi-Record Fields configured for this profile (gid=%1)',
array(1 => $this->_gid)
));
if (array_key_exists($this->_recordId, $getValues)) {
$this->_recordExists = TRUE;
- } else {
+ }
+ else {
$this->_recordExists = FALSE;
if ($this->_multiRecord & CRM_Core_Action::UPDATE) {
CRM_Core_Session::setStatus(ts('Note: The record %1 doesnot exists. Upon save a new record will be create', array(1 => $this->_recordId)), ts('Record doesnot exist'), 'alert');
}
}
- } elseif (!empty($this->_multiRecordFields)
+ }
+ elseif (!empty($this->_multiRecordFields)
&& (!$this->_multiRecord || !in_array($this->_multiRecord, array(CRM_Core_Action::DELETE, CRM_Core_Action::UPDATE)) )) {
CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header');
//multirecord listing page
if ($this->_multiRecord && !empty($this->_multiRecordFields)) {
$this->_fields = $this->_multiRecordFields;
$this->_multiRecordProfile = TRUE;
- } elseif ($this->_multiRecord && empty($this->_multiRecordFields)) {
+ }
+ elseif ($this->_multiRecord && empty($this->_multiRecordFields)) {
CRM_Core_Session::setStatus(ts('This feature is not currently available.'), ts('Sorry'), 'error');
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm', 'reset=1'));
}
$defaultValues = CRM_Core_BAO_CustomValueTable::getEntityValues($this->_id, NULL, $fieldIds, TRUE);
if ($this->_recordExists == TRUE) {
$defaultValues = $defaultValues[$this->_recordId];
- } else {
+ }
+ else {
$defaultValues = NULL;
}
}
$this->_mode,
$value
);
- } else {
+ }
+ else {
$this->_defaults[$name] = "";
}
}
if ($this->_multiRecord && $this->_customGroupTitle) {
$groupTitle = ($this->_multiRecord & CRM_Core_Action::UPDATE) ? 'Edit ' . $this->_customGroupTitle . ' Record' : $this->_customGroupTitle;
- } else {
+ }
+ else {
$groupTitle = $this->_ufGroup['title'];
}
CRM_Utils_System::setTitle($groupTitle);
$copyFields = $fields;
CRM_Core_BAO_UFGroup::shiftMultiRecordFields($copyFields, $multiRecordFields);
$fieldKey = key($multiRecordFields);
- } else {
+ }
+ else {
$fieldKey = key($fields);
}
if ($fieldID = CRM_Core_BAO_CustomField::getKeyID($fieldKey)) {
$fieldId = CRM_Core_BAO_CustomField::getKeyID($fieldDetail['name']);
$customGroupDetails = CRM_Core_BAO_CustomGroup::getGroupTitles(array($fieldId));
$multiRecTitle = $customGroupDetails[$fieldId]['groupTitle'];
- } else {
+ }
+ else {
$title = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $this->_gid, 'title');
}
if (!$isOK) {
$exception = new Exception('Task returned false');
}
- } catch (Exception$e) {
+ }
+ catch (Exception$e) {
$isOK = FALSE;
$exception = $e;
}
if (! $instanceID) {
if ($reportID = CRM_Utils_Array::value('report_id', $params)) {
$instance->report_id = $reportID;
- } else if ($instanceID) {
+ }
+ else if ($instanceID) {
$instance->report_id = CRM_Report_Utils_Report::getValueFromUrl($instanceID);
- } else {
+ }
+ else {
// just take it from current url
$instance->report_id = CRM_Report_Utils_Report::getValueFromUrl();
}
$count++;
$numRows++;
}
- } elseif ($this->_params['id_op'] == 'notin') {
+ }
+ elseif ($this->_params['id_op'] == 'notin') {
$events = CRM_Event_PseudoConstant::event(NULL, NULL,
"is_template = 0"
);
if ($instanceID && !$isNew) {
// updating existing instance
$statusMsg = ts('"%1" report has been updated.', array(1 => $instance->title));
- } elseif ($form->getVar('_id') && $isNew) {
+ }
+ elseif ($form->getVar('_id') && $isNew) {
$statusMsg = ts('Your report has been successfully copied as "%1". You are currently viewing the new copy.', array(1 => $instance->title));
- } else {
+ }
+ else {
$statusMsg = ts('"%1" report has been successfully created. You are currently viewing the new report instance.', array(1 => $instance->title));
}
CRM_Core_Session::setStatus($statusMsg);
$this->assign('reportUrl', $reportUrl);
if ($this->ovID) {
$this->assign('title', $this->title);
- } else {
+ }
+ else {
CRM_Utils_System::setTitle(ts('%1 Reports', array(1 => $this->_compName)));
}
}
if ($this->compID) {
$newButton = ts('New %1 Report', array(1 => $this->_compName));
$templateUrl = CRM_Utils_System::url('civicrm/report/template/list', "reset=1&compid={$this->compID}");
- } else {
+ }
+ else {
$newButton = ts('New Report');
$templateUrl = CRM_Utils_System::url('civicrm/report/template/list', "reset=1");
}
if ($compID) {
if ($compID == 99) {
$compClause = " AND v.component_id IS NULL ";
- } else {
+ }
+ else {
$compClause = " AND v.component_id = {$compID} ";
}
}
if (array_key_exists('status',$_REQUEST)){
$provider->callback();
- } else {
+ }
+ else {
$provider->inbound();
}
}
if ($ext->isExtensionKey($providerName)) {
$paymentClass = $ext->keyToClass($providerName);
require_once "{$paymentClass}.php";
- } else {
+ }
+ else {
CRM_Core_Error::fatal("Could not locate extension for {$providerName}.");
}
$postUpgradeMessage = file_get_contents($postUpgradeMessageFile);
$versionObject->setPostUpgradeMessage($postUpgradeMessage, $rev);
file_put_contents($postUpgradeMessageFile, $postUpgradeMessage);
- } else {
+ }
+ else {
$postUpgradeMessage = file_get_contents($postUpgradeMessageFile);
CRM_Upgrade_Incremental_Legacy::setPostUpgradeMessage($postUpgradeMessage, $rev);
file_put_contents($postUpgradeMessageFile, $postUpgradeMessage);
$preUpgradeMessage .= '<br />' . ts('This system included an outdated, insecure script (%1). The file was automatically deleted.', array(
1 => $ofcFile
));
- } else {
+ }
+ else {
$preUpgradeMessage .= '<br />' . ts('This system includes an outdated, insecure script (%1). Please delete it.', array(
1 => $ofcFile
));
if ($value['tableName'] == 'civicrm_membership_type' || $value['tableName'] == 'civicrm_contribution_recur') {
$foreignKeyExists = CRM_Core_DAO::checkConstraintExists($value['tableName'], $value['fkey']);
$fKey = $value['fkey'];
- } else {
+ }
+ else {
$foreignKeyExists = CRM_Core_DAO::checkFKConstraintInFormat($value['tableName'], $columnName);
$fKey = "`FK_{$value['tableName']}_{$columnName}`";
}
$preUpgradeMessage .= '<br />' . ts('Could not determine path to civicrm.settings.php. Please manually locate it and add these lines at the bottom: <pre>%1</pre>', array(
1 => self::SETTINGS_SNIPPET
));
- } elseif (preg_match(self::SETTINGS_SNIPPET_PATTERN, file_get_contents(CIVICRM_SETTINGS_PATH))) {
+ }
+ elseif (preg_match(self::SETTINGS_SNIPPET_PATTERN, file_get_contents(CIVICRM_SETTINGS_PATH))) {
// OK, nothing to do
- } elseif (!is_writable(CIVICRM_SETTINGS_PATH)) {
+ }
+ elseif (!is_writable(CIVICRM_SETTINGS_PATH)) {
$preUpgradeMessage .= '<br />' . ts('The settings file (%1) must be updated. Please make it writable or manually add these lines:<pre>%2</pre>', array(
1 => CIVICRM_SETTINGS_PATH,
2 => self::SETTINGS_SNIPPET
CRM_Core_DAO::executeQuery("ALTER TABLE `civicrm_price_set` DROP INDEX `UI_title_{$locale}`", $params, TRUE, NULL, FALSE, FALSE);
}
}
- } else {
+ }
+ else {
$query = "SHOW KEYS FROM `civicrm_price_set` WHERE key_name = 'UI_title'";
$dao = CRM_Core_DAO::executeQuery($query);
if ($dao->N) {
'price_field_value_id' => $dao->price_field_value_id,
);
$priceSetId = $dao->price_set_id;
- } else {
+ }
+ else {
$lineParams['price_field_id'] = $fieldID;
$priceSetId = $defaultPriceSetId;
}
foreach ( $processedRecords as $record ) {
CRM_Core_Error::debug_log_message(implode(', ', $record));
}
- } else {
+ }
+ else {
CRM_Core_Error::debug_log_message("deleteInvalidPairs() - Could not find any records to process.");
}
return $processedRecords;
$config = CRM_Core_Config::singleton();
// also cleanup the templates_c directory
$config->cleanupCaches();
- } else {
+ }
+ else {
$config = CRM_Core_Config::singleton();
// cleanup only the templates_c directory
$config->cleanup(1, FALSE);
// This destroys $session, so do it after get('postUpgradeMessageFile')
CRM_Upgrade_Form::doFinish();
- } else {
+ }
+ else {
$postUpgradeMessage = ''; // Session was destroyed! Can't recover messages.
}
if (property_exists($qf, '_membershipBlock') && !empty($qf->_membershipBlock['is_separate_payment']) && $qf->_quickConfig && $field->name == 'other_amount' && !property_exists($qf, '_contributionAmount')) {
$label = ts('Additional Contribution');
$useRequired = 0;
- } elseif (!empty($fieldOptions[$optionKey]['label'])) { //check for label.
+ }
+ elseif (!empty($fieldOptions[$optionKey]['label'])) { //check for label.
$label = $fieldOptions[$optionKey]['label'];
}
if (property_exists($qf, '_quickConfig') && $qf->_quickConfig) {
$message = ts("Please enter a valid amount.");
$type = "money";
- } else {
+ }
+ else {
$message = ts('%1 must be an integer (whole number).', array(1 => $label));
$type = "positiveInteger";
}
);
if (property_exists($qf, '_quickConfig') && $qf->_quickConfig && $field->name == 'contribution_amount') {
$extra += array('onclick' => 'clearAmountOther();');
- } elseif (property_exists($qf, '_quickConfig') && $qf->_quickConfig && $field->name == 'membership_amount') {
+ }
+ elseif (property_exists($qf, '_quickConfig') && $qf->_quickConfig && $field->name == 'membership_amount') {
$extra += array(
'onclick' => "return showHideAutoRenew({$opt['membership_type_id']});",
'membership-type' => $opt['membership_type_id'],
// add "none" option
if (!empty($otherAmount['is_allow_other_amount']) && $field->name == 'contribution_amount') {
$none = ts('Other Amount');
- } elseif (property_exists($qf, '_membershipBlock') && empty($qf->_membershipBlock['is_required']) && $field->name == 'membership_amount') {
+ }
+ elseif (property_exists($qf, '_membershipBlock') && empty($qf->_membershipBlock['is_required']) && $field->name == 'membership_amount') {
$none = ts('No thank you');
- } else {
+ }
+ else {
$none = ts('-none-');
}
$entityName = 'default_contribution_amount';
$where .= " AND ps.name = %4 ";
$params[4] = array($entityName, 'String');
- } elseif ($entityTable == 'civicrm_participant') {
+ }
+ elseif ($entityTable == 'civicrm_participant') {
$from .= "
LEFT JOIN civicrm_price_set_entity cpse ON cpse.price_set_id = ps.id
LEFT JOIN civicrm_price_field_value cpfv ON cpfv.price_field_id = pf.id and cpfv.label = %4 ";
if (!empty($field['import'])) {
if ($prefix) {
self::$_import['price_field'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_import[$name] = & $fields[$name];
}
}
if (!empty($field['export'])) {
if ($prefix) {
self::$_export['price_field'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_export[$name] = & $fields[$name];
}
}
if (!empty($field['import'])) {
if ($prefix) {
self::$_import['price_field_value'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_import[$name] = & $fields[$name];
}
}
if (!empty($field['export'])) {
if ($prefix) {
self::$_export['price_field_value'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_export[$name] = & $fields[$name];
}
}
if (!empty($field['import'])) {
if ($prefix) {
self::$_import['line_item'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_import[$name] = & $fields[$name];
}
}
if (!empty($field['export'])) {
if ($prefix) {
self::$_export['line_item'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_export[$name] = & $fields[$name];
}
}
if (!empty($field['import'])) {
if ($prefix) {
self::$_import['price_set'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_import[$name] = & $fields[$name];
}
}
if (!empty($field['export'])) {
if ($prefix) {
self::$_export['price_set'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_export[$name] = & $fields[$name];
}
}
if (!empty($field['import'])) {
if ($prefix) {
self::$_import['price_set_entity'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_import[$name] = & $fields[$name];
}
}
if (!empty($field['export'])) {
if ($prefix) {
self::$_export['price_set_entity'] = & $fields[$name];
- } else {
+ }
+ else {
self::$_export[$name] = & $fields[$name];
}
}
foreach ($values as &$value) {
$this->encodeInput($value, TRUE);
}
- } elseif ($castToString || is_string($values)) {
+ }
+ elseif ($castToString || is_string($values)) {
$values = str_replace(array('<', '>'), array('<', '>'), $values);
}
}
foreach ($values as &$value) {
$this->decodeOutput($value, TRUE);
}
- } elseif ($castToString || is_string($values)) {
+ }
+ elseif ($castToString || is_string($values)) {
$values = str_replace(array('<', '>'), array('<', '>'), $values);
}
}
$lowerAction = strtolower($apiRequest['action']);
if ($lowerAction === 'create') {
return parent::toApiOutput($apiRequest, $result);
- } else {
+ }
+ else {
return $result;
}
}
foreach ($keys as $key) {
if (is_array($record)) {
$keyvalue = isset($record[$key]) ? $record[$key] : NULL;
- } else {
+ }
+ else {
$keyvalue = isset($record->{$key}) ? $record->{$key} : NULL;
}
if (isset($node[$keyvalue]) && !is_array($node[$keyvalue])) {
}
if (is_array($record)) {
$node[$record[$final_key]] = $record;
- } else {
+ }
+ else {
$node[$record->{$final_key}] = $record;
}
}
foreach ($records as $key => $record) {
if (is_object($record)) {
$result[$key] = $record->{$prop};
- } else {
+ }
+ else {
$result[$key] = $record[$prop];
}
}
public function __construct($config) {
if (isset($config['group'])) {
$this->group = $config['group'];
- } else {
+ }
+ else {
throw new RuntimeException("Cannot construct SqlGroup cache: missing group");
}
if (isset($config['componentID'])) {
$this->componentID = $config['componentID'];
- } else {
+ }
+ else {
$this->componentID = NULL;
}
$this->frontCache = array();
public static function value($name, $default = NULL) {
if (defined($name)) {
return constant($name);
- } else {
+ }
+ else {
return $default;
}
}
);
if (!isset($svq)) {
return civicrm_api3_create_error("Invalid Contact ID: There is no contact record with contact_id = $value.");
- } else if ($svq == 1) {
+ }
+ else if ($svq == 1) {
return civicrm_api3_create_error("Invalid Contact ID: contact_id $value is a soft-deleted contact.");
}
( strtolower( $v2['value'] ) == strtolower( trim( $v1 ) ) ) ) {
if ( $htmlType == 'CheckBox' ) {
$newValues[$key][$v2['value']] = 1;
- } else {
+ }
+ else {
$newValues[$key][] = $v2['value'];
}
}
public function __call($name, $arguments) {
if (isset($this->array[$name]) && is_callable($this->array[$name])) {
return call_user_func_array($this->array[$name], $arguments);
- } else {
+ }
+ else {
throw new Exception("Call to unimplemented method: $name");
}
}
public static function relativize($directory, $basePath) {
if (substr($directory, 0, strlen($basePath)) == $basePath) {
return substr($directory, strlen($basePath));
- } else {
+ }
+ else {
return $directory;
}
}
$path = $subdir . DIRECTORY_SEPARATOR . $entry;
if ($entry{0} == '.') {
// ignore
- } elseif (is_dir($path)) {
+ }
+ elseif (is_dir($path)) {
$todos[] = $path;
}
}
}
if (empty($childParts)) {
return FALSE; // same directory
- } else {
+ }
+ else {
return TRUE;
}
}
foreach ($values as $key => $value) {
$frame[$globalKey][$key] = CRM_Utils_Array::value($key, $GLOBALS[$globalKey]);
}
- } else {
+ }
+ else {
$frame[$globalKey] = CRM_Utils_Array::value($globalKey, $GLOBALS);
}
}
foreach ($values as $key => $value) {
$GLOBALS[$globalKey][$key] = $value;
}
- } else {
+ }
+ else {
$GLOBALS[$globalKey] = $values;
}
}
error_reporting($old_error_reporting);
return TRUE;
}
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
}
error_reporting($old_error_reporting);
return FALSE;
if ($args[1] == 'ping') {
return self::ping();
}
- } else {
+ }
+ else {
// or the new format (entity+action)
$args = array();
$args[0] = 'civicrm';
return CRM_Utils_System::theme($content);
- } else {
+ }
+ else {
$content = "<!-- .tpl file embeded: $tpl -->\n";
CRM_Utils_System::appendTPLFile( $tpl, $content );
echo $content . $smarty->fetch($tpl);
$message['payload'] = array();
if (empty($salt)) {
$message['salt'] = $this->createSalt();
- } else {
+ }
+ else {
$message['salt'] = $salt;
}
// recall: paramNames is pre-sorted for stability
if (is_numeric($params[$paramName])) {
$params[$paramName] = (string) $params[$paramName];
}
- } else { // $paramName is not included or ===NULL
+ }
+ else { // $paramName is not included or ===NULL
$params[$paramName] = '';
}
$message['payload'][$paramName] = $params[$paramName];
if (isset($a[$attribute]) && isset($b[$attribute])) {
if ($a[$attribute] < $b[$attribute]) {
return -1;
- } elseif ($a[$attribute] > $b[$attribute]) {
+ }
+ elseif ($a[$attribute] > $b[$attribute]) {
return 1;
} // else: $a and $b are equal wrt to this attribute, try next...
}
if (!function_exists('ts')) {
if ($resource == 'wiki') {
$docBaseURL = self::getWikiBaseURL();
- } else {
+ }
+ else {
$docBaseURL = self::getDocBaseURL();
}
return $docBaseURL . str_replace(' ', '+', $page);
if (CRM_Utils_Array::value('resource', $params) == 'wiki') {
$docBaseURL = self::getWikiBaseURL();
- } else {
+ }
+ else {
$docBaseURL = self::getDocBaseURL();
}
// TODO: Find a more solid way to make this test
// Also, since we don't know how to get the entity type of the group, we'll assume it's 'node'
og_ungroup('node', $ogID, 'user', user_load($drupalID));
- } else {
+ }
+ else {
// Works for the OG 7.x-1.x branch
og_ungroup($ogID, 'user', user_load($drupalID));
}
global $user;
if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
$timezone = $user->timezone;
- } else {
+ }
+ else {
$timezone = variable_get('date_default_timezone', NULL);
}
if (!$timezone) {
global $user;
if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
$timezone = $user->timezone;
- } else {
+ }
+ else {
$timezone = variable_get('date_default_timezone', NULL);
}
if (!$timezone) {
static $run_once = FALSE;
if ($run_once) {
return TRUE;
- } else {
+ }
+ else {
$run_once = TRUE;
}
elseif ($forceBackend) {
if (defined('JVERSION')) {
$joomlaVersion = JVERSION;
- } else {
+ }
+ else {
$jversion = new JVersion;
$joomlaVersion = $jversion->getShortVersion();
}
$template->assign('pageTitle', $pageTitle);
}
- } elseif (civicrm_wp_in_civicrm()) {
+ }
+ elseif (civicrm_wp_in_civicrm()) {
// legacy pre-4.6 behaviour
global $civicrm_wp_title;
if (isset($language)) {
return CRM_Core_I18n_PseudoConstant::longForShort(substr($language, 0, 2));
- } else {
+ }
+ else {
return NULL;
}
}
if (! file_exists($file)) {
$error = 'File ' . $file . ' does not exist.';
- } else {
+ }
+ else {
$oldLibXMLErrors = libxml_use_internal_errors();
libxml_use_internal_errors(TRUE);
if (preg_match('/^[^\/]+\/$/', $filename) && $filename != './' && $filename != '../') {
$base = $filename;
$baselen = strlen($filename);
- } else {
+ }
+ else {
return FALSE;
}
} elseif (0 != substr_compare($base, $filename, 0, $baselen)) {
$basedirs = CRM_Utils_Zip::findBaseDirs($zip);
if (in_array($expected, $basedirs)) {
$candidate = $expected;
- } elseif (count($basedirs) == 1) {
+ }
+ elseif (count($basedirs) == 1) {
$candidate = array_shift($basedirs);
}
if ($candidate !== FALSE && preg_match('/^[a-zA-Z0-9]/', $candidate)) {
return $candidate;
- } else {
+ }
+ else {
return FALSE;
}
}
}
}
$zip->close();
- } else {
+ }
+ else {
return FALSE;
}
return TRUE;
if ($printerType == 'csv') {
$printer = new \Civi\CiUtil\CsvPrinter('php://stdout', \Civi\CiUtil\Arrays::collect($suites, 'file'));
- } else {
+ }
+ else {
$printer = new \Civi\CiUtil\ComparisonPrinter(\Civi\CiUtil\Arrays::collect($suites, 'file'));
}
foreach ($tests as $test) {
$xml = CRM_Case_XMLRepository::singleton()->retrieve($caseTypeName);
if ($xml) {
$result['values'][$key]['definition'] = CRM_Case_BAO_CaseType::convertXmlToDefinition($xml);
- } else {
+ }
+ else {
$result['values'][$key]['definition'] = array();
}
$result['values'][$key]['is_forkable'] = CRM_Case_BAO_CaseType::isForkable($result['values'][$key]['id']);
try {
CRM_Extension_System::singleton()->getManager()->install($keys);
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
return civicrm_api3_create_error($e->getMessage());
}
try {
$result = $runner->runAll();
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
return civicrm_api3_create_error($e->getMessage());
}
if ($result === TRUE) {
return civicrm_api3_create_success();
- } else {
+ }
+ else {
return $result;
}
}
function _civicrm_api3_getKeys($params) {
if (array_key_exists('keys', $params) && is_array($params['keys'])) {
return $params['keys'];
- } elseif (array_key_exists('keys', $params) && is_string($params['keys'])) {
+ }
+ elseif (array_key_exists('keys', $params) && is_string($params['keys'])) {
if ($params['keys'] == '') {
return array();
- } else {
+ }
+ else {
return explode(API_V3_EXTENSION_DELIMITER, $params['keys']);
}
- } elseif (array_key_exists('key', $params)) {
+ }
+ elseif (array_key_exists('key', $params)) {
return array($params['key']);
- } else {
+ }
+ else {
throw new API_Exception('Missing required parameter: key or keys');
}
}
list ($apiProvider, $hypApiRequest) = \Civi\Core\Container::singleton()->get('civi_api_kernel')->resolve($hypApiRequest);
if (isset($hypApiRequest['function'])) {
$helper = '_' . $hypApiRequest['function'] . '_spec';
- } else {
+ }
+ else {
// not implemented MagicFunctionProvider
$helper = NULL;
}
- } catch (\Civi\API\Exception\NotImplementedException $e) {
+ }
+ catch (\Civi\API\Exception\NotImplementedException $e) {
$helper = NULL;
}
if (function_exists($helper)) {
$values = array( );
$lock->release();
return civicrm_api3_create_success($values, $params,'mailing','activities');
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
$lock->release();
return civicrm_api3_create_error('Process Activities failed');
}
// security hole here but seems sensible - perhaps should apply to the trace as well?)
if(isset($data['sql']) && CRM_Core_Permission::check('Administer CiviCRM')) {
$data['debug_information'] = $data['sql']; // Isn't this redundant?
- } else {
+ }
+ else {
unset($data['sql']);
}
return $data;
$realContactId = _civicrm_api3_resolve_contactID($params[$fieldName]);
if ('unknown-user' === $realContactId) {
throw new API_Exception("\"$fieldName\" \"{$params[$fieldName]}\" cannot be resolved to a contact ID", 2002, array('error_field' => $fieldName, "type" => "integer"));
- } elseif (is_numeric($realContactId)) {
+ }
+ elseif (is_numeric($realContactId)) {
$params[$fieldName] = $realContactId;
}
}
$result = civicrm_api($this->_entity, 'Delete', $params);
if ($result['is_error']) {
echo "\nERROR line " . $this->row . ": " . $result['error_message'] . "\n";
- } else {
+ }
+ else {
echo "\nline " . $this->row . ": deleted\n";
}
}
if (!$result) {
$testDetails[2] = 'Could not query thread_stack.';
$this->error($testDetails);
- } else {
+ }
+ else {
$values = mysql_fetch_row($result);
if ($values[1] < (1024 * $minValueKB)) {
$testDetails[2] = 'MySQL "thread_stack" is ' . ($values[1] / 1024) . 'k';
$objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly);
if (is_array($objects)) {
$this->registerTestObjects($objects);
- } else {
+ }
+ else {
$this->registerTestObjects(array($objects));
}
return $objects;
$objects = CRM_Core_DAO::createTestObject($daoName, $params, $numObjects, $createOnly);
if (is_array($objects)) {
$this->registerTestObjects($objects);
- } else {
+ }
+ else {
$this->registerTestObjects(array($objects));
}
return $objects;
$message = NULL;
try {
$result = CRM_Core_BAO_CustomValueTable::setValues($params);
- } catch ( Exception $e ) {
+ }
+ catch ( Exception $e ) {
$message = $e->getMessage();
}
$errorScope = NULL;
$message = NULL;
try {
$result = CRM_Core_BAO_CustomValueTable::setValues($params);
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
$message = $e->getMessage();
}
$errorScope = NULL;
try {
CRM_Core_DAO::executeQuery('SELECT id FROM civicrm_contact WHERE MATCH(first_name,last_name) AGAINST ("joe")');
$this->fail("Missed expected exception");
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
$this->assertTrue(TRUE, 'Received expected exception');
}
}
try {
$me->reconcile();
$this->fail('Expected exception when using invalid declaration');
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
// good
}
}
try {
$me->reconcile();
$this->fail('Expected exception when using invalid declaration');
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
// good
}
}
try {
$me->reconcile();
$this->fail('Expected exception when using invalid declaration');
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
// good
}
}
$test->assertContactsExistByOffset(array(0 => TRUE));
throw new Exception("Ruh-roh");
});
- } catch (Exception $ex) {
+ }
+ catch (Exception $ex) {
$e = $ex;
if (get_class($e) != 'Exception' || $e->getMessage() != 'Ruh-roh') {
throw $e;
if ($insert == 'sql-insert') {
$r = CRM_Core_DAO::executeQuery("INSERT INTO civicrm_contact(first_name,last_name) VALUES ('ff', 'll')");
$cid = mysql_insert_id();
- } elseif ($insert == 'bao-create') {
+ }
+ elseif ($insert == 'bao-create') {
$params = array(
'contact_type' => 'Individual',
'first_name' => 'FF',
if ($outcome == 'rollback') {
$tx->rollback();
- } elseif ($outcome == 'explicit-commit') {
+ }
+ elseif ($outcome == 'explicit-commit') {
$tx->commit();
} // else: implicit-commit
if ($outcome == 'rollback') {
$tx->rollback();
- } elseif ($outcome == 'explicit-commit') {
+ }
+ elseif ($outcome == 'explicit-commit') {
$tx->commit();
} // else: implicit-commit
}
list($basedir, $c) = $this->_createContainer();
try {
$c->getPath('un.kno.wn');
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$exc = $e;
}
$this->assertTrue(is_object($exc), 'Expected exception');
list($basedir, $c) = $this->_createContainer(NULL, NULL, '/');
try {
$c->getPath('un.kno.wn');
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$exc = $e;
}
$this->assertTrue(is_object($exc), 'Expected exception');
list($basedir, $c) = $this->_createContainer();
try {
$c->getResUrl('un.kno.wn');
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$exc = $e;
}
$this->assertTrue(is_object($exc), 'Expected exception');
list($basedir, $c) = $this->_createContainer(NULL, NULL, '/');
try {
$c->getResUrl('un.kno.wn');
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$exc = $e;
}
$this->assertTrue(is_object($exc), 'Expected exception');
$c = $this->_createContainer();
try {
$c->getPath('un.kno.wn');
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$exc = $e;
}
$this->assertTrue(is_object($exc), 'Expected exception');
$c = $this->_createContainer();
try {
$c->getResUrl('un.kno.wn');
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$exc = $e;
}
$this->assertTrue(is_object($exc), 'Expected exception');
$c = $this->_createContainer();
try {
$c->getPath('un.kno.wn');
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$exc = $e;
}
$this->assertTrue(is_object($exc), 'Expected exception');
$c = $this->_createContainer();
try {
$c->getResUrl('un.kno.wn');
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$exc = $e;
}
$this->assertTrue(is_object($exc), 'Expected exception');
$exc = NULL;
try {
$info = CRM_Extension_Info::loadFromFile($this->file);
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$exc = $e;
}
$this->assertTrue(is_object($exc));
$exc = NULL;
try {
$info = CRM_Extension_Info::loadFromString($data);
- } catch (CRM_Extension_Exception $e) {
+ }
+ catch (CRM_Extension_Exception $e) {
$exc = $e;
}
$this->assertTrue(is_object($exc));
try {
$manager->uninstall(array('test.extension.manager.paymenttest'));
$this->fail('Failed to catch expected exception');
- } catch (CRM_Extension_Exception_DependencyException $e) {
+ }
+ catch (CRM_Extension_Exception_DependencyException $e) {
}
$this->assertEquals(0, test_extension_manager_paymenttest::$counts['uninstall']);
$this->assertDBQuery(1, 'SELECT count(*) FROM civicrm_payment_processor_type WHERE class_name = "test.extension.manager.paymenttest"');
'#num' => '5not-a-number5'
));
$this->fail('Expected exception; got: ' . var_export($result, TRUE));
- } catch (CRM_Core_Exception $e) {
+ }
+ catch (CRM_Core_Exception $e) {
$this->assertTrue(TRUE, "Caught expected exception");
}
'#num' => array(1, '5not-a-number5', 2)
));
$this->fail('Expected exception; got: ' . var_export($result, TRUE));
- } catch (CRM_Core_Exception $e) {
+ }
+ catch (CRM_Core_Exception $e) {
$this->assertTrue(TRUE, "Caught expected exception");
}
}
'{var}' => 'not a well-formed variable name'
));
$this->fail('Expected exception; got: ' . var_export($result, TRUE));
- } catch (CRM_Core_Exception $e) {
+ }
+ catch (CRM_Core_Exception $e) {
$this->assertTrue(TRUE, "Caught expected exception");
}
}
$tmpFile = $this->createTempDir() . CRM_Utils_File::makeFileName('CiviReport.csv');
$csvContent = CRM_Report_Utils_Report::makeCsv($reportObj, $rows);
file_put_contents($tmpFile, $csvContent);
- } catch (Exception $e) {
+ }
+ catch (Exception $e) {
// print_r($e->getCause()->getUserInfo());
CRM_Utils_GlobalStack::singleton()->pop();
throw $e;
$dsn = getenv("CIVICRM_TEST_DSN");
if (!empty ($dsn)) {
define("CIVICRM_DSN", $dsn);
- } else {
+ }
+ else {
echo "\nFATAL: no DB connection configured (CIVICRM_DSN). \nYou can either create/edit " . __DIR__ . "/civicrm.settings.local.php\n";
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
echo "OR set it in your shell:\n \$export CIVICRM_TEST_DSN=mysql://db_username:db_password@localhost/civicrm_tests_dev \n";
- } else {
+ }
+ else {
echo "OR set it in your shell:\n SETX CIVICRM_TEST_DSN mysql://db_username:db_password@localhost/civicrm_tests_dev \n
(you will need to open a new command shell before it takes effect)";
}
if (!defined("CIVICRM_TEMPLATE_COMPILEDIR")) {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
define( 'CIVICRM_TEMPLATE_COMPILEDIR', getenv('TMP') . DIRECTORY_SEPARATOR . 'civi' . DIRECTORY_SEPARATOR );
- } else {
+ }
+ else {
define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/tmp/civi/' );
}
}
list ($class, $method) = explode('::', $test);
$clazz = new \ReflectionClass($class);
$suite->addTestMethod($clazz, $clazz->getMethod($method));
- } else {
+ }
+ else {
$suite->addTestSuite($test);
}
}
if ( array_key_exists( 'function', $frame ) ) {
echo " method {$frame['function']}";
}
- } else {
+ }
+ else {
if ( array_key_exists( 'function', $frame ) ) {
echo " function {$frame['function']}";
}
$this->open($mailingReportUrl);
if ($entity == "report") {
$this->clickLink("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$key}']]/descendant::td[3]/span/a[1][text()='Report']");
- } else {
+ }
+ else {
$this->clickLink("xpath=//fieldset/legend[text()='Delivery Summary']/../table//tr[td/a[text()='{$key}']]/descendant::td[3]/span/a[2][text()='Advanced Search']");
}
$this-> _verifyCriteria($key, $dataToCheck, $entity);
continue;
}
$this->assertTrue($this->isElementPresent("xpath=//form//div[3]/table/tbody//tr/th[contains(text(),'{$key}')]/../td[contains(text(),'{$value}')]"), "Criteria check for {$key} failed for Report for {$summaryInfo}");
- } else {
+ }
+ else {
$this->assertElementContainsText('page-title', "Advanced Search");
$assertedValue = $this->isElementPresent("xpath=//div[@class='crm-results-block']//div[@class='qill'][contains(text(),'{$key} {$value}')]");
if (!$assertedValue) {
if ($this->isChecked("edit-2-administer-reserved-reports")) {
$this->click("edit-2-administer-reserved-reports");
- } else {
+ }
+ else {
$this->click("edit-{$roleId}-administer-reserved-reports");
}
$this->click("edit-submit");
}
try {
$result = $function($params);
- } catch ( Exception $e ) {
+ }
+ catch ( Exception $e ) {
continue;
}
try {
$kernel->authorize(NULL, $apiRequest);
return TRUE;
- } catch (\API_Exception $e) {
+ }
+ catch (\API_Exception $e) {
$extra = $e->getExtraParams();
if (!$throws && $extra['error_code'] == API_Exception::UNAUTHORIZED) {
return FALSE;
- } else {
+ }
+ else {
throw $e;
}
}