From ecb77199a60c8d924e02da7d9afab1c9f026a525 Mon Sep 17 00:00:00 2001 From: polo Date: Sat, 23 Dec 2023 15:34:55 +0100 Subject: =?UTF-8?q?modification=20de=20prestation=20moins=20dangereuse=20g?= =?UTF-8?q?r=C3=A2ce=20=C3=A0=20shell=5Fexec()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sections/1_customer.php | 1 - src/sections/3-1_windows.php | 20 +++++++++++--------- src/sections/3_modify_data.php | 3 +-- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/sections') diff --git a/src/sections/1_customer.php b/src/sections/1_customer.php index ae8067f..b0e3283 100644 --- a/src/sections/1_customer.php +++ b/src/sections/1_customer.php @@ -7,7 +7,6 @@ function newCustomer(): array { // fenêtres $TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']); - //~ $NouveauClient = new ZenityForms(ZenitySetup::$nouveau_client_text, ZenitySetup::$nouveau_client_entrees); $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']); // -- partie 1: client ou prospect? -- diff --git a/src/sections/3-1_windows.php b/src/sections/3-1_windows.php index 7e7367b..31c6cee 100644 --- a/src/sections/3-1_windows.php +++ b/src/sections/3-1_windows.php @@ -5,7 +5,9 @@ function makeModifyCustomerWindow(Clients $Customer): ZenityList { + // fenêtre $ModifyCustomer = new ZenityList(ZenitySetup::$modification_client['text'], []); + $entries = []; $i = 0; $client_data = $Customer->getAllWithWindowFields(); @@ -18,7 +20,6 @@ function makeModifyCustomerWindow(Clients $Customer): ZenityList } $entries[$i][] = ZenitySetup::$modification_client['service']; $entries[$i][] = ''; - //~ $i++; //~ $entries[$i][] = ZenitySetup::$modification_client['return']; //~ $entries[$i][] = ''; $ModifyCustomer->setListRows($entries, 2, 2.5); @@ -28,10 +29,11 @@ function makeModifyCustomerWindow(Clients $Customer): ZenityList function makeModifyServiceWindow(Prestations $Service, $ServiceDetails = null): ZenityList { + // fenêtre $ModifyService = new ZenityList(ZenitySetup::$modification_presta['text'], []); + $entrees = []; $i = 0; - $presta_data = $Service->getAllWithWindowFields(); //var_dump($presta_data); foreach($presta_data as $key => $value) @@ -53,18 +55,18 @@ function makeModifyServiceWindow(Prestations $Service, $ServiceDetails = null): } } - if($Service->getTypePresta() === 'devis') - { - $entrees[$i][] = ZenitySetup::$modification_presta['devis_facture']; // option créer une facture à partir du devis - $entrees[$i][] = ''; - //~ $i++; - } + //~ if($Service->getTypePresta() === 'devis') + //~ { + //~ $entrees[$i][] = ZenitySetup::$modification_presta['devis_facture']; // option créer une facture à partir du devis + //~ $entrees[$i][] = ''; + //~ } + //~ $entrees[$i][] = ZenitySetup::$modification_presta['service']; //~ $entrees[$i][] = ''; //~ $i++; //~ $entrees[$i][] = ZenitySetup::$modification_presta['return']; //~ $entrees[$i][] = ''; - $ModifyService->setListRows($entrees, 2, 2.5); + $ModifyService->setListRows($entrees, 2, 2.5); return $ModifyService; } diff --git a/src/sections/3_modify_data.php b/src/sections/3_modify_data.php index 0a67cea..279310b 100644 --- a/src/sections/3_modify_data.php +++ b/src/sections/3_modify_data.php @@ -164,8 +164,7 @@ function modifyData($Client): array { echo "choix: modifier" . $choix_niv3 . "\n"; $ModificationPrestaForm = new ZenityEntry($choix_niv3); - $input = exec($ModificationPrestaForm->get()); - //if(is_string($input) && $input != '') + $input = shell_exec($ModificationPrestaForm->get()); // shell_exec() retourne null si la commande échoue, exec() retourne la dernière ligne de texte en sortie ou null si aucune commande ne réussit if(is_string($input)) // chaine vide autorisée { // mettre à jour la base de données -- cgit v1.2.3