From 35373147622a1d9b880481f23f61ec82e6594dbc Mon Sep 17 00:00:00 2001 From: Noizette Date: Fri, 21 Jul 2023 23:28:54 +0200 Subject: [PATCH] First steps in update to 1.3.0 --- {www/admin => admin}/_facture_common.php | 4 ++-- {www/admin => admin}/_inc.php | 6 +++--- {www/admin => admin}/aide.php | 0 {www/admin => admin}/client.php | 0 {www/admin => admin}/client_modifier.php | 0 {www/admin => admin}/client_supprimer.php | 0 {www/admin => admin}/clients.php | 0 {www/admin => admin}/config.php | 0 {www/admin => admin}/facture.php | 0 {www/admin => admin}/facture_ajouter.php | 2 +- {www/admin => admin}/facture_modifier.php | 2 +- {www/admin => admin}/facture_supprimer.php | 0 {www/admin => admin}/index.php | 0 {www/admin => admin}/pdf.php | 2 +- install.php | 6 +++--- lib/Facture.php | 14 +++++++------- garradin_plugin.ini => plugin.ini | 9 ++++----- upgrade.php | 22 +++++++++++----------- 18 files changed, 33 insertions(+), 34 deletions(-) rename {www/admin => admin}/_facture_common.php (99%) rename {www/admin => admin}/_inc.php (96%) rename {www/admin => admin}/aide.php (100%) rename {www/admin => admin}/client.php (100%) rename {www/admin => admin}/client_modifier.php (100%) rename {www/admin => admin}/client_supprimer.php (100%) rename {www/admin => admin}/clients.php (100%) rename {www/admin => admin}/config.php (100%) rename {www/admin => admin}/facture.php (100%) rename {www/admin => admin}/facture_ajouter.php (66%) rename {www/admin => admin}/facture_modifier.php (58%) rename {www/admin => admin}/facture_supprimer.php (100%) rename {www/admin => admin}/index.php (100%) rename {www/admin => admin}/pdf.php (99%) rename garradin_plugin.ini => plugin.ini (72%) diff --git a/www/admin/_facture_common.php b/admin/_facture_common.php similarity index 99% rename from www/admin/_facture_common.php rename to admin/_facture_common.php index cd3f03e..32b951c 100644 --- a/www/admin/_facture_common.php +++ b/admin/_facture_common.php @@ -1,6 +1,6 @@ requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE); -use Garradin\DB; +use Paheko\DB; use stdClass; use const \Garradin\Plugin\Facturation\PATTERNS_LIST; diff --git a/www/admin/_inc.php b/admin/_inc.php similarity index 96% rename from www/admin/_inc.php rename to admin/_inc.php index 5db92d0..01cbd47 100644 --- a/www/admin/_inc.php +++ b/admin/_inc.php @@ -1,9 +1,9 @@ requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ); diff --git a/install.php b/install.php index 8ed3d95..7ae8274 100644 --- a/install.php +++ b/install.php @@ -1,7 +1,7 @@ getInfos(); +$version = $plugin->get('version'); // 0.2.0 - Stock le contenu en json plutôt qu'en serialized -if (version_compare($infos->version, '0.2.0', '<')) +if (version_compare($version, '0.2.0', '<')) { $r = (array) DB::getInstance()->get('SELECT * FROM plugin_facturation_factures'); @@ -26,7 +26,7 @@ if (version_compare($infos->version, '0.2.0', '<')) } // 0.3.0 - Migration Facturation\Config vers la table plugins -if (version_compare($infos->version, '0.3.0', '<')) +if (version_compare($version, '0.3.0', '<')) { $conf = $db->getAssoc('SELECT cle, valeur FROM plugin_facturation_config ORDER BY cle;'); foreach($conf as $k=>$v) @@ -40,7 +40,7 @@ if (version_compare($infos->version, '0.3.0', '<')) } // 0.4.0 - -if (version_compare($infos->version, '0.4.0', '<')) +if (version_compare($version, '0.4.0', '<')) { $db->exec(<<version, '0.6.0', '<')) +if (version_compare($version, '0.6.0', '<')) { $r = $db->first('SELECT id, total FROM plugin_facturation_factures;'); if (strpos($r->total,'.')) @@ -145,7 +145,7 @@ EOT } // 0.6.2 - -if (version_compare($infos->version, '0.6.2', '<')) +if (version_compare($version, '0.6.2', '<')) { $db->exec(<<version, '0.7.1', '<')) +if (version_compare($version, '0.7.1', '<')) { $plugin->setConfig('ttc', false); } // 0.7.4 - Signal menu item -if (version_compare($infos->version, '0.7.4', '<')) +if (version_compare($version, '0.7.4', '<')) { $plugin->registerSignal('menu.item', [Facture::class, 'menuItem']); } \ No newline at end of file