Move DeclarationTVA menu to Comptabilité (Accounting) menu

Changed:
- Removed top menu entry for DeclarationTVA
- Moved module link to Comptabilité (Accounting) left menu
- Changed mainmenu from 'declarationtva' to 'accountancy'
- Changed fk_menu to 'fk_mainmenu=accountancy'
- Module now appears under Accounting menu where it belongs
This commit is contained in:
Frank Cools 2025-10-02 23:08:03 +02:00
parent d7e494ea91
commit c2eb67f405

View File

@ -323,30 +323,17 @@ class modDeclarationTVA extends DolibarrModules
$r = 0; $r = 0;
// Add here entries to declare new menus // Add here entries to declare new menus
/* BEGIN MODULEBUILDER TOPMENU */ /* BEGIN MODULEBUILDER TOPMENU */
$this->menu[$r++] = array( // Top menu removed - module will be under Comptabilité (Accounting) menu instead
'fk_menu' => '', // Will be stored into mainmenu + leftmenu. Use '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type' => 'top', // This is a Top menu entry
'titre' => 'ModuleDeclarationTVAName',
'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth valignmiddle"'),
'mainmenu' => 'declarationtva',
'leftmenu' => '',
'url' => '/declarationtva/declarationtvaindex.php',
'langs' => 'declarationtva@declarationtva', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position' => 1000 + $r,
'enabled' => 'isModEnabled("declarationtva")', // Define condition to show or hide menu entry. Use 'isModEnabled("declarationtva")' if entry must be visible if module is enabled.
'perms' => '$user->hasRight("declarationtva", "declarationtva", "read")', // Use 'perms'=>'$user->hasRight("declarationtva", "declarationtva", "read")' if you want your menu with a permission rules
'target' => '',
'user' => 2, // 0=Menu for internal users, 1=external users, 2=both
);
/* END MODULEBUILDER TOPMENU */ /* END MODULEBUILDER TOPMENU */
/* BEGIN MODULEBUILDER LEFTMENU DECLARATIONTVA */ /* BEGIN MODULEBUILDER LEFTMENU DECLARATIONTVA */
// Add DeclarationTVA under Comptabilité (Accounting) menu
$this->menu[$r++]=array( $this->menu[$r++]=array(
'fk_menu' => 'fk_mainmenu=declarationtva', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'fk_menu' => 'fk_mainmenu=accountancy', // Add under Comptabilité (accountancy) menu
'type' => 'left', // This is a Left menu entry 'type' => 'left', // This is a Left menu entry
'titre' => 'DeclarationTVAMainInterface', 'titre' => 'DeclarationTVAMainInterface',
'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth valignmiddle paddingright"'), 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth valignmiddle paddingright"'),
'mainmenu' => 'declarationtva', 'mainmenu' => 'accountancy',
'leftmenu' => 'declarationtva_main', 'leftmenu' => 'declarationtva_main',
'url' => '/custom/declarationtva/declarationtvaindex.php', 'url' => '/custom/declarationtva/declarationtvaindex.php',
'langs' => 'declarationtva@declarationtva', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'langs' => 'declarationtva@declarationtva', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.