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