summaryrefslogtreecommitdiff
path: root/src/sections
diff options
context:
space:
mode:
Diffstat (limited to 'src/sections')
-rw-r--r--src/sections/2_service.php10
-rw-r--r--src/sections/3_modify_data.php11
2 files changed, 8 insertions, 13 deletions
diff --git a/src/sections/2_service.php b/src/sections/2_service.php
index e25d677..9ebf303 100644
--- a/src/sections/2_service.php
+++ b/src/sections/2_service.php
@@ -3,9 +3,7 @@
3// 3//
4// -- SECTION 2: Prestation et devis -- 4// -- SECTION 2: Prestation et devis --
5 5
6use Doctrine\ORM\EntityManager; 6function newService(?Client $Client = null): array
7
8function newService($Client): array // $Client est un Client ou null
9{ 7{
10 // fenêtres recherche d'un client 8 // fenêtres recherche d'un client
11 $RechercheClient = new zenityEntry(ZenitySetup::$recherche_client['text']); 9 $RechercheClient = new zenityEntry(ZenitySetup::$recherche_client['text']);
@@ -25,11 +23,11 @@ function newService($Client): array // $Client est un Client ou null
25 23
26 24
27 // -- partie 1: le client -- 25 // -- partie 1: le client --
28 if($Client == null || get_class($Client) !== 'Client') 26 if(!$Client)
29 { 27 {
30 $Client = Client::getObject($RechercheClient, $ResultatsRechercheClient); // retourne un Client ou 0 28 $Client = Client::find($RechercheClient, $ResultatsRechercheClient); // retourne un Client ou 0
31 //$ResultatsRechercheClient->cleanCommand(); // inutile parce qu'on ne boucle pas dans cette fonction 29 //$ResultatsRechercheClient->cleanCommand(); // inutile parce qu'on ne boucle pas dans cette fonction
32 if($Client === 0) 30 if(!$Client)
33 { 31 {
34 echo "debug: annulation sélection client\n"; 32 echo "debug: annulation sélection client\n";
35 return [0, null]; // menu principal 33 return [0, null]; // menu principal
diff --git a/src/sections/3_modify_data.php b/src/sections/3_modify_data.php
index 00fe220..607638b 100644
--- a/src/sections/3_modify_data.php
+++ b/src/sections/3_modify_data.php
@@ -5,9 +5,7 @@
5 5
6require('3-1_windows.php'); 6require('3-1_windows.php');
7 7
8use Doctrine\ORM\EntityManager; 8function modifyData(?Client $Client = null): array
9
10function modifyData($Client): array
11{ 9{
12 // -- partie 1: rechercher un client -- 10 // -- partie 1: rechercher un client --
13 11
@@ -19,12 +17,11 @@ function modifyData($Client): array
19 $TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']); 17 $TypeDeClient = new ZenityList(ZenitySetup::$type_client['text'], ZenitySetup::$type_client['entrees']);
20 $Calendrier = new ZenityCalendar(ZenitySetup::$calendar['section3']); 18 $Calendrier = new ZenityCalendar(ZenitySetup::$calendar['section3']);
21 19
22 if($Client == null || get_class($Client) !== 'Client') // étape sautable 20 if(!$Client)
23 { 21 {
24 $Client = Client::getObject($RechercheClient, $ResultatsRechercheClient); // = 0 ou type "Client" 22 $Client = Client::find($RechercheClient, $ResultatsRechercheClient);
25 //$ResultatsRechercheClient->cleanCommand(); // inutile parce qu'on ne boucle pas dans cette fonction 23 //$ResultatsRechercheClient->cleanCommand(); // inutile parce qu'on ne boucle pas dans cette fonction
26 //if(!is_object($Client) || !get_class($Client) == 'Client') 24 if(!$Client)
27 if($Client === 0)
28 { 25 {
29 echo "debug: annulation sélection client\n"; 26 echo "debug: annulation sélection client\n";
30 return [0, null]; // menu principal 27 return [0, null]; // menu principal