Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAE-823: Align with latest CiviCRM version 5.51 #870

Merged
merged 35 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b1d4a7f
MAE-823: Update CiviCRM version in test workflow
olayiwola-compucorp Aug 31, 2022
174c0df
CIVICRM-1867: Remove unnecessary DisplayAllCustomGroupsInCaseForm bui…
agileware-justin Aug 31, 2022
c16390f
PHP fatal error fixes, issue #848
Aug 13, 2022
ad0cfad
MAE-823: Apply phpcs linter fixes
olayiwola-compucorp Sep 1, 2022
dbd704b
MAE-823: Update the info file to point to the supported CiviCRM version
olayiwola-compucorp Sep 1, 2022
fe6a897
MAE-823: from_email_address is a compulsory field when sending mail
olayiwola-compucorp Sep 1, 2022
c6810f1
MAE-823: Sets the form submission values in Session
olayiwola-compucorp Sep 1, 2022
840cd4b
MAE-823: Prevent the hook from running when subject is not set
olayiwola-compucorp Sep 1, 2022
5065f15
MAE-823: Ignore the header value causing test to fail
olayiwola-compucorp Sep 1, 2022
cba5188
MAE-823: Use new CRM_Case_Form_Task_Email path
olayiwola-compucorp Sep 2, 2022
1f4b80e
MAE-823: Use CRM_Case_Form_Task_Email in email test
olayiwola-compucorp Sep 2, 2022
76f0ae0
MAE-823: Restrict emails in the "to" form field for each case ID
olayiwola-compucorp Sep 2, 2022
06c3b96
MAE-892: Use PHP8.0 container in test workflow
olayiwola-compucorp Sep 26, 2022
cc7832e
MAE-892: Use usermenu php8 branch in test workflow
olayiwola-compucorp Sep 26, 2022
5d6391f
MAE-892: Return NULL when category array is empty
olayiwola-compucorp Sep 26, 2022
f32a646
MAE-892: Supress mock builder depreciation error
olayiwola-compucorp Sep 26, 2022
e6a385a
MAE-892: Use valid activity type
olayiwola-compucorp Sep 27, 2022
c58035b
MAE-892: Supress all reflection depreciation error
olayiwola-compucorp Sep 27, 2022
64b5b05
MAE-892: Apply Compuco CiviCRM 5.51.3 patch
olayiwola-compucorp Sep 28, 2022
d5f6f55
MAE-892: Add proper check for possible undefined index
olayiwola-compucorp Sep 28, 2022
16a482b
MAE-892: Use Drupal version 7.79
olayiwola-compucorp Sep 28, 2022
c405508
MAE-892: Fix PHPCS linter
olayiwola-compucorp Sep 28, 2022
f483ad9
MAE-956: Fix Manage cases and new case category pages on PHP 8
omarabuhussein Nov 9, 2022
bdb37f7
MAE-955: Fix Cases export on CiviCRM versions >= 5.41.0
olayiwola-compucorp Nov 15, 2022
56b13c0
MAE-955: Only get case details if array of cases are returned
olayiwola-compucorp Nov 15, 2022
c7344c7
MAE-966: Resolve issue with recording case activity on contact page
olayiwola-compucorp Nov 28, 2022
1db1359
MAE-966: Resolve issue with creating Application Review Activity
olayiwola-compucorp Nov 29, 2022
982c300
MAE-966: Apply PHPCS linters fix
olayiwola-compucorp Nov 29, 2022
9ed232f
MAE-976: Fix the issue with linking two cases
olayiwola-compucorp Dec 9, 2022
ca489ac
MAE-978: Fix issue with creating CaseActivity reports
olayiwola-compucorp Dec 9, 2022
c17424e
MAE-999: Fix issue preventing user from creating activity report
olayiwola-compucorp Dec 27, 2022
8c6a593
MAE-992: Fix restrict email recipients to contact involved with case
asem-compuco Dec 22, 2022
f2ac98e
MAE-823: Fix UI not showing the right labels for other case_type_cate…
olayiwola-compucorp Jan 11, 2023
9e2fa03
Merge pull request #891 from compucorp/MAE-993-fix-UI
olayiwola-compucorp Jan 12, 2023
1ff3311
CIVIIB-57: Use master branch of Usermenu extension for test action
olayiwola-compucorp Jan 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
run-unit-tests:

