From 46591fffb0226b0fa87e68248b06182389825f80 Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 27 May 2024 21:34:05 +0200 Subject: =?UTF-8?q?typeToClient()=20modifie=20$Client=20et=20ne=20touche?= =?UTF-8?q?=20la=20base=20que=20si=20n=C3=A9cessaire,=20nettoyage=20divers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sections/2_service.php | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'src/sections/2_service.php') 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 } // si encore de type prospect, devient un type client - //$Client->setType('client'); // inutile? - $Client->updateOneValue('type', 'client'); // modifier le type prospect en client + if($Client->typeToClient()) // utile si $Client est renvoyé dans le "return" + { + $Client->updateOneValue('type', 'client'); // base synchronisée + } // -- partie 3: LaTeX -- - //makeLatexAndPdfDocuments($Client, $Presta, $PrestaDetails); - // factoriser tout ça - /* plusieurs parties: - * - une fonction ou on crée et manipule les objets (une classe par type de document) - * - manipulation des données - * - chemins et noms de fichiers - * - insertion des variables - * - écriture du fichier (+ dossier si nécessaire) - */ - // et pour bien faire ajouter aussi une interface - - //~ function makeLatexSubClass(string $type) - //~ {} - - // fabrique d'objets (sans connaître les noms des classes) + // fabrique d'objets enfants de Latex (sans connaître les noms des classes) $EnveloppeRecto = Latex::makeInstance('enveloppe_recto'); $EnveloppeVerso = Latex::makeInstance('enveloppe_verso'); $DocumentPresta = Latex::makeInstance($Presta->getTypePresta()); // retourne objet ou null @@ -194,9 +182,7 @@ function newService($Client): array // $Client est un Client ou null $DocumentPresta->makeLatex(); } - // création des fichiers - // paramètre = Objet enfant de Latex makeTexAndPdf($EnveloppeRecto); makeTexAndPdf($EnveloppeVerso); @@ -217,6 +203,7 @@ function newService($Client): array // $Client est un Client ou null // ? modifications avec le menu de la section 3 obtenu avec makeModifyCustomerWindow() + // -- partie 5: on fait quoi maintenant -- $choix_niv2 = exec($FinSection2->get()); if($choix_niv2 === ZenitySetup::$fin_section_2['entrees'][0]) // afficher le document -- cgit v1.2.3