diff --git a/redaxo/src/addons/structure/plugins/history/lang/de_de.lang b/redaxo/src/addons/structure/plugins/history/lang/de_de.lang
index c5ff6562e9..13a427f5a7 100644
--- a/redaxo/src/addons/structure/plugins/history/lang/de_de.lang
+++ b/redaxo/src/addons/structure/plugins/history/lang/de_de.lang
@@ -1,14 +1,20 @@
structure_history = Historie
structure_history_title_info = Kurzerklärung
structure_history_snapshot_reactivate = Diese Version übernehmen
+structure_history_snapshot_live_reactivate = Diese Version in Liveversion übernehmen
+structure_history_snapshot_draft_reactivate = Diese Version in Arbeitsversion übernehmen
+structure_history_draft_warning = Achtung: Die Arbeitsversion ist nicht versioniert. Wenn Sie die rechts ausgewählte Version in die Arbeitsversion wiederherstellen, geht der Inhalt der aktuellen Arbeitsversion unwiderruflich verloren. Sind Sie sicher?
structure_history_snapshot_reactivated = Version wurde übernommen
structure_history_overview_versions = history_overview_versions
structure_history_current_version = Aktuelle Version
+structure_history_current_live_version = Aktuelle Liveversion
structure_history_info_content =
Ein History PlugIn mit welchem man Änderungen in den Artikelinhalten aufnehmen kann. Es wird jeweils ein Snapshot der Version erstellt und mit einem Datum versehen. Nachträglich können dann ältere Versionen wieder aktiviert werden.
structure_history_todos = Todos
structure_history_todos_content =
cronjob vorbereiten
History deaktivierbar machen
Einstellungen einbauen, um die Anzahl der Version einzuschränken. Z.B. nach einer Woche nur eine Version/Tag behalten. nach einem Monat nur noch eine Version/Monat behalten..
Skalierungswerte der Webseite setzen
Darstellung aufhübschen ala Time Machine ?
-perm_options_history[article_rollback] = Artikel wiederherstellen (Historie)
+perm_options_history[read] = Artikel-Historie anzeigen
+perm_options_history[article_rollback] = Frühere Artikel-Snapshots wiederherstellen (Historie)
+perm_options_history[article_draft_rollback] = Frühere Artikel-Snapshots in Arbeitsversion wiederherstellen (Historie)
structure_history_button_delete_history = Historie komplett löschen
structure_history_deleted = Historie wurde komplett gelöscht.
diff --git a/redaxo/src/addons/structure/plugins/history/lang/en_gb.lang b/redaxo/src/addons/structure/plugins/history/lang/en_gb.lang
index 5a8bde8419..d866f7b2e2 100644
--- a/redaxo/src/addons/structure/plugins/history/lang/en_gb.lang
+++ b/redaxo/src/addons/structure/plugins/history/lang/en_gb.lang
@@ -1,14 +1,20 @@
structure_history = History
structure_history_title_info = Short explanation
structure_history_snapshot_reactivate = Revert to this version
+structure_history_snapshot_live_reactivate = Revert live version to this version
+structure_history_snapshot_draft_reactivate = Revert draft version to this version
+structure_history_draft_warning = Warning: The draft version is not versioned. Restoring the selected version to the draft will permanently overwrite the current draft content. Are you sure?
structure_history_snapshot_reactivated = Version has been revertet
structure_history_overview_versions = History overview
structure_history_current_version = Current version
+structure_history_current_live_version = Current live version
structure_history_info_content =
The History PlugIn records all changes made to an article and creates snapshots which can later be used to restore a specific article to a previous state.
structure_history_todos = To do
structure_history_todos_content =
prepare cronjob
allow History to be turned off
Build settings, to reduce the number of version. Example: keep only one version after a month/week/day.
set scaling values for the website
make the visual appearance prettier similar to Time Machine?
-perm_options_history[article_rollback] = Restore article (History)
+perm_options_history[read] = View article history
+perm_options_history[article_rollback] = Restore previous article snapshots (History)
+perm_options_history[article_draft_rollback] = Restore previous article snapshots to draft version (History)
structure_history_button_delete_history = Delete all snapshots from History
structure_history_deleted = All snapshots have been deleted.
diff --git a/redaxo/src/addons/structure/plugins/history/lang/es_es.lang b/redaxo/src/addons/structure/plugins/history/lang/es_es.lang
index 9b3b5924aa..1cac54d577 100644
--- a/redaxo/src/addons/structure/plugins/history/lang/es_es.lang
+++ b/redaxo/src/addons/structure/plugins/history/lang/es_es.lang
@@ -1,14 +1,20 @@
structure_history = Historia
structure_history_title_info = Breve explicación
structure_history_snapshot_reactivate = Aceptar esta versión
+structure_history_snapshot_live_reactivate = Aceptar esta versión en la versión en vivo
+structure_history_snapshot_draft_reactivate = Aceptar esta versión en la versión de trabajo
+structure_history_draft_warning = Atención: La versión de trabajo no está versionada. Si restaura la versión seleccionada a la versión de trabajo, el contenido actual de la versión de trabajo se perderá de forma irrecuperable. ¿Está seguro?
structure_history_snapshot_reactivated = Se adoptó la versión
structure_history_overview_versions = Versiones generales de la historia
structure_history_current_version = Versión actual
+structure_history_current_live_version = Versión en vivo actual
structure_history_info_content =
Un plug-in de la historia con la que puede registrar los cambios en el contenido del artículo. En cada caso, una versión instantánea y dado una fecha. Posteriormente versiones anteriores pueden entonces ser re-activados.
structure_history_todos = Todos
structure_history_todos_content =
cronjob preparar
Historia hacer desactivado
Instalar las opciones para restringir el número de versiones. Por ejemplo, mantener sólo una versión / día después de una semana. retener meses después de un mes sólo una versión /..
Los valores escalados el sitio web creado
representación aufhübschen ala máquina del tiempo?
-perm_options_history[article_rollback] = Restablecimiento del artículo (Historia)
+perm_options_history[read] = Ver historial del artículo
+perm_options_history[article_rollback] = Restaurar instantáneas anteriores del artículo (Historia)
+perm_options_history[article_draft_rollback] = Restaurar instantáneas anteriores del artículo en versión de trabajo (Historia)
structure_history_button_delete_history = Borrar por completo la historia
structure_history_deleted = La historia ha sido completamente borrada.
diff --git a/redaxo/src/addons/structure/plugins/history/lang/it_it.lang b/redaxo/src/addons/structure/plugins/history/lang/it_it.lang
index 29a7fcd541..25776a69b3 100644
--- a/redaxo/src/addons/structure/plugins/history/lang/it_it.lang
+++ b/redaxo/src/addons/structure/plugins/history/lang/it_it.lang
@@ -1,16 +1,21 @@
-structure_history =
-structure_history_title_info =
-structure_history_snapshot_reactivate =
-structure_history_snapshot_reactivated =
-structure_history_overview_versions =
-structure_history_current_version =
-structure_history_info_content =
-structure_history_todos =
-structure_history_todos_content =
+structure_history =
+structure_history_title_info =
+structure_history_snapshot_reactivate =
+structure_history_snapshot_live_reactivate =
+structure_history_snapshot_draft_reactivate =
+structure_history_draft_warning =
+structure_history_snapshot_reactivated =
+structure_history_overview_versions =
+structure_history_current_version =
+structure_history_current_live_version =
+structure_history_info_content =
+structure_history_todos =
+structure_history_todos_content =
-perm_options_history[article_rollback] =
-
-structure_history_button_delete_history =
-structure_history_deleted =
-structure_history_savedby =
-structure_history_close =
+perm_options_history[read] = Visualizza cronologia articolo
+perm_options_history[article_rollback] =
+perm_options_history[article_draft_rollback] =
+structure_history_button_delete_history =
+structure_history_deleted =
+structure_history_savedby =
+structure_history_close =
diff --git a/redaxo/src/addons/structure/plugins/history/lang/pt_br.lang b/redaxo/src/addons/structure/plugins/history/lang/pt_br.lang
index 25b7de3893..daeb88f556 100644
--- a/redaxo/src/addons/structure/plugins/history/lang/pt_br.lang
+++ b/redaxo/src/addons/structure/plugins/history/lang/pt_br.lang
@@ -1,14 +1,20 @@
structure_history = História
structure_history_title_info = Explicação curta
structure_history_snapshot_reactivate = Reverter para essa versão
+structure_history_snapshot_live_reactivate = Reverter versão ao vivo para esta versão
+structure_history_snapshot_draft_reactivate = Reverter versão de rascunho para esta versão
+structure_history_draft_warning = Atenção: A versão de rascunho não é versionada. Restaurar a versão selecionada para o rascunho irá substituir permanentemente o conteúdo atual do rascunho. Tem certeza?
structure_history_snapshot_reactivated = Versão foi revertida
structure_history_overview_versions = Panorama da história
structure_history_current_version = Versão atual
+structure_history_current_live_version = Versão ao vivo atual
structure_history_info_content =
O PlugIn história grava todas as alterações feitas em um produto e cria snapshots que podem ser utilizados posteriormente para restaurar um status anterior de produto específico.
structure_history_todos = A ser feito
structure_history_todos_content =
preparar cronjob
permite que o PlugIn "história" seja desligado
Criar configurações, para reduzir o número de versão. Exemplo: mantenha apenas uma versão após um mês / semana / diaLi>
definir valores de escala para o site li>
Tornar a aparência mais bonita, semelhante ao Time Machine? Li> ul>
-perm_options_history[article_rollback] = Restaurar produto (história)
+perm_options_history[read] = Ver histórico do artigo
+perm_options_history[article_rollback] = Restaurar snapshots anteriores do artigo (história)
+perm_options_history[article_draft_rollback] = Restaurar snapshots anteriores do artigo para versão de rascunho (história)
structure_history_button_delete_history = Deletar todos os snapshots do História
structure_history_deleted = Todos os snapshots foram deletados
diff --git a/redaxo/src/addons/structure/plugins/history/lang/ru_ru.lang b/redaxo/src/addons/structure/plugins/history/lang/ru_ru.lang
index 2f24726e4b..a1d167a5f2 100644
--- a/redaxo/src/addons/structure/plugins/history/lang/ru_ru.lang
+++ b/redaxo/src/addons/structure/plugins/history/lang/ru_ru.lang
@@ -1,14 +1,20 @@
structure_history = История
structure_history_title_info = Краткое пояснение
structure_history_snapshot_reactivate = Вернуться к этой версии
+structure_history_snapshot_live_reactivate = Применить эту версию к живой версии
+structure_history_snapshot_draft_reactivate = Применить эту версию к рабочей версии
+structure_history_draft_warning = Внимание: Рабочая версия не версионируется. Восстановление выбранной версии в рабочую версию безвозвратно перезапишет её текущее содержимое. Вы уверены?
structure_history_snapshot_reactivated = Версия была изменена
structure_history_overview_versions = Обзор истории
structure_history_current_version = Текущая версия
+structure_history_current_live_version = Текущая живая версия
structure_history_info_content =
Плагин History PlugIn записывает все изменения, внесенные в статью, и создает снэпшоты, которые впоследствии можно использовать для восстановления предыдущего состояния конкретной статьи.
structure_history_todos = Сделать
structure_history_todos_content =
Подготовить cronjob
Разрешить отключение истории
Настройки сборки, позволяющие уменьшить количество версий. Пример: хранить только одну версию через месяц/неделю/день.
Установить значения масштабирования для сайта
Cделать визуальный вид более красивым, похожим на Time Machine?
-perm_options_history[article_rollback] = Восстановить статью (История)
+perm_options_history[read] = Просмотр истории статьи
+perm_options_history[article_rollback] = Восстановить предыдущие снэпшоты статьи (История)
+perm_options_history[article_draft_rollback] = Восстановить предыдущие снэпшоты статьи в рабочую версию (История)
structure_history_button_delete_history = Удаление всех снэпшотов из истории
structure_history_deleted = Все снэпшоты были удалены
diff --git a/redaxo/src/addons/structure/plugins/history/lang/sv_se.lang b/redaxo/src/addons/structure/plugins/history/lang/sv_se.lang
index cf924f6f43..7c10c7347f 100644
--- a/redaxo/src/addons/structure/plugins/history/lang/sv_se.lang
+++ b/redaxo/src/addons/structure/plugins/history/lang/sv_se.lang
@@ -1,14 +1,20 @@
structure_history = Historia
structure_history_title_info = Kort förklaring
structure_history_snapshot_reactivate = Spara den här versionen
+structure_history_snapshot_live_reactivate = Spara den här versionen som liveversion
+structure_history_snapshot_draft_reactivate = Spara den här versionen som arbetsversion
+structure_history_draft_warning = Varning: Arbetsversionen är inte versionerad. Om du återställer den valda versionen till arbetsversionen kommer det aktuella innehållet i arbetsversionen att gå förlorat återkallbart. Är du säker?
structure_history_snapshot_reactivated = Versionen har sparas
structure_history_overview_versions = Historiköversikt
structure_history_current_version = Aktuell version
+structure_history_current_live_version = Aktuell liveversion
structure_history_info_content =
Historik PlugIn registrerar alla ändringar som gjorts i en artikel och skapar ögonblicksbilder som senare kan användas för att återställa en specifik artikel till ett tidigare tillstånd. P>
structure_history_todos = Att göra
structure_history_todos_content =
Förbered cronjob li>
Tillåta historiken att stängas av li>
Gör inställningar för att minska antalet versioner. Exempel: Behåll bara en version efter en månad / vecka / dag. Li>
Ange skalvärden för webbplatsen li>
Gör det visuella utseendet snyggare som t.ex. Time Machine? Li> ul>
-perm_options_history[article_rollback] = återskapa artikeln fån historiken
+perm_options_history[read] = Visa artikelhistorik
+perm_options_history[article_rollback] = Återställ tidigare artikelbilder (historik)
+perm_options_history[article_draft_rollback] = Återställ tidigare artikelbilder till arbetsversion (historik)
structure_history_button_delete_history = Radera historik totalt.
structure_history_deleted = Alla historik har tagits bort.
diff --git a/redaxo/src/addons/structure/plugins/history/lib/article_slice_history.php b/redaxo/src/addons/structure/plugins/history/lib/article_slice_history.php
index 2e1545cd23..7c58cd23c8 100644
--- a/redaxo/src/addons/structure/plugins/history/lib/article_slice_history.php
+++ b/redaxo/src/addons/structure/plugins/history/lib/article_slice_history.php
@@ -118,6 +118,52 @@ public static function restoreSnapshot($historyDate, $articleId, $clangId)
return true;
}
+ /**
+ * Restore a snapshot from history into the draft revision (revision=1) if the 'version' addon is enabled.
+ *
+ * @param string $historyDate
+ * @param int $articleId
+ * @param int $clangId
+ *
+ * @return bool
+ */
+ public static function restoreDraftSnapshot($historyDate, $articleId, $clangId)
+ {
+ self::checkTables();
+
+ $sql = rex_sql::factory();
+ $slices = $sql->getArray('select id from ' . $sql->escapeIdentifier(self::getTable()) . ' where article_id=? and clang_id=? and revision=? and history_date=?', [$articleId, $clangId, 0, $historyDate]);
+
+ if (0 == count($slices)) {
+ return false;
+ }
+
+ $articleSlicesTable = rex_sql_table::get(rex::getTable('article_slice'));
+
+ $sql = rex_sql::factory();
+ $sql->setQuery('delete from ' . $sql->escapeIdentifier(rex::getTable('article_slice')) . ' where article_id=? and clang_id=? and revision=?', [$articleId, $clangId, 1]);
+
+ $slices = rex_sql::factory();
+ $slices = $slices->getArray('select * from ' . $slices->escapeIdentifier(self::getTable()) . ' where article_id=? and clang_id=? and revision=? and history_date=?', [$articleId, $clangId, 0, $historyDate]);
+
+ foreach ($slices as $slice) {
+ $sql = rex_sql::factory();
+ $sql->setTable(rex::getTable('article_slice'));
+
+ $ignoreFields = ['id', 'slice_id', 'history_date', 'history_type', 'history_user'];
+ foreach ($articleSlicesTable->getColumns() as $column) {
+ $columnName = $column->getName();
+ if (!in_array($columnName, $ignoreFields)) {
+ $sql->setValue($columnName, 'revision' === $columnName ? 1 : $slice[$columnName]);
+ }
+ }
+
+ $sql->insert();
+ }
+ rex_article_cache::delete($articleId, $clangId);
+ return true;
+ }
+
/** @return void */
public static function clearAllHistory()
{
diff --git a/redaxo/src/addons/structure/plugins/history/package.yml b/redaxo/src/addons/structure/plugins/history/package.yml
index 3d4deff3f4..cbcca557af 100644
--- a/redaxo/src/addons/structure/plugins/history/package.yml
+++ b/redaxo/src/addons/structure/plugins/history/package.yml
@@ -12,7 +12,7 @@ pages:
left: true
linkAttr:
data-history-layer: open
- perm: history[article_rollback]
+ perm: history[read]
system/history:
title: translate:history