Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix(Calendar): reload client when on web template change
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusweiss committed Aug 18, 2022
1 parent e45ae78 commit 0a848af
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion tine20/Calendar/Preference.php
Expand Up @@ -195,7 +195,6 @@ public function getTranslatedPreferences()
self::WEB_EVENT_TITLE_TEMPLATE => [
'label' => $translate->_('Web Event Title Template'),
'description' => $translate->_('How to build event titles in web ui.'),
self::CLIENT_NEEDS_RELOAD => true,
],
self::NOTIFICATION_LEVEL => array(
'label' => $translate->_('Get Notification Emails'),
Expand Down Expand Up @@ -329,6 +328,9 @@ public function getApplicationPreferenceDefaults($_preferenceName, $_accountId =
break;
case self::WEB_EVENT_TITLE_TEMPLATE:
$translate = Tinebase_Translation::getTranslation($this->_application);
$preference->uiconfig = [
self::CLIENT_NEEDS_RELOAD => true
];
$preference->value = '{{ summary }}';
$preference->options = '<?xml version="1.0" encoding="UTF-8"?>
<options>
Expand Down
2 changes: 1 addition & 1 deletion tine20/Calendar/translations/de.po
Expand Up @@ -2833,7 +2833,7 @@ msgid "Attendee status if the user has the status grant"
msgstr "Teilnehmer Status, wenn der Benutzer über das Status Recht verfügt"

msgid "Web Event Title Template"
msgstr "Termin Titel Template"
msgstr "Termin Titel Schablone"

msgid "How to build event titles in web ui."
msgstr "Wie der Titel in der Web-Anwendung gebildet wird."
Expand Down
4 changes: 2 additions & 2 deletions tine20/Tinebase/js/widgets/dialog/PreferencesDialog.js
Expand Up @@ -247,7 +247,7 @@ Tine.widgets.dialog.Preferences = Ext.extend(Ext.FormPanel, {
this.loadMask.show();

// get values from card panels
const [data,clientneedsreload] = this.getValuesFromPanels();
const [data, clientneedsreload] = this.getValuesFromPanels();

// save preference data
Ext.Ajax.request({
Expand Down Expand Up @@ -322,7 +322,7 @@ Tine.widgets.dialog.Preferences = Ext.extend(Ext.FormPanel, {
}
} else {
data[panel.appName][item.name] = {value: item.getValue()};
if(!clientneedsreload && (item.startValue !== item.getValue()) && item.startValue && item.clientneedsreload) {
if(!clientneedsreload && (item.startValue !== item.getValue()) && item.startValue && _.get(item, 'pref.data.uiconfig.clientneedsreload')) {
clientneedsreload = true;
}
}
Expand Down
3 changes: 1 addition & 2 deletions tine20/Tinebase/js/widgets/dialog/PreferencesPanel.js
Expand Up @@ -107,8 +107,7 @@ Tine.widgets.dialog.PreferencesPanel = Ext.extend(Ext.Panel, {
},
prefId: pref.id,
description: pref.get('description'),
clientneedsreload: pref.get('uiconfig').clientneedsreload

pref
};

var options = pref.get('options');
Expand Down

0 comments on commit 0a848af

Please sign in to comment.