Sistema de pestañas: Difference between revisions

(Created page with "Category:Core {{TemplateDocDesarrollo}} {{ToTranslate}} = Le système des onglets Dolibarr = Dolibarr affiche les informations d'un élément (facture, entrepot, utilisateur...")
 
m (Import interlang links (links to translated versions of this page in other languages) from origin English page "Tabs_system".)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!-- BEGIN interlang links -->
<!-- Do NOT edit this section
    Links below are automatically managed by PolyglotBot
    You can edit links on the English source page : Tabs_system -->
[[en:Tabs_system]]
[[zh:选项卡]]
[[fr:Système_d'onglets]]
<!-- END interlang links -->
[[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
* 'order_supplier'  to add a tab in supplier order view
* 'supplier_order'  to add a tab in supplier order view
* 'invoice_supplier' to add a tab in supplier invoice view
* 'supplier_invoice' to add a tab in supplier invoice view
* 'invoice'          to add a tab in customer invoice view
* 'invoice'          to add a tab in customer invoice view
* 'order'            to add a tab in customer order view
* 'order'            to add a tab in customer order view
Line 25: Line 33:
* 'contact'          to add a tab in contact 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)
* 'categories_x'    to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
* 'member_stats', 'order_stats', 'supplier_order_stats', 'invoice_stats', 'supplier_invoice_stats', 'trip_stats', 'propal_stats' to add a tab in statistic view of elements.


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 43:
);
);
</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".  
Si su nueva pestaña tiene el mismo título que la elimina, el efecto es perfecto.
 
= Mostrar pestañas en sus páginas =
Vea la página [[Desarrollo_de_un_módulo#A.C3.B1adir_pesta.C3.B1as_.28opcional.29|Desarrollo de un módulo]]

Latest revision as of 13:21, 23 July 2019

El sistema de pestañas 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) 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
  • '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
  • 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
  • 'member_stats', 'order_stats', 'supplier_order_stats', 'invoice_stats', 'supplier_invoice_stats', 'trip_stats', 'propal_stats' to add a tab in statistic view of elements.

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) Dentro del archivo descriptor editar la propiedad this->tab para añadir su pestaña, siguiendo la sintaxis:

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

Ejemplo:

$this->tabs = array(
'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__',  // Para añadir una pestaña en el objeto de tipo objecttype, pestaña identificada por el id tabname2
);

4) Activar el módulo.

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:

$this->tabs = array(
'objecttype:-tabname'
);                                                     // Para eliminar una pestaña existente identificada por el id tabname

Para reemplazar una pestaña por la suya

Acaba de ver como "Añadir su pestaña" y el proceso para "Eliminar una pestaña existente". Si su nueva pestaña tiene el mismo título que la elimina, el efecto es perfecto.

Mostrar pestañas en sus páginas

Vea la página Desarrollo de un módulo