|
@@ -12,8 +12,7 @@ use App\State\Provider\Dolibarr\DolibarrDocDownloadProvider;
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Demande de téléchargement d'un fichier depuis Dolibarr (facture, bon de commande, etc)
|
|
|
|
|
- *
|
|
|
|
|
|
|
+ * Demande de téléchargement d'un fichier depuis Dolibarr (facture, bon de commande, etc).
|
|
|
*/
|
|
*/
|
|
|
#[ApiResource(
|
|
#[ApiResource(
|
|
|
operations: [
|
|
operations: [
|
|
@@ -21,7 +20,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|
|
uriTemplate: '/dolibarr/download/{dolibarrDocType}/{ref}',
|
|
uriTemplate: '/dolibarr/download/{dolibarrDocType}/{ref}',
|
|
|
requirements: [
|
|
requirements: [
|
|
|
'dolibarrDocType' => DolibarrDocTypeEnum::VALIDATION_REGEX,
|
|
'dolibarrDocType' => DolibarrDocTypeEnum::VALIDATION_REGEX,
|
|
|
- 'ref' => '[\w-]+'
|
|
|
|
|
|
|
+ 'ref' => '[\w-]+',
|
|
|
],
|
|
],
|
|
|
security: '(is_granted("ROLE_ADMIN_CORE") or
|
|
security: '(is_granted("ROLE_ADMIN_CORE") or
|
|
|
is_granted("ROLE_ADMINISTRATIF_MANAGER_CORE") or
|
|
is_granted("ROLE_ADMINISTRATIF_MANAGER_CORE") or
|
|
@@ -48,8 +47,7 @@ class DolibarrDocDownload
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* The dolibarr reference of the document (ex: CO2502-0380, FA2101-02988, ...)
|
|
* The dolibarr reference of the document (ex: CO2502-0380, FA2101-02988, ...)
|
|
|
- * Must be URL Encoded
|
|
|
|
|
- * @var string
|
|
|
|
|
|
|
+ * Must be URL Encoded.
|
|
|
*/
|
|
*/
|
|
|
protected string $ref;
|
|
protected string $ref;
|
|
|
|
|
|
|
@@ -61,6 +59,7 @@ class DolibarrDocDownload
|
|
|
public function setId(int $id): self
|
|
public function setId(int $id): self
|
|
|
{
|
|
{
|
|
|
$this->id = $id;
|
|
$this->id = $id;
|
|
|
|
|
+
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -72,6 +71,7 @@ class DolibarrDocDownload
|
|
|
public function setDolibarrDocType(DolibarrDocTypeEnum $dolibarrDocType): self
|
|
public function setDolibarrDocType(DolibarrDocTypeEnum $dolibarrDocType): self
|
|
|
{
|
|
{
|
|
|
$this->dolibarrDocType = $dolibarrDocType;
|
|
$this->dolibarrDocType = $dolibarrDocType;
|
|
|
|
|
+
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -83,6 +83,7 @@ class DolibarrDocDownload
|
|
|
public function setRef(string $ref): self
|
|
public function setRef(string $ref): self
|
|
|
{
|
|
{
|
|
|
$this->ref = $ref;
|
|
$this->ref = $ref;
|
|
|
|
|
+
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|