Module development: Difference between revisions

m
Line 73: Line 73:
A file '''out.tablename_script.php''' has been generated and contains a sample code to use the class for each of the 4 CRUD methods.
A file '''out.tablename_script.php''' has been generated and contains a sample code to use the class for each of the 4 CRUD methods.


= Ajouter vos onglets sur les fiches entités (optionnel) =
= Add your own tabs on entities sheets (optionnal) =
{{ToTranslate}}
{{ToTranslate}}
'''Quand''': Pour ajouter un onglet sur une fiche entité (facture, commande, proposition commercial, adhérent...)
'''When''': To add a tab on an entity (invoices, orders, proposals, member ...)
 
To do this go into the file descriptor of module previously created and edit the $this->tabs array:


Pour cela, aller dans le fichier descripteur de module précédemment créé et modifier le tableau $this->tabs:
<pre>
<pre>
// Array to add new pages in new tabs
// Array to add new pages in new tabs
Line 93: Line 94:
</pre>
</pre>


Le tableau doit contenir une liste de chaine, chaque chaine représentant un nouvel onglet.
The table should contain a list of strings, each string representing a new tab.  
Le format de la chaine étant composée de 4 parties séparées par ":"
The format of the string consisting of 4 parts separated by ":"
* Partie 1: Le code entité dans lequel doit apparaitre l'onglet qui est une valeur parmi celle-ci:
* Part 1: The entity code which should appear in the tab is a value from the following:
** 'thirdparty'
** 'thirdparty'
** 'intervention'
** 'intervention'
Line 105: Line 106:
** 'propal'
** 'propal'
** 'member'
** 'member'
* Partie 2: Le titre de l'onglet. Cela peut être un libellé en dur ou mieux un code traduction présent dans un fichier lang.
* Part 2: The title of the tab. This can be a hard read or better code translation in a file lang.
* Partie 3: Le nom du fichier .lang qui contient la correspondance entre le code traduction et le libellé à afficher.
* Part 3: The name of the file. Lang which contains correspondence between the code translation and language to display.
* Partie 4: L'url de la page à afficher quand on clique sur l'onglet. La chaine __ID__ sera remplacée automatiquement par l'Id de l'entité concernée.
* Part 4: The url of the page to display when you click on the tab. The __ID__ string will be replaced automatically by the Id of the entity concerned.


Pour alimenter le contenu de l'onglet avec des données issues de la base, voir le chapitre suivant.
To feed the contents of the tab with data from the database, see the next chapter.


= Créer vos pages écran PHP (optionnel) =
= Créer vos pages écran PHP (optionnel) =