Skip to content

Commit

Permalink
Merge branch '2024.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlabci committed Nov 15, 2024
2 parents 75c50ec + 8b8e498 commit cc59561
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 80 deletions.
4 changes: 4 additions & 0 deletions tine20/Admin/Admin.jsb2
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@
{
"text": "SchedulerPanel.js",
"path": "js/"
},
{
"text": "SchedulerModelPicker.js",
"path": "js/"
}
]
},
Expand Down
20 changes: 10 additions & 10 deletions tine20/Admin/Model/SchedulerTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ public static function inheritModelConfigHook(array &$_definition)
]
]);

Tinebase_Helper::arrayInsertAfterKey($_definition[self::FIELDS], self::FLD_CONFIG_CLASS, [
self::FLD_EMAILS => [
self::TYPE => self::TYPE_STRING,
self::LABEL => 'Emails', // _('Emails')
self::VALIDATORS => [
Zend_Filter_Input::ALLOW_EMPTY => true,
],
]
]);

$_definition[self::FIELDS][self::FLD_CONFIG] = [
self::TYPE => self::TYPE_DYNAMIC_RECORD,
self::LABEL => 'Task config', // _('Task config')
Expand All @@ -90,6 +80,16 @@ public static function inheritModelConfigHook(array &$_definition)
],
];

Tinebase_Helper::arrayInsertAfterKey($_definition[self::FIELDS], self::FLD_CONFIG, [
self::FLD_EMAILS => [
self::TYPE => self::TYPE_STRING,
self::LABEL => 'Emails', // _('Emails')
self::VALIDATORS => [
Zend_Filter_Input::ALLOW_EMPTY => true,
],
]
]);

