diff options
| author | polo <ordipolo@gmx.fr> | 2026-07-17 23:04:59 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-07-17 23:04:59 +0200 |
| commit | 9ca2e7f3b212ca7434bb169f7c1b9ac0f8b2b22e (patch) | |
| tree | 754f601c6010fa428425178b36f102e2c732908f /src/sections | |
| parent | e30f1b6f6bc6df56aa7ed2dff4169ab7d7f93fc4 (diff) | |
| download | AppliGestionPHP-9ca2e7f3b212ca7434bb169f7c1b9ac0f8b2b22e.tar.gz AppliGestionPHP-9ca2e7f3b212ca7434bb169f7c1b9ac0f8b2b22e.tar.bz2 AppliGestionPHP-9ca2e7f3b212ca7434bb169f7c1b9ac0f8b2b22e.zip | |
param ?Client dans newService() et modifyData(), gitignore, config-template
Diffstat (limited to 'src/sections')
| -rw-r--r-- | src/sections/2_service.php | 10 | ||||
| -rw-r--r-- | src/sections/3_modify_data.php | 11 |
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 | ||
| 6 | use Doctrine\ORM\EntityManager; | 6 | function newService(?Client $Client = null): array |
| 7 | |||
| 8 | function 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 | ||
| 6 | require('3-1_windows.php'); | 6 | require('3-1_windows.php'); |
| 7 | 7 | ||
| 8 | use Doctrine\ORM\EntityManager; | 8 | function modifyData(?Client $Client = null): array |
| 9 | |||
| 10 | function 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 |
