$this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'campaign');
//when we do load tab, lets load the default objects.
- $this->assign('force', ($this->_force || $this->_searchTab) ? TRUE : FALSE);
+ $this->assign('force', $this->_force || $this->_searchTab);
$this->assign('searchParams', json_encode($this->get('searchParams')));
$this->assign('buildSelector', $this->_search);
$this->assign('searchFor', $this->_searchTab);
$this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'petition');
//when we do load tab, lets load the default objects.
- $this->assign('force', ($this->_force || $this->_searchTab) ? TRUE : FALSE);
+ $this->assign('force', $this->_force || $this->_searchTab);
$this->assign('searchParams', json_encode($this->get('searchParams')));
$this->assign('buildSelector', $this->_search);
$this->assign('searchFor', $this->_searchTab);
$this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'survey');
//when we do load tab, lets load the default objects.
- $this->assign('force', ($this->_force || $this->_searchTab) ? TRUE : FALSE);
+ $this->assign('force', $this->_force || $this->_searchTab);
$this->assign('searchParams', json_encode($this->get('searchParams')));
$this->assign('buildSelector', $this->_search);
$this->assign('searchFor', $this->_searchTab);
if (in_array($actTypeName, $singletonNames)) {
$allow = FALSE;
if ($operation == 'File On Case') {
- $allow = (in_array($actTypeName, $doNotFileNames)) ? FALSE : TRUE;
+ $allow = !in_array($actTypeName, $doNotFileNames);
}
if (in_array($operation, $actionOperations)) {
$allow = TRUE;
if ($operation == 'edit') {
- $allow = (in_array($actTypeName, $allowEditNames)) ? TRUE : FALSE;
+ $allow = in_array($actTypeName, $allowEditNames);
}
elseif ($operation == 'delete') {
- $allow = (in_array($actTypeName, $doNotDeleteNames)) ? FALSE : TRUE;
+ $allow = !in_array($actTypeName, $doNotDeleteNames);
}
}
}
//lets check for case configured.
$allCasesCount = CRM_Case_BAO_Case::caseCount(NULL, FALSE);
- $configured['configured'] = ($allCasesCount) ? TRUE : FALSE;
+ $configured['configured'] = (bool) $allCasesCount;
if (!$configured['configured']) {
//do check for case type and case status.
$caseTypes = CRM_Case_PseudoConstant::caseType('title', FALSE);
* @throws \CiviCRM_API3_Exception
*/
public static function batchMerge($rgid, $gid = NULL, $mode = 'safe', $batchLimit = 1, $isSelected = 2, $criteria = [], $checkPermissions = TRUE, $reloadCacheIfEmpty = NULL, $searchLimit = 0) {
- $redirectForPerformance = ($batchLimit > 1) ? TRUE : FALSE;
+ $redirectForPerformance = $batchLimit > 1;
if ($mode === 'aggressive' && $checkPermissions && !CRM_Core_Permission::check('force merge duplicate contacts')) {
throw new CRM_Core_Exception(ts('Insufficient permissions for aggressive mode batch merge'));
}
self::assignProfiles($this);
//consider total amount.
- $this->assign('isAmountzero', ($this->_totalAmount <= 0) ? TRUE : FALSE);
+ $this->assign('isAmountzero', $this->_totalAmount <= 0);
$contribButton = ts('Continue');
$this->addButtons([
$value['participant_register_date'] = $this->_values['participant']['register_date'];
}
- $createContrib = ($value['amount'] != 0) ? TRUE : FALSE;
+ $createContrib = $value['amount'] != 0;
// force to create zero amount contribution, CRM-5095
if (!$createContrib && ($value['amount'] == 0)
&& $this->_priceSetId && $this->_lineItem
$this->assign('trxn_id', $this->_trxnId);
//cosider total amount.
- $this->assign('isAmountzero', ($this->_totalAmount <= 0) ? TRUE : FALSE);
+ $this->assign('isAmountzero', $this->_totalAmount <= 0);
$this->assign('defaultRole', FALSE);
if (CRM_Utils_Array::value('defaultRole', $this->_params[0]) == 1) {
$statusClass = $statusClasses[$statusId];
}
- $row['showConfirmUrl'] = ($statusClass == 'Pending') ? TRUE : FALSE;
+ $row['showConfirmUrl'] = $statusClass == 'Pending';
if (!empty($row['participant_is_test'])) {
$row['participant_status'] = CRM_Core_TestEntity::appendTestText($row['participant_status']);
$capabilitiesString = implode('', $capabilities);
if (!isset(\Civi::$statics[__CLASS__]['supported_capabilities'][$capabilitiesString])) {
$result = self::getPaymentProcessors($capabilities);
- \Civi::$statics[__CLASS__]['supported_capabilities'][$capabilitiesString] = (!empty($result) && array_keys($result) !== [0]) ? TRUE : FALSE;
+ \Civi::$statics[__CLASS__]['supported_capabilities'][$capabilitiesString] = (!empty($result) && array_keys($result) !== [0]);
}
return \Civi::$statics[__CLASS__]['supported_capabilities'][$capabilitiesString];
}
$entityID = isset($_REQUEST['entityID']) ? CRM_Utils_Type::escape($_REQUEST['entityID'], 'String') : NULL;
$notPresent = isset($_REQUEST['notPresent']) ? CRM_Utils_Type::escape($_REQUEST['notPresent'], 'String') : NULL;
$statusID = isset($_REQUEST['statusID']) ? CRM_Utils_Type::escape($_REQUEST['statusID'], 'String') : NULL;
- $search = isset($_REQUEST['search']) ? TRUE : FALSE;
+ $search = isset($_REQUEST['search']);
$params = $_POST;
if ($sort && $sortOrder) {
* @return bool
*/
protected function isValidRelationshipKey($key) {
- return !empty($this->getValidRelationships()[$key]) ? TRUE : FALSE;
+ return !empty($this->getValidRelationships()[$key]);
}
/**
$pEmails = [];
foreach ($pTemplates as $type => $pTemplate) {
- $html = ($type == 'html') ? TRUE : FALSE;
+ $html = $type == 'html';
$pEmails[$type] = [];
$pEmail = &$pEmails[$type];
$template = &$pTemplates[$type]['template'];
$message = new Mail_mime("\n");
- $useSmarty = defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY ? TRUE : FALSE;
+ $useSmarty = defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY;
if ($useSmarty) {
$smarty = CRM_Core_Smarty::singleton();
// also add the contact tokens to the template
$mailing->templates[$type] = CRM_Utils_Token::replaceDomainTokens(
$mailing->templates[$type],
$domain,
- $type == 'html' ? TRUE : FALSE,
+ $type == 'html',
$tokens[$type]
);
$mailing->templates[$type] = CRM_Utils_Token::replaceMailingTokens($mailing->templates[$type], $mailing, NULL, $tokens[$type]);
$token = $token_a['token'];
$data = $token;
- $useSmarty = defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY ? TRUE : FALSE;
+ $useSmarty = defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY;
if ($type == 'embedded_url') {
$embed_data = [];
$enableWorkflow = Civi::settings()->get('civimail_workflow');
- return ($enableWorkflow &&
- $config->userSystem->is_drupal
- ) ? TRUE : FALSE;
+ return $enableWorkflow && $config->userSystem->is_drupal;
}
/**
$isRecur = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_Membership', $this->membershipID, 'contribution_recur_id');
- $autoRenew = $isRecur ? TRUE : FALSE;
+ $autoRenew = (bool) $isRecur;
}
if (!empty($values['is_test'])) {
unset($params['is_navigation']);
}
- $viewMode = !empty($params['view_mode']) ? $params['view_mode'] : FALSE;
+ $viewMode = !empty($params['view_mode']);
if ($viewMode) {
// Do not save to the DB - it's saved in the url.
unset($params['view_mode']);
if (!empty($this->_params['charts'])) {
if (!empty($this->_params['group_bys']['receive_date'])) {
- $contrib = !empty($this->_params['fields']['total_amount']) ? TRUE : FALSE;
- $softContrib = !empty($this->_params['fields']['soft_amount']) ? TRUE : FALSE;
+ $contrib = !empty($this->_params['fields']['total_amount']);
+ $softContrib = !empty($this->_params['fields']['soft_amount']);
foreach ($rows as $key => $row) {
if ($row['civicrm_contribution_receive_date_subtotal']) {
$contributionPages = CRM_Contribute_PseudoConstant::contributionPage();
//CRM-16338 if both soft-credit and contribution are enabled then process the contribution's
//total amount's average, count and sum separately and add it to the respective result list
- $softCredit = (!empty($this->_params['fields']['soft_amount']) && !empty($this->_params['fields']['total_amount'])) ? TRUE : FALSE;
+ $softCredit = (!empty($this->_params['fields']['soft_amount']) && !empty($this->_params['fields']['total_amount']));
if ($softCredit) {
$this->from('contribution');
$this->customDataFrom();
'custom_group_id' => $customGroup->id,
'extends_entity_column_id' => $customGroup->extends_entity_column_id,
'extends_entity_column_value' => CRM_Utils_Array::explodePadded($customGroup->extends_entity_column_value),
- 'is_reserved' => $customGroup->is_reserved ? TRUE : FALSE,
+ 'is_reserved' => (bool) $customGroup->is_reserved,
];
$result['sections'][$sectionName] = $section;
}
$version, 'id',
'version'
);
- return $domainID ? TRUE : FALSE;
+ return (bool) $domainID;
}
/**
foreach ($localeCustomArray as $localCustomData) {
// Traverse status array "enabled" "disabled"
foreach ($localCustomData as $status => $matchTypes) {
- $params["is_active"] = ($status == "enabled") ? TRUE : FALSE;
+ $params["is_active"] = $status == "enabled";
// Traverse Match Type array "wildcardMatch" "exactMatch"
foreach ($matchTypes as $matchType => $words) {
$params["match_type"] = $matchType;