From a4d88fd1913758cc95b395eefcf5e9d730450382 Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 23 Dec 2023 10:00:24 +0100 Subject: =?UTF-8?q?devis=20payant,=20cr=C3=A9er=20devis=20depuis=20facture?= =?UTF-8?q?,=20changement=20dans=20getIDsByIdClient(),=20suppression=20d?= =?UTF-8?q?=C3=A9pendance=20paquet=20latex=20"ulem",=20(string)=20dans=20s?= =?UTF-8?q?etTelephone()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sections/3_modify_data.php | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'src/sections/3_modify_data.php') diff --git a/src/sections/3_modify_data.php b/src/sections/3_modify_data.php index 5da7ed9..0a67cea 100644 --- a/src/sections/3_modify_data.php +++ b/src/sections/3_modify_data.php @@ -7,6 +7,11 @@ require('3-1_windows.php'); function modifyData($Client): array { + // fenêtres fixes + $TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']); + $Calendrier = new ZenityCalendar(ZenitySetup::$calendar['section3']); + + // -- partie 1: rechercher un client -- if($Client == null || get_class($Client) !== 'Clients') // étape sautable { @@ -25,22 +30,21 @@ function modifyData($Client): array $ModificationClientMenu = makeModifyCustomerWindow($Client); $choix_niv2 = exec($ModificationClientMenu->get()); - if($choix_niv2 === ZenitySetup::$modification_client['service']) // ne pas modifier le client mais une prestation + if($choix_niv2 === ZenitySetup::$modification_client['service']) // clic sur "Modifier une prestation" { echo "choix: modifier une prestation\n"; - // on passe à la suite + // ne rien faire dans cette partie et passer à la suite } - elseif($choix_niv2 === "Client ou Prospect?") // modifier type de client + elseif($choix_niv2 === "Client ou Prospect?") { echo "choix: modifier" . $choix_niv2 . "\n"; - $TypeDeClient = new ZenityList(ZenitySetup::$type_client_text, ZenitySetup::$type_client_entrees); $input = exec($TypeDeClient->get()); - if($input === ZenitySetup::$type_client_entrees[0]) + if($input === ZenitySetup::$type_client['entrees'][0]) { echo "choix: " . $input . "\n"; $Client->setType('client'); } - elseif($input === ZenitySetup::$type_client_entrees[1]) + elseif($input === ZenitySetup::$type_client['entrees'][1]) { echo "choix: " . $input . "\n"; $Client->setType('prospect'); @@ -52,7 +56,7 @@ function modifyData($Client): array $Client->update(); return [3, $Client]; // menu précédent } - elseif(is_string($choix_niv2) && $choix_niv2 != '') // modifier une valeur + elseif(is_string($choix_niv2) && $choix_niv2 != '') // autres choix, modifier une valeur { echo "choix: modifier" . $choix_niv2 . "\n"; $ModificationClient = new ZenityEntry($choix_niv2); @@ -74,7 +78,7 @@ function modifyData($Client): array } return [3, $Client]; // menu précédent } - else // annuler + else { echo "annulation: retour au menu principal\n"; return [0, null]; // menu principal @@ -95,7 +99,6 @@ function modifyData($Client): array case 'facture': $PrestaDetails = new DevisFactures('factures'); break; - case 'devis': $PrestaDetails = new DevisFactures('devis'); break; @@ -122,16 +125,13 @@ function modifyData($Client): array $ModificationPrestaMenu = makeModifyServiceWindow($Presta, $PrestaDetails); $choix_niv3 = exec($ModificationPrestaMenu->get()); - if($choix_niv3 === ZenitySetup::$modification_presta['devis_facture']) // devis -> facture - { - echo "choix: changer un devis en facture\n"; - return [3, $Client]; // menu "client" - } - elseif($choix_niv3 === 'Date:') + //~ if($choix_niv3 === ZenitySetup::$modification_presta['devis_facture']) // devis -> facture + //~ { + //~ echo "choix: changer un devis en facture\n"; + //~ return [2, $Client]; // menu "client" + //~ } + if($choix_niv3 === 'Date:') { - // fenêtre - $Calendrier = new ZenityCalendar(ZenitySetup::$calendar['section3']); - $Date = new Dates(exec($Calendrier->get())); // exec() renvoie soit une chaîne soit un false if($Date->getDate() == '') // clic sur "annuler", touche "échap" { @@ -157,7 +157,7 @@ function modifyData($Client): array } //~ elseif($choix_niv3 === 'Type de Presta:') // choix impossible pour le moment //~ { - //~ echo "choix: Impossible de modifier le type de prestation\n"; + //~ echo "choix: changer le type de prestation (devis, facture, etc)\n"; //~ return [3, $Client]; // menu "client" //~ } elseif(is_string($choix_niv3) && $choix_niv3 != '') // modifier une valeur @@ -179,7 +179,6 @@ function modifyData($Client): array } // mettre à jour les documents - //$type = $Presta->getTypePresta(); if($type === 'devis' || $type === 'facture' || $type === 'location') { $DocumentPresta = Latex::makeInstance($type); -- cgit v1.2.3