diff options
author | polo <ordipolo@gmx.fr> | 2023-12-23 15:34:55 +0100 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2023-12-23 15:34:55 +0100 |
commit | ecb77199a60c8d924e02da7d9afab1c9f026a525 (patch) | |
tree | 23ea5f65b03a3a7d6c326a62848545b4892d6ef3 /src/sections | |
parent | a4d88fd1913758cc95b395eefcf5e9d730450382 (diff) | |
download | AppliGestionPHP-ecb77199a60c8d924e02da7d9afab1c9f026a525.zip |
modification de prestation moins dangereuse grâce à shell_exec()
Diffstat (limited to 'src/sections')
-rw-r--r-- | src/sections/1_customer.php | 1 | ||||
-rw-r--r-- | src/sections/3-1_windows.php | 20 | ||||
-rw-r--r-- | src/sections/3_modify_data.php | 3 |
3 files changed, 12 insertions, 12 deletions
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 | |||
7 | { | 7 | { |
8 | // fenêtres | 8 | // fenêtres |
9 | $TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']); | 9 | $TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']); |
10 | //~ $NouveauClient = new ZenityForms(ZenitySetup::$nouveau_client_text, ZenitySetup::$nouveau_client_entrees); | ||
11 | $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']); | 10 | $FinSection1 = new ZenityList(ZenitySetup::$fin_section_1['text'], ZenitySetup::$fin_section_1['entrees']); |
12 | 11 | ||
13 | // -- partie 1: client ou prospect? -- | 12 | // -- 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 @@ | |||
5 | 5 | ||
6 | function makeModifyCustomerWindow(Clients $Customer): ZenityList | 6 | function makeModifyCustomerWindow(Clients $Customer): ZenityList |
7 | { | 7 | { |
8 | // fenêtre | ||
8 | $ModifyCustomer = new ZenityList(ZenitySetup::$modification_client['text'], []); | 9 | $ModifyCustomer = new ZenityList(ZenitySetup::$modification_client['text'], []); |
10 | |||
9 | $entries = []; | 11 | $entries = []; |
10 | $i = 0; | 12 | $i = 0; |
11 | $client_data = $Customer->getAllWithWindowFields(); | 13 | $client_data = $Customer->getAllWithWindowFields(); |
@@ -18,7 +20,6 @@ function makeModifyCustomerWindow(Clients $Customer): ZenityList | |||
18 | } | 20 | } |
19 | $entries[$i][] = ZenitySetup::$modification_client['service']; | 21 | $entries[$i][] = ZenitySetup::$modification_client['service']; |
20 | $entries[$i][] = ''; | 22 | $entries[$i][] = ''; |
21 | //~ $i++; | ||
22 | //~ $entries[$i][] = ZenitySetup::$modification_client['return']; | 23 | //~ $entries[$i][] = ZenitySetup::$modification_client['return']; |
23 | //~ $entries[$i][] = ''; | 24 | //~ $entries[$i][] = ''; |
24 | $ModifyCustomer->setListRows($entries, 2, 2.5); | 25 | $ModifyCustomer->setListRows($entries, 2, 2.5); |
@@ -28,10 +29,11 @@ function makeModifyCustomerWindow(Clients $Customer): ZenityList | |||
28 | 29 | ||
29 | function makeModifyServiceWindow(Prestations $Service, $ServiceDetails = null): ZenityList | 30 | function makeModifyServiceWindow(Prestations $Service, $ServiceDetails = null): ZenityList |
30 | { | 31 | { |
32 | // fenêtre | ||
31 | $ModifyService = new ZenityList(ZenitySetup::$modification_presta['text'], []); | 33 | $ModifyService = new ZenityList(ZenitySetup::$modification_presta['text'], []); |
34 | |||
32 | $entrees = []; | 35 | $entrees = []; |
33 | $i = 0; | 36 | $i = 0; |
34 | |||
35 | $presta_data = $Service->getAllWithWindowFields(); | 37 | $presta_data = $Service->getAllWithWindowFields(); |
36 | //var_dump($presta_data); | 38 | //var_dump($presta_data); |
37 | foreach($presta_data as $key => $value) | 39 | foreach($presta_data as $key => $value) |
@@ -53,18 +55,18 @@ function makeModifyServiceWindow(Prestations $Service, $ServiceDetails = null): | |||
53 | } | 55 | } |
54 | } | 56 | } |
55 | 57 | ||
56 | if($Service->getTypePresta() === 'devis') | 58 | //~ if($Service->getTypePresta() === 'devis') |
57 | { | 59 | //~ { |
58 | $entrees[$i][] = ZenitySetup::$modification_presta['devis_facture']; // option créer une facture à partir du devis | 60 | //~ $entrees[$i][] = ZenitySetup::$modification_presta['devis_facture']; // option créer une facture à partir du devis |
59 | $entrees[$i][] = ''; | 61 | //~ $entrees[$i][] = ''; |
60 | //~ $i++; | 62 | //~ } |
61 | } | 63 | |
62 | //~ $entrees[$i][] = ZenitySetup::$modification_presta['service']; | 64 | //~ $entrees[$i][] = ZenitySetup::$modification_presta['service']; |
63 | //~ $entrees[$i][] = ''; | 65 | //~ $entrees[$i][] = ''; |
64 | //~ $i++; | 66 | //~ $i++; |
65 | //~ $entrees[$i][] = ZenitySetup::$modification_presta['return']; | 67 | //~ $entrees[$i][] = ZenitySetup::$modification_presta['return']; |
66 | //~ $entrees[$i][] = ''; | 68 | //~ $entrees[$i][] = ''; |
67 | $ModifyService->setListRows($entrees, 2, 2.5); | ||
68 | 69 | ||
70 | $ModifyService->setListRows($entrees, 2, 2.5); | ||
69 | return $ModifyService; | 71 | return $ModifyService; |
70 | } | 72 | } |
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 | |||
164 | { | 164 | { |
165 | echo "choix: modifier" . $choix_niv3 . "\n"; | 165 | echo "choix: modifier" . $choix_niv3 . "\n"; |
166 | $ModificationPrestaForm = new ZenityEntry($choix_niv3); | 166 | $ModificationPrestaForm = new ZenityEntry($choix_niv3); |
167 | $input = exec($ModificationPrestaForm->get()); | 167 | $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 |
168 | //if(is_string($input) && $input != '') | ||
169 | if(is_string($input)) // chaine vide autorisée | 168 | if(is_string($input)) // chaine vide autorisée |
170 | { | 169 | { |
171 | // mettre à jour la base de données | 170 | // mettre à jour la base de données |