Replaces the yes/no notify_email flag with notify_mode:
- off: no mail
- owner: only the board owner, as before (migrated from notify_email=1)
- board: everyone with access to the board, filtered by their own Deck
"Notifications" setting for it (board:<id>:notify-due: off /
assigned / all), mirroring Deck's NotificationHelper rules
Recipients are resolved via PermissionService::findUsers() (owner, ACL,
groups and circles expanded), AssignmentMapper::isUserAssigned() and
IConfig, none of which reads Deck's frozen $userId. If they cannot be
resolved, no mail is sent rather than one to the wrong people.
Moved cards are collected over the whole run and each recipient gets a
single digest mail afterwards, in their own language.
Bumps to 35.2.0 so the migrations run.
35 lines
904 B
PHP
35 lines
904 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\WorkflowDeckAutomation\Migration;
|
|
|
|
use Closure;
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
/**
|
|
* Drops `notify_email` now that Version1002Date20261001120000 has copied it
|
|
* into `notify_mode`. It has to go rather than be ignored: Entity::fromRow()
|
|
* calls a setter per selected column, and Workflow no longer has one.
|
|
*/
|
|
class Version1003Date20261001120100 extends SimpleMigrationStep {
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
|
/** @var ISchemaWrapper $schema */
|
|
$schema = $schemaClosure();
|
|
|
|
if (!$schema->hasTable('wfda_workflows')) {
|
|
return null;
|
|
}
|
|
|
|
$table = $schema->getTable('wfda_workflows');
|
|
if (!$table->hasColumn('notify_email')) {
|
|
return null;
|
|
}
|
|
|
|
$table->dropColumn('notify_email');
|
|
return $schema;
|
|
}
|
|
}
|