diff --git a/action/pdf_gamutable.php b/action/pdf_gamutable.php new file mode 100644 index 0000000..03997be --- /dev/null +++ b/action/pdf_gamutable.php @@ -0,0 +1,52 @@ + implode(',', $Tcles)]); + } + + include_spip('spipdf_options'); + include_spip('inc/spipdf'); + + $a = spipdf_html2pdf($fond); + $dir = sous_repertoire(_DIR_IMG . 'pdfgamutable'); + $chemin = $dir . md5($namepdf) . '.pdf' ; + file_put_contents($chemin, $a); + + $id_job = job_queue_add( + 'gamutable_clean_pdf', + 'Gamutable nettoyer pdf', + [$chemin], + 'inc/gamutable_clean_pdf', + false, + time() + 20 + ); + echo url_absolue($chemin); +} diff --git a/gamutable_autorisations.php b/gamutable_autorisations.php index 59d67cf..1c3b6df 100644 --- a/gamutable_autorisations.php +++ b/gamutable_autorisations.php @@ -24,7 +24,10 @@ function autoriser_gamutable_purger_dist($faire, $type, $id, $qui, $opt) { return autoriser('webmestre'); } +function autoriser_gamutablepdf_generer_dist($faire, $type, $id, $qui, $opt) { + return intval($qui['id_auteur']); +} + function autoriser_gamutable_modifier_dist($faire, $type, $id, $qui, $opt) { return true; } - diff --git a/gamutable_fonctions.php b/gamutable_fonctions.php index 1091d8e..cd4952f 100644 --- a/gamutable_fonctions.php +++ b/gamutable_fonctions.php @@ -13,6 +13,7 @@ if (!defined('_ECRIRE_INC_VERSION')) { return; } + function gamutable_fermer_modalbox($id_objet = 9999999999){ $html = << diff --git a/inc/gamutable_clean_pdf.php b/inc/gamutable_clean_pdf.php new file mode 100644 index 0000000..3f22956 --- /dev/null +++ b/inc/gamutable_clean_pdf.php @@ -0,0 +1,9 @@ + [(#SET{sort_asc,[(#CHEMIN{img/sprite_gamutable.svg})#sort_asc]})] [(#SET{sort_desc,[(#CHEMIN{img/sprite_gamutable.svg})#sort_desc]})] +[(#SET{pdfuri,#VAL{pdf_gamutable}|generer_url_action{"", 1}})]
@@ -11,12 +12,13 @@ [(#ENV{titreGamutableUn})] (#ENV{titreGamutableDeux})]
\n\n\t\t
\n\t\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