diff options
Diffstat (limited to 'src/sections/2_service.php')
-rw-r--r-- | src/sections/2_service.php | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/sections/2_service.php b/src/sections/2_service.php index 9683ef9..28fba3f 100644 --- a/src/sections/2_service.php +++ b/src/sections/2_service.php | |||
@@ -159,27 +159,15 @@ function newService($Client): array // $Client est un Client ou null | |||
159 | } | 159 | } |
160 | 160 | ||
161 | // si encore de type prospect, devient un type client | 161 | // si encore de type prospect, devient un type client |
162 | //$Client->setType('client'); // inutile? | 162 | if($Client->typeToClient()) // utile si $Client est renvoyé dans le "return" |
163 | $Client->updateOneValue('type', 'client'); // modifier le type prospect en client | 163 | { |
164 | $Client->updateOneValue('type', 'client'); // base synchronisée | ||
165 | } | ||
164 | 166 | ||
165 | 167 | ||
166 | // -- partie 3: LaTeX -- | 168 | // -- partie 3: LaTeX -- |
167 | 169 | ||
168 | //makeLatexAndPdfDocuments($Client, $Presta, $PrestaDetails); | 170 | // fabrique d'objets enfants de Latex (sans connaître les noms des classes) |
169 | // factoriser tout ça | ||
170 | /* plusieurs parties: | ||
171 | * - une fonction ou on crée et manipule les objets (une classe par type de document) | ||
172 | * - manipulation des données | ||
173 | * - chemins et noms de fichiers | ||
174 | * - insertion des variables | ||
175 | * - écriture du fichier (+ dossier si nécessaire) | ||
176 | */ | ||
177 | // et pour bien faire ajouter aussi une interface | ||
178 | |||
179 | //~ function makeLatexSubClass(string $type) | ||
180 | //~ {} | ||
181 | |||
182 | // fabrique d'objets (sans connaître les noms des classes) | ||
183 | $EnveloppeRecto = Latex::makeInstance('enveloppe_recto'); | 171 | $EnveloppeRecto = Latex::makeInstance('enveloppe_recto'); |
184 | $EnveloppeVerso = Latex::makeInstance('enveloppe_verso'); | 172 | $EnveloppeVerso = Latex::makeInstance('enveloppe_verso'); |
185 | $DocumentPresta = Latex::makeInstance($Presta->getTypePresta()); // retourne objet ou null | 173 | $DocumentPresta = Latex::makeInstance($Presta->getTypePresta()); // retourne objet ou null |
@@ -194,9 +182,7 @@ function newService($Client): array // $Client est un Client ou null | |||
194 | $DocumentPresta->makeLatex(); | 182 | $DocumentPresta->makeLatex(); |
195 | } | 183 | } |
196 | 184 | ||
197 | |||
198 | // création des fichiers | 185 | // création des fichiers |
199 | // paramètre = Objet enfant de Latex | ||
200 | makeTexAndPdf($EnveloppeRecto); | 186 | makeTexAndPdf($EnveloppeRecto); |
201 | makeTexAndPdf($EnveloppeVerso); | 187 | makeTexAndPdf($EnveloppeVerso); |
202 | 188 | ||
@@ -217,6 +203,7 @@ function newService($Client): array // $Client est un Client ou null | |||
217 | 203 | ||
218 | // ? modifications avec le menu de la section 3 obtenu avec makeModifyCustomerWindow() | 204 | // ? modifications avec le menu de la section 3 obtenu avec makeModifyCustomerWindow() |
219 | 205 | ||
206 | |||
220 | // -- partie 5: on fait quoi maintenant -- | 207 | // -- partie 5: on fait quoi maintenant -- |
221 | $choix_niv2 = exec($FinSection2->get()); | 208 | $choix_niv2 = exec($FinSection2->get()); |
222 | if($choix_niv2 === ZenitySetup::$fin_section_2['entrees'][0]) // afficher le document | 209 | if($choix_niv2 === ZenitySetup::$fin_section_2['entrees'][0]) // afficher le document |