runs-on: ubuntu-latest
container: compucorp/civicrm-buildkit:1.1.1-php7.2-chrome
container: compucorp/civicrm-buildkit:1.3.0-php8.0-chrome

env:
CIVICRM_EXTENSIONS_DIR: site/web/sites/all/modules/civicrm/tools/extensions
Expand All @@ -28,7 +28,15 @@ jobs:
run : amp config:set --mysql_dsn=mysql://root:root@mysql:3306

- name: Build Drupal site
run: civibuild create drupal-clean --civi-ver 5.39.1 --cms-ver 7.85 --web-root $GITHUB_WORKSPACE/site
run: civibuild create drupal-clean --civi-ver 5.51.3 --cms-ver 7.79 --web-root $GITHUB_WORKSPACE/site

- uses: compucorp/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repo: compucorp/civicrm-core
version: 5.51.3
path: site/web/sites/all/modules/civicrm

- uses: actions/checkout@v2
with:
Expand Down
11 changes: 0 additions & 11 deletions CRM/Case/Export/Form/Map.php

This file was deleted.

10 changes: 0 additions & 10 deletions CRM/Case/Export/Form/Select.php

This file was deleted.

4 changes: 1 addition & 3 deletions CRM/Civicase/Activity/ContactActivitiesSelector.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php

