gere le cas des documents protected
This commit is contained in:
parent
9e3e8e59ad
commit
fb640a92bc
2 changed files with 19 additions and 4 deletions
|
@ -217,8 +217,15 @@ function formulaires_gamumail_traiter_dist($slug, $destinataires = 0, $Tclient =
|
||||||
$docs_spip = ($docs_spip != '' ? explode(',', $docs_spip) : []);
|
$docs_spip = ($docs_spip != '' ? explode(',', $docs_spip) : []);
|
||||||
if (!empty($docs_spip)) {
|
if (!empty($docs_spip)) {
|
||||||
foreach ($docs_spip as $id_document) {
|
foreach ($docs_spip as $id_document) {
|
||||||
$Tdocument = sql_fetsel('titre,fichier,extension','spip_documents','id_document='.intval($id_document));
|
$protected = '';
|
||||||
$destination = _DIR_IMG.$Tdocument['fichier'];
|
$Tdocument = sql_fetsel('*','spip_documents','id_document='.intval($id_document));
|
||||||
|
if (
|
||||||
|
array_key_exists('protected', $Tdocument)
|
||||||
|
and $Tdocument['protected'] === 'oui'
|
||||||
|
) {
|
||||||
|
$protected = 'PROTECTED/';
|
||||||
|
}
|
||||||
|
$destination = _DIR_IMG.$protected.$Tdocument['fichier'];
|
||||||
$extension = $Tdocument['extension'];
|
$extension = $Tdocument['extension'];
|
||||||
if ($Tdocument['titre']) {
|
if ($Tdocument['titre']) {
|
||||||
$nom_fichier = $Tdocument['titre'] .".".$extension;
|
$nom_fichier = $Tdocument['titre'] .".".$extension;
|
||||||
|
|
|
@ -94,8 +94,16 @@ function inc_envoyer_gamumail($slug, $destinataires, $options = []) {
|
||||||
// récup des paramètres des docs à attacher
|
// récup des paramètres des docs à attacher
|
||||||
if (!empty($Tid_doc)) {
|
if (!empty($Tid_doc)) {
|
||||||
foreach ($Tid_doc as $id_document) {
|
foreach ($Tid_doc as $id_document) {
|
||||||
$Tdocument = sql_fetsel('titre,fichier,extension','spip_documents','id_document='.intval($id_document));
|
$protected = '';
|
||||||
$destination = _DIR_IMG.$Tdocument['fichier'];
|
$Tdocument = sql_fetsel('*','spip_documents','id_document='.intval($id_document));
|
||||||
|
if (
|
||||||
|
array_key_exists('protected', $Tdocument)
|
||||||
|
and $Tdocument['protected'] === 'oui'
|
||||||
|
) {
|
||||||
|
$protected = 'PROTECTED/';
|
||||||
|
}
|
||||||
|
$destination = _DIR_IMG.$protected.$Tdocument['fichier'];
|
||||||
|
|
||||||
$extension = $Tdocument['extension'];
|
$extension = $Tdocument['extension'];
|
||||||
if ($Tdocument['titre']) {
|
if ($Tdocument['titre']) {
|
||||||
$nom_fichier = $Tdocument['titre'] .".".$extension;
|
$nom_fichier = $Tdocument['titre'] .".".$extension;
|
||||||
|
|
Loading…
Add table
Reference in a new issue