Commit 9b127118 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

- Up : Un commentaire listant les étapes validées est généré automatiquement...

 - Up : Un commentaire listant les étapes validées est généré automatiquement si la signature est une étape d'un processus
parent 143faf73
Loading
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -315,4 +315,17 @@ class Process
        return $return;
    }

    public function getCommentSteps() :string
    {
        $out = "";
        foreach ($this->getSteps() as $step) {
            if( $step->getStatus() == Signature::STATUS_SIGNATURE_SIGNED ){
                $out .= " - Etape " . $step->getOrder()
                    . " (" . $step->getLabel(). ") "
                    . " : validé par " . $step->getSignature()->getValidatedByStr() . "\n"
                ;
            }
        }
        return $out;
    }
}
 No newline at end of file
+16 −0
Original line number Diff line number Diff line
@@ -763,4 +763,20 @@ class Signature
            $this->getStatusText()
        );
    }

    public function getValidatedBy() :array
    {
        $out = [];
        foreach ($this->getRecipients() as $recipient) {
            if( $recipient->isSigned() ){
                $out[] = $recipient->getDisplayed();
            }
        }
        return $out;
    }

    public function getValidatedByStr() :string
    {
        return implode(', ', $this->getValidatedBy());
    }
}
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -907,6 +907,10 @@ class SignatureService

            // Envoi au parafeur
            try {
                if( $signature->getProcessStep() ){
                    $repport = $signature->getProcessStep()->getProcess()->getCommentSteps();
                    $signature->setDescription($repport);
                }
                $this->getLetterfileService()->getLetterFileStrategy(
                    $signature->getLetterfileKey()
                )->sendSignature($signature);