Loading admin/src/BddAdmin/Table.php +13 −3 Original line number Diff line number Diff line Loading @@ -240,7 +240,9 @@ class Table 'delete' => true, 'insert' => true, 'update' => true, 'update-cols' => [], 'update-ignore-cols' => [], 'update-only-null' => [], ]; $options = array_merge($defaultOptions, $options); Loading Loading @@ -300,10 +302,18 @@ class Table $oldc = isset($old[$c]) ? $old[$c] : null; if ($newc instanceof \DateTime) $newc = $newc->format('Y-m-d'); if ($oldc instanceof \DateTime) $oldc = $oldc->format('Y-m-d'); if (!in_array($c, $options['update-ignore-cols']) && $c != 'ID' && array_key_exists($c, $new) && $newc !== $oldc) { if ($newc !== $oldc && array_key_exists($c, $new) && $c != 'ID') { $ok = empty($options['update-cols']); // OK par défaut si une liste n'a pas été établie manuellement if (in_array($c, $options['update-cols'])) $ok = true; if (in_array($c, $options['update-ignore-cols'])) $ok = false; if (in_array($c, $options['update-only-null']) && $oldc !== null) $ok = false; if ($ok) { $toUpdate[$c] = $new[$c]; } } } if (!empty($toUpdate)) { $this->update($toUpdate, $this->makeKeyArray($old, $key), $traitementOptions); $result['update']++; Loading admin/src/DataGen.php +4 −1 Original line number Diff line number Diff line Loading @@ -190,7 +190,10 @@ class DataGen 'table' => 'ETAT_SORTIE', 'context' => ['install', 'update'], 'key' => 'CODE', 'options' => ['update' => false, 'delete' => false], 'options' => ['update' => true, 'delete' => false, 'update-cols' => ['CSV_PARAMS', 'CSV_TRAITEMENT', 'PDF_TRAITEMENT'], 'update-only-null' => ['CSV_PARAMS', 'CSV_TRAITEMENT', 'PDF_TRAITEMENT'], ], ], [ 'table' => 'MODELE_CONTRAT', Loading data/etats_sortie.php +1 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ return [ 'CODE' => 'export_services', 'LIBELLE' => 'Export des services', 'PDF_TRAITEMENT' => '/data/Etats de sortie/export_services.php', 'CSV_TRAITEMENT' => '/data/Etats de sortie/export_services_csv.php', 'AUTO_BREAK' => true, 'REQUETE' => 'SELECT * Loading Loading
admin/src/BddAdmin/Table.php +13 −3 Original line number Diff line number Diff line Loading @@ -240,7 +240,9 @@ class Table 'delete' => true, 'insert' => true, 'update' => true, 'update-cols' => [], 'update-ignore-cols' => [], 'update-only-null' => [], ]; $options = array_merge($defaultOptions, $options); Loading Loading @@ -300,10 +302,18 @@ class Table $oldc = isset($old[$c]) ? $old[$c] : null; if ($newc instanceof \DateTime) $newc = $newc->format('Y-m-d'); if ($oldc instanceof \DateTime) $oldc = $oldc->format('Y-m-d'); if (!in_array($c, $options['update-ignore-cols']) && $c != 'ID' && array_key_exists($c, $new) && $newc !== $oldc) { if ($newc !== $oldc && array_key_exists($c, $new) && $c != 'ID') { $ok = empty($options['update-cols']); // OK par défaut si une liste n'a pas été établie manuellement if (in_array($c, $options['update-cols'])) $ok = true; if (in_array($c, $options['update-ignore-cols'])) $ok = false; if (in_array($c, $options['update-only-null']) && $oldc !== null) $ok = false; if ($ok) { $toUpdate[$c] = $new[$c]; } } } if (!empty($toUpdate)) { $this->update($toUpdate, $this->makeKeyArray($old, $key), $traitementOptions); $result['update']++; Loading
admin/src/DataGen.php +4 −1 Original line number Diff line number Diff line Loading @@ -190,7 +190,10 @@ class DataGen 'table' => 'ETAT_SORTIE', 'context' => ['install', 'update'], 'key' => 'CODE', 'options' => ['update' => false, 'delete' => false], 'options' => ['update' => true, 'delete' => false, 'update-cols' => ['CSV_PARAMS', 'CSV_TRAITEMENT', 'PDF_TRAITEMENT'], 'update-only-null' => ['CSV_PARAMS', 'CSV_TRAITEMENT', 'PDF_TRAITEMENT'], ], ], [ 'table' => 'MODELE_CONTRAT', Loading
data/etats_sortie.php +1 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ return [ 'CODE' => 'export_services', 'LIBELLE' => 'Export des services', 'PDF_TRAITEMENT' => '/data/Etats de sortie/export_services.php', 'CSV_TRAITEMENT' => '/data/Etats de sortie/export_services_csv.php', 'AUTO_BREAK' => true, 'REQUETE' => 'SELECT * Loading