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,6 +1,7 @@
<?php
namespace Garradin;
use Garradin\Entities\Files\File;
use Garradin\Plugin\Facturation\Facture;
$db = DB::getInstance();
@ -8,3 +9,5 @@ $db->import(dirname(__FILE__) . "/data/schema.sql");
$path = __DIR__.'/data/default_sign.png';
$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);
}
public static function menuItem(array $params, array &$list): void
{
$list['plugin_facturation'] = sprintf('<a href="%sp/taima/">Facturation</a>', \Garradin\ADMIN_URL);
}
}

View File

@ -199,3 +199,9 @@ if (version_compare($infos->version, '0.7.1', '<'))
{
$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']);
}