Loading src/Command/SignatureLetterfileListCommand.php +56 Changes for src/Command/SignatureLetterfileListCommand.php: 56 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace UnicaenSignature\Command; use Laminas\ServiceManager\ServiceManager; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class SignatureLetterfileListCommand extends SignatureCommandAbstract { protected static $defaultName = 'signature:letterfiles-list'; const opt_letterfile = 'letterfile'; protected function configure() { $this ->setDescription("Vérification du status de la procédure de signature depuis le parafeur") ->addOption(self::opt_letterfile, 'l', InputOption::VALUE_OPTIONAL, 'Clef du parafeur', null) ; } protected function execute(InputInterface $input, OutputInterface $output): int { $io = $this->getIO($input, $output); $io->info("LISTE des INFORMATION DANS le Parafeur"); $letterfileKey = $input->getOption(self::opt_letterfile); if( $letterfileKey === null ){ $letterfile = $this->getSignatureService()->getLetterfileService()->getDefaultLetterFileStrategy(); } else { $letterfile = $this->getSignatureService()->getLetterfileService()->getLetterFileStrategy($letterfileKey); } $list = $letterfile->getSignRequests(); $headers = ['ID', 'title', 'Emails', 'Statut', 'Créé le', 'Dernière MAJ']; $rows = []; foreach ($list as $signrequest){ $row = []; $row[] = $signrequest->getIdInLetterfile(); $row[] = substr($signrequest->getTitle(), 0, 50); $row[] = $signrequest->getRecipientsEmails() ? implode(', ', $signrequest->getRecipientsEmails()) : 'unknow'; $row[] = $signrequest->getStatus(); $row[] = $signrequest->getDateCreated()->format('Y-m-d H:i'); $row[] = $signrequest->getDateUpdated() ? $signrequest->getDateUpdated()->format('Y-m-d H:i') : "-"; $rows[] = $row; } $io->table($headers, $rows); return self::SUCCESS; } } No newline at end of file src/Entity/Db/Signature.php +57 −24 Changes for src/Entity/Db/Signature.php: 57 added lines, 24 removed lines. Original line number Diff line number Diff line Loading @@ -74,10 +74,10 @@ class Signature /** * Liste des contrats de financement pour le projet. * * @var ArrayCollection * @var SignatureRecipient[] * @ORM\OneToMany(targetEntity="SignatureRecipient", mappedBy="signature") */ protected $recipients; protected array $recipients; /** * Date du dernier changement d'état. Loading @@ -89,12 +89,12 @@ class Signature /** * @var string * @ORM\Column (type="blob", nullable=false) * @ORM\Column (type="string", nullable=false) */ private string $document_data; private string $document_path; /** * Clef permettant d'identifier le document * Clef permettant d'identifier le document côté parafeur * * @var string * @ORM\Column (type="string", length=255, nullable=false) Loading @@ -102,12 +102,20 @@ class Signature private string $document_remotekey; /** * Clef permettant d'identifier la procédure dans le parapheur * Clef permettant d'identifier le document côté application * * @var string * @ORM\Column (type="string", length=255, nullable=false) * @ORM\Column (type="string", length=255, nullable=true) */ private string $letterfile_key; private string $document_localkey; /** * Clef permettant d'identifier le parapheur * * @var string|null * @ORM\Column (type="string", length=255, nullable=true) */ private ?string $letterfile_key; /** * Nom de la procédure de signature dans le parapheur Loading @@ -120,10 +128,10 @@ class Signature /** * URL permettant d'identifier la procédure dans le parapheur * * @var string * @ORM\Column (type="string", length=255, nullable=false) * @var string|null * @ORM\Column (type="string", length=255, nullable=true) */ private string $letterfile_url; private ?string $letterfile_url; /** * @return int Loading Loading @@ -170,17 +178,18 @@ class Signature } /** * @return string * @return int|null */ public function getStatus(): int|string|null public function getStatus(): int|null { return $this->status; } /** * @param string $status * @param int|null $status * @return Signature */ public function setStatus(int|string|null $status): self public function setStatus(int|null $status): self { $this->status = $status; return $this; Loading @@ -196,6 +205,7 @@ class Signature /** * @param DateTime|null $dateUpdate * @return Signature */ public function setDateUpdate(?DateTime $dateUpdate): self { Loading @@ -204,17 +214,18 @@ class Signature } /** * @return ArrayCollection * @return array */ public function getRecipients(): ArrayCollection public function getRecipients(): array { return $this->recipients; } /** * @param ArrayCollection $recipients * @param array $recipients * @return Signature */ public function setRecipients(ArrayCollection $recipients): self public function setRecipients(array $recipients): self { $this->recipients = $recipients; return $this; Loading @@ -223,17 +234,17 @@ class Signature /** * @return string */ public function getDocumentData(): string public function getDocumentPath(): string { return $this->document_data; return $this->document_path; } /** * @param string $document_data * @param string $document_path */ public function setDocumentData(string $document_data): self public function setDocumentPath(string $document_path): self { $this->document_data = $document_data; $this->document_path = $document_path; return $this; } Loading @@ -247,6 +258,7 @@ class Signature /** * @param string $document_remotekey * @return Signature */ public function setDocumentRemotekey(string $document_remotekey): self { Loading @@ -254,6 +266,24 @@ class Signature return $this; } /** * @return string */ public function getDocumentLocalkey(): string { return $this->document_localkey; } /** * @param string $document_localkey * @return Signature */ public function setDocumentLocalkey(string $document_localkey): self { $this->document_localkey = $document_localkey; return $this; } /** * @return string */ Loading @@ -264,6 +294,7 @@ class Signature /** * @param string $letterfile_process * @return Signature */ public function setLetterfileProcess(string $letterfile_process): self { Loading @@ -281,6 +312,7 @@ class Signature /** * @param string $letterfile_key * @return Signature */ public function setLetterfileKey(string $letterfile_key): self { Loading @@ -298,6 +330,7 @@ class Signature /** * @param string $letterfile_url * @return Signature */ public function setLetterfileUrl(string $letterfile_url): self { Loading src/Entity/Db/SignatureRecipient.php +30 −23 Changes for src/Entity/Db/SignatureRecipient.php: 30 added lines, 23 removed lines. Original line number Diff line number Diff line Loading @@ -18,22 +18,22 @@ class SignatureRecipient private int $id; /** * @var string * @var string|null * @ORM\Column(type="integer", nullable=true) */ private int $status; private ?string $status; /** * @var string * @ORM\Column(type="string", length=64) * @var string|null * @ORM\Column(type="string", length=64, nullable=true) */ private string $firstname; private ?string $firstname; /** * @var string * @ORM\Column(type="string", length=64) * @var string|null * @ORM\Column(type="string", length=64, nullable=true) */ private string $lastname; private ?string $lastname; /** * @var string Loading @@ -42,10 +42,10 @@ class SignatureRecipient private string $email; /** * @var string * @ORM\Column(type="string", length=20) * @var string|null * @ORM\Column(type="string", length=20, nullable=true) */ private string $phone; private ?string $phone; /** * Date du dernier changement d'état. Loading Loading @@ -79,6 +79,7 @@ class SignatureRecipient /** * @param int $status * @return SignatureRecipient */ public function setStatus(int $status): self { Loading @@ -87,34 +88,36 @@ class SignatureRecipient } /** * @return string * @return string|null */ public function getFirstname(): string public function getFirstname(): ?string { return $this->firstname; } /** * @param string $firstname * @param string|null $firstname * @return SignatureRecipient */ public function setFirstname(string $firstname): self public function setFirstname(?string $firstname): self { $this->firstname = $firstname; return $this; } /** * @return string * @return string|null */ public function getLastname(): string public function getLastname(): ?string { return $this->lastname; } /** * @param string $lastname * @param string|null $lastname * @return SignatureRecipient */ public function setLastname(string $lastname): self public function setLastname(?string $lastname): self { $this->lastname = $lastname; return $this; Loading @@ -130,6 +133,7 @@ class SignatureRecipient /** * @param string $email * @return SignatureRecipient */ public function setEmail(string $email): self { Loading @@ -147,6 +151,7 @@ class SignatureRecipient /** * @param DateTime|null $dateUpdate * @return SignatureRecipient */ public function setDateUpdate(?DateTime $dateUpdate): self { Loading @@ -164,6 +169,7 @@ class SignatureRecipient /** * @param Signature $signature * @return SignatureRecipient */ public function setSignature(Signature $signature): self { Loading @@ -172,17 +178,18 @@ class SignatureRecipient } /** * @return string * @return string|null */ public function getPhone(): string public function getPhone(): ?string { return $this->phone; } /** * @param string $phone * @param string|null $phone * @return SignatureRecipient */ public function setPhone(string $phone): self public function setPhone(?string $phone): self { $this->phone = $phone; return $this; Loading src/Strategy/Letterfile/Esup/EsupLetterfileStrategy.php +2 −1 Changes for src/Strategy/Letterfile/Esup/EsupLetterfileStrategy.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace UnicaenSignature\Strategy\Letterfile\Esup; use UnicaenSignature\Service\LoggerService; use UnicaenSignature\Strategy\Letterfile\ILetterfileStrategy; use UnicaenSignature\Strategy\Letterfile\ISignRequest; use UnicaenSignature\Strategy\Letterfile\Tools\CurlAccess; use UnicaenSignature\Utils\SignatureException; Loading Loading @@ -117,7 +118,7 @@ class EsupLetterfileStrategy implements ILetterfileStrategy /** * Liste des procédures en court. * * @return array * @return ISignRequest[] * @throws \UnicaenSignature\Exception\SignatureCurlException * @throws \UnicaenSignature\Exception\SignatureDataMissingException */ Loading src/Strategy/Letterfile/Esup/EsupSignRequest.php +20 −1 Changes for src/Strategy/Letterfile/Esup/EsupSignRequest.php: 20 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -3,9 +3,10 @@ namespace UnicaenSignature\Strategy\Letterfile\Esup; use UnicaenSignature\Exception\SignatureDataMissingException; use UnicaenSignature\Strategy\Letterfile\ISignRequest; use UnicaenSignature\Strategy\Letterfile\Tools\JsonDataArray; class EsupSignRequest extends JsonDataArray class EsupSignRequest extends JsonDataArray implements ISignRequest { private int $id; private \DateTime $dateCreate; Loading Loading @@ -88,6 +89,24 @@ class EsupSignRequest extends JsonDataArray } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public function getIdInLetterfile(): string { return strval($this->getId()); } public function getRecipientsEmails(): ?array { return null; } public function getDateCreated(): \DateTime { return $this->getDateCreate(); } public function getDateUpdated(): ?\DateTime { return $this->getDateEnd(); } } No newline at end of file Loading
src/Command/SignatureLetterfileListCommand.php +56 Changes for src/Command/SignatureLetterfileListCommand.php: 56 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace UnicaenSignature\Command; use Laminas\ServiceManager\ServiceManager; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class SignatureLetterfileListCommand extends SignatureCommandAbstract { protected static $defaultName = 'signature:letterfiles-list'; const opt_letterfile = 'letterfile'; protected function configure() { $this ->setDescription("Vérification du status de la procédure de signature depuis le parafeur") ->addOption(self::opt_letterfile, 'l', InputOption::VALUE_OPTIONAL, 'Clef du parafeur', null) ; } protected function execute(InputInterface $input, OutputInterface $output): int { $io = $this->getIO($input, $output); $io->info("LISTE des INFORMATION DANS le Parafeur"); $letterfileKey = $input->getOption(self::opt_letterfile); if( $letterfileKey === null ){ $letterfile = $this->getSignatureService()->getLetterfileService()->getDefaultLetterFileStrategy(); } else { $letterfile = $this->getSignatureService()->getLetterfileService()->getLetterFileStrategy($letterfileKey); } $list = $letterfile->getSignRequests(); $headers = ['ID', 'title', 'Emails', 'Statut', 'Créé le', 'Dernière MAJ']; $rows = []; foreach ($list as $signrequest){ $row = []; $row[] = $signrequest->getIdInLetterfile(); $row[] = substr($signrequest->getTitle(), 0, 50); $row[] = $signrequest->getRecipientsEmails() ? implode(', ', $signrequest->getRecipientsEmails()) : 'unknow'; $row[] = $signrequest->getStatus(); $row[] = $signrequest->getDateCreated()->format('Y-m-d H:i'); $row[] = $signrequest->getDateUpdated() ? $signrequest->getDateUpdated()->format('Y-m-d H:i') : "-"; $rows[] = $row; } $io->table($headers, $rows); return self::SUCCESS; } } No newline at end of file
src/Entity/Db/Signature.php +57 −24 Changes for src/Entity/Db/Signature.php: 57 added lines, 24 removed lines. Original line number Diff line number Diff line Loading @@ -74,10 +74,10 @@ class Signature /** * Liste des contrats de financement pour le projet. * * @var ArrayCollection * @var SignatureRecipient[] * @ORM\OneToMany(targetEntity="SignatureRecipient", mappedBy="signature") */ protected $recipients; protected array $recipients; /** * Date du dernier changement d'état. Loading @@ -89,12 +89,12 @@ class Signature /** * @var string * @ORM\Column (type="blob", nullable=false) * @ORM\Column (type="string", nullable=false) */ private string $document_data; private string $document_path; /** * Clef permettant d'identifier le document * Clef permettant d'identifier le document côté parafeur * * @var string * @ORM\Column (type="string", length=255, nullable=false) Loading @@ -102,12 +102,20 @@ class Signature private string $document_remotekey; /** * Clef permettant d'identifier la procédure dans le parapheur * Clef permettant d'identifier le document côté application * * @var string * @ORM\Column (type="string", length=255, nullable=false) * @ORM\Column (type="string", length=255, nullable=true) */ private string $letterfile_key; private string $document_localkey; /** * Clef permettant d'identifier le parapheur * * @var string|null * @ORM\Column (type="string", length=255, nullable=true) */ private ?string $letterfile_key; /** * Nom de la procédure de signature dans le parapheur Loading @@ -120,10 +128,10 @@ class Signature /** * URL permettant d'identifier la procédure dans le parapheur * * @var string * @ORM\Column (type="string", length=255, nullable=false) * @var string|null * @ORM\Column (type="string", length=255, nullable=true) */ private string $letterfile_url; private ?string $letterfile_url; /** * @return int Loading Loading @@ -170,17 +178,18 @@ class Signature } /** * @return string * @return int|null */ public function getStatus(): int|string|null public function getStatus(): int|null { return $this->status; } /** * @param string $status * @param int|null $status * @return Signature */ public function setStatus(int|string|null $status): self public function setStatus(int|null $status): self { $this->status = $status; return $this; Loading @@ -196,6 +205,7 @@ class Signature /** * @param DateTime|null $dateUpdate * @return Signature */ public function setDateUpdate(?DateTime $dateUpdate): self { Loading @@ -204,17 +214,18 @@ class Signature } /** * @return ArrayCollection * @return array */ public function getRecipients(): ArrayCollection public function getRecipients(): array { return $this->recipients; } /** * @param ArrayCollection $recipients * @param array $recipients * @return Signature */ public function setRecipients(ArrayCollection $recipients): self public function setRecipients(array $recipients): self { $this->recipients = $recipients; return $this; Loading @@ -223,17 +234,17 @@ class Signature /** * @return string */ public function getDocumentData(): string public function getDocumentPath(): string { return $this->document_data; return $this->document_path; } /** * @param string $document_data * @param string $document_path */ public function setDocumentData(string $document_data): self public function setDocumentPath(string $document_path): self { $this->document_data = $document_data; $this->document_path = $document_path; return $this; } Loading @@ -247,6 +258,7 @@ class Signature /** * @param string $document_remotekey * @return Signature */ public function setDocumentRemotekey(string $document_remotekey): self { Loading @@ -254,6 +266,24 @@ class Signature return $this; } /** * @return string */ public function getDocumentLocalkey(): string { return $this->document_localkey; } /** * @param string $document_localkey * @return Signature */ public function setDocumentLocalkey(string $document_localkey): self { $this->document_localkey = $document_localkey; return $this; } /** * @return string */ Loading @@ -264,6 +294,7 @@ class Signature /** * @param string $letterfile_process * @return Signature */ public function setLetterfileProcess(string $letterfile_process): self { Loading @@ -281,6 +312,7 @@ class Signature /** * @param string $letterfile_key * @return Signature */ public function setLetterfileKey(string $letterfile_key): self { Loading @@ -298,6 +330,7 @@ class Signature /** * @param string $letterfile_url * @return Signature */ public function setLetterfileUrl(string $letterfile_url): self { Loading
src/Entity/Db/SignatureRecipient.php +30 −23 Changes for src/Entity/Db/SignatureRecipient.php: 30 added lines, 23 removed lines. Original line number Diff line number Diff line Loading @@ -18,22 +18,22 @@ class SignatureRecipient private int $id; /** * @var string * @var string|null * @ORM\Column(type="integer", nullable=true) */ private int $status; private ?string $status; /** * @var string * @ORM\Column(type="string", length=64) * @var string|null * @ORM\Column(type="string", length=64, nullable=true) */ private string $firstname; private ?string $firstname; /** * @var string * @ORM\Column(type="string", length=64) * @var string|null * @ORM\Column(type="string", length=64, nullable=true) */ private string $lastname; private ?string $lastname; /** * @var string Loading @@ -42,10 +42,10 @@ class SignatureRecipient private string $email; /** * @var string * @ORM\Column(type="string", length=20) * @var string|null * @ORM\Column(type="string", length=20, nullable=true) */ private string $phone; private ?string $phone; /** * Date du dernier changement d'état. Loading Loading @@ -79,6 +79,7 @@ class SignatureRecipient /** * @param int $status * @return SignatureRecipient */ public function setStatus(int $status): self { Loading @@ -87,34 +88,36 @@ class SignatureRecipient } /** * @return string * @return string|null */ public function getFirstname(): string public function getFirstname(): ?string { return $this->firstname; } /** * @param string $firstname * @param string|null $firstname * @return SignatureRecipient */ public function setFirstname(string $firstname): self public function setFirstname(?string $firstname): self { $this->firstname = $firstname; return $this; } /** * @return string * @return string|null */ public function getLastname(): string public function getLastname(): ?string { return $this->lastname; } /** * @param string $lastname * @param string|null $lastname * @return SignatureRecipient */ public function setLastname(string $lastname): self public function setLastname(?string $lastname): self { $this->lastname = $lastname; return $this; Loading @@ -130,6 +133,7 @@ class SignatureRecipient /** * @param string $email * @return SignatureRecipient */ public function setEmail(string $email): self { Loading @@ -147,6 +151,7 @@ class SignatureRecipient /** * @param DateTime|null $dateUpdate * @return SignatureRecipient */ public function setDateUpdate(?DateTime $dateUpdate): self { Loading @@ -164,6 +169,7 @@ class SignatureRecipient /** * @param Signature $signature * @return SignatureRecipient */ public function setSignature(Signature $signature): self { Loading @@ -172,17 +178,18 @@ class SignatureRecipient } /** * @return string * @return string|null */ public function getPhone(): string public function getPhone(): ?string { return $this->phone; } /** * @param string $phone * @param string|null $phone * @return SignatureRecipient */ public function setPhone(string $phone): self public function setPhone(?string $phone): self { $this->phone = $phone; return $this; Loading
src/Strategy/Letterfile/Esup/EsupLetterfileStrategy.php +2 −1 Changes for src/Strategy/Letterfile/Esup/EsupLetterfileStrategy.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace UnicaenSignature\Strategy\Letterfile\Esup; use UnicaenSignature\Service\LoggerService; use UnicaenSignature\Strategy\Letterfile\ILetterfileStrategy; use UnicaenSignature\Strategy\Letterfile\ISignRequest; use UnicaenSignature\Strategy\Letterfile\Tools\CurlAccess; use UnicaenSignature\Utils\SignatureException; Loading Loading @@ -117,7 +118,7 @@ class EsupLetterfileStrategy implements ILetterfileStrategy /** * Liste des procédures en court. * * @return array * @return ISignRequest[] * @throws \UnicaenSignature\Exception\SignatureCurlException * @throws \UnicaenSignature\Exception\SignatureDataMissingException */ Loading
src/Strategy/Letterfile/Esup/EsupSignRequest.php +20 −1 Changes for src/Strategy/Letterfile/Esup/EsupSignRequest.php: 20 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -3,9 +3,10 @@ namespace UnicaenSignature\Strategy\Letterfile\Esup; use UnicaenSignature\Exception\SignatureDataMissingException; use UnicaenSignature\Strategy\Letterfile\ISignRequest; use UnicaenSignature\Strategy\Letterfile\Tools\JsonDataArray; class EsupSignRequest extends JsonDataArray class EsupSignRequest extends JsonDataArray implements ISignRequest { private int $id; private \DateTime $dateCreate; Loading Loading @@ -88,6 +89,24 @@ class EsupSignRequest extends JsonDataArray } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public function getIdInLetterfile(): string { return strval($this->getId()); } public function getRecipientsEmails(): ?array { return null; } public function getDateCreated(): \DateTime { return $this->getDateCreate(); } public function getDateUpdated(): ?\DateTime { return $this->getDateEnd(); } } No newline at end of file