4,395
edits
(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}} | ||
= | = El sistema de pestañas Dolibarr = | ||
Dolibarr | Dolibarr muestra la información de un elemento (factura, almacén, usuario, etc.) como una vista compuesta generalmente de varias pestañas.ets. | ||
Es posible añadir sus propias pestañas, incluso eliminar o reemplazar las existentes. | |||
= | = Para añadir su '''pestaña''' = | ||
1) | 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) | 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) | 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> | ||
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__', // | '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__', // | '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) | 4) Activar el módulo. | ||
5) | 5) Comprobar que la nueva pestaña aparece y que el enlace abre su página. | ||
= | = Para eliminar una '''pestaña''' existente = | ||
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' | ||
); // | ); // Para eliminar una pestaña existente identificada por el id tabname | ||
</source> | </source> | ||
= | = Para reemplazar una '''pestaña''' por la suya = | ||
Just do step "To add your own tab" and process "To remove an existing tab". | 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. | |||