diff --git a/CHANGES.txt b/CHANGES.txt index d193a54..0c09bb3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -79,7 +79,8 @@ Outre ces changements, voici d'autres changements importants : 30/07/2020 v3.7.9.78-79 (EP) - (i) Meilleure résilience (reprise après crash) du script UPDATE avec fichier ftpf (install/files_to_process.txt file) => permet de s'assurer que les script sql non exécutés (à cause crash ou stop script) le seront à l'itération suivante - + - bugfix pb année date sur 2 chiffres avec php5 !! + ------- 29/07/2020 v3.7.9.77 (EP) - Bugfix Page "Statistiques" diff --git a/README.md b/README.md index ab77c20..1269787 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Logiciel testé et validé sur les configurations suivantes : -------------------------------------------------------------------------------------------- Date: 30/07/2020 -Version: 3.7.9.80 +Version: 3.7.9.81 HISTORIQUE DES CHANGEMENTS DE VERSION : voir le fichier CHANGES.txt (ou la page web /pages/changes) diff --git a/src/Model/Table/MaterielsTable.php b/src/Model/Table/MaterielsTable.php index 05d4e70..8691635 100755 --- a/src/Model/Table/MaterielsTable.php +++ b/src/Model/Table/MaterielsTable.php @@ -252,7 +252,8 @@ class MaterielsTable extends AppTable ]) ->first(); */ - $configuration = TableRegistry::get('Configurations')->get(1); + //$configuration = TableRegistry::getTableLocator()->get('Configurations')->get(1); + $configuration = TableRegistry::getTableLocator()->get('Configurations')->find()->first(); @@ -477,7 +478,9 @@ class MaterielsTable extends AppTable 'id =' => 1 ])->first(); */ - $this->config = TableRegistry::getTableLocator()->get('Configurations')->get(1); + //$this->config = TableRegistry::getTableLocator()->get('Configurations')->get(1); + $this->config = TableRegistry::getTableLocator()->get('Configurations')->find()->first(); + //debug($this->config); /* @@ -657,7 +660,10 @@ class MaterielsTable extends AppTable 'id =' => 1 ]) -> first(); */ - $configuration = TableRegistry::get('Configurations')->get(1); + //$configuration = TableRegistry::get('Configurations')->get(1); + //$configuration = TableRegistry::get('Configurations')->first(); + $configuration = TableRegistry::getTableLocator()->get('Configurations')->find()->first(); + // numero_laboratoire generator (QC changed this in Jan 2015) // (EP) Set new $labNumber (laboratory number) for this new materiel @@ -674,14 +680,17 @@ class MaterielsTable extends AppTable if ( $DATE_GIVEN ) { if ($WITH_YEAR) { $year=substr($entity->get('date_acquisition'), 6, 4); + debug("year before : $year"); if (strlen($year) == 2) { $year = '20' . $year; } + debug("year after: $year"); } $labShortName = $configuration->labNameShort; $numero_laboratoire = $labShortName; $WITH_YEAR && $numero_laboratoire .= '-' . $year; - $num = TableRegistry::get('Materiels')->find('all', [ + //$num = TableRegistry::get('Materiels')->find('all', [ + $num = TableRegistry::getTableLocator()->get('Materiels')->find('all', [ 'fields' => [ 'numero_laboratoire' ], diff --git a/src/Template/Materiels/add_edit.ctp b/src/Template/Materiels/add_edit.ctp index 40cd540..7274c7c 100644 --- a/src/Template/Materiels/add_edit.ctp +++ b/src/Template/Materiels/add_edit.ctp @@ -551,8 +551,10 @@ if (isset($cpMateriel)) { Form->control('date_acquisition', [ + echo $this->Form->control('date_acquisition', [ + //echo $this->Form->date('date_acquisition', [ 'type' => 'text', 'label' => 'Date commande (BC)', 'class' => 'datepicker', @@ -560,7 +562,14 @@ if (isset($cpMateriel)) { // ADD only //'default' => $Date_acquisition //'default' => $materiel->date_acquisition, - 'default' => date("d/m/Y"), + 'default' => date("d/m/Y"), + + // A CAUSE DE CE FICHU PHP5 ET VIEUX MYSQL !!!, INUTILE EN PHP7 !! + // Affichage dd/mm/yy + //'value' => $materiel->date_acquisition->format('d/m/y'), + // Affichage dd/mm/yyyy + 'value' => $IS_ADD ? null : $materiel->date_acquisition->format('d/m/Y'), + // EDIT only 'disabled' => $IS_ADD ? false : $isReadonlyField('date_acquisition', $myReadonlyFields) ]); @@ -575,6 +584,10 @@ if (isset($cpMateriel)) { // ADD only //'default' => $Date_reception 'default' => $materiel->date_reception, + + // php5... + 'value' => $IS_ADD ? null : $materiel->date_reception->format('d/m/Y'), + // EDIT only 'disabled' => $IS_ADD ? false : $isReadonlyField('date_reception', $myReadonlyFields) ]); @@ -616,7 +629,10 @@ if (isset($cpMateriel)) { 'label' => 'Date fin de garantie', 'placeholder' => $comment, 'class' => 'datepicker', - 'default' => NULL + 'default' => NULL, + + // php5... + //'value' => $IS_ADD ? null : $materiel->date_fin_garantie->format('d/m/Y'), ]); // EDIT only diff --git a/webroot/js/DatepickerConfig.js b/webroot/js/DatepickerConfig.js index b0887a1..ee667ec 100755 --- a/webroot/js/DatepickerConfig.js +++ b/webroot/js/DatepickerConfig.js @@ -82,6 +82,8 @@ $.datepicker.regional['fr'] = { // (20200410 EP change) //dateFormat: 'dd-mm-yy', dateFormat: 'dd/mm/yy', + // INVALIDE : + //dateFormat: 'dd/mm/yyyy', firstDay: 1, isRTL: false, showMonthAfterYear: false, -- libgit2 0.21.2