Skip to content

Commit

Permalink
11.0.3: * [Workflows] Added the cerb.records.reminders workflow for…
Browse files Browse the repository at this point in the history
… creating reminders from record profiles and cards.
  • Loading branch information
jstanden committed Jan 14, 2025
1 parent b7fcb9d commit b125151
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/Application.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ static function initBundledResources($force=false) {
'cerb.login.terms_of_use',
'cerb.notifications.mention_emailer',
'cerb.quickstart',
'cerb.records.reminders',
'cerb.satisfaction.surveys',
'cerb.search.simple',
'cerb.sla',
Expand Down
5 changes: 5 additions & 0 deletions features/cerberusweb.core/api/dao/workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,11 @@ function renderPeekPopup($context_id=0, $view_id='', $edit=false) {
'name' => 'Quickstart Checklist',
'description' => 'A workspace with a quickstart checklist for initial configuration of Cerb',
],
'cerb.records.reminders' => [
'id' => 'cerb.records.reminders',
'name' => 'Record Reminders',
'description' => 'Create reminders from record profiles and cards',
],
'cerb.email.org_by_hostname' => [
'id' => 'cerb.email.org_by_hostname',
'name' => 'Sender Org By Hostname',
Expand Down
2 changes: 2 additions & 0 deletions features/cerberusweb.core/api/uri/profiles/workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ private function _profileAction_savePeekJson() {
'cerb.login.terms_of_use',
'cerb.notifications.mention_emailer',
'cerb.quickstart',
'cerb.records.reminders',
'cerb.satisfaction.surveys',
'cerb.search.simple',
'cerb.sla',
Expand Down Expand Up @@ -487,6 +488,7 @@ private function _profileAction_showTemplateUpdatePopup() {
'cerb.login.terms_of_use' => file_get_contents(APP_PATH . '/features/cerberusweb.core/workflows/cerb.login.terms_of_use.kata'),
'cerb.notifications.mention_emailer' => file_get_contents(APP_PATH . '/features/cerberusweb.core/workflows/cerb.notifications.mention_emailer.kata'),
'cerb.quickstart' => file_get_contents(APP_PATH . '/features/cerberusweb.core/workflows/cerb.quickstart.kata'),
'cerb.records.reminders' => file_get_contents(APP_PATH . '/features/cerberusweb.core/workflows/cerb.records.reminders.kata'),
'cerb.satisfaction.surveys' => file_get_contents(APP_PATH . '/features/cerberusweb.core/workflows/cerb.satisfaction.surveys.kata'),
'cerb.search.simple' => file_get_contents(APP_PATH . '/features/cerberusweb.core/workflows/cerb.search.simple.kata'),
'cerb.sla' => file_get_contents(APP_PATH . '/features/cerberusweb.core/workflows/cerb.sla.kata'),
Expand Down
100 changes: 100 additions & 0 deletions features/cerberusweb.core/workflows/cerb.records.reminders.kata
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
workflow:
name: cerb.records.reminders
description: Create reminders from record profiles and cards
website: https://cerb.ai/workflows/cerb.records.reminders/
requirements:
cerb_version: >=11.0 <11.1
cerb_plugins: cerberusweb.core
version: 2025-01-13T23:21:57Z
records:
automation/workerInteraction:
fields:
name: cerb.records.reminders.interaction
extension_id: cerb.trigger.interaction.worker
description@text:
script@raw:
inputs:
text/record_type:
type: freeform
required@bool: yes
text/record_id:
type: number
required@bool: yes

start:
set/load:
record_id@int: {{inputs.record_id}}
record__context: {{inputs.record_type}}

await/input:
form:
title: Create Reminder
elements:
text/prompt_name:
label: Reminder:
required@bool: yes
type: freeform
default: {{record__label}}
placeholder: (e.g. "Remind me to write back")
text/prompt_due:
label: When:
type: date
required@bool: yes
chooser/prompt_owner_id:
label: Who:
record_type: worker
query@text: isDisabled:n
default: {{worker_id}}
required@bool: yes

record.create/reminder:
output: new_reminder
inputs@ref:
record_type: reminder
fields:
name: {{prompt_name}}
remind_at@date: {{prompt_due}}
worker_id@optional,int: {{prompt_owner_id}}
links@csv: {{record__context}}:{{record_id}}

return:
alert: Reminder created!
policy_kata@raw:
commands:
record.create:
deny/type@bool: {{inputs.record_type is not record type ('reminder')}}
allow@bool: yes
toolbar_section/recordProfile:
fields:
name: Reminders
toolbar_name: record.profile
priority@int: 50
is_disabled: 0
toolbar_kata@raw:
interaction/reminder:
label: Reminder
uri: cerb:automation:cerb.records.reminders.interaction
icon: pushpin
inputs:
record_type: {{record__context}}
record_id: {{record_id}}
after:
refresh_toolbar@bool: no
refresh_widgets@list: Ticket
toolbar_section/recordCard:
fields:
name: Reminders
toolbar_name: record.card
priority@int: 50
is_disabled: 0
toolbar_kata@raw:
interaction/reminder:
label: Reminder
uri: cerb:automation:cerb.records.reminders.interaction
icon: pushpin
inputs:
record_type: {{record__context}}
record_id: {{record_id}}
after:
refresh_toolbar@bool: no
refresh_widgets@list: Properties

0 comments on commit b125151

Please sign in to comment.