From cbf70e5884e38a8fdb95f9bda8c394619b887e12 Mon Sep 17 00:00:00 2001 From: Igor Manjencic Date: Fri, 19 Jan 2024 09:53:28 +0100 Subject: [PATCH] feat(ZMS-1808): remove requests from redirected appointment --- zmsadmin/src/Zmsadmin/WorkstationProcessRedirect.php | 6 ------ zmsapi/src/Zmsapi/ProcessRedirect.php | 8 ++------ zmsdb/src/Zmsdb/Query/ProcessStatusArchived.php | 4 ++++ 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/zmsadmin/src/Zmsadmin/WorkstationProcessRedirect.php b/zmsadmin/src/Zmsadmin/WorkstationProcessRedirect.php index 9a4880196..f4d9ded40 100644 --- a/zmsadmin/src/Zmsadmin/WorkstationProcessRedirect.php +++ b/zmsadmin/src/Zmsadmin/WorkstationProcessRedirect.php @@ -50,12 +50,6 @@ public function readResponse( ['resolveReferences' => 2] )->getEntity(); - $process = \App::$http - ->readGetResult( - '/process/'. $process->getId() .'/'. $process->getAuthKey() .'/', - ['resolveReferences' => 2] - )->getEntity(); - $newProcess = clone $process; $newProcess->scope = $scope; $newProcess->appointments[0]->scope = $scope; diff --git a/zmsapi/src/Zmsapi/ProcessRedirect.php b/zmsapi/src/Zmsapi/ProcessRedirect.php index f42228529..770f319b2 100644 --- a/zmsapi/src/Zmsapi/ProcessRedirect.php +++ b/zmsapi/src/Zmsapi/ProcessRedirect.php @@ -12,6 +12,7 @@ use \BO\Zmsdb\Process as Query; use \BO\Zmsdb\ProcessStatusQueued; use BO\Zmsdb\Workstation; +use BO\Zmsentities\Collection\RequestList; /** * @SuppressWarnings(Coupling) @@ -31,13 +32,8 @@ public function readResponse( $input = Validator::input()->isJson()->assertValid()->getValue(); $entity = new \BO\Zmsentities\Process($input); $newProcess = new \BO\Zmsentities\Process($input); - - - $process = $this->readValidProcess($workstation, $entity, $input); - $process = (new Process())->readEntity($process->id, $process->authKey, 2); - $requests = $process->getRequests(); - $newProcess->requests = $requests; + $newProcess->requests = new RequestList(); $this->testProcessAccess($workstation, $process); diff --git a/zmsdb/src/Zmsdb/Query/ProcessStatusArchived.php b/zmsdb/src/Zmsdb/Query/ProcessStatusArchived.php index 228248c72..39c079123 100644 --- a/zmsdb/src/Zmsdb/Query/ProcessStatusArchived.php +++ b/zmsdb/src/Zmsdb/Query/ProcessStatusArchived.php @@ -159,6 +159,10 @@ public function postProcess($data) private function getArchivedServices(\BO\Zmsentities\Process $process) { + if ($process->getRequests()->count() === 0) { + return ''; + } + $services = $process->getRequests()->getFirst()->name; if ($process->getRequests()->count() > 1) {