Skip to content

Commit 49f3082

Browse files
committed
feat: implement separate system notification checkbox for inventory changes
1 parent e7de408 commit 49f3082

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

install/db_scripts/preferences.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
'system_notifications_role' => '',
115115
'system_notifications_new_entries' => '0',
116116
'system_notifications_profile_changes' => '0',
117+
'system_notifications_inventory_changes' => '0',
117118

118119
// Captcha
119120
'captcha_type' => 'pic',

languages/en.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,8 @@
11081108
<string name="SYS_NOT_SET">Not set</string>
11091109
<string name="SYS_NOT_VALID_DATE_FORMAT">Please use a valid date as condition for field #VAR1_BOLD#.</string>
11101110
<string name="SYS_NOTE">Note</string>
1111+
<string name="SYS_NOTIFICATION_INVENTORY_CHANGES">Notification for changes in the inventory</string>
1112+
<string name="SYS_NOTIFICATION_INVENTORY_CHANGES_DESC">Members of the stored notification role will get a system notification if items in the inventory are created, changed, deleted, reinstated, retired or imported. (Default: no)</string>
11111113
<string name="SYS_NOTIFICATION_NEW_ENTRIES">Notification for new or changed entries</string>
11121114
<string name="SYS_NOTIFICATION_NEW_ENTRIES_DESC">Members of the stored notification role will get a system notification for new or changed entries in the modules Announcements, Events, Documents &amp; Files, Photos, Web Links and forum. (Default: no)</string>
11131115
<string name="SYS_NOTIFICATION_NEW_REGISTRATION">Notification after a new registration</string>

src/Inventory/ValueObjects/ItemsData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ public function sendNotification($importData = null): bool
11921192
global $gCurrentUser, $gSettingsManager, $gL10n;
11931193

11941194
// check if notifications are enabled
1195-
if ($gSettingsManager->getBool('system_notifications_new_entries')) {
1195+
if ($gSettingsManager->getBool('system_notifications_inventory_changes')) {
11961196
$notification = new Email();
11971197
$messageDateText = 'SYS_CHANGED_AT';
11981198

src/UI/Presenter/PreferencesPresenter.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,6 +2538,12 @@ public function createSystemNotificationsForm(): string
25382538
(bool) $formValues['system_notifications_profile_changes'],
25392539
array('helpTextId' => 'SYS_NOTIFICATION_PROFILE_CHANGES_DESC')
25402540
);
2541+
$formSystemNotifications->addCheckbox(
2542+
'system_notifications_inventory_changes',
2543+
$gL10n->get('SYS_NOTIFICATION_INVENTORY_CHANGES'),
2544+
(bool) $formValues['system_notifications_inventory_changes'],
2545+
array('helpTextId' => 'SYS_NOTIFICATION_INVENTORY_CHANGES_DESC')
2546+
);
25412547

25422548
// read all roles of the organization
25432549
$sqlData = array();

themes/simple/templates/preferences/preferences.system-notifications.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{include 'sys-template-parts/form.checkbox.tpl' data=$elements['system_notifications_enabled']}
77
{include 'sys-template-parts/form.checkbox.tpl' data=$elements['system_notifications_new_entries']}
88
{include 'sys-template-parts/form.checkbox.tpl' data=$elements['system_notifications_profile_changes']}
9+
{include 'sys-template-parts/form.checkbox.tpl' data=$elements['system_notifications_inventory_changes']}
910
{include 'sys-template-parts/form.select.tpl' data=$elements['system_notifications_role']}
1011
<div class="admidio-form-group admidio-form-custom-content row mb-3">
1112
<label for="systemNotifications" class="col-sm-3 col-form-label">

0 commit comments

Comments
 (0)