From 969b22efb28d1366c7196af643ea4d04e8d4425f Mon Sep 17 00:00:00 2001 From: reneolivo Date: Thu, 7 Mar 2019 15:54:39 -0400 Subject: [PATCH 1/7] C51-284: Add overdue notification setting and field --- civicaseextras.php | 50 +++++++++++-------- settings/Civicaseextras.setting.php | 23 +++++++++ .../CRM/Civicaseextra/Admin/Form/Settings.tpl | 10 ++++ 3 files changed, 61 insertions(+), 22 deletions(-) create mode 100644 settings/Civicaseextras.setting.php create mode 100644 templates/CRM/Civicaseextra/Admin/Form/Settings.tpl diff --git a/civicaseextras.php b/civicaseextras.php index 7a7f313..304d996 100644 --- a/civicaseextras.php +++ b/civicaseextras.php @@ -138,30 +138,36 @@ function civicaseextras_civicrm_alterAngular(\Civi\Angular\Manager $angular) { _civicaseextras_civicrm_alterAngular($angular); } -// --- Functions below this ship commented out. Uncomment as required. --- - /** - * Implements hook_civicrm_preProcess(). + * Implements hook_civicrm_alterContent(). + * Adds extra settings fields to the Civicase Admin Settings form. * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_preProcess - * -function civicaseextras_civicrm_preProcess($formName, &$form) { + * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterContent/ + */ +function civicaseextras_civicrm_alterContent (&$content, $context, $templateName, $form) { + $isViewingTheCaseAdminForm = get_class($form) === CRM_Admin_Form_Setting_Case::class; + + if (!$isViewingTheCaseAdminForm) { + return; + } + + $settingsTemplate = &CRM_Core_Smarty::singleton(); + $settingsTemplateHtml = $settingsTemplate->fetchWith('CRM/Civicaseextra/Admin/Form/Settings.tpl', []); -} // */ + $doc = phpQuery::newDocumentHTML($content); + $doc->find('table.form-layout tr:last')->append($settingsTemplateHtml); + + $content = $doc->getDocument(); +} /** - * Implements hook_civicrm_navigationMenu(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_navigationMenu - * -function civicaseextras_civicrm_navigationMenu(&$menu) { - _civicaseextras_civix_insert_navigation_menu($menu, 'Mailings', array( - 'label' => E::ts('New subliminal message'), - 'name' => 'mailing_subliminal_message', - 'url' => 'civicrm/mailing/subliminal', - 'permission' => 'access CiviMail', - 'operator' => 'OR', - 'separator' => 0, - )); - _civicaseextras_civix_navigationMenu($menu); -} // */ + * Implements hook_civicrm_preProcess(). + */ +function civicaseextras_civicrm_preProcess($formName, &$form) { + if ($formName == 'CRM_Admin_Form_Setting_Case') { + $settings = $form->getVar('_settings'); + $settings['civicaseOverdueNotificationLimit'] = CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME; + + $form->setVar('_settings', $settings); + } +} diff --git a/settings/Civicaseextras.setting.php b/settings/Civicaseextras.setting.php new file mode 100644 index 0000000..9fee7f7 --- /dev/null +++ b/settings/Civicaseextras.setting.php @@ -0,0 +1,23 @@ + [ + 'group_name' => 'CiviCRM Preferences', + 'group' => 'core', + 'name' => 'civicaseOverdueNotificationLimit', + 'quick_form_type' => 'Element', + 'type' => 'Integer', + 'default' => 90, + 'html_type' => 'text', + 'html_attributes' => array( + 'size' => 2, + 'maxlength' => 4, + ), + 'add' => '4.7', + 'title' => 'Display Overdue notification after days', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'This adds a visual indicator for cases where there has not been any activity for the selected number of days. This will be visible on the Manage Cases screen on the last updated date.', + 'help_text' => '', + ], +]; diff --git a/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl b/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl new file mode 100644 index 0000000..fc821b2 --- /dev/null +++ b/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl @@ -0,0 +1,10 @@ + + {$form.civicaseOverdueNotificationLimit.label} + {$form.civicaseOverdueNotificationLimit.html}
+ + {ts}This adds a visual indicator for cases where there has not been any activity + for the selected number of days. This will be visible on the Manage Cases screen + on the last updated date.{/ts} + + + From 055c1278a581a5f4b02ac6465f4ab84eb13d22f1 Mon Sep 17 00:00:00 2001 From: reneolivo Date: Thu, 7 Mar 2019 16:26:09 -0400 Subject: [PATCH 2/7] C51-284: Expose overdue notification limit setting --- ang/civicaseextras.ang.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ang/civicaseextras.ang.php b/ang/civicaseextras.ang.php index 94472c9..ccb6a15 100644 --- a/ang/civicaseextras.ang.php +++ b/ang/civicaseextras.ang.php @@ -1,5 +1,9 @@ (int) Civi::settings()->get('civicaseOverdueNotificationLimit'), +]; + return [ 'js' => [ 'assetBuilder://visual-bundle.js', @@ -13,7 +17,7 @@ 'partials' => [ 'ang/civicaseextras', ], - 'settings' => [], + 'settings' => $settings, 'requires' => [ 'crmUtil' ], From 2fc4edd3457253f8e6c6af5de8e184fd5cebf6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Olivo?= Date: Thu, 7 Mar 2019 23:14:16 +0000 Subject: [PATCH 3/7] C51-284: Decorate the format case function so it appends overdue dates information to the case --- ang/civicaseextras.ang.php | 15 ++++--- .../decorators/formatCase.decorator.js | 31 ++++++++++++++ .../decorators/formatCase.decorator.spec.js | 42 +++++++++++++++++++ ang/test/global.js | 1 + ang/test/karma.conf.js | 4 +- package.json | 1 + 6 files changed, 88 insertions(+), 6 deletions(-) create mode 100644 ang/civicaseextras/decorators/formatCase.decorator.js create mode 100644 ang/test/civicaseextras/decorators/formatCase.decorator.spec.js diff --git a/ang/civicaseextras.ang.php b/ang/civicaseextras.ang.php index ccb6a15..95ca42c 100644 --- a/ang/civicaseextras.ang.php +++ b/ang/civicaseextras.ang.php @@ -1,15 +1,20 @@ (int) Civi::settings()->get('civicaseOverdueNotificationLimit'), ]; return [ - 'js' => [ - 'assetBuilder://visual-bundle.js', - 'ang/civicaseextras.js', - 'ang/civicaseextras/*.js', - ], + 'js' => getCivicaseExtrasJSFiles(), 'css' => [ 'assetBuilder://visual-bundle.css', 'css/*.css', diff --git a/ang/civicaseextras/decorators/formatCase.decorator.js b/ang/civicaseextras/decorators/formatCase.decorator.js new file mode 100644 index 0000000..d309027 --- /dev/null +++ b/ang/civicaseextras/decorators/formatCase.decorator.js @@ -0,0 +1,31 @@ +(function (angular, caseStatuses, civicaseextras) { + var module = angular.module('civicase'); + + module.config(function ($provide) { + $provide.decorator('formatCase', function ($delegate) { + var originalFormatCase = $delegate; + /** + * Enhances the formatCase method so it adds information about overfue dates for the case. + * + * @param {Object} caseItem + * @return {Object} + */ + return function formatCase (caseItem) { + var overdueNotificationLimit = parseInt(civicaseextras.overdueNotificationLimit, 10); + var isStatusOpen = caseStatuses[caseItem.status_id].grouping === 'Opened'; + var isModifiedDateOverdue = moment().subtract(overdueNotificationLimit, 'days') + .isSameOrAfter(caseItem.modified_date); + caseItem = originalFormatCase(caseItem); + caseItem.overdueDates = { + modified_date: isStatusOpen && isModifiedDateOverdue + }; + + return caseItem; + }; + }); + }); +})( + angular, + CRM.civicase.caseStatuses, + CRM.civicaseextras +); diff --git a/ang/test/civicaseextras/decorators/formatCase.decorator.spec.js b/ang/test/civicaseextras/decorators/formatCase.decorator.spec.js new file mode 100644 index 0000000..1575d8c --- /dev/null +++ b/ang/test/civicaseextras/decorators/formatCase.decorator.spec.js @@ -0,0 +1,42 @@ +/* eslint-env jasmine */ + +(function (CRM) { + describe('formatCase decorator', function () { + var formatCase, formattedCase, mockCase; + + beforeEach(module('civicase', 'civicaseextras', 'civicase.data')); + + beforeEach(inject(function (CasesData, _formatCase_) { + mockCase = CasesData.get().values[0]; + formatCase = _formatCase_; + })); + + describe('when the case modified date is over the limit', function () { + beforeEach(function () { + CRM.civicaseextras.overdueNotificationLimit = 90; + mockCase.modified_date = moment() + .subtract(90, 'days') + .format('YYYY-MM-DD HH:mm:ss'); + formattedCase = formatCase(mockCase); + }); + + it('marks the modified date as overdue', function () { + expect(formattedCase.overdueDates.modified_date).toBe(true); + }); + }); + + describe('when the case modified date is not over the limit', function () { + beforeEach(function () { + CRM.civicaseextras.overdueNotificationLimit = 160; + mockCase.modified_date = moment() + .subtract(90, 'days') + .format('YYYY-MM-DD HH:mm:ss'); + formattedCase = formatCase(mockCase); + }); + + it('does not mark the modified date as overdue', function () { + expect(formattedCase.overdueDates.modified_date).toBe(false); + }); + }); + }); +})(CRM); diff --git a/ang/test/global.js b/ang/test/global.js index 6c4a1cf..4a0acfe 100644 --- a/ang/test/global.js +++ b/ang/test/global.js @@ -2,6 +2,7 @@ (function (CRM) { CRM.civicase = {}; + CRM.civicaseextras = {}; CRM.angular = { requires: {} }; /** * Dependency Injection for civicase module, defined in ang/civicase.ang.php diff --git a/ang/test/karma.conf.js b/ang/test/karma.conf.js index cf06427..69958fb 100644 --- a/ang/test/karma.conf.js +++ b/ang/test/karma.conf.js @@ -28,7 +28,9 @@ module.exports = function (config) { // angular templates extPath + '/ang/civicaseextras/*.html', - // Civicase Mock files + // Civicase files + civicasePath + '/ang/civicase.js', + civicasePath + '/ang/civicase/case/factories/format-case.factory.js', { pattern: civicasePath + '/ang/test/mocks/modules.mock.js' }, { pattern: civicasePath + '/ang/test/mocks/**/*.js' }, diff --git a/package.json b/package.json index 748ec08..6d4a1f8 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "globals": [ "CRM", "angular", + "moment", "inject" ] }, From ee1c40472a8a7c7072428a0c21c96b9e76adb968 Mon Sep 17 00:00:00 2001 From: reneolivo Date: Fri, 8 Mar 2019 08:07:08 -0400 Subject: [PATCH 4/7] C51-284: Implement modified date warning on case list table --- civicaseextras.php | 47 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/civicaseextras.php b/civicaseextras.php index 304d996..4ab2b36 100644 --- a/civicaseextras.php +++ b/civicaseextras.php @@ -2,6 +2,8 @@ require_once 'civicaseextras.civix.php'; use CRM_Civicaseextras_ExtensionUtil as E; +use \Civi\Angular\ChangeSet as AngularChangeSet; +use \Civi\Angular\Manager as AngularManager; /** * Implements hook_civicrm_config(). @@ -134,8 +136,49 @@ function civicaseextras_civicrm_entityTypes(&$entityTypes) { _civicaseextras_civix_civicrm_entityTypes($entityTypes); } -function civicaseextras_civicrm_alterAngular(\Civi\Angular\Manager $angular) { - _civicaseextras_civicrm_alterAngular($angular); +function civicaseextras_civicrm_alterAngular(AngularManager $angular) { + _civicaseextras_alterAngular_addVisualAlert($angular); + _civicaseextras_alterAngular_appendOutcomePanel($angular); +} + +/** + * Replaces the date column type on case lists so it displays an alert when the + * given date is overdue. + * + * @param $angular AngularManager + */ +function _civicaseextras_alterAngular_addVisualAlert (AngularManager &$angular) { + $changeSet = AngularChangeSet::create('display_warning_for_overdue_cases') + ->alterHtml('~/civicase/case/list/directives/case-list-table.directive.html', + function (phpQueryObject $doc) { + $doc->find('[ng-switch-when="date"]') + ->html(' + + {{ CRM.utils.formatDate(item[header.name]) }} + + + {{ CRM.utils.formatDate(item[header.name]) }} + error + + '); + }); + $angular->add($changeSet); +} + +/** + * Appends the case outcomes to the case details summary. + * + * @param $angular AngularManager + */ +function _civicaseextras_alterAngular_appendOutcomePanel (AngularManager &$angular) { + $changeSet = AngularChangeSet::create('inject_case_outcomes') + ->alterHtml('~/civicase/case/details/summary-tab/case-summary-custom-data.html', + function (phpQueryObject $doc) { + $doc->find('civicase-masonry-grid') + ->prepend(''); + }); + $angular->add($changeSet); } /** From 2ef0b0e9aacbf05709fc978485e1e575138603fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Olivo?= Date: Mon, 11 Mar 2019 14:50:44 +0000 Subject: [PATCH 5/7] C51-284: PR Feedback --- ang/civicaseextras.ang.php | 20 +++- .../decorators/formatCase.decorator.js | 43 +++---- civicaseextras.php | 105 +++++++++++------- .../CRM/Civicaseextra/Admin/Form/Settings.tpl | 2 +- .../Civicaseextra/Partials/CaseListTable.tpl | 12 ++ 5 files changed, 118 insertions(+), 64 deletions(-) create mode 100644 templates/CRM/Civicaseextra/Partials/CaseListTable.tpl diff --git a/ang/civicaseextras.ang.php b/ang/civicaseextras.ang.php index 95ca42c..615f450 100644 --- a/ang/civicaseextras.ang.php +++ b/ang/civicaseextras.ang.php @@ -1,6 +1,9 @@ (int) Civi::settings()->get('civicaseOverdueNotificationLimit'), -]; +/** + * Returns a list of Civicaseextras settings that will be shared with the front-end. + * + * @return array + */ +function getCivicaseExtrasSettings () { + return [ + 'overdueNotificationLimit' => (int) Civi::settings()->get('civicaseOverdueNotificationLimit'), + ]; +} return [ 'js' => getCivicaseExtrasJSFiles(), @@ -22,7 +32,7 @@ function getCivicaseExtrasJSFiles () { 'partials' => [ 'ang/civicaseextras', ], - 'settings' => $settings, + 'settings' => getCivicaseExtrasSettings(), 'requires' => [ 'crmUtil' ], diff --git a/ang/civicaseextras/decorators/formatCase.decorator.js b/ang/civicaseextras/decorators/formatCase.decorator.js index d309027..2b69915 100644 --- a/ang/civicaseextras/decorators/formatCase.decorator.js +++ b/ang/civicaseextras/decorators/formatCase.decorator.js @@ -2,28 +2,31 @@ var module = angular.module('civicase'); module.config(function ($provide) { - $provide.decorator('formatCase', function ($delegate) { - var originalFormatCase = $delegate; - /** - * Enhances the formatCase method so it adds information about overfue dates for the case. - * - * @param {Object} caseItem - * @return {Object} - */ - return function formatCase (caseItem) { - var overdueNotificationLimit = parseInt(civicaseextras.overdueNotificationLimit, 10); - var isStatusOpen = caseStatuses[caseItem.status_id].grouping === 'Opened'; - var isModifiedDateOverdue = moment().subtract(overdueNotificationLimit, 'days') - .isSameOrAfter(caseItem.modified_date); - caseItem = originalFormatCase(caseItem); - caseItem.overdueDates = { - modified_date: isStatusOpen && isModifiedDateOverdue - }; + $provide.decorator('formatCase', formatCaseDecorator); + }); + + function formatCaseDecorator ($delegate) { + var originalFormatCase = $delegate; - return caseItem; + /** + * Enhances the formatCase method so it adds information about overdue dates for the case. + * + * @param {Object} caseItem + * @return {Object} + */ + return function formatCase (caseItem) { + var overdueNotificationLimit = parseInt(civicaseextras.overdueNotificationLimit, 10); + var isStatusOpen = caseStatuses[caseItem.status_id].grouping === 'Opened'; + var isModifiedDateOverdue = moment().subtract(overdueNotificationLimit, 'days') + .isSameOrAfter(caseItem.modified_date); + caseItem = originalFormatCase(caseItem); + caseItem.overdueDates = { + modified_date: isStatusOpen && isModifiedDateOverdue }; - }); - }); + + return caseItem; + }; + } })( angular, CRM.civicase.caseStatuses, diff --git a/civicaseextras.php b/civicaseextras.php index 4ab2b36..a35a0ea 100644 --- a/civicaseextras.php +++ b/civicaseextras.php @@ -136,11 +136,66 @@ function civicaseextras_civicrm_entityTypes(&$entityTypes) { _civicaseextras_civix_civicrm_entityTypes($entityTypes); } +/** + * Implements hook_civicrm_alterAngular(). + * + * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterAngular/ + */ function civicaseextras_civicrm_alterAngular(AngularManager $angular) { _civicaseextras_alterAngular_addVisualAlert($angular); _civicaseextras_alterAngular_appendOutcomePanel($angular); } +/** + * Implements hook_civicrm_alterContent(). + * + * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterContent/ + */ +function civicaseextras_civicrm_alterContent (&$content, $context, $templateName, $form) { + $isViewingTheCaseAdminForm = get_class($form) === CRM_Admin_Form_Setting_Case::class; + + if ($isViewingTheCaseAdminForm) { + _civicaseextras_alterContent_addCivicaseAdminSettingsFields($content); + } +} + +/** + * Implements hook_civicrm_preProcess(). + * + * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_preProcess/ + */ +function civicaseextras_civicrm_preProcess($formName, &$form) { + if ($formName == 'CRM_Admin_Form_Setting_Case') { + _civicaseextras_preProcess_addCivicaseAdminSettingsFieldsReference($form); + } +} + +/** + * Adds extra settings fields to the Civicase Admin Settings form. + * + * @param string $content the original form content. + */ +function _civicaseextras_alterContent_addCivicaseAdminSettingsFields (&$content) { + $settingsTemplateHtml = _civicaseextras_getTemplateContent('CRM/Civicaseextra/Admin/Form/Settings.tpl'); + + $doc = phpQuery::newDocumentHTML($content); + $doc->find('table.form-layout tr:last')->append($settingsTemplateHtml); + + $content = $doc->getDocument(); +} + +/** + * It adds extra settings to the Civicase settings page. + * + * @param object $form a reference to the civicase admin form. + */ +function _civicaseextras_preProcess_addCivicaseAdminSettingsFieldsReference (&$form) { + $settings = $form->getVar('_settings'); + $settings['civicaseOverdueNotificationLimit'] = CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME; + + $form->setVar('_settings', $settings); +} + /** * Replaces the date column type on case lists so it displays an alert when the * given date is overdue. @@ -151,18 +206,12 @@ function _civicaseextras_alterAngular_addVisualAlert (AngularManager &$angular) $changeSet = AngularChangeSet::create('display_warning_for_overdue_cases') ->alterHtml('~/civicase/case/list/directives/case-list-table.directive.html', function (phpQueryObject $doc) { + $caseListTableHtml = _civicaseextras_getTemplateContent('CRM/Civicaseextra/Partials/CaseListTable.tpl'); + $doc->find('[ng-switch-when="date"]') - ->html(' - - {{ CRM.utils.formatDate(item[header.name]) }} - - - {{ CRM.utils.formatDate(item[header.name]) }} - error - - '); + ->html($caseListTableHtml); }); + $angular->add($changeSet); } @@ -182,35 +231,15 @@ function (phpQueryObject $doc) { } /** - * Implements hook_civicrm_alterContent(). - * Adds extra settings fields to the Civicase Admin Settings form. + * Returns the HTML generated by the smarty template located at the given path. * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_alterContent/ - */ -function civicaseextras_civicrm_alterContent (&$content, $context, $templateName, $form) { - $isViewingTheCaseAdminForm = get_class($form) === CRM_Admin_Form_Setting_Case::class; - - if (!$isViewingTheCaseAdminForm) { - return; - } - - $settingsTemplate = &CRM_Core_Smarty::singleton(); - $settingsTemplateHtml = $settingsTemplate->fetchWith('CRM/Civicaseextra/Admin/Form/Settings.tpl', []); - - $doc = phpQuery::newDocumentHTML($content); - $doc->find('table.form-layout tr:last')->append($settingsTemplateHtml); - - $content = $doc->getDocument(); -} - -/** - * Implements hook_civicrm_preProcess(). + * @param string $templatePath the path tot he smarty template. + * @param array $vars the list of vars and their values to pass to the template. + * + * @return string */ -function civicaseextras_civicrm_preProcess($formName, &$form) { - if ($formName == 'CRM_Admin_Form_Setting_Case') { - $settings = $form->getVar('_settings'); - $settings['civicaseOverdueNotificationLimit'] = CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME; +function _civicaseextras_getTemplateContent ($templatePath, $vars = []) { + $smarty = &CRM_Core_Smarty::singleton(); - $form->setVar('_settings', $settings); - } + return $smarty->fetchWith($templatePath, $vars); } diff --git a/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl b/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl index fc821b2..ccd2bf6 100644 --- a/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl +++ b/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl @@ -1,4 +1,4 @@ - + {$form.civicaseOverdueNotificationLimit.label} {$form.civicaseOverdueNotificationLimit.html}
diff --git a/templates/CRM/Civicaseextra/Partials/CaseListTable.tpl b/templates/CRM/Civicaseextra/Partials/CaseListTable.tpl new file mode 100644 index 0000000..05abaaa --- /dev/null +++ b/templates/CRM/Civicaseextra/Partials/CaseListTable.tpl @@ -0,0 +1,12 @@ + + {literal} + {{ CRM.utils.formatDate(item[header.name]) }} + {/literal} + + + {literal} + {{ CRM.utils.formatDate(item[header.name]) }} + {/literal} + error + From fba825c9f828052eac2501835dad8a7a5387228d Mon Sep 17 00:00:00 2001 From: Debarshi Bhaumik Date: Thu, 14 Mar 2019 15:22:51 +0530 Subject: [PATCH 6/7] C51-284: Change settings name --- ang/civicaseextras.ang.php | 2 +- civicaseextras.php | 2 +- settings/Civicaseextras.setting.php | 6 +++--- templates/CRM/Civicaseextra/Admin/Form/Settings.tpl | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ang/civicaseextras.ang.php b/ang/civicaseextras.ang.php index 615f450..84769ba 100644 --- a/ang/civicaseextras.ang.php +++ b/ang/civicaseextras.ang.php @@ -19,7 +19,7 @@ function getCivicaseExtrasJSFiles () { */ function getCivicaseExtrasSettings () { return [ - 'overdueNotificationLimit' => (int) Civi::settings()->get('civicaseOverdueNotificationLimit'), + 'overdueNotificationLimit' => (int) Civi::settings()->get('civicaseCaseLastUpdatedNotificationLimit'), ]; } diff --git a/civicaseextras.php b/civicaseextras.php index a35a0ea..5982949 100644 --- a/civicaseextras.php +++ b/civicaseextras.php @@ -191,7 +191,7 @@ function _civicaseextras_alterContent_addCivicaseAdminSettingsFields (&$content) */ function _civicaseextras_preProcess_addCivicaseAdminSettingsFieldsReference (&$form) { $settings = $form->getVar('_settings'); - $settings['civicaseOverdueNotificationLimit'] = CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME; + $settings['civicaseCaseLastUpdatedNotificationLimit'] = CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME; $form->setVar('_settings', $settings); } diff --git a/settings/Civicaseextras.setting.php b/settings/Civicaseextras.setting.php index 9fee7f7..eebd82f 100644 --- a/settings/Civicaseextras.setting.php +++ b/settings/Civicaseextras.setting.php @@ -1,10 +1,10 @@ [ + 'civicaseCaseLastUpdatedNotificationLimit' => [ 'group_name' => 'CiviCRM Preferences', 'group' => 'core', - 'name' => 'civicaseOverdueNotificationLimit', + 'name' => 'civicaseCaseLastUpdatedNotificationLimit', 'quick_form_type' => 'Element', 'type' => 'Integer', 'default' => 90, @@ -14,7 +14,7 @@ 'maxlength' => 4, ), 'add' => '4.7', - 'title' => 'Display Overdue notification after days', + 'title' => 'Last updated notification after days', 'is_domain' => 1, 'is_contact' => 0, 'description' => 'This adds a visual indicator for cases where there has not been any activity for the selected number of days. This will be visible on the Manage Cases screen on the last updated date.', diff --git a/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl b/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl index ccd2bf6..8175459 100644 --- a/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl +++ b/templates/CRM/Civicaseextra/Admin/Form/Settings.tpl @@ -1,6 +1,6 @@ - {$form.civicaseOverdueNotificationLimit.label} - {$form.civicaseOverdueNotificationLimit.html}
+ {$form.civicaseCaseLastUpdatedNotificationLimit.label} + {$form.civicaseCaseLastUpdatedNotificationLimit.html}
{ts}This adds a visual indicator for cases where there has not been any activity for the selected number of days. This will be visible on the Manage Cases screen From 0a1c198848e42ab4b3e436924fce6a35a3455da8 Mon Sep 17 00:00:00 2001 From: Debarshi Bhaumik Date: Tue, 19 Mar 2019 17:49:50 +0530 Subject: [PATCH 7/7] Release: Update info.xml --- info.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/info.xml b/info.xml index 9d71479..ff6e6d1 100644 --- a/info.xml +++ b/info.xml @@ -14,8 +14,8 @@ http://compucorp.co.uk http://www.gnu.org/licenses/agpl-3.0.html - 2018-10-29 - 1.0.0-alpha1 + 2019-03-19 + 1.0.0-alpha3 alpha 4.7