Sistema de pestañas

From Dolibarr ERP CRM Wiki
Revision as of 06:47, 13 October 2011 by Simnandez (talk | contribs) (Created page with "Category:Core {{TemplateDocDesarrollo}} {{ToTranslate}} = Le système des onglets Dolibarr = Dolibarr affiche les informations d'un élément (facture, entrepot, utilisateur...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

En verysmall.png Page waiting for translation. To translate, create an account, go back and clic on "Modify".
Fr verysmall.png Page en attente de traduction. Pour traduire, créez un compte, revenez et cliquez sur "Modifier".
Es verysmall.png Página a traducir. Para traducirla, cree una cuenta, vuelva a la página y haga clic en "editar".
It verysmall.png Pagina da tradurre. Per tradurla, crea un utente, torna indietro e clicca su "modifica".
Pt verysmall.png Página a aguardar por tradução. Para traduzir, crie uma conta, volte atrás e clique em "Modificar".
De verysmall.png Seite wartet auf Übersetzung. Um Übersetzung zu erstellen, richte einen Account ein, geh zurück und klicke auf "bearbeiten".
Zh verysmall.png 页面等待翻译。若要翻译本页,先创建一个帐户、登录并返回本页后单击“编辑”。

Le système des onglets Dolibarr

Dolibarr affiche les informations d'un élément (facture, entrepot, utilisateur, etc...) dans une vue composée en général de plusieurs onglets.

Il est possible d'ajouter vos propres onglets, d'en supprimer ou remplacer des existants.

Pour ajouter votre onglet

1) 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:

  • 'thirdparty' to add a tab in third party view
  • 'intervention' to add a tab in intervention view
  • 'order_supplier' to add a tab in supplier order view
  • 'invoice_supplier' 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
  • 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)

2) Pour ajouter votre propre onglet, créer un module et son fichier descripteur. Voir la page Développement module pour cela.

3) Ensuite dans le descripteur de fichier, éditer la propriétés this->tab pour ajouter votre onglet en suivant la syntaxe:

$this->tabs = array(
'objecttype:+tabname:TitleOfTab:@mymodule:conditiontohavetab:urlfortab?id=__ID__'
);

Example:

$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
);

4) Activer ce module.

5) Tester que le nouvel onglet apparaît et que le lien ouvre votre page.

To remove an existing tab

Process is same than adding a tab, put into the tab array of descriptor the following syntax:

$this->tabs = array(
'objecttype:-tabname'
);                                                     // To remove an existing tab identified by code tabname

To replace a tab with yours

Just do step "To add your own tab" and process "To remove an existing tab". If your new tab as same title than removed one, illusion is perfect.