Sistema de pestañas: Difference between revisions

no edit summary
(Created page with "Category:Core {{TemplateDocDesarrollo}} {{ToTranslate}} = Le système des onglets Dolibarr = Dolibarr affiche les informations d'un élément (facture, entrepot, utilisateur...")
 
No edit summary
Line 1: Line 1:
[[Category:Core]]
[[Category:Core]]
{{TemplateDocDesarrollo}}
{{TemplateDocDesarrollo}}
{{ToTranslate}}


= Le système des onglets Dolibarr =
= El sistema de pestañas 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.
Dolibarr muestra la información de un elemento (factura, almacén, usuario, etc.) como una vista compuesta generalmente de varias pestañas.ets.


Il est possible d'ajouter vos propres onglets, d'en supprimer ou remplacer des existants.
Es posible añadir sus propias pestañas, incluso eliminar o reemplazar las existentes.


= Pour ajouter votre '''onglet''' =
= Para añadir su '''pestaña''' =
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:
1) En un primer paso, debe identificar el tipo del objeto y su código 'objecttype' al que hay que añadir, eliminar o suprimir la pestaña. Son estos:
* '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)


2) Pour ajouter votre propre onglet, créer un module et son fichier descripteur. Voir la page [[Développement module]] pour cela.
2) Para añadir su própia pestaña, crear un módulo y su archivo descriptor. Para ello vea la página[[Desarrollo de un módulo]].


3) Ensuite dans le descripteur de fichier, éditer la propriétés this->tab pour ajouter votre onglet en suivant la syntaxe:
3) Dentro del archivo descriptor editar la propiedad this->tab para añadir su pestaña, siguiendo la sintaxis:
<source lang="php">
<source lang="php">
$this->tabs = array(
$this->tabs = array(
Line 34: Line 33:
);
);
</source>
</source>
Example:
Ejemplo:
<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__',    // Pour ajouter un onglet sur les objects de type objecttype, onglet identifié par l'id tabname1
'objecttype:+tabname1:Title1:@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__',    // Para añadir una pestaña en el objeto de tipo objecttype, pestaña identificada por el 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
'objecttype:+tabname2:Title2:@mymodule:$user->rights->othermodule->read:/mymodule/mynewtab2.php?id=__ID__',  // Para añadir una pestaña en el objeto de tipo objecttype, pestaña identificada por el id tabname2
);
);
</source>
</source>


4) Activer ce module.
4) Activar el módulo.


5) Tester que le nouvel onglet apparaît et que le lien ouvre votre page.
5) Comprobar que la nueva pestaña aparece y que el enlace abre su página.


= To remove an existing '''tab''' =
= Para eliminar una '''pestaña''' existente =
Process is same than adding a tab, put into the tab array of descriptor the following syntax:
El proceso es el mismo que el de añadir una pestaña, con la salvedad que en el array del descriptor debe seguir la sintaxis:
<source lang="php">
<source lang="php">
$this->tabs = array(
$this->tabs = array(
'objecttype:-tabname'
'objecttype:-tabname'
);                                                    // To remove an existing tab identified by code tabname
);                                                    // Para eliminar una pestaña existente identificada por el id tabname
</source>
</source>


= To replace a '''tab''' with yours =
= Para reemplazar una '''pestaña''' por la suya =
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.
Acaba de ver como "Añadir su pestaña" y el proceso para "Eliminar una pestaña existente".
Just do step "To add your own tab" and process "To remove an existing tab". Si su nueva pestaña tiene el mismo título que la elimina, el efecto es perfecto.