From a6a64aa4a508e164c81c522887430a450a88276d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Sch=C3=BCle?= Date: Thu, 7 Sep 2023 09:59:20 +0200 Subject: [PATCH 1/2] conf(Tasks/Import): add checklist as example file --- tine20/Tasks/Import/definitions/tasks_import_csv.xml | 1 + tine20/Tasks/Import/examples/checklist.csv | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 tine20/Tasks/Import/examples/checklist.csv diff --git a/tine20/Tasks/Import/definitions/tasks_import_csv.xml b/tine20/Tasks/Import/definitions/tasks_import_csv.xml index 45652f90ede..332a51337e4 100644 --- a/tine20/Tasks/Import/definitions/tasks_import_csv.xml +++ b/tine20/Tasks/Import/definitions/tasks_import_csv.xml @@ -8,6 +8,7 @@ 0 , Import CSV formatted tasks + Tasks/Import/examples/checklist.csv csv diff --git a/tine20/Tasks/Import/examples/checklist.csv b/tine20/Tasks/Import/examples/checklist.csv new file mode 100644 index 00000000000..f300a6f7e9d --- /dev/null +++ b/tine20/Tasks/Import/examples/checklist.csv @@ -0,0 +1,4 @@ +summary,due,priority,description,percent,status,completed,alarm_minutes_before +Configure Backup,+1 week friday,normal,,0,NEEDS-ACTION,,1440 +Configure Monitoring,+1 week friday,normal,,0,NEEDS-ACTION,,1440 +Restore Test Database,+1 week friday,normal,,0,NEEDS-ACTION,,1440 From 338fafb8617be5cef384001eaee23c4acbc0427c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Sch=C3=BCle?= Date: Thu, 11 Jan 2024 11:37:47 +0100 Subject: [PATCH 2/2] tweak(Tinebase/ImportDialog): only show text about example file if there is one --- .../js/widgets/dialog/ImportDialog.js | 36 ++++++------------- tine20/Tinebase/translations/de.po | 3 ++ 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/tine20/Tinebase/js/widgets/dialog/ImportDialog.js b/tine20/Tinebase/js/widgets/dialog/ImportDialog.js index 5996a8faed6..87ed39524ed 100644 --- a/tine20/Tinebase/js/widgets/dialog/ImportDialog.js +++ b/tine20/Tinebase/js/widgets/dialog/ImportDialog.js @@ -3,7 +3,7 @@ * * @license http://www.gnu.org/licenses/agpl.html AGPL Version 3 * @author Cornelius Weiss - * @copyright Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de) + * @copyright Copyright (c) 2007-2024 Metaways Infosystems GmbH (http://www.metaways.de) */ Ext.ns('Tine.widgets.dialog'); @@ -236,7 +236,7 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, { * returns the file panel of this wizard (step 1) * * @TODO restrict allowed extensions on definition selection OR - * restirct allowed definitions on file selection + * restrict allowed definitions on file selection */ getFilePanel: function() { if (this.filePanel) { @@ -247,6 +247,10 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, { description = def ? this.app.i18n._hidden(def.get('description')) : '', options = def ? def.get('plugin_options_json') : null, example = options && options.example ? options.example : ''; + + const importText = (example !== '') + ? i18n._('Following you find a list of all supported import formats and a sample file, how Tine 2.0 expects your file to look like.').replace(/Tine 2\.0/g, Tine.title) + : i18n._('Following you find a list of all supported import formats.'); return { title: i18n._('Choose File and Format'), @@ -277,16 +281,12 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, { baseCls: 'ux-subformpanel', title: i18n._('What should the file you upload look like?'), flex: 1, - items: [/*{ - xtype: 'label', - cls: 'tb-login-big-label', - html: i18n._('What should the file you upload look like?') + '
' - },*/ { + items: [{ xtype: 'label', html: '

' + i18n._('Tine 2.0 does not understand all kind of files you might want to upload. You will have to manually adjust your file so Tine 2.0 can handle it.').replace(/Tine 2\.0/g, Tine.title) + '


' }, { xtype: 'label', - html: '

' + i18n._('Following you find a list of all supported import formats and a sample file, how Tine 2.0 expects your file to look like.').replace(/Tine 2\.0/g, Tine.title) + '


' + html: '

' + importText + '


' }, { xtype: 'label', html: '

' + i18n._('Please select the import format of the file you want to upload').replace(/Tine 2\.0/g, Tine.title) + '

' @@ -313,7 +313,6 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, { html: example ? ('

' + i18n._('Download example file') + '

') : '

 

' }, { xtype: 'displayfield', -// fieldLabel: i18n._('Import description'), ref: '../../definitionDescription', height: 70, value: description, @@ -483,13 +482,7 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, { frame: true, ref: '../conflictsPanel', canonicalName: 'ImportResolveConflicts', - items: [/*{ - xtype: 'label', - ref: '../conflictsLabel', - rawText: '

' + i18n._('There are {0} {1} that might already exist.') + '

', - html: '

', - height: 20 - },*/ { + items: [{ xtype: 'paging', ref: '../conflictPagingToolbar', pageSize: 1, @@ -661,14 +654,8 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, { return this.summaryPanel; } var exceptionExpander = new Ext.ux.grid.RowExpander({ - tpl : new Ext.XTemplate('{[this.showClientRecord(values)]}', { showClientRecord: function(values) { + tpl : new Ext.XTemplate('{[this.showClientRecord(values)]}', { function(values) { if (values && values.exception && values.exception.clientRecord) { - // there is no generic detailsPanel retirval yet -// if (Ext.isObject(values.exception.clientRecord)) { -// var detailsPanel = new Tine.Addressbook.ContactGridDetailsPanel({}); -// -// return detailsPanel.tpl.apply(values.exception.clientRecord); -// } return Ext.util.Format.htmlEncode(Ext.encode(values.exception.clientRecord)); } else { return i18n._('No Detail Informations'); @@ -858,8 +845,7 @@ Tine.widgets.dialog.ImportDialog.openWindow = function (config) { height: 600, name: Tine.widgets.dialog.ImportDialog.windowNamePrefix + Ext.id(), contentPanelConstructor: 'Tine.widgets.dialog.ImportDialog', - contentPanelConstructorConfig: config//, -// modal: true + contentPanelConstructorConfig: config }); return window; }; diff --git a/tine20/Tinebase/translations/de.po b/tine20/Tinebase/translations/de.po index deda3d0b50c..67fa149870b 100644 --- a/tine20/Tinebase/translations/de.po +++ b/tine20/Tinebase/translations/de.po @@ -2480,6 +2480,9 @@ msgstr "" "Nachfolgend finden Sie eine Liste mit allen Import-Formaten und eine " "Beispieldatei, anhand derer Sie sehen, wir die Datei aussehen sollte." +msgid "Following you find a list of all supported import formats." +msgstr "Nachfolgend finden Sie eine Liste mit allen unterstützten Import-Formaten." + #: js/widgets/dialog/ImportDialog.js:292 #: js/widgets/dialog/SimpleImportDialog.js:191 msgid "Please select the import format of the file you want to upload"