Add new menu item call

This commit is contained in:
Noizette 2023-04-16 00:51:55 +02:00
parent b74226871e
commit 97404460ee
3 changed files with 15 additions and 1 deletions

View File

@ -1,10 +1,13 @@
<?php <?php
namespace Garradin; namespace Garradin;
use Garradin\Entities\Files\File; use Garradin\Entities\Files\File;
use Garradin\Plugin\Facturation\Facture;
$db = DB::getInstance(); $db = DB::getInstance();
$db->import(dirname(__FILE__) . "/data/schema.sql"); $db->import(dirname(__FILE__) . "/data/schema.sql");
$path = __DIR__.'/data/default_sign.png'; $path = __DIR__.'/data/default_sign.png';
$png = (new File)->createAndStore('skel/plugin/facturation','sign.png', $path, null); $png = (new File)->createAndStore('skel/plugin/facturation','sign.png', $path, null);
$plugin->registerSignal('menu.item', [Facture::class, 'menuItem']);

View File

@ -523,4 +523,9 @@ class Facture
{ {
return DB::getInstance()->delete('plugin_facturation_factures', 'id = '. (int)$id); return DB::getInstance()->delete('plugin_facturation_factures', 'id = '. (int)$id);
} }
public static function menuItem(array $params, array &$list): void
{
$list['plugin_facturation'] = sprintf('<a href="%sp/taima/">Facturation</a>', \Garradin\ADMIN_URL);
}
} }

View File

@ -198,4 +198,10 @@ EOT
if (version_compare($infos->version, '0.7.1', '<')) if (version_compare($infos->version, '0.7.1', '<'))
{ {
$plugin->setConfig('ttc', false); $plugin->setConfig('ttc', false);
}
// 0.7.4 - Signal menu item
if (version_compare($infos->version, '0.7.4', '<'))
{
$plugin->registerSignal('menu.item', [Facture::class, 'menuItem']);
} }