From 77f342ad7f08138a59cf3074d2bb461b5b980d07 Mon Sep 17 00:00:00 2001 From: Edsel Lopez Date: Mon, 20 Jul 2020 18:16:28 +0530 Subject: [PATCH] Core overrides for 5.27 --- CRM/Core/Controller.php | 14 +++++++------- CRM/Core/Page/AJAX/Location.php | 6 +++--- CRM/Grant/BAO/Query.php | 6 +----- CRM/UF/Page/ProfileEditor.php | 4 ++-- info.xml | 9 ++++----- 5 files changed, 17 insertions(+), 22 deletions(-) diff --git a/CRM/Core/Controller.php b/CRM/Core/Controller.php index 06accaf..a2c52ee 100644 --- a/CRM/Core/Controller.php +++ b/CRM/Core/Controller.php @@ -208,7 +208,7 @@ public function __construct( parent::__construct($name, $modal); - $snippet = CRM_Utils_Array::value('snippet', $_REQUEST); + $snippet = $_REQUEST['snippet'] ?? NULL; if ($snippet) { if ($snippet == 3) { $this->_print = CRM_Core_Smarty::PRINT_PDF; @@ -284,7 +284,7 @@ public function key($name, $addSequence = FALSE, $ignoreKey = FALSE) { return NULL; } - $key = CRM_Utils_Array::value('qfKey', $_REQUEST, NULL); + $key = $_REQUEST['qfKey'] ?? NULL; if (!$key && $_SERVER['REQUEST_METHOD'] === 'GET') { $key = CRM_Core_Key::get($name, $addSequence); } @@ -417,8 +417,8 @@ public function addPages(&$stateMachine, $action = CRM_Core_Action::NONE) { $pages = $stateMachine->getPages(); foreach ($pages as $name => $value) { $className = CRM_Utils_Array::value('className', $value, $name); - $title = CRM_Utils_Array::value('title', $value); - $options = CRM_Utils_Array::value('options', $value); + $title = $value['title'] ?? NULL; + $options = $value['options'] ?? NULL; $stateName = CRM_Utils_String::getClassName($className); if (!empty($value['className'])) { $formName = $name; @@ -464,7 +464,7 @@ public function addPages(&$stateMachine, $action = CRM_Core_Action::NONE) { */ public function getButtonName() { $data = &$this->container(); - return CRM_Utils_Array::value('_qf_button_name', $data); + return $data['_qf_button_name'] ?? NULL; } /** @@ -556,8 +556,8 @@ public function wizardHeader($currentPageName) { public function addWizardStyle(&$wizard) { $wizard['style'] = [ 'barClass' => '', - 'stepPrefixCurrent' => '»', - 'stepPrefixPast' => '✔', + 'stepPrefixCurrent' => ' ', + 'stepPrefixPast' => ' ', 'stepPrefixFuture' => ' ', 'subStepPrefixCurrent' => '  ', 'subStepPrefixPast' => '  ', diff --git a/CRM/Core/Page/AJAX/Location.php b/CRM/Core/Page/AJAX/Location.php index afe32f9..b929516 100644 --- a/CRM/Core/Page/AJAX/Location.php +++ b/CRM/Core/Page/AJAX/Location.php @@ -145,7 +145,7 @@ public static function getPermissionedLocation() { if (!empty($defaults)) { foreach ($profileFields as $key => $val) { if (array_key_exists($key, $defaults)) { - $htmlType = CRM_Utils_Array::value('html_type', $val); + $htmlType = $val['html_type'] ?? NULL; if ($htmlType == 'Radio') { $elements["onbehalf_{$key}"]['type'] = $htmlType; $elements["onbehalf_{$key}"]['value'] = $defaults[$key]; @@ -233,7 +233,7 @@ public static function getLocBlock() { $element = 'name'; } $fld = "address[1][{$element}]"; - $value = CRM_Utils_Array::value($element, $location['address'][1]); + $value = $location['address'][1][$element] ?? NULL; $value = $value ? $value : ""; $result[str_replace([ '][', @@ -251,7 +251,7 @@ public static function getLocBlock() { $block = ($element == 'phone_type_id') ? 'phone' : $element; for ($i = 1; $i < 3; $i++) { $fld = "{$block}[{$i}][{$element}]"; - $value = CRM_Utils_Array::value($element, $location[$block][$i]); + $value = $location[$block][$i][$element] ?? NULL; $value = $value ? $value : ""; $result[str_replace([ '][', diff --git a/CRM/Grant/BAO/Query.php b/CRM/Grant/BAO/Query.php index f7239f5..ec3dad3 100644 --- a/CRM/Grant/BAO/Query.php +++ b/CRM/Grant/BAO/Query.php @@ -10,11 +10,7 @@ */ /** - * - * @package CRM - * @copyright CiviCRM LLC https://civicrm.org/licensing - * $Id$ - * + * Class CRM_Grant_BAO_Query */ class CRM_Grant_BAO_Query extends CRM_Core_BAO_Query { diff --git a/CRM/UF/Page/ProfileEditor.php b/CRM/UF/Page/ProfileEditor.php index a42cd9a..e16e99f 100644 --- a/CRM/UF/Page/ProfileEditor.php +++ b/CRM/UF/Page/ProfileEditor.php @@ -303,11 +303,11 @@ public static function convertCiviModelToBackboneModel($extends, $title, $availa $sectionName = 'cg_' . $customGroup->id; $section = [ 'title' => ts('%1: %2', [1 => $title, 2 => $customGroup->title]), - 'is_addable' => $customGroup->is_reserved ? FALSE : TRUE, + 'is_addable' => !$customGroup->is_reserved, '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; } diff --git a/info.xml b/info.xml index d33e6bd..7b902c1 100644 --- a/info.xml +++ b/info.xml @@ -1,6 +1,6 @@ - https://github.com/JMAConsulting/biz.jmaconsulting.grantapplications/archive/1.6.2.zip + https://github.com/JMAConsulting/biz.jmaconsulting.grantapplications/archive/1.7.zip grantapplications Grant Applications This extension enhances profile creation for Grants. Applicants can submit online grant applications after filling in fields that are configured through CiviProfile. Core and custom grant fields can be added to CiviProfiles to collect information about various applicants that will be applying online for grants. Online grant application pages can be created and managed from the grant dashboard. @@ -16,12 +16,11 @@ JMA Consulting support@jmaconsulting.biz - 2020-02-05 - 1.6.4 + 2020-07-20 + 1.7 stable - 4.7 - 5.22 + 5.27