Line 38... |
Line 38... |
38 |
private $html;
|
38 |
private $html;
|
39 |
private $wkhtml;
|
39 |
private $wkhtml;
|
40 |
private $piedepage;
|
40 |
private $piedepage;
|
41 |
private $fichier_pdf;
|
41 |
private $fichier_pdf;
|
42 |
private $blocs = array();
|
42 |
private $blocs = array();
|
- |
|
43 |
private $nom_retenu;
|
Line 43... |
Line 44... |
43 |
|
44 |
|
44 |
private $Desc;
|
45 |
private $Desc;
|
45 |
private $Ecolo;
|
46 |
private $Ecolo;
|
46 |
private $Ethno;
|
47 |
private $Ethno;
|
Line 65... |
Line 66... |
65 |
$this->Nomen = new Nomenclature($this->conteneur);
|
66 |
$this->Nomen = new Nomenclature($this->conteneur);
|
66 |
$this->Stat = new Statut($this->conteneur);
|
67 |
$this->Stat = new Statut($this->conteneur);
|
67 |
$this->Biblio = new Bibliographie($this->conteneur);
|
68 |
$this->Biblio = new Bibliographie($this->conteneur);
|
68 |
$this->Reparti = new Repartition($this->conteneur);
|
69 |
$this->Reparti = new Repartition($this->conteneur);
|
69 |
$this->piedepage = Config::get('chemin_modules').'pdf_export/squelettes/footer.html';
|
70 |
$this->piedepage = Config::get('chemin_modules').'pdf_export/squelettes/footer.html';
|
- |
|
71 |
$this->nom_retenu = $this->conteneur->getNomCourant()->getNomRetenu()->get('nom_sci_html');
|
70 |
}
|
72 |
}
|
Line 71... |
Line 73... |
71 |
|
73 |
|
72 |
|
74 |
|
Line 132... |
Line 134... |
132 |
|
134 |
|
Line 133... |
Line 135... |
133 |
//++-------------------------------------récupération des données-----------------------------------++
|
135 |
//++-------------------------------------récupération des données-----------------------------------++
|
134 |
|
136 |
|
135 |
private function obtenirDonnees() {
|
137 |
private function obtenirDonnees() {
|
136 |
$donnees = array();
|
138 |
$donnees = array();
|
137 |
$donnees['donnees_pdf'] = array('nom' => $this->parametres['nom'],
|
139 |
$donnees['donnees_pdf'] = array('nom' => $this->nom_retenu,
|
138 |
'chemin_css' => Config::get('url_css_pdf'));
|
140 |
'chemin_css' => Config::get('url_css_pdf'));
|
139 |
$donnees['description'] = $this->Desc->obtenirDonnees();
|
141 |
$donnees['description'] = $this->Desc->obtenirDonnees();
|
140 |
$donnees['ecologie'] = $this->Ecolo->obtenirDonnees();
|
142 |
$donnees['ecologie'] = $this->Ecolo->obtenirDonnees();
|
Line 167... |
Line 169... |
167 |
//version WKHTMLtoPDF en ligne de commande
|
169 |
//version WKHTMLtoPDF en ligne de commande
|
168 |
private function transformerHtmlEnPdf() {
|
170 |
private function transformerHtmlEnPdf() {
|
169 |
$time = $_SERVER['REQUEST_TIME'] ;
|
171 |
$time = $_SERVER['REQUEST_TIME'] ;
|
170 |
$this->fichier_html = $this->chemin_pdf.''.str_replace(' ','_',$this->parametres['nom']).'-'.$time.'.html';
|
172 |
$this->fichier_html = $this->chemin_pdf.''.str_replace(' ','_',$this->parametres['nom']).'-'.$time.'.html';
|
171 |
$this->fichier_pdf = $this->chemin_pdf.''.str_replace(' ','_',$this->parametres['nom']).'-'.$time.'.pdf';
|
173 |
$this->fichier_pdf = $this->chemin_pdf.''.str_replace(' ','_',$this->parametres['nom']).'-'.$time.'.pdf';
|
172 |
$nom = $this->parametres['nom'];
|
174 |
$nom = $this->nom_retenu;
|
173 |
file_put_contents($this->fichier_html, $this->html);
|
175 |
file_put_contents($this->fichier_html, $this->html);
|
174 |
$commande =
|
176 |
$commande =
|
175 |
" {$this->wkhtml} --replace 'nom' '$nom' --footer-html '{$this->piedepage}' --encoding utf-8 $this->fichier_html $this->fichier_pdf 2>&1";
|
177 |
" {$this->wkhtml} --replace 'nom' '$nom' --footer-html '{$this->piedepage}' --encoding utf-8 $this->fichier_html $this->fichier_pdf 2>&1";
|
176 |
$debug = exec($commande);
|
178 |
$debug = exec($commande);
|
177 |
//echo $debug;
|
179 |
//echo $debug;
|