$_definition[self::FIELDS][self::FLD_NEXT_RUN][self::VALIDATORS][Zend_Filter_Input::ALLOW_EMPTY] = true;
$_definition[self::FIELDS][self::FLD_NEXT_RUN][self::VALIDATORS][Zend_Filter_Input::DEFAULT_VALUE] = '1970-01-01 00:00:00';
$_definition[self::FIELDS][self::FLD_NEXT_RUN][self::INPUT_FILTERS] = [
Expand Down
2 changes: 2 additions & 0 deletions tine20/Admin/Model/SchedulerTask/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public static function inheritModelConfigHook(array &$_definition)
$_definition[self::RECORD_NAME] = 'Scheduled Import Task config'; // gettext('GENDER_Scheduled Import Task config')
$_definition[self::RECORDS_NAME] = 'Scheduled Import Task configs'; // ngettext('Scheduled Import Task config', 'Scheduled Import Task configs', n)

$_definition[self::TITLE_PROPERTY] = '{{ plugin_class }} {{ import_name }}';

$_definition[self::MODEL_NAME] = self::MODEL_NAME_PART;
$_definition[self::FIELDS][self::FLD_IMPORT_NAME] = [
self::TYPE => self::TYPE_STRING,
Expand Down
21 changes: 21 additions & 0 deletions tine20/Admin/js/SchedulerModelPicker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const modelPicker = Ext.extend(Tine.Tinebase.widgets.form.ModelPicker, {
// emptyText: 'Built in configs',
// fieldLabel: 'Task Type',
allowBlank: true,
initComponent() {
this.availableModels = _.get(Tine.Admin.Model.SchedulerTask.getModelConfiguration(), 'fields.config_class.config.availableModels');
this.supr().initComponent.call(this);
const app = Tine.Tinebase.appMgr.get('Admin');
this.emptyText = app.i18n._('Built in configs');
},
checkState(editDialog, record) {
this.setDisabled(record && !!+record.get('is_system'));
editDialog.getForm().findField('config').setDisabled(record && !!+record.get('is_system'));
}
})

Ext.reg('admin-schedulertask-modelpicker', modelPicker);

Tine.widgets.form.FieldManager.register('Admin', 'SchedulerTask', 'config_class', {
xtype: 'admin-schedulertask-modelpicker'
}, Tine.widgets.form.FieldManager.CATEGORY_EDITDIALOG);
139 changes: 94 additions & 45 deletions tine20/Calendar/js/ImportDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ Tine.Calendar.ImportDialog = Ext.extend(Tine.widgets.dialog.ImportDialog, {
},

getItems: function() {
return [this.getPanel()];
return [
this.getPanel(),
this.getEventOptionsPanel()
];
},

/**
Expand Down Expand Up @@ -76,7 +79,10 @@ Tine.Calendar.ImportDialog = Ext.extend(Tine.widgets.dialog.ImportDialog, {
interval: this.ttlCombo.getValue()
});
}


// finally apend generic options from Calendar_Import_Abstract
Object.assign(params.importOptions, this.eventOptionsForm.getForm().getFieldValues())

Ext.Ajax.request({
scope: this,
timeout: 1800000, // 30 minutes
Expand All @@ -102,16 +108,22 @@ Tine.Calendar.ImportDialog = Ext.extend(Tine.widgets.dialog.ImportDialog, {
this.lastImportResponse = decoded;

var that = this;

if (success) {
Ext.MessageBox.show({
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO,
fn: callback,
scope: that,
title: that.app.i18n._('Import Definition Success!'),
msg: that.app.i18n._('The Ical Import definition has been created successfully! Please wait some minutes to get the events synced by the cronjob.')
});
const type = this.typeCombo.getValue()

if (type !== 'upload' && this.ttlCombo.getValue() !== 'once') {
Ext.MessageBox.show({
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO,
fn: callback,
scope: that,
title: that.app.i18n._('Import Definition Success!'),
msg: that.app.i18n._('The Ical Import definition has been created successfully! Please wait some minutes to get the events synced by the cronjob.')
});
} else {
_.defer(_.bind(callback, that))
}

var wp = this.app.mainScreen.getWestPanel(),
tp = wp.getContainerTreePanel(),
Expand Down Expand Up @@ -363,8 +375,9 @@ Tine.Calendar.ImportDialog = Ext.extend(Tine.widgets.dialog.ImportDialog, {
example = options && options.example ? options.example : '';

var types = [
['remote_ics', this.app.i18n._('Remote / ICS')],
['upload', this.app.i18n._('Upload')]
['remote_ics', this.app.i18n._('Remote ICS File')],
['remote_caldav', i18n._('Remote CalDAV Server')],
['upload', this.app.i18n._('Upload Local File')]
]

var typeStore = new Ext.data.ArrayStore({
Expand All @@ -387,11 +400,8 @@ Tine.Calendar.ImportDialog = Ext.extend(Tine.widgets.dialog.ImportDialog, {
xtype: 'panel',
baseCls: 'ux-subformpanel',
title: this.app.i18n._('Select type of source'),
height: 100,
height: 60,
items: [{
xtype: 'label',
html: '<p>' + this.app.i18n._('Please select the type of source you want to add to Tine 2.0') + '</p><br />'
}, {
xtype: 'combo',
mode: 'local',
ref: '../../typeCombo',
Expand Down Expand Up @@ -449,34 +459,7 @@ Tine.Calendar.ImportDialog = Ext.extend(Tine.widgets.dialog.ImportDialog, {
this.getImportOptionsPanel(),
this.getDefinitionPanel()],

/**
* finish button handler for this panel
*/
onFinishButton: (function() {
if (! this.importMask) {
this.importMask = new Ext.LoadMask(this.getEl(), {msg: String.format(i18n._('Importing {0}'), this.recordClass.getRecordsName())});
}
this.importMask.show();

// collect client data
var clientRecordData = [];
var importOptions = {};

this.doImport(function(request, success, response) {
this.importMask.hide();

this.fireEvent('finish', this, this.layout.activeItem);

if (Ext.isArray(response.exceptions) && response.exceptions.length > 0) {
this.backButton.setDisabled(true);
this.finishButton.setHandler(function() {this.window.close()}, this);
} else {
this.window.close();
}
}, importOptions, clientRecordData);
}).createDelegate(this),

finishIsAllowed: (function() {
nextIsAllowed: (function() {
var credentialsCheck = false;

if (this.typeCombo.getValue() == 'remote_caldav') {
Expand All @@ -500,6 +483,72 @@ Tine.Calendar.ImportDialog = Ext.extend(Tine.widgets.dialog.ImportDialog, {

}).createDelegate(this)
};
},

getEventOptionsPanel: function () {
return {
title: this.app.i18n._('Event Import Options'),
border: false,
layout: 'fit',
frame: true,
items: [{
xtype: 'form',
ref: '../eventOptionsForm',
labelAlign: 'top',
bodyStyle: 'padding: 5px;',
defaults: { anchor: '100%' },
items: [{
xtype: 'checkbox',
fieldLabel: this.app.i18n._('Update Existing Events'),
boxLabel: this.app.i18n._('Force update of existing events'),
name: 'updateExisting'
}, {
xtype: 'checkbox',
fieldLabel: this.app.i18n._('Force Update Existing Events'),
boxLabel: this.app.i18n._("Update exiting events even if imported sequence number isn't higher"),
name: 'forceUpdateExisting'
}, {
xtype: 'checkbox',
fieldLabel: this.app.i18n._('Keep Existing Attendee'),
boxLabel: this.app.i18n._('Do not remove attendee of existing events which are not in the import data'),
name: 'keepExistingAttendee'
}, {
xtype: 'checkbox',
fieldLabel: this.app.i18n._('Delete Missing Events'),
boxLabel: this.app.i18n._('Delete events missing in import data (future only)'),
name: 'deleteMissing'
}/*, {
xtype: 'checkbox',
fieldLabel: this.app.i18n._('Basic Data Only'),
boxLabel: this.app.i18n._('Import basic data only (i.e. without attendee, alarms, uid, ...)'),
name: 'onlyBasicData'
}*/
]
}],
onFinishButton: (function() {
if (! this.importMask) {
this.importMask = new Ext.LoadMask(this.getEl(), {msg: String.format(i18n._('Importing {0}'), this.recordClass.getRecordsName())});
}
this.importMask.show();

// collect client data
var clientRecordData = [];
var importOptions = {};

this.doImport(function(request, success, response) {
this.importMask.hide();

this.fireEvent('finish', this, this.layout.activeItem);

if (Ext.isArray(response?.exceptions) && response.exceptions.length > 0) {
this.backButton.setDisabled(true);
this.finishButton.setHandler(function() {this.window.close()}, this);
} else {
this.window.close();
}
}, importOptions, clientRecordData);
}).createDelegate(this)
}
}
});

Expand Down
3 changes: 2 additions & 1 deletion tine20/Calendar/js/MainScreenCenterPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ Tine.Calendar.MainScreenCenterPanel = Ext.extend(Ext.Panel, {
* @param {Button} btn
*/
onImport: function(btn) {
var popupWindow = Tine.Calendar.ImportDialog.openWindow({

Tine.Calendar.ImportDialog.openWindow({
appName: 'Calendar',
modelName: 'Event',
defaultImportContainer: this.app.getMainScreen().getWestPanel().getContainerTreePanel().getDefaultContainer('defaultContainer'),
Expand Down
21 changes: 16 additions & 5 deletions tine20/Calendar/translations/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -2391,7 +2391,7 @@ msgstr "vorletzten"

#: Model/Rrule.php:473
msgid "fifth"
msgstr "fünften"
msgstr "fünfte"

#: Model/Rrule.php:478
msgid "st"
Expand Down Expand Up @@ -2911,17 +2911,28 @@ msgid "The container already exists"
msgstr "Der Container existiert bereits"

msgid ""
"You are about to change the status of the event itself and not just your "
"own status. Do you really want to change the event status?"
"You are about to change the status of the event itself and not just your own "
"status. Do you really want to change the event status?"
msgstr ""
"Sie sind dabei, den Termin-Status und nicht nur Ihren eigenen Teilnehmer-"
"Status am Termin zu ändern. Wollen Sie wirklich den Termin-Status ändern? "
"Die Teilnahme von Ihnen und der der anderen Teilnehmenden bleibt "
"unverändert."
"Die Teilnahme von Ihnen und der der anderen Teilnehmenden bleibt unverändert."

msgid "Save in calendar without response"
msgstr "Termin ohne Rückmeldung im Kalender speichern"

#: views/eventNotification.php:12
msgid "Updates from"
msgstr "Änderungen von"

#: js/ImportDialog.js:366
msgid "Remote ICS File"
msgstr "Entfernte ICS Datei"

#: js/ImportDialog.js:367
msgid "Remote CalDAV Server"
msgstr "Entfernter CalDAV Server"

#: js/ImportDialog.js:368
msgid "Upload Local File"
msgstr "Lokale Datei hochladen"
19 changes: 0 additions & 19 deletions tine20/Tinebase/js/widgets/form/ModelPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,6 @@ Tine.Tinebase.widgets.form.ModelPicker = Ext.extend(Ext.form.ComboBox, {

Ext.reg('tw-modelpicker', Tine.Tinebase.widgets.form.ModelPicker);

const modelPicker = Ext.extend(Tine.Tinebase.widgets.form.ModelPicker, {
emptyText: 'Built in configs',
fieldLabel: 'Task Type',
allowBlank: true,
checkState(editDialog, record) {
this.setDisabled(record && !!+record.get('is_system'));
editDialog.getForm().findField('config').setDisabled(record && !!+record.get('is_system'));
}
})

Ext.reg('admin-schedulertask-modelpicker', modelPicker);
window.setTimeout(() => {
Tine.widgets.form.FieldManager.register('Admin', 'SchedulerTask', 'config_class', {
xtype: 'admin-schedulertask-modelpicker'
}, Tine.widgets.form.FieldManager.CATEGORY_EDITDIALOG);
}, 500);



Ext.reg('tw-modelspickers', Ext.extend(Tine.widgets.grid.PickerGridPanel, {
searchComboConfig: {
xtype: 'tw-modelpicker',
Expand Down

0 comments on commit cc59561

Please sign in to comment.