From 33ebad60ba8a729fda81cd65472ff68b430131d4 Mon Sep 17 00:00:00 2001 From: Miguel Angel Date: Wed, 10 Sep 2025 15:21:01 -0400 Subject: [PATCH 1/2] feat: add saved_search_advanced_configuration to filesystem configuration --- .gitignore | 1 + ProcessMaker/Multitenancy/SwitchTenant.php | 2 ++ config/filesystems.php | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index fcf4007765..f375b4a8bc 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ storage/ssl storage/api/* storage/data-sources/logs/* storage/decision-tables/* +storage/saved_search_advanced_configuration/* npm.sh laravel-echo-server.lock public/.htaccess diff --git a/ProcessMaker/Multitenancy/SwitchTenant.php b/ProcessMaker/Multitenancy/SwitchTenant.php index 2ca2efc3ec..dfc5332b35 100644 --- a/ProcessMaker/Multitenancy/SwitchTenant.php +++ b/ProcessMaker/Multitenancy/SwitchTenant.php @@ -76,6 +76,8 @@ public function makeCurrent(IsTenant $tenant): void 'filesystems.disks.samlidp.root' => storage_path('samlidp'), 'filesystems.disks.decision_tables.root' => storage_path('decision-tables'), 'filesystems.disks.decision_tables.url' => $tenant->config['app.url'] . '/storage/decision-tables', + 'filesystems.disks.saved_search_advanced_configuration.root' => storage_path('saved_search_advanced_configuration'), + 'filesystems.disks.decision_tables.url' => $tenant->config['app.url'] . '/storage/saved_search_advanced_configuration', 'filesystems.disks.tenant_translations' => [ 'driver' => 'local', 'root' => storage_path('lang'), diff --git a/config/filesystems.php b/config/filesystems.php index 182dde1afe..a480cecde9 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -131,6 +131,13 @@ // Others declared in packages // - translations - package-translations // - 'filesystems.disks.install' configured on the fly + + 'saved_search_advanced_configuration' => [ + 'driver' => 'local', + 'root' => storage_path('saved_search_advanced_configuration'), + 'url' => env('APP_URL') . '/storage/saved_search_advanced_configuration', + 'visibility' => 'private', + ], ], /* From bf587d1d0eaaffb7e0c20b903bd3ec1b32fa7d0f Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Tue, 16 Sep 2025 18:31:15 -0400 Subject: [PATCH 2/2] Add job validation and new scheduling method `scheduleDateJob` --- .../Managers/TaskSchedulerManager.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/ProcessMaker/Managers/TaskSchedulerManager.php b/ProcessMaker/Managers/TaskSchedulerManager.php index d59dc4db80..e459bd2cee 100644 --- a/ProcessMaker/Managers/TaskSchedulerManager.php +++ b/ProcessMaker/Managers/TaskSchedulerManager.php @@ -12,6 +12,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Schema; +use InvalidArgumentException; use PDOException; use ProcessMaker\Facades\WorkflowManager; use ProcessMaker\Jobs\StartEventConditional; @@ -574,6 +575,9 @@ public function scheduleCycle( */ public function scheduleCycleJob($interval, array $config): ScheduledTask { + if (!isset($config['job'])) { + throw new InvalidArgumentException('$config["job"] is required'); + } $configuration = [ 'type' => 'TimeCycle', 'interval' => $interval, @@ -590,6 +594,33 @@ public function scheduleCycleJob($interval, array $config): ScheduledTask return $scheduledTask; } + /** + * Schedule a job for a specific datetime + * + * @param string $datetime in ISO-8601 format + * @param array $config configuration + * + * @return ScheduledTask + */ + public function scheduleDateJob($datetime, array $config): ScheduledTask + { + if (!isset($config['job'])) { + throw new InvalidArgumentException('$config["job"] is required'); + } + $configuration = [ + 'type' => 'TimeDate', + 'date' => $datetime, + ...$config, + ]; + $scheduledTask = new ScheduledTask(); + $scheduledTask->configuration = json_encode($configuration); + $scheduledTask->type = 'SCHEDULED_JOB'; + $scheduledTask->last_execution = null; + $scheduledTask->save(); + + return $scheduledTask; + } + /** * Schedule a job execution after a time duration for the given BPMN element, * event definition and an optional Token object