* @return bool
*/
public static function checkEditInboundEmailsPermissions() {
- if (CRM_Core_Permission::check('edit inbound email basic information')
- || CRM_Core_Permission::check('edit inbound email basic information and content')
- ) {
- return TRUE;
- }
-
- return FALSE;
+ return CRM_Core_Permission::check([
+ ['edit inbound email basic information', /* OR */ 'edit inbound email basic information and content'],
+ ]);
}
/**
return FALSE;
}
- if (CRM_Core_Permission::check('access my cases and activities') ||
- CRM_Core_Permission::check('access all cases and activities')
- ) {
- return TRUE;
- }
-
- return FALSE;
+ return CRM_Core_Permission::check([
+ ['access my cases and activities', /* OR */ 'access all cases and activities'],
+ ]);
}
/**
$relationshipCount = CRM_Core_DAO::singleValueQuery($relationshipQuery);
- if (!empty($relationshipCount)) {
- return TRUE;
- }
-
- return FALSE;
+ return (bool) $relationshipCount;
}
/**
return TRUE;
}
- $recordsFound = (int) CRM_Core_DAO::singleValueQuery("SELECT COUNT(*) FROM civicrm_relationship WHERE relationship_type_id IN ( " . implode(',', $membershipTypeRelationshipTypeIDs) . " ) AND contact_id_a IN ( %1, %2 ) AND contact_id_b IN ( %1, %2 ) AND id NOT IN (" . implode(',', $relIds) . ")", $relParamas);
-
- if ($recordsFound) {
- return FALSE;
- }
-
- return TRUE;
+ return !CRM_Core_DAO::singleValueQuery("SELECT COUNT(*) FROM civicrm_relationship WHERE relationship_type_id IN ( " . implode(',', $membershipTypeRelationshipTypeIDs) . " ) AND contact_id_a IN ( %1, %2 ) AND contact_id_b IN ( %1, %2 ) AND id NOT IN (" . implode(',', $relIds) . ")", $relParamas);
}
/**
$parsingSupportedLocales = ['en_US', 'en_CA', 'fr_CA'];
- if (in_array($locale, $parsingSupportedLocales)) {
- return TRUE;
- }
-
- return FALSE;
+ return in_array($locale, $parsingSupportedLocales);
}
/**
$path = $_GET[$urlVar] ?? NULL;
}
- if ($path && preg_match('/^civicrm\/upgrade(\/.*)?$/', $path)) {
- return TRUE;
- }
-
- return FALSE;
+ return ($path && preg_match('/^civicrm\/upgrade(\/.*)?$/', $path));
}
/**
return FALSE;
}
- if (isset($_GET['payment_date']) &&
+ return (isset($_GET['payment_date']) &&
isset($_GET['merchant_return_link']) &&
($_GET['payment_status'] ?? NULL) == 'Completed' &&
$paymentProcessor['payment_processor_type'] == "PayPal_Standard"
- ) {
- return TRUE;
- }
-
- return FALSE;
+ );
}
/**
}
// if user is an admin, return true
- if (CRM_Core_Permission::check('administer CiviCRM') ||
- CRM_Core_Permission::check('approve mailings') ||
- CRM_Core_Permission::check('access CiviMail')
- ) {
- return TRUE;
- }
-
- return FALSE;
+ return CRM_Core_Permission::check([
+ ['administer CiviCRM', /* OR */ 'approve mailings', /* OR */ 'access CiviMail'],
+ ]);
}
/**
* @return bool
*/
public static function isOverridden($overrideType) {
- if ($overrideType == self::NO) {
- return FALSE;
- }
-
- return TRUE;
+ return $overrideType != self::NO;
}
public static function isNo($overrideType) {
- if ($overrideType != self::NO) {
- return FALSE;
- }
-
- return TRUE;
+ return $overrideType == self::NO;
}
public static function isPermanent($overrideType) {
- if ($overrideType != self::PERMANENT) {
- return FALSE;
- }
-
- return TRUE;
+ return $overrideType == self::PERMANENT;
}
public static function isUntilDate($overrideType) {
- if ($overrideType != self::UNTIL_DATE) {
- return FALSE;
- }
-
- return TRUE;
+ return $overrideType == self::UNTIL_DATE;
}
}