Skip to content

Commit

Permalink
Add support for Embargo & Expiry module. Remove feature from codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Penny committed Jul 18, 2022
1 parent 6600e48 commit c8767a6
Show file tree
Hide file tree
Showing 23 changed files with 344 additions and 1,309 deletions.
3 changes: 1 addition & 2 deletions .upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ mappings:
AdvancedWorkflowExtension: Symbiote\AdvancedWorkflow\Extensions\AdvancedWorkflowExtension
FileWorkflowApplicable: Symbiote\AdvancedWorkflow\Extensions\FileWorkflowApplicable
WorkflowApplicable: Symbiote\AdvancedWorkflow\Extensions\WorkflowApplicable
WorkflowEmbargoExpiryExtension: Symbiote\AdvancedWorkflow\Extensions\WorkflowEmbargoExpiryExtension
WorkflowEmbargoExpiryExtension: Terraformers\EmbargoExpiry\Extension\EmbargoExpiryExtension
WorkflowField: Symbiote\AdvancedWorkflow\FormFields\WorkflowField
WorkflowFieldActionController: Symbiote\AdvancedWorkflow\FormFields\WorkflowFieldActionController
WorkflowFieldItemController: Symbiote\AdvancedWorkflow\FormFields\WorkflowFieldItemController
WorkflowFieldTransitionController: Symbiote\AdvancedWorkflow\FormFields\WorkflowFieldTransitionController
AWRequiredFields: Symbiote\AdvancedWorkflow\Forms\AWRequiredFields
FrontendWorkflowForm: Symbiote\AdvancedWorkflow\Forms\FrontendWorkflowForm
WorkflowPublishTargetJob: Symbiote\AdvancedWorkflow\Jobs\WorkflowPublishTargetJob
WorkflowReminderJob: Symbiote\AdvancedWorkflow\Jobs\WorkflowReminderJob
WorkflowService: Symbiote\AdvancedWorkflow\Services\WorkflowService
ExistingWorkflowException: Symbiote\AdvancedWorkflow\Services\ExistingWorkflowException
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3"
"squizlabs/php_codesniffer": "^3",
"silverstripe-terraformers/embargo-expiry": "^1.2"
},
"extra": {
"expose": [
Expand All @@ -34,7 +35,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
22 changes: 4 additions & 18 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,9 @@ 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

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.

*/1 * * * * cd && sudo -u www php /var/www/framework/cli-script.php dev/tasks/ProcessJobQueueTask

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.
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.

### Sending reminder emails

Expand All @@ -57,4 +43,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 @@ -91,18 +91,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 @@ -91,16 +91,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
21 changes: 2 additions & 19 deletions lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,28 +200,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
21 changes: 2 additions & 19 deletions lang/eo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,28 +200,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: Embargo
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 Down
14 changes: 2 additions & 12 deletions lang/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,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 @@ -23,7 +23,6 @@ fi_FI:
Title: Otsikko
WorkflowDefinition:
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 @@ -20,7 +20,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 @@ -55,12 +55,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 @@ -85,18 +85,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
10 changes: 0 additions & 10 deletions lang/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,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

0 comments on commit c8767a6

Please sign in to comment.