/**
* Class CRM_Civicase_Activity_ContactActivitiesSelector.
*
* Handle fetching activities for a given contact.
* Handles fetching activities for a given contact.
*/
class CRM_Civicase_Activity_ContactActivitiesSelector {

Expand Down
13 changes: 5 additions & 8 deletions CRM/Civicase/BAO/Query/ContactLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@
class CRM_Civicase_BAO_Query_ContactLock extends CRM_Contact_BAO_Query_Interface {

/**
* Implements getFields method, required by CRM_Contact_BAO_Query_Interface
* class.
* {@inheritDoc}
*/
public function &getFields() {
$fields = array();
$fields = [];

return $fields;
}

/**
* Alters from statement to include case locks.
*/
public function from($fieldName, $mode, $side) {
public static function from($fieldName, $mode, $side) {
if ($fieldName == 'civicase_contactlock') {
$loggedContactID = CRM_Core_Session::singleton()->getLoggedInContactID();

Expand All @@ -38,7 +37,7 @@ public function from($fieldName, $mode, $side) {
/**
* Alters where statement to include case locks.
*/
public function where(&$query) {
public static function where(&$query) {
if ($query->_mode == CRM_Contact_BAO_QUERY::MODE_ACTIVITY) {

$query->_where[0][] = CRM_Contact_BAO_Query::buildClause("activity_lock", 'IS NULL');
Expand All @@ -47,9 +46,7 @@ public function where(&$query) {
}

/**
* Implements getPanesMapper, required by getPanesMapper hook.
*
* @param $panes
* {@inheritDoc}
*/
public function getPanesMapper(&$panes) {

Expand Down
29 changes: 29 additions & 0 deletions CRM/Civicase/Event/Listener/AssetBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

use Civi\Angular\Page\Modules;
use Civi\Core\Event\GenericHookEvent;

/**
* Asset Builder Event Listener Class.
*/
class CRM_Civicase_Event_Listener_AssetBuilder {

/**
* Add word replacements to Angular asset.
*
* @param \Civi\Core\Event\GenericHookEvent $event
* AssetBuilder Event.
*/
public static function addWordReplacements(GenericHookEvent $event) {
if ($event->asset == 'angular-modules.json') {
$caseCategoryName = \Civi::cache('metadata')->get('current_case_category');
CRM_Civicase_Hook_Helper_CaseTypeCategory::addWordReplacements($caseCategoryName);

// Rebuild the asset if it has been built.
if (!empty($event->content)) {
Modules::buildAngularModules($event);
}
}
}

}
48 changes: 9 additions & 39 deletions CRM/Civicase/Form/Report/BaseExtendedReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -1173,23 +1173,9 @@ protected function addAggregateTotalField($fieldName, array $aggregates) {
* of fields to be selected in the column header fields which is not
* possible in the original function in base class.
*
* @param array $specs
* Specifications.
* @param string $tableName
* Table name.
* @param string|null $daoName
* DAO name.
* @param string|null $tableAlias
* Table alias.
* @param array $defaults
* Defaults.
* @param array $options
* Options.
*
* @return array
* Column lists.
* @inheritDoc
*/
protected function buildColumns(array $specs, $tableName, $daoName = NULL, $tableAlias = NULL, array $defaults = [], array $options = []) {
protected function buildColumns($specs, $tableName, $daoName = NULL, $tableAlias = NULL, $defaults = [], $options = []) {

if (!$tableAlias) {
$tableAlias = str_replace('civicrm_', '', $tableName);
Expand Down Expand Up @@ -1283,8 +1269,8 @@ protected function buildColumns(array $specs, $tableName, $daoName = NULL, $tabl
}
}
}
$columns[$tableName]['prefix'] = isset($options['prefix']) ? $options['prefix'] : '';
$columns[$tableName]['prefix_label'] = isset($options['prefix_label']) ? $options['prefix_label'] : '';
$columns[$tableName]['prefix'] = $options['prefix'] ?? '';
$columns[$tableName]['prefix_label'] = $options['prefix_label'] ?? '';
if (isset($options['group_title'])) {
$groupTitle = $options['group_title'];
}
Expand All @@ -1305,12 +1291,9 @@ protected function buildColumns(array $specs, $tableName, $daoName = NULL, $tabl
* results for the row totals based on new Data aggregate functions
* introduced.
*
* @param array $rows
* Result rows.
* @param bool $pager
* Pager.
* @inheritDoc
*/
public function formatDisplay(array &$rows, $pager = TRUE) {
public function formatDisplay(&$rows, $pager = TRUE) {
// Set pager based on if any limit was applied in the query.
if ($pager) {
$this->setPager();
Expand Down Expand Up @@ -1352,19 +1335,7 @@ public function formatDisplay(array &$rows, $pager = TRUE) {
/**
* Use the options for the field to map the display value.
*
* @param string $value
* Value of the field.
* @param array $row
* Row display values.
* @param string $selectedField
* Selected field.
* @param string $criteriaFieldName
* Criteria field name.
* @param array $specs
* Specifications of the column.
*
* @return string
* Label of the option ids.
* @inheritDoc
*/
public function alterFromOptions($value, array &$row, $selectedField, $criteriaFieldName, array $specs) {
if ($specs['data_type'] == 'ContactReference') {
Expand Down Expand Up @@ -1798,10 +1769,9 @@ public function buildQuickForm() {
* when next the report instance is opened, those panes are automatically
* expanded.
*
* @param array $params
* Params.
* @inheritDoc
*/
public function setParams(array $params) {
public function setParams($params) {
if (empty($params)) {
$this->_params = $params;
return;
Expand Down
8 changes: 2 additions & 6 deletions CRM/Civicase/Form/Report/ColumnDefinitionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,9 @@ public function getCaseColumns(array $options) {
/**
* Get contact columns.
*
* @param array $options
* Options for generating the columns.
*
* @return array
* Contact columns
* @inheritDoc
*/
public function getContactColumns(array $options = []) {
protected function getContactColumns($options = []) {
$defaultOptions = [
'prefix' => '',
'prefix_label' => '',
Expand Down
12 changes: 6 additions & 6 deletions CRM/Civicase/Form/Report/ExtendedReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ function aggregateSelect() {
*
* @throws Exception
*/
function addColumnAggregateSelect($fieldName, $dbAlias, $spec) {
public function addColumnAggregateSelect($fieldName, $dbAlias, array $spec) {
if (empty($fieldName)) {
$this->addAggregateTotal($fieldName);
return;
Expand Down Expand Up @@ -2314,7 +2314,7 @@ protected function addNullToFilterOptions($table, $fieldName, $label = '--does n
* @param string $fieldAlias
* @param string $title
*/
protected function addRowHeader($tableAlias, $selectedField, $fieldAlias, $title = '') {
protected function addRowHeader($tableAlias, array $selectedField, $fieldAlias, $title = '') {
if (empty($tableAlias)) {
$this->_select = 'SELECT 1 '; // add a fake value just to save lots of code to calculate whether a comma is required later
$this->_rollup = NULL;
Expand Down Expand Up @@ -2578,7 +2578,7 @@ public function sectionTotals() {
*
* @param $rows
*/
function alterRollupRows(&$rows) {
function alterRollupRows(array &$rows) {
if (count($rows) === 1) {
// If the report only returns one row there is no rollup.
return;
Expand Down Expand Up @@ -2636,7 +2636,7 @@ function alterRollupRows(&$rows) {
*
* @return string
*/
function alterFromOptions($value, &$row, $selectedField, $criteriaFieldName, $specs) {
public function alterFromOptions($value, array &$row, $selectedField, $criteriaFieldName, array $specs) {
if ($specs['data_type'] == 'ContactReference') {
if (!empty($row[$selectedField])) {
return CRM_Contact_BAO_Contact::displayName($row[$selectedField]);
Expand Down Expand Up @@ -7488,7 +7488,7 @@ protected function getCustomDataDaos($extends) {
* @param $prefixLabel
* @param $tableKey
*/
protected function addCustomTableToColumns($field, $currentTable, $prefix, $prefixLabel, $tableKey) {
protected function addCustomTableToColumns(array $field, $currentTable, $prefix, $prefixLabel, $tableKey) {
$entity = $field['extends'];
if (in_array($entity, ['Individual', 'Organization', 'Household'])) {
$entity = 'Contact';
Expand Down Expand Up @@ -7572,7 +7572,7 @@ protected function getCustomFieldMetadata($field, $prefixLabel, $prefix = '') {
* @return array
* @throws \Exception
*/
protected function getCustomFieldOptions($spec) {
protected function getCustomFieldOptions(array $spec) {
$options = [];
if (!empty($spec['options'])) {
return $spec['options'];
Expand Down
2 changes: 1 addition & 1 deletion CRM/Civicase/Helper/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function get(string $categoryName) {
$categoryData = array_shift($categoryData['values']);

$categoryCustomFields = (new CaseCategoryCustomFieldsSetting())->get($categoryData['value']);
$categoryData['singular_label'] = $categoryCustomFields['singular_label'];
$categoryData['singular_label'] = $categoryCustomFields['singular_label'] ?? NULL;

return $categoryData;
}
Expand Down
77 changes: 0 additions & 77 deletions CRM/Civicase/Hook/BuildForm/DisplayAllCustomGroupsInCaseForm.php

This file was deleted.

4 changes: 2 additions & 2 deletions CRM/Civicase/Hook/BuildForm/HandleDraftActivities.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CRM_Civicase_Hook_BuildForm_HandleDraftActivities {
];

const PDF_LETTER_FORM_NAME = 'CRM_Contact_Form_Task_PDF';
const EMAIL_FORM_NAME = 'CRM_Contact_Form_Task_Email';
const EMAIL_FORM_NAME = 'CRM_Case_Form_Task_Email';
const SPECIAL_FORMS = [
self::PDF_LETTER_FORM_NAME,
self::EMAIL_FORM_NAME,
Expand Down Expand Up @@ -96,7 +96,7 @@ private function addSaveDraftButton(CRM_Core_Form &$form, $formName) {
'id' => $id,
'return' => 'case_id',
]);
$composeUrl = CRM_Utils_System::url("civicrm/activity/$atype/add", [
$composeUrl = CRM_Utils_System::url("civicrm/case/$atype/add", [
'action' => 'add',
'reset' => 1,
'caseId' => $caseId['case_id'][0],
Expand Down
Loading