First steps in update to 1.3.0
This commit is contained in:
parent
4aaed6f3c2
commit
3537314762
18 changed files with 33 additions and 34 deletions
22
upgrade.php
22
upgrade.php
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Garradin;
|
||||
use Garradin\Plugin\Facturation\Facture;
|
||||
use Garradin\Entities\Files\File;
|
||||
namespace Paheko;
|
||||
use Paheko\Plugin\Facturation\Facture;
|
||||
use Paheko\Entities\Files\File;
|
||||
|
||||
define('DEVIS', 0);
|
||||
define('FACT', 1);
|
||||
|
|
@ -11,11 +11,11 @@ define('COTIS', 3);
|
|||
|
||||
$db = DB::getInstance();
|
||||
$facture = new Facture;
|
||||
$infos = $plugin->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(<<<EOT
|
||||
CREATE TABLE IF NOT EXISTS plugin_facturation_paiement
|
||||
|
|
@ -85,7 +85,7 @@ EOT
|
|||
}
|
||||
|
||||
// 0.6.0 -
|
||||
if (version_compare($infos->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(<<<EOT
|
||||
INSERT OR IGNORE INTO plugin_facturation_paiement
|
||||
|
|
@ -195,13 +195,13 @@ EOT
|
|||
}
|
||||
|
||||
// 0.7.1 - Ajout clé config TTC/HT
|
||||
if (version_compare($infos->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']);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue