Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/support external embargo module cms 5 #1

Open
wants to merge 11 commits into
base: 6
Choose a base branch
from
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"phpunit/phpunit": "^9.6",
"squizlabs/php_codesniffer": "^3",
"silverstripe/standards": "^1",
"phpstan/extension-installer": "^1.3"
"phpstan/extension-installer": "^1.3",
"silverstripe-terraformers/embargo-expiry": "^2.0"
},
"extra": {
"expose": [
Expand All @@ -40,7 +41,8 @@
]
},
"suggest": {
"symbiote/silverstripe-queuedjobs": "Allow automated workflow transitions with queued system jobs"
"symbiote/silverstripe-queuedjobs": "Allow automated workflow transitions with queued system jobs",
"silverstripe-terraformers/embargo-expiry": "Allow automated workflow transitions with embargo & expiry dates."
},
"autoload": {
"psr-4": {
Expand Down
29 changes: 14 additions & 15 deletions docs/en/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extending from `ModelAdmin`. `mysite/_config/config.yml`:
extensions:
- AdvancedWorkflowExtension

We strongly recommend also setting the `NotifyUsersWorkflowAction` configuration parameter `whitelist_template_variables`
We strongly recommend also setting the `NotifyUsersWorkflowAction` configuration parameter `whitelist_template_variables`
to true on new projects. This configuration will achieve this:

:::yml
Expand All @@ -27,23 +27,22 @@ to true on new projects. This configuration will achieve this:
See the Security section below for more details.

### Embargo and Expiry
This add-on functionality allows you to embargo some content changes to only appear as published at some future date. To enable it,
add the `WorkflowEmbargoExpiryExtension`.

:::yml
SiteTree:
extensions:
- WorkflowEmbargoExpiryExtension
You can optionally add the [Embargy & Expiry](https://github.com/silverstripe-terraformers/silverstripe-embargo-expiry)
module to your project to allow changes to be published (and/or unpublished) at future dates.

**Note:** You will need to use version 1.2.1 or greater.

Make sure the [QueuedJobs](https://github.com/nyeholt/silverstripe-queuedjobs)
module is installed and configured correctly.
You should have a cronjob similar to the following in place, running
as the webserver user.
#### Migrating from an older Workflow version

*/1 * * * * cd && sudo -u www php /var/www/framework/cli-script.php dev/tasks/ProcessJobQueueTask
If you have an existing project which used the `WorkflowEmbargoExpiryExtension`, then you will need to go through a
couple of migration steps.

It also allows for an optional subsequent expiry date. Note: Changes to these dates also constitute modifications to the content and as such
are subject to the same workflow approval processes, where a particular workflow instance is in effect. The embargo export functionality can also be used independently of any workflow.
1) Update usages of `WorkflowEmbargoExpiryExtension` to `EmbargoExpiryExtension` (from the Terraformers module)
2) Run the `EmbargoExpiryMigrationTask` to migrate over any existing Workflow jobs to the new Terraformers' jobs
* This task will require you to define some basic configuration where you tell us what classes you have applied the
`EmbargoExpiryExtension` to. Other than that, you just need to run it
* See the class for more info

### Sending reminder emails

Expand All @@ -57,4 +56,4 @@ Periodically run the Workflow Reminder Task by adding a task like this one to th

This is an example only. The key is to run the task as the same user as the web server.

You can run the task manually for testing by visiting the `/dev/tasks/WorkflowReminderTask` URL of your site.
You can run the task manually for testing by visiting the `/dev/tasks/WorkflowReminderTask` URL of your site.
10 changes: 0 additions & 10 deletions lang/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,8 @@ ar:
WORKFLOW: 'سير العمل'
WORKFLOWACTIVEIINSTANCES: 'أمثلة مهام سير العمل النشطة'
WORKFLOWCOMPLETEDIINSTANCES: 'حالات مهام سير العمل المكتملة'
WorkflowEmbargoExpiryExtension:
ActiveWorkflowStateTitle: نشط
CompletedWorkflowStateTitle: أكتمل
PUBLISH_ON: 'موعد النشر المحدد'
REQUESTED_PUBLISH_DATE: 'موعد النشر المطلوب'
REQUESTED_PUBLISH_DATE_H3: 'انتهاء الصلاحية و الحظر'
REQUESTED_PUBLISH_DATE_INTRO: 'قم بإدخال تاريخ و/أو وقت لتحديد موعد الحظر و مواعيد انتهاء الصلاحية.'
REQUESTED_PUBLISH_DATE_INTRO_BULLET_1: 'هذه الإعدادات لن تنفذ حتى يتم اتخاذ إجراءات الموافقة'
REQUESTED_PUBLISH_DATE_INTRO_BULLET_2: 'إذا تم بالفعل تطبيق الحظر, فإن إضافة موعد حظر جديد قبل هذا الموعد سوف يقوم باستبدال هذا الموعد'
REQUESTED_UNPUBLISH_DATE: 'موعد مطلوب لعدم النشر'
TabTitle: 'نشر الجدول الزمني'
UNPUBLISH_ON: 'موعد محدد لعد النشر'
WorkflowField:
AddTransitionAction: 'أضف انتقال'
CreateAction: 'قم بعمل نشاط'
Expand Down
9 changes: 2 additions & 7 deletions lang/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,11 @@ de:
WORKFLOW: Arbeitsablauf
WORKFLOWACTIVEIINSTANCES: 'Aktive Arbeitsablaufinstanzen'
WORKFLOWCOMPLETEDIINSTANCES: 'Abgeschlossene Arbeitsablaufinstanzen'
ActiveWorkflowStateTitle: Aktiv
CompletedWorkflowStateTitle: Fertiggestellt
WorkflowDefinitionImporter:
INVALID_YML_FORMAT_NO_HEADER: 'Ungültiges YAML-Format.'
INVALID_YML_FORMAT_NO_PARSE: 'Ungültiges YAML-Format. Kann nicht eingelesen werden.'
WorkflowEmbargoExpiryExtension:
ActiveWorkflowStateTitle: Aktiv
CompletedWorkflowStateTitle: Fertiggestellt
PUBLISH_ON: 'Geplantes Veröffentlichungsdatum'
REQUESTED_PUBLISH_DATE: 'Gewünschtes Veröffentlichungsdatum'
REQUESTED_PUBLISH_DATE_H3: 'Ablauf und Embargo'
TabTitle: Veröffentlichungsplan
WorkflowField:
AddTransitionAction: 'Übergang hinzufügen'
CreateAction: 'Aktion erstellen'
Expand Down
29 changes: 2 additions & 27 deletions lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ en:
Symbiote\AdvancedWorkflow\Extensions\WorkflowApplicable:
has_one_WorkflowDefinition: 'Workflow definition'
many_many_AdditionalWorkflowDefinitions: 'Additional workflow definitions'
Symbiote\AdvancedWorkflow\Extensions\WorkflowEmbargoExpiryExtension:
db_AllowEmbargoedEditing: 'Allow embargoed editing'
db_DesiredPublishDate: 'Desired publish date'
db_DesiredUnPublishDate: 'Desired un publish date'
db_PublishOnDate: 'Publish on date'
db_UnPublishOnDate: 'Un publish on date'
has_one_PublishJob: 'Publish job'
has_one_UnPublishJob: 'Un publish job'
Symbiote\AdvancedWorkflow\Forms\GridField\GridFieldExportAction:
Export: Export
UnpublishItemWorkflowAction:
Expand Down Expand Up @@ -269,28 +261,11 @@ en:
WORKFLOW: Workflow
WORKFLOWACTIVEIINSTANCES: 'Active Workflow Instances'
WORKFLOWCOMPLETEDIINSTANCES: 'Completed Workflow Instances'
ActiveWorkflowStateTitle: Active
CompletedWorkflowStateTitle: Completed
WorkflowDefinitionImporter:
INVALID_YML_FORMAT_NO_HEADER: 'Invalid YAML format.'
INVALID_YML_FORMAT_NO_PARSE: 'Invalid YAML format. Unable to parse.'
WorkflowEmbargoExpiryExtension:
ActiveWorkflowStateTitle: Active
BADGE_PUBLISH: Embargo
BADGE_PUBLISH_UNPUBLISH: Embargo+Expiry
BADGE_UNPUBLISH: Expiry
CompletedWorkflowStateTitle: Completed
INVALIDEXPIRY: 'The unpublish date cannot be before the publish date.'
INVALIDSAMEEMBARGOEXPIRY: 'The publish date and unpublish date cannot be the same.'
PUBLISH_ON: 'Scheduled publish date'
REQUESTED_PUBLISH_DATE: 'Requested publish date'
REQUESTED_PUBLISH_DATE_H3: 'Expiry and Embargo'
REQUESTED_PUBLISH_DATE_INTRO: 'Enter a date and/or time to specify embargo and expiry dates.'
REQUESTED_PUBLISH_DATE_INTRO_BULLET_1: "These settings won't take effect until any approval actions are run"
REQUESTED_PUBLISH_DATE_INTRO_BULLET_2: "If an embargo is already set, adding a new one prior to that date's passing will overwrite it"
REQUESTED_PUBLISH_DATE_RIGHT_TITLE: 'To request this page to be <strong>published immediately</strong> leave the date and time fields blank'
REQUESTED_UNPUBLISH_DATE: 'Requested un-publish date'
REQUESTED_UNPUBLISH_DATE_RIGHT_TITLE: 'To request this page to <strong>never expire</strong> leave the date and time fields blank'
TabTitle: 'Publishing Schedule'
UNPUBLISH_ON: 'Scheduled un-publish date'
WorkflowField:
AddTransitionAction: 'Add Transition'
CreateAction: 'Create an action'
Expand Down
29 changes: 3 additions & 26 deletions lang/eo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ eo:
Symbiote\AdvancedWorkflow\Extensions\WorkflowApplicable:
has_one_WorkflowDefinition: 'Laborflua difino'
many_many_AdditionalWorkflowDefinitions: 'Kromaj laborfluoj'
Symbiote\AdvancedWorkflow\Extensions\WorkflowEmbargoExpiryExtension:
db_AllowEmbargoedEditing: 'Permesi embargitan redaktadon'
db_DesiredPublishDate: 'Dezirata publikiga dato'
db_DesiredUnPublishDate: 'Dezirata malpublikiga dato'
db_PublishOnDate: 'Publikigi je dato'
db_UnPublishOnDate: 'Malpublikigi je dato'
has_one_PublishJob: 'Publikigi taskon'
has_one_UnPublishJob: 'Malpublikigi taskon'
Symbiote\AdvancedWorkflow\Forms\GridField\GridFieldExportAction:
Export: Eksporti
UnpublishItemWorkflowAction:
Expand Down Expand Up @@ -269,27 +261,11 @@ eo:
WORKFLOW: Laborfluo
WORKFLOWACTIVEIINSTANCES: 'Aktivaj laborfluaj ekzemploj'
WORKFLOWCOMPLETEDIINSTANCES: 'Kompletaj laborfluaj ekzemploj'
ActiveWorkflowStateTitle: Aktiva
CompletedWorkflowStateTitle: Kompletigita
WorkflowDefinitionImporter:
INVALID_YML_FORMAT_NO_HEADER: 'Nevalida YAML-formato.'
INVALID_YML_FORMAT_NO_PARSE: 'Nevalida YAML-formato. Ne povas analizi.'
WorkflowEmbargoExpiryExtension:
ActiveWorkflowStateTitle: Aktiva
BADGE_PUBLISH_UNPUBLISH: Embargo+eksvalidiĝo
BADGE_UNPUBLISH: Eksvalidiĝo
CompletedWorkflowStateTitle: Kompletigita
INVALIDEXPIRY: 'La dato de malpublikigo ne povas esti antaŭ la dato de publikigo.'
INVALIDSAMEEMBARGOEXPIRY: 'La dato de dato de publikigo kaj la dato demalpublikigo ne povas esti samaj.'
PUBLISH_ON: 'Planita publikiga dato'
REQUESTED_PUBLISH_DATE: 'Petita publikiga dato'
REQUESTED_PUBLISH_DATE_H3: 'Malvalidiĝo kaj embargo'
REQUESTED_PUBLISH_DATE_INTRO: 'Enigu daton kaj/aŭ horon por agordi embargan kaj malvalidiĝan datojn.'
REQUESTED_PUBLISH_DATE_INTRO_BULLET_1: 'Tiuj agordoj ekefikos nur kiam eventualaj agoj estas rulitaj'
REQUESTED_PUBLISH_DATE_INTRO_BULLET_2: 'Se embargo jam estas agordita, aldoni novan antaŭ la paso de ties dato anstataŭos ĝin'
REQUESTED_PUBLISH_DATE_RIGHT_TITLE: 'Por peti ke ĉi tiu paĝo <strong>tuj publikiĝu</strong> lasu vakaj la datan kaj horan kampojn'
REQUESTED_UNPUBLISH_DATE: 'Petita malpublikiga dato'
REQUESTED_UNPUBLISH_DATE_RIGHT_TITLE: 'Por peti ke ĉi tiu paĝo <strong>neniam eksvalidiĝu</strong> lasu vakaj la datan kaj horan kampojn'
TabTitle: 'Publikiga plano'
UNPUBLISH_ON: 'Planita malpublikiga dato'
WorkflowField:
AddTransitionAction: 'Aldoni transiron'
CreateAction: 'Krei agon'
Expand All @@ -300,6 +276,7 @@ eo:
ActionLogTitle: Protokolo
EXECUTE_EXCEPTION: 'Provis startigi nevalidan laborfluan ekzemplon #%s!'
REASSIGN_HEADER: 'Reagordi laborfluon'
TITLE_FOR_DO: '%s - %s'
TITLE_STUB: 'Ekzemplo #%s el %s'
TargetClassLabel: 'Cela klaso'
TargetIDLabel: Celo
Expand Down
14 changes: 2 additions & 12 deletions lang/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,11 @@ es:
WORKFLOW: 'Flujo de trabajo'
WORKFLOWACTIVEIINSTANCES: 'Instancias activas de flujo de trabajo'
WORKFLOWCOMPLETEDIINSTANCES: 'Instancias del flujo de trabajo completadas'
ActiveWorkflowStateTitle: Activo
CompletedWorkflowStateTitle: Completo
WorkflowDefinitionImporter:
INVALID_YML_FORMAT_NO_HEADER: 'Formato YAML inválido.'
INVALID_YML_FORMAT_NO_PARSE: 'Formato YAML inválido. Imposible analizar.'
WorkflowEmbargoExpiryExtension:
ActiveWorkflowStateTitle: Activo
CompletedWorkflowStateTitle: Completo
PUBLISH_ON: 'Fecha prevista de publicación'
REQUESTED_PUBLISH_DATE: 'Fecha solicitada de publicación'
REQUESTED_PUBLISH_DATE_H3: 'Caducidad y Embargo'
REQUESTED_PUBLISH_DATE_INTRO: 'Ingresar una fecha y/u hora para especificar las fechas de embargo y caducidad.'
REQUESTED_PUBLISH_DATE_INTRO_BULLET_1: 'Estos parámetros no tendrán efecto hasta que se ejecuten las acciones de aprobación'
REQUESTED_PUBLISH_DATE_INTRO_BULLET_2: 'Si ya se estableció un embargo, agregar uno nuevo antes que pase esa fecha, lo sobrescribirá.'
REQUESTED_UNPUBLISH_DATE: 'Fecha solicitada para anular la publicación'
TabTitle: 'Horario de publicación'
UNPUBLISH_ON: 'Fecha prevista para anular la publicación'
WorkflowField:
AddTransitionAction: 'Agregar transición'
CreateAction: 'Crear una acción'
Expand Down
1 change: 0 additions & 1 deletion lang/fi_FI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ fi_FI:
WorkflowDefinition:
DESCRIPTION: Kuvaus
TITLE: Otsikko
WorkflowEmbargoExpiryExtension:
ActiveWorkflowStateTitle: Aktiivinen
CompletedWorkflowStateTitle: Valmistunut
WorkflowField:
Expand Down
1 change: 0 additions & 1 deletion lang/id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ id:
WorkflowDefinition:
DESCRIPTION: Deskripsi
TITLE: Judul
WorkflowEmbargoExpiryExtension:
ActiveWorkflowStateTitle: Aktif
WorkflowField:
CreateLabel: Buat
Expand Down
5 changes: 2 additions & 3 deletions lang/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,11 @@ it:
TITLE: Titolo
USERS: 'Ristretto agli Utenti'
WORKFLOW: 'Flusso di lavoro'
ActiveWorkflowStateTitle: Attivo
CompletedWorkflowStateTitle: Completato
WorkflowDefinitionImporter:
INVALID_YML_FORMAT_NO_HEADER: 'Formatto YAML non valido'
INVALID_YML_FORMAT_NO_PARSE: 'Formatto YAML non valido. Impossibile fare il parse.'
WorkflowEmbargoExpiryExtension:
ActiveWorkflowStateTitle: Attivo
CompletedWorkflowStateTitle: Completato
WorkflowField:
AddTransitionAction: 'Aggiungi Transazione'
CreateAction: 'Crea un azione'
Expand Down
10 changes: 0 additions & 10 deletions lang/mi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,8 @@ mi:
WORKFLOW: Reremahi
WORKFLOWACTIVEIINSTANCES: 'Ngā Tauira Reremahi Hohe'
WORKFLOWCOMPLETEDIINSTANCES: 'Ngā Tauira Reremahi Oti'
WorkflowEmbargoExpiryExtension:
ActiveWorkflowStateTitle: Hohe
CompletedWorkflowStateTitle: 'Kua Oti'
PUBLISH_ON: 'Rā whakaputa kua whakaritea'
REQUESTED_PUBLISH_DATE: 'I tonoa te rā whakaputa'
REQUESTED_PUBLISH_DATE_H3: 'Mōnehutanga me te Rāhui'
REQUESTED_PUBLISH_DATE_INTRO: 'Tāurua he rā, he wā hoki/rānei hei whakarite rā rāhui me te mōnehu.'
REQUESTED_PUBLISH_DATE_INTRO_BULLET_1: 'Kāore ēnei tautuhinga e whai mana kia whakahaeretia rā anō ngā hohenga whakaaetanga'
REQUESTED_PUBLISH_DATE_INTRO_BULLET_2: 'Mēnā kua tautuhi kētia tētahi rāhuitanga, ka tuhiruatia mā te tāpiri i te mea hou i mua i te hipa o taua rā'
REQUESTED_UNPUBLISH_DATE: 'I tonoa te rā wetewhakaputa'
TabTitle: 'Hōtaka Whakaputa'
UNPUBLISH_ON: 'Rā wetewhakaputa kua whakaritea'
WorkflowField:
AddTransitionAction: 'Tāpiri Whakawhiti'
CreateAction: 'Hangaia he hohenga'
Expand Down
2 changes: 0 additions & 2 deletions lang/sv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ sv:
WorkflowDefinition:
DESCRIPTION: Beskrivning
TITLE: Titel
WorkflowEmbargoExpiryExtension:
BADGE_UNPUBLISH: 'Går ut'
WorkflowField:
CreateLabel: Skapa
DeleteAction: Radera
Expand Down
10 changes: 0 additions & 10 deletions lang/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,8 @@ zh:
WORKFLOW: 工作流
WORKFLOWACTIVEIINSTANCES: 活动的工作流实例
WORKFLOWCOMPLETEDIINSTANCES: 完成的工作流实例
WorkflowEmbargoExpiryExtension:
ActiveWorkflowStateTitle: 活跃的
CompletedWorkflowStateTitle: 已完成
PUBLISH_ON: 安排的发布日期
REQUESTED_PUBLISH_DATE: 请求的发布日期
REQUESTED_PUBLISH_DATE_H3: 到期和禁止
REQUESTED_PUBLISH_DATE_INTRO: 欲指定禁止和到期日,请输入一个日期和/或时间。
REQUESTED_PUBLISH_DATE_INTRO_BULLET_1: 批准动作执行之前,这些设置不会生效
REQUESTED_PUBLISH_DATE_INTRO_BULLET_2: 如果已经设置了禁令,在该日期之前添加新的可覆盖该设置
REQUESTED_UNPUBLISH_DATE: 请求未发布的日期
TabTitle: 发布日程表
UNPUBLISH_ON: 安排未发布的日期
WorkflowField:
AddTransitionAction: 添加转换
CreateAction: 制定计划
Expand Down
Loading
Loading