Compare commits
2
Commits
860e8b7bbb
...
v35.2.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebf48b0707 | ||
|
|
30e644a001 |
No files matched your search
+1
-1
@@ -24,7 +24,7 @@ This app lets every user configure Deck automation workflows for the boards they
|
|||||||
|
|
||||||
A background job periodically evaluates all enabled workflows and moves cards whose due date has passed, using Deck's own internal PHP classes only (no HTTP/OCS calls).
|
A background job periodically evaluates all enabled workflows and moves cards whose due date has passed, using Deck's own internal PHP classes only (no HTTP/OCS calls).
|
||||||
]]></description>
|
]]></description>
|
||||||
<version>35.2.0</version>
|
<version>35.2.2</version>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author mail="patrick@niebel.ing">Patrick Niebeling</author>
|
<author mail="patrick@niebel.ing">Patrick Niebeling</author>
|
||||||
<namespace>WorkflowDeckAutomation</namespace>
|
<namespace>WorkflowDeckAutomation</namespace>
|
||||||
|
|||||||
@@ -98,24 +98,34 @@ class NotificationMailer {
|
|||||||
* @param array{board: string, sourceStack: string, targetStack: string} $targets
|
* @param array{board: string, sourceStack: string, targetStack: string} $targets
|
||||||
*/
|
*/
|
||||||
private function addCard(IEMailTemplate $template, Workflow $workflow, Card $card, array $targets): void {
|
private function addCard(IEMailTemplate $template, Workflow $workflow, Card $card, array $targets): void {
|
||||||
// Single-argument addBodyText() runs htmlspecialchars() itself, so
|
// The card description and the workflow's name are deliberately left
|
||||||
// these card-, workflow-, board- and stack-titles (user input) are
|
// out — the mail only says what moved where. The card title itself is
|
||||||
// safe as-is. The card description is deliberately left out.
|
// the link to the card.
|
||||||
$template->addBodyText(sprintf(
|
$sentence = '„%1$s“ (Board „%2$s“) ist überfällig und wurde von „%3$s“ nach „%4$s“ verschoben.';
|
||||||
'Die Karte „%1$s“ wurde verschoben, weil sie überfällig ist (Workflow „%2$s“).',
|
$url = $this->urlGenerator->getAbsoluteURL('/apps/deck/board/' . $workflow->getBoardId() . '/card/' . $card->getId());
|
||||||
|
|
||||||
|
// With both parts passed, addBodyText() escapes nothing: every title
|
||||||
|
// is user input and has to be escaped here for the HTML part.
|
||||||
|
$html = sprintf(
|
||||||
|
$sentence,
|
||||||
|
'<a href="' . self::escape($url) . '">' . self::escape($card->getTitle()) . '</a>',
|
||||||
|
self::escape($targets['board']),
|
||||||
|
self::escape($targets['sourceStack']),
|
||||||
|
self::escape($targets['targetStack']),
|
||||||
|
);
|
||||||
|
$plain = sprintf(
|
||||||
|
$sentence,
|
||||||
$card->getTitle(),
|
$card->getTitle(),
|
||||||
$workflow->getTitle(),
|
|
||||||
));
|
|
||||||
$template->addBodyText(sprintf(
|
|
||||||
'Board „%1$s“: von „%2$s“ nach „%3$s“ verschoben.',
|
|
||||||
$targets['board'],
|
$targets['board'],
|
||||||
$targets['sourceStack'],
|
$targets['sourceStack'],
|
||||||
$targets['targetStack'],
|
$targets['targetStack'],
|
||||||
));
|
) . PHP_EOL . $url;
|
||||||
$template->addBodyButton(
|
|
||||||
'Karte öffnen',
|
$template->addBodyText($html, $plain);
|
||||||
$this->urlGenerator->getAbsoluteURL('/apps/deck/board/' . $workflow->getBoardId() . '/card/' . $card->getId()),
|
}
|
||||||
);
|
|
||||||
|
private static function escape(string $text): string {
|
||||||
|
return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "workflow_deck_automation",
|
"name": "workflow_deck_automation",
|
||||||
"version": "35.2.0",
|
"version": "35.2.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Automates moving overdue Deck cards between stacks, configurable per user.",
|
"description": "Automates moving overdue Deck cards between stacks, configurable per user.",
|
||||||
|
|||||||
Reference in new issue
Block a user