Skip to content
Snippets Groups Projects
Verified Commit 6d970d9d authored by Kevin Cristiano's avatar Kevin Cristiano :earth_americas:
Browse files

civicrm release 5.47.0

parent 104bea16
No related branches found
No related tags found
No related merge requests found
Showing
with 46 additions and 51 deletions
......@@ -90,8 +90,7 @@ class CRM_Activity_Task extends CRM_Core_Task {
],
];
$config = CRM_Core_Config::singleton();
if (in_array('CiviCase', $config->enableComponents)) {
if (CRM_Core_Component::isEnabled('CiviCase')) {
if (CRM_Core_Permission::check('access all cases and activities') ||
CRM_Core_Permission::check('access my cases and activities')
) {
......
......@@ -100,7 +100,7 @@ class CRM_Activity_Tokens extends CRM_Core_EntityTokens {
*/
protected function getBespokeTokens(): array {
$tokens = [];
if (array_key_exists('CiviCase', CRM_Core_Component::getEnabledComponents())) {
if (CRM_Core_Component::isEnabled('CiviCase')) {
$tokens['case_id'] = ts('Activity Case ID');
return [
'case_id' => [
......
......@@ -30,7 +30,7 @@ class CRM_Admin_Form extends CRM_Core_Form {
/**
* The default values for form fields.
*
* @var int
* @var array
*/
protected $_values;
......
......@@ -67,7 +67,7 @@ class CRM_Admin_Form_ContactType extends CRM_Admin_Form {
* The input form values.
*
* @param $files
* @param $self
* @param self $self
*
* @return bool|array
* true if no errors, else array of errors
......
......@@ -151,7 +151,7 @@ class CRM_Admin_Form_Extensions extends CRM_Admin_Form {
* The input form values.
* @param array $files
* The uploaded files if any.
* @param array $self
* @param self $self
* This object.
*
* @return bool|array
......
......@@ -116,7 +116,7 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form {
}
/**
* @param $fields
* @param array $fields
*
* @return array|bool
* @throws API_Exception
......
......@@ -244,7 +244,7 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Core_Form {
* The input form values.
* @param array $files
* The uploaded files if any.
* @param array $self
* @param self $self
*
* @return array
* array of errors
......
......@@ -94,7 +94,7 @@ class CRM_Admin_Form_OptionGroup extends CRM_Admin_Form {
* The input form values.
*
* @param $files
* @param $self
* @param self $self
*
* @return bool|array
* true if no errors, else array of errors
......
......@@ -269,8 +269,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
// If CiviCase enabled AND "Add" mode OR "edit" mode for non-reserved activities, only allow user to pick Core or CiviCase component.
// FIXME: Each component should define whether adding new activity types is allowed.
$config = CRM_Core_Config::singleton();
if ($this->_gName == 'activity_type' && in_array("CiviCase", $config->enableComponents) &&
if ($this->_gName == 'activity_type' && CRM_Core_Component::isEnabled("CiviCase") &&
(($this->_action & CRM_Core_Action::ADD) || !$isReserved)
) {
$caseID = CRM_Core_Component::getComponentID('CiviCase');
......@@ -342,7 +341,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
* The input form values.
* @param array $files
* The uploaded files if any.
* @param array $self
* @param self $self
* Current form object.
*
* @return array
......
......@@ -28,7 +28,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
protected $_testID;
/**
* @var \CRM_Core_DAO_PaymentProcessor
* @var \CRM_Financial_DAO_PaymentProcessorType
* Payment Processor DAO Object
*/
protected $_paymentProcessorDAO;
......@@ -269,7 +269,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
}
/**
* @param $fields
* @param array $fields
*
* @return array|bool
*/
......@@ -295,9 +295,9 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
}
/**
* @param $fields
* @param $errors
* @param null $section
* @param array $fields
* @param array $errors
* @param string|null $section
*
* @return bool
*/
......
......@@ -46,7 +46,7 @@ class CRM_Admin_Form_Preferences_Address extends CRM_Admin_Form_Preferences {
}
/**
* @param $fields
* @param array $fields
*
* @return bool
*/
......
......@@ -54,6 +54,7 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
'html_type' => 'text',
'title' => ts('Due Date'),
'weight' => 3,
'description' => '',
],
'due_date_period' => [
'html_type' => 'select',
......@@ -84,11 +85,13 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences {
'html_type' => 'text',
'title' => ts('Tax Term'),
'weight' => 7,
'description' => '',
],
'tax_display_settings' => [
'html_type' => 'select',
'title' => ts('Tax Display Settings'),
'weight' => 8,
'description' => '',
'option_values' => [
'Do_not_show' => ts('Do not show breakdown, only show total - i.e %1', [
1 => CRM_Utils_Money::format(120),
......
......@@ -32,6 +32,7 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
'inheritLocale' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
'lcMessages' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
'legacyEncoding' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
'format_locale' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
'monetaryThousandSeparator' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
'monetaryDecimalPoint' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
'moneyformat' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
......@@ -43,11 +44,9 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
* Build the form object.
*/
public function buildQuickForm() {
$config = CRM_Core_Config::singleton();
$this->setTitle(ts('Settings - Localization'));
$warningTitle = json_encode(ts("Warning"));
$warningTitle = json_encode(ts('Warning'));
$defaultLocaleOptions = CRM_Admin_Form_Setting_Localization::getDefaultLocaleOptions();
if (CRM_Core_I18n::isMultiLingual()) {
......@@ -98,7 +97,7 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
}
/**
* @param $fields
* @param array $fields
*
* @return array|bool
*/
......@@ -230,8 +229,8 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
/**
* Replace available currencies by the ones provided
*
* @param $currencies array of currencies ['USD', 'CAD']
* @param $default default currency
* @param string[] $currencies array of currencies ['USD', 'CAD']
* @param string $default default currency
*/
public static function updateEnabledCurrencies($currencies, $default) {
......@@ -339,7 +338,7 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
$currencies = array_keys(CRM_Core_OptionGroup::values('currencies_enabled'));
if (!in_array($newCurrency, $currencies)) {
if (empty($currencies)) {
$currencies = [$values['defaultCurrency']];
$currencies = [$newCurrency];
}
else {
$currencies[] = $newCurrency;
......
......@@ -41,7 +41,7 @@ class CRM_Admin_Form_Setting_Mail extends CRM_Admin_Form_Setting {
}
/**
* @param $fields
* @param array $fields
*
* @return array|bool
*/
......
......@@ -48,7 +48,7 @@ class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting {
}
/**
* @param $fields
* @param array $fields
*
* @return array|bool
*/
......
......@@ -85,16 +85,19 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic {
CRM_Core_DAO::storeValues($eventTemplate, $allEventTemplates[$eventTemplate->id]);
//get listing types.
$allEventTemplates[$eventTemplate->id]['participant_listing'] = ts('Disabled');
if ($eventTemplate->participant_listing_id) {
$allEventTemplates[$eventTemplate->id]['participant_listing'] = $participantListings[$eventTemplate->participant_listing_id];
}
//get participant role
$allEventTemplates[$eventTemplate->id]['participant_role'] = '';
if ($eventTemplate->default_role_id) {
$allEventTemplates[$eventTemplate->id]['participant_role'] = $participantRoles[$eventTemplate->default_role_id];
}
//get event type.
$allEventTemplates[$eventTemplate->id]['event_type'] = '';
if (isset($eventTypes[$eventTemplate->event_type_id])) {
$allEventTemplates[$eventTemplate->id]['event_type'] = $eventTypes[$eventTemplate->event_type_id];
}
......
......@@ -40,8 +40,8 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic {
protected $_revertedId;
/**
* @param null $title
* @param null $mode
* @param string $title
* @param int $mode
*/
public function __construct($title = NULL, $mode = NULL) {
parent::__construct($title, $mode);
......
......@@ -22,10 +22,7 @@ class CRM_Api4_Page_AJAX extends CRM_Core_Page {
*/
public function run() {
$config = CRM_Core_Config::singleton();
if (!$config->debug && (!array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER) ||
$_SERVER['HTTP_X_REQUESTED_WITH'] != "XMLHttpRequest"
)
) {
if (!$config->debug && !CRM_Utils_REST::isWebServiceRequest()) {
$response = [
'error_code' => 401,
'error_message' => "SECURITY ALERT: Ajax requests can only be issued by javascript clients, eg. CRM.api4().",
......
......@@ -57,12 +57,6 @@ class CRM_Api4_Services {
[new Reference($provider)]
);
}
if (defined('CIVICRM_UF') && CIVICRM_UF === 'UnitTests'
&& file_exists('tests/phpunit/api/v4/services.xml')
) {
$loader->load('tests/phpunit/api/v4/services.xml');
}
}
/**
......
......@@ -147,7 +147,7 @@ class CRM_Badge_BAO_Badge {
}
/**
* @param $formattedRow
* @param array $formattedRow
*/
public function generateLabel($formattedRow) {
switch ($formattedRow['labelFormat']) {
......@@ -164,7 +164,7 @@ class CRM_Badge_BAO_Badge {
}
/**
* @param $formattedRow
* @param array $formattedRow
* @param int $cellspacing
*/
public function labelCreator(&$formattedRow, $cellspacing = 0) {
......@@ -349,13 +349,12 @@ class CRM_Badge_BAO_Badge {
*
* @param string $img
* Image url.
*
* @param string $x
* @param string $y
* @param null $w
* @param null $h
* @param string|null $x
* @param string|null $y
* @param int|null $w
* @param int|null $h
*/
public function printImage($img, $x = '', $y = '', $w = NULL, $h = NULL) {
public function printImage($img, $x = NULL, $y = NULL, $w = NULL, $h = NULL) {
if (!$x) {
$x = $this->pdf->GetAbsX();
}
......@@ -375,12 +374,14 @@ class CRM_Badge_BAO_Badge {
}
/**
* @param $img
* @param string $img
* Filename
* @param int $imgRes
* @param null $w
* @param null $h
* @param int|null $w
* @param int|null $h
*
* @return array
* @return int[]
* [width, height]
*/
public static function getImageProperties($img, $imgRes = 300, $w = NULL, $h = NULL) {
$imgsize = getimagesize($img);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment