Commit ae58f81d authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Update

parent 5f7951dd
Loading
Loading
Loading
Loading
Loading
+17 −1
Changes for src/Entity/Db/Process.php: 17 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -267,11 +267,27 @@ class Process
            $this->getStatus() == Signature::STATUS_PROCESS_UNCONFIGURED;
    }


    public function __toString(): string
    {
        return $this->getLabel() . '(' . $this->getId() . ')';
    }

    public function toArray() :array {
        $return = [];
        $return['id'] = $this->getId();
        $return['label'] = $this->getLabel();
        $return['lastUpdate'] = $this->getLastUpdate() ? $this->getLastUpdate()->format('Y-m-d H:i:s') : '';
        $return['status'] = $this->getStatus();
        $return['status_text'] = $this->getStatusText();

        $steps = [];

        foreach ($this->getSteps() as $step){
            $steps[] = $step->toArray();
        }
        $return['steps'] = $steps;
        $return['lastUpdate'] = $this->getLastUpdate() ? $this->getLastUpdate()->format('Y-m-d H:i:s') : '';
        return $return;
    }

}
 No newline at end of file
+15 −0
Changes for src/Entity/Db/ProcessStep.php: 15 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -144,6 +144,21 @@ class ProcessStep
        return $this->getSignature()->getStatusText();
    }

    public function toArray() :array {
        $recipients = [];
        foreach ($this->getRecipients() as $recipient){
            $recipients[] = $recipient->toArray();
        }
        return [
            'label' => $this->getLabel(),
            'letterfile' => $this->getLetterfileName(),
            'level' => $this->getLevel(),
            'status' => $this->getStatus(),
            'status_text' => $this->getStatusText(),
            'recipients' => $recipients,
        ];
    }

    public function __toString(): string
    {
        return sprintf("Etape %s : %s",
+11 −0
Changes for src/Entity/Db/SignatureRecipient.php: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -342,4 +342,15 @@ class SignatureRecipient
            return $this->getSignature()->getLabel();
        }
    }

    public function toArray() :array {
        return [
            'fullname' => $this->getFullname(),
            'firstname' => $this->getFirstname(),
            'lastname' => $this->getLastname(),
            'email' => $this->getEmail(),
            'status' => $this->getStatus(),
            'status_text' => $this->getStatusText(),
        ];
    }
}
 No newline at end of file
+1 −1
Changes for src/Service/ProcessService.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ class ProcessService
        return $process;
    }

    public function configureProcess(Process $process, array $jsonDatas, string $documentPreviewUrl): void
    public function configureProcess(Process $process, array $jsonDatas, string $documentPreviewUrl=""): void
    {
        $signatureFlow = $process->getSignatureFlow();

+2 −1
Changes for src/Service/SignatureService.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ class SignatureService
        foreach ($signatureFlow->getSteps() as $step) {
            $letterfile = $letterfiles[$step->getLetterfileName()];
            $levels = $letterfile['levels_infos'];
            $method = $this->getSignatureConfigurationService()->getMethodByKey($step->getRecipientsMethod());

            $currentStep = [];
            $currentStep['id'] = $step->getId();
@@ -235,9 +236,9 @@ class SignatureService
            $currentStep['level_in_letterfile'] = $levels[$step->getLevel()]['key_in_letterfile'];
            $currentStep['allSignToComplete'] = true;
            $currentStep['editable'] = false;
            $currentStep['dynamicRecipients'] = is_callable($method['getRecipients']);
            $currentStep['recipients'] = [];

            $method = $this->getSignatureConfigurationService()->getMethodByKey($step->getRecipientsMethod());
            if (is_callable($method['getRecipients'])) {
                $options = array_merge_recursive($extrasOptions, $step->getOptions());
                $recipientsDatas = $method['getRecipients']($this->getServiceContainer(), $options);