diff --git a/src/main/java/de/deadlocker8/budgetmaster/database/Database.java b/src/main/java/de/deadlocker8/budgetmaster/database/Database.java index 5baf21d552da9b58fc99af6802836065f284e6b1..d839e1db6f2ec0501633a208a2e8c27330ad4728 100644 --- a/src/main/java/de/deadlocker8/budgetmaster/database/Database.java +++ b/src/main/java/de/deadlocker8/budgetmaster/database/Database.java @@ -90,9 +90,9 @@ public class Database numberOfEntitiesByType.put(EntityType.CATEGORY, categories.size()); numberOfEntitiesByType.put(EntityType.ACCOUNT, accounts.size()); numberOfEntitiesByType.put(EntityType.TRANSACTION, transactions.size()); - numberOfEntitiesByType.put(EntityType.CHART, charts.size()); - numberOfEntitiesByType.put(EntityType.IMAGE, images.size()); numberOfEntitiesByType.put(EntityType.TEMPLATE, templates.size()); + numberOfEntitiesByType.put(EntityType.IMAGE, images.size()); + numberOfEntitiesByType.put(EntityType.CHART, charts.size()); return numberOfEntitiesByType; } } \ No newline at end of file diff --git a/src/main/resources/languages/base_de.properties b/src/main/resources/languages/base_de.properties index 386e2a641f5d6d13f6ec3289578e9e2bc0f2ce79..d7a4cf75a0f0a1a1c0737d72f8e4bdd0e92f3b29 100644 --- a/src/main/resources/languages/base_de.properties +++ b/src/main/resources/languages/base_de.properties @@ -546,3 +546,10 @@ entity.transaction=Buchungen entity.template=Vorlagen entity.chart=Diagramme entity.image=Bilder + +import.entity.category=Alle Kategorien werden nacheinander importiert.<br>Wird dabei eine Kategorie mit gleichem Namen und gleicher Farbe in der bestehenden BudgetMaster Datenbank gefunden, so werden alle Buchungen und Vorlagen, die zur Kategorie gehören in diese bestehende Kategorie verschoben.<br>Wenn keine bestehende Kategorie den gleichen Namen und die gleiche Farbe aufweist, so wird eine neue Kategorie angelegt. +import.entity.account=Jedes zu importierende Konto wird in den weiteren Schritten des Importvorgangs einem Konto in der bestehenden Datenbank zugeordnet.<br>Die zugehörigen Buchungen und Vorlagen werden dann mit dem zugordneten Konto verknüpft.<br>Falls nicht ausreichend Konten oder kein passendes Konto existiert, können neue Konten während des Importvorgangs angelegt werden. +import.entity.transaction=Alle Buchungen werden nacheinander importiert und dabei dem jeweils verknüpften Konto zugeordnet.<br>Wiederholende Buchungen werden am Ende des Importvorgangs automatisch bis zum aktuellen Datum aktualisiert. +import.entity.template=Alle Vorlagen werden nacheinander importiert und dabei die verknüpften Konten neu zugeordnet.<br>Der Import von Vorlagen ist optional. +import.entity.image=Icons werden automatisch mit den zugehörigen Konten und Vorlagen importiert. +import.entity.chart=Es werden nur die benutzerdefinierten Diagramme importiert.<br>Der Import von Diagrammen ist optional. diff --git a/src/main/resources/languages/base_en.properties b/src/main/resources/languages/base_en.properties index cadacbdbc37846a78819d73a8d67ee60c193e948..76cc271e25c4128816cb9752004b5fb04a269966 100644 --- a/src/main/resources/languages/base_en.properties +++ b/src/main/resources/languages/base_en.properties @@ -544,3 +544,10 @@ entity.transaction=Transactions entity.template=Templates entity.chart=Charts entity.image=Images + +import.entity.category=All categories will be imported one by one.<br>If a category with the same name and color already exists in the BudgetMaster database, all transactions and templates belonging to the category will be moved to this existing category.<br>If no existing category has the same name and color, a new category will be created. +import.entity.account=Each account to be imported will be assigned to an existing account in the database during the next steps of the import process.<br>The associated transactions and templates will then be linked to the assigned account.<br>If there are not enough accounts or no matching account, new accounts can be created during the import process. +import.entity.transaction=All transactions will be imported one by one, assigning them to the respective linked account.<br>Recurring transactions are automatically updated to the current date at the end of the import process. +import.entity.template=All templates will be imported one by one, reassigning the linked accounts.<br>The import of templates is optional. +import.entity.image=Icons are automatically imported with their associated accounts and templates. +import.entity.chart=Only user-defined charts will be imported.<br>The import of charts is optional. diff --git a/src/main/resources/static/js/import.js b/src/main/resources/static/js/import.js index 434a9306b164b15602727cde5607f8bf2b468805..5fff9ce76dc0c45df2b8f60f283b18a909e660ec 100644 --- a/src/main/resources/static/js/import.js +++ b/src/main/resources/static/js/import.js @@ -10,6 +10,19 @@ $(document).ready(function() return false; } }); + + $('.import-entity-help-button').click(function() + { + let modalTitle = document.getElementById('modal-import-entity-help-title'); + modalTitle.innerHTML = this.dataset.title; + + let modalContent = document.getElementById('modal-import-entity-help-content'); + modalContent.innerHTML = this.dataset.text; + + let modalElement = document.getElementById('modal-import-entity-help'); + let modalInstance = M.Modal.getInstance(modalElement); + modalInstance.open(); + }); }); function validateForm() diff --git a/src/main/resources/templates/settings/import.ftl b/src/main/resources/templates/settings/import.ftl index e4f1b4351c075f3ede549bb86745f05a18e453a0..a1f2574b2b56eb4ceb8e452e3da5deb2760f4f0d 100644 --- a/src/main/resources/templates/settings/import.ftl +++ b/src/main/resources/templates/settings/import.ftl @@ -29,8 +29,11 @@ <table> <#list database.getNumberOfEntitiesByType() as entityType, numberOfItems> <tr> - <td class="valign-wrapper"><i class="material-icons">${entityType.getIcon()}</i><div class="import-entity-name">${locale.getString(entityType.getLocalizationKey())}</div></td> + <td><i class="material-icons left">${entityType.getIcon()}</i><div class="import-entity-name">${locale.getString(entityType.getLocalizationKey())}</div></td> <td>${numberOfItems}</td> + <td><a class="btn btn-flat text-default import-entity-help-button" + data-title="${locale.getString(entityType.getLocalizationKey())}" + data-text="${locale.getString("import.entity." + entityType.name()?lower_case)}"><i class="material-icons">help_outline</i></a></td> </tr> </#list> </table> @@ -38,6 +41,16 @@ </div> </div> + <div id="modal-import-entity-help" class="modal background-color"> + <div class="modal-content"> + <h4 id="modal-import-entity-help-title"></h4> + <p id="modal-import-entity-help-content"></p> + </div> + <div class="modal-footer background-color"> + <@header.buttonLink url='' icon='done' localizationKey='ok' color='green' classes='modal-action modal-close text-white' noUrl=true/> + </div> + </div> + <div class="container"> <div class="section center-align"> <div class="headline-small">${locale.getString("info.database.import.match.accounts")}</div>