Système d'onglets: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 8: Line 8:


= Pour ajouter votre '''onglet''' =
= Pour ajouter votre '''onglet''' =
{{ToTranslate}}
Dans un premier temps, vous devez identifier le type de l'objet sur lequel porte l'onglet à ajouter, supprimer ou modifier et son code 'objecttype'. Pour cela, voici la liste:
First, you must identify the type of object your tab is about, and its objecttype code. This is full list:
* 'thirdparty'      to add a tab in third party view
* 'thirdparty'      to add a tab in third party view
* 'intervention'    to add a tab in intervention view
* 'intervention'    to add a tab in intervention view
Line 26: Line 25:
* 'categories_x'    to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
* 'categories_x'    to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)


Then to add your tab, create a new module descriptor file. See page for this.
Pour ajouter votre propre onglet, créer un module et son fichier descripteur. Voir la page [[Dévelopement module]] pour cela.


Then into the descriptor file, edit the property this->tab to add your tab using syntax provided by example:
Ensuite dans le descripteur de fichier, éditer la propriétés this->tab pour ajouter votre onglet en suivant la syntaxe:
<source lang="php">
<source lang="php">
$this->tabs = array(
$this->tabs = array(
'objecttype:+tabname1:Title1:@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__',    // To add a new tab identified by code tabname1
'objecttype:+tabname:TitleOfTab:@mymodule:conditiontohavetab:urlfortab?id=__ID__'
'objecttype:+tabname2:Title2:@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__',  // To add another new tab identified by code tabname2
);
);
</source>
</source>
Example:
<source lang="php">
$this->tabs = array(
'objecttype:+tabname1:Title1:@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__',    // Pour ajouter un onglet sur les objects de type objecttype, onglet identifié par l'id tabname1
'objecttype:+tabname2:Title2:@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__',  // Pour ajouter un onglet sur les objects de type objecttype, onglet identifié par l'id tabname2
);
</source>
Activer ce module.
Tester.


= To remove an existing '''tab''' =
= To remove an existing '''tab''' =

Navigation menu