Skip to content

Commit

Permalink
Merge branch 'pu/ps/merge2024' into 'main'
Browse files Browse the repository at this point in the history
merge 2024 -> main

See merge request tine20/tine20!6617
  • Loading branch information
pschuele committed Feb 20, 2025
2 parents 64722fe + 549c743 commit 7cd7c62
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
12 changes: 7 additions & 5 deletions tine20/Addressbook/js/ListEditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,18 @@ Tine.Addressbook.ListEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
if (editDialog?.mailingListPanel) {
const checked = editDialog.mailingListPanel.isMailinglistCheckbox.checked;
const field = editDialog.getForm().findField('email');
field.setVisible(checked);
field.validate();
field[checked ? 'show' : 'hide']();
editDialog.doLayout();
field.validate();
}
},
validator: function (value) {
if(!value) {
return false;
const editDialog = this.findParentBy((c) => {return c instanceof Tine.widgets.dialog.EditDialog})
if (editDialog?.mailingListPanel?.isMailinglistCheckbox?.checked) {
if (!value) return false;
return Tine.Tinebase.common.checkEmailDomain(value);
}
return Tine.Tinebase.common.checkEmailDomain(value);
return true;
},
disabled: ! Tine.Tinebase.common.hasRight('manage_list_email_options', 'Addressbook'),
}], [new Tine.Tinebase.widgets.keyfield.ComboBox({
Expand Down
1 change: 1 addition & 0 deletions tine20/Addressbook/js/MailinglistPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Tine.Addressbook.MailinglistPanel = Ext.extend(Ext.Panel, {
maxLength: 128,
disabled: ! Tine.Tinebase.common.hasRight('manage_list_email_options', 'Addressbook'),
allowBlank: false,
hidden: true,
checkState: function (editDialog, record) {
this.validate();
},
Expand Down
23 changes: 16 additions & 7 deletions tine20/Admin/js/GroupEditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,27 @@ Tine.Admin.Groups.EditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
disabled: this.record.get('visibility') === 'hidden'
}], [{
columnWidth: 0.5,
xtype: 'textfield',
xtype: 'mirrortextfield',
fieldLabel: this.app.i18n._('E-mail'),
name: 'email',
anchor: '100%',
vtype: 'email',
maxLength: 255,
allowBlank: true,
checkState: function (editDialog, field) {
const checked = editDialog.record.data.xprops?.useAsMailinglist;
field = editDialog.getForm().findField('email');
field.setVisible(checked);
editDialog.doLayout();
const checked = editDialog.record.data.xprops?.useAsMailinglist;
field = editDialog.getForm().findField('email');
field[checked ? 'show' : 'hide']();
editDialog.doLayout();
field.validate();
},
validator: function (value) {
const editDialog = this.findParentBy((c) => {return c instanceof Tine.widgets.dialog.EditDialog})
if (editDialog?.record?.data?.xprops?.useAsMailinglist) {
if (!value) return false;
return Tine.Tinebase.common.checkEmailDomain(value);
}
return true;
},
}, {
columnWidth: 0.5,
Expand Down Expand Up @@ -151,10 +160,10 @@ Tine.Admin.Groups.EditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
Tine.Tinebase.registry.get('manageSmtpEmailUser') &&
adb.featureEnabled('featureMailinglist')
) {
var mailingListPanel = new Tine.Addressbook.MailinglistPanel({
this.mailingListPanel = new Tine.Addressbook.MailinglistPanel({
editDialog: this
});
tabpanelItems.push(mailingListPanel);
tabpanelItems.push(this.mailingListPanel);
}

if (this.app.featureEnabled('xpropsEditor')) {
Expand Down

0 comments on commit 7cd7c62

Please sign in to comment.