Add Module Tab

ID - _BUGFISH - E#196
^Top
<< Back
Mobile-Menu










Add Module Tab
Category: Dolibarr
Sub-Category:
Creator: Jan-Maurice Dahlmanns
Created: 2023-01-10 08:47:25
Modified: 2024-11-19 09:09:57
Views: 73

Caution: I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.

// Array to add new pages in new tabs or remove existing one
$this->tabs =
array('objecttype:+tabname1:Title1:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule
/mypagetab1.php?id=__ID__' // To add a new tab identified by code tabname1
'objecttype:+tabname2:Title2:mylangfile@mymodule:$user->rights->mymodule->read:/mymodule
/mypagetab2.php?id=__ID__', // To add a new tab identified by code tabname2
'objecttype:-tabname'); //
To remove an existing tab identified by code tabname 

 

'thirdparty' to add a tab in third party view
'intervention' to add a tab in intervention view
'supplier_order' to add a tab in supplier order view
'supplier_invoice' to add a tab in supplier invoice view
'invoice' to add a tab in customer invoice view
'order' to add a tab in customer order view
'product' to add a tab in product view
'stock' to add a tab in stock view
'propal' to add a tab in propal view
'member' to add a tab in fundation member view
'contract' to add a tab in contract view
'user' to add a tab in user view
'group' to add a tab in group view
'contact' to add a tab in contact view
'payment' to add a tab in payments view (since 3.6.0)
'payment_supplier' to add a tab in supplier payments view (since 3.6.0)
'categories_x' to add a tab in category view (replace 'x' by type of category (0=product,
1=supplier, 2=customer, 3=member)

 

Part 2: A code to identify tab to add (start with +) or to remove (start with -)
Part 3: The title of the tab. This can be a hard read or better code translation in a file lang.
Part 4: The name of the file "*.lang" which contains correspondence between the code translation
and language to display. If this name is followed with @mymodule, Dolibarr will search translation
file "*.lang" within the module, so htdocs/mymodule/langs/code_CODE/mylangfile.lang, otherwise
Dolibarr will look for file htdocs/langs/code_CODE/mylangfile.lang
Part 5: A condition to test if tab must be visible. Put 1 to be always visible.
Part 6: The URL of the page to display when you click on the tab. The __ID__ string will be
replaced automatically by the Id of the element concerned.
To feed the contents of the tab with data from the database, see the next chapter.
In order to get the names 'tabname' of existing tabs, you have to check the names used in the
function 'product_prepare_head' of the file 'core/lib/module.lib.php' corresponding to section
'$head[$h][2]'.

Currently 0 Upvotes!

captcha image
System - 2024-11-05 18:29:38
Commenting System Initialized! Have a very nice day!

Switches: 0 | Arrivals: 7 | Visits: 7
This Website is using Session Cookies for Site Functionality.