« MyList/en » : différence entre les versions
Page créée avec « |- style="vertical-align:top;" | 600px | It is then possible to select several categories for filtering. If you use the check mark, filtering several categories will be done by OR instead of AND » |
Page créée avec « ====Calculated Fields==== It is possible to display a calculated field in the list from php code entered in the additional parameters. » |
||
Ligne 423 : | Ligne 423 : | ||
===Importing a list=== | ===Importing a list=== | ||
It is possible to save a list and the settings of its fields by importing an '''XML''' file. | |||
{{Note|List examples are provided with the MyList module in the XMLsample folder}} | |||
{{Note| | |||
{| class="wikitable" | {| class="wikitable" | ||
| [[file:mylist_Import.png|600px]] | | [[file:mylist_Import.png|600px]] | ||
| style="vertical-align:top;" | | | style="vertical-align:top;" | From the page '''Patas-M Tools > MyList > Import a list''', paste the XML file in the input area and click on the button '''Start import'''. | ||
Activate the list from its file and it will be accessible from your Dolibarr menus | |||
|} | |} | ||
Activate the list from its file and it will be accessible from your Dolibarr menus. | |||
<div lang="fr" dir="ltr" class="mw-content-ltr"> | <div lang="fr" dir="ltr" class="mw-content-ltr"> |
Version du 15 janvier 2025 à 14:54
Presentation
The myList Module allows you to create your own personalized lists from the information contained in your database and make them accessible from the Dolibarr menus. The information is retrieved by SQL query.
From the custom lists, different actions can be performed from additional processing requests (deletion, update, etc.).
MyList comes with three list import files to inspire you to create your own lists: contacts to call back, list of unpaid invoices and turnover.
myList also includes:
Sums and averages of the calculated fields of myList on screen and on edition | |
PDF editions |
myList also includes two new field types that allow the display of a tooltip of additional field values from a list or dictionaries.
Configuration of the module features
Configuration
The module configuration is done from the modules administration page accessible via the menus Home > Configuration > Modules by clicking on the icon or at the end of the line.
The myList module configuration page contains the settings provided by myListMore. Mylistmore therefore does not require any specific settings.
https://www.youtube.com/watch?v=1ZKnTFTGxfM
Permissions
Access to the module's features can be restricted to existing users and groups or those created after the module's installation. Click on the – to add a permission. A granted permission is symbolized by a green check mark ( ).
- User and group permissions
Fichier:Myliste Permissions-Utilisateurs.png | Access to the module's features can be restricted to users and groups, from their profile then Permissions tab, according to the permissions |
- Default permissions
The default permissions (Home > Configuration > Security > Default permissions), granted to any user created after the installation of the module, if he is not added to a group, are the following |
Getting started
The features of myList are accessible from the main menu tab Patas-M Tools. The features of MyListMore are added to those of MyList when creating new lists. Your secondary menu then presents the following menu entries:
Creating a list
Open the list creation page from the menu link Patas-M Tools > Mylist > New list:
Example of creating a simple list
Creation page
For the example, let's create a list of products and services displaying their selling price, cost and PMP, accessible from the main Products/Services menu:
Open the page for creating a new list and enter the data opposite, then complete the first step of creating the list by clicking on the Create button | |||
Once the list is created, three new fields are displayed and can be modified when editing the form:
|
There are three buttons at the bottom of the screen:
- Modify will allow you to edit the list to modify the query or any other element (access menus, display tabs, etc.)
- Import / Export the page will generate the XML file that you can modify before copying it to export it
- Delete will erase the list from your database. Always deactivate a list before deleting it. If you delete it without having deactivated the list beforehand, it will remain present in your database and on your interface, but emptied of its content|warn
List fields
From the list screen, it is possible to create fields, click on the New field button or the (+) icon at the end of the title:
|
List of possible types
- Text: displays the field in text format
- Price: displays a number using the precision format defined in Dolibarr
- Percentage: displays a number as a percentage
- Date: displays a date in "day" format
- Duration: displays the numeric value in time format (e.g. the value 7200 will be displayed as 2:00)
- Boolean: displays a yes or no in the cell of the line
- Status/State: corresponds to the format of the statuses of the elements (be careful, this type requires additional configuration
- List: Displays the content of the field but also a filter list
- List type extrafield: to highlight the value of an additional field on the sheets on a myList, select this type of field. Its parameter will then be
ElementName:FieldName
. For example, to display the content of the extrafieldextrafield
recorded on a product sheet, enterproduct:extrafield
. - Eval: allows you to enter in the parameters a php code which uses the dol_eval function of the additional calculated fields
depending on the type of fields created, other fields may appear for modification.
The fields below only apply to price or number type fields. |
- Field Totalization: Will display a table with the totals of the fields for which the feature has been enabled.
- Field Average: Will display a table with the averages of the fields for which the feature has been enabled.
Field Setting
This feature is related to the setting of key type fields (rowid
and fk_xxx
) for list fields of type text, list and status.
It allows you to make it clickable and/or filterable by drop-down list.
Feeding this field requires knowledge of the tables and the organization of the classes of the different elements of Dolibarr. Some examples of parameter formation:
- 1st case: list from a table
Table: c_typent
(without the prefix)
Key: id
Label: libelle
Parameter to indicate in the configuration of the myList field: c_typent:id:libelle
- 2nd case: make the list results clickable
Example of entering a clickable field for contacts |
Result displayed for the example opposite for contacts |
- Most frequently used parameters:
- Third party:
Company:/company/class/company.class.php
- Contact:
Contact:/contact/class/contact.class.php
- Users:
User:/user/class/user.class.php:user:lastname
- Product:
Product:/product/class/product.class.php
- Sales proposal:
Propal:/comm/propal/class/propal.class.php
- Customer order:
Order:/order/class/order.class.php:order:ref
- Customer invoice:
Invoice:/accounting/invoice/class/invoice.class.php
- Project:
Project:/project/class/project.class.php
- Tasks:
Task:/project/class/task.class.php
- Contract:
Contract:/contract/class/contract.class.php
- Intervention:
Fichinter:/fichinter/class/fichinter.class.php
- Shipping:
Shipping:/shipping/class/shipping.class.php
- Supplier order:
SupplierOrder:/supplier/class/supplier.order.class.php
- Supplier invoice:
SupplierInvoice:/supplier/class/supplier.invoice.class.php
- Warehouse:
Warehouse:/product/stock/class/warehouse.class.php
- Event:
ActionComm:/comm/action/class/actioncomm.class.php
- Bank:
Account:/compta/bank/class/account.class.php
- Category:
Category:/categories/class/categorie.class.php
- Third party:
- for text type fields containing a url, it is possible to make them clickable by adding the "url" parameter
Category type field
for category type fields, the following settings must be made:
Here are some other examples of category parameters:
| |
It is then possible to select several categories for filtering.
If you use the check mark, filtering several categories will be done by OR instead of AND
|
Field filtering
- Filtering options on field values.
Duration, Number, Sum, Price Result < 20000 numbers < and = to 200000 200000-300000 numbers from 200000 to 300000 inclusive Date 2008 all dates of 2008 from 01/01 to 31/12 inclusive 2006-2009 all dates from 01/01/2006 to 31/12/2009 inclusive >2004 all dates greater than (or =) 01/01/2004 20060401 All items corresponding to the day entered in YYYYMMDD format
- Boolean, List, Status: in the case of a Boolean filter, three values can be selected in the list:
- empty: the field is not filtered
true
: selects values entered as "true"false
: selects values entered as "false"- In other cases, it depends on the additional setting of the field.
- Boolean, List, Status: in the case of a Boolean filter, three values can be selected in the list:
Remarks on filtering
- A Check format zone is not filterable
- In the case of filtering by a user's company (for example to filter a list on invoices) you must use the #SOCID# value as the default value on a field containing the company key
- In the case of filtering by the default user, you must use the #USERID# value as the default value on a field containing the user key
Calculated Fields
It is possible to display a calculated field in the list from php code entered in the additional parameters.
this type of fields uses the native operation of additional attributes (extrafields) and the dol_eval() function. |
Management of specific keys (rowid
, fk_statut
)
- Rowid fields: rowid fields have a particular operation in myList, associated with parameters, they allow to create a link to the element of which they are the key.
- Making a field clickable is probably the most complex problem of myList because it involves understanding a little of the Dolibarr architecture.
- First of all, it is necessary to locate in the Dolibarr directories where the class of the element that we want to call is located and what it is named in the file
- If, for example, we want to make a supplier order clickable, we must find the file of the class associated with this element (
/fourn/class/fournisseur.commande.class.php
) then look at the name of the object class (CommandeFournisseur).
- fk_statut fields: the fk_statut fields are used to know the status of an element. However, the number and type of status is specific to each element. The selectable choices are therefore to be added to the additional parameters of the fields. As for the
rowid
, it is therefore advisable to identify the class used to define the element and add the states that you want to use by separating them with #.- example for tickets: Ticket:/ticket/class/ticket.class.php:0#1#2#3#5#7#8#9 )
- for invoices, there is a specific value "P" for the "paid" status of the invoice ( Invoice:/compta/facture/class/facture.class.php:0#1#2#P )
Finish creating the fields on the model opposite |
To make the list accessible from the Dolibarr menus, you just need to modify the list to make it active.
Before making the list active, you can display it with its query using the menu link Patas-M Tools > MyList.
This trick only works on lists that are not yet activated. |
Once the list is activated, it will appear from the links defined on its creation page.
The Export to CSV button allows you to export the results of the list in CSV format for external processing. It is necessary to have activated the export functionality in the "Configuration" and in the settings saved during the "Fields on the list creation page". |
If you have set the list to display it in the tab of a card, the results will be filtered according to the element.
|
Other Features
Tab in the element
It is possible to display a myList as a tab of an element for this it is necessary to use in the SQL query a particular alias for the table associated with the element
prefix | Element |
s | Third party (company) |
p | Product |
e | Stock (warehouse) |
p | Project |
p | Propal |
c | order |
f | Invoice |
pf | Price request |
cf | supplier order |
ff | Supplier invoice |
Importing a list
It is possible to save a list and the settings of its fields by importing an XML file.
List examples are provided with the MyList module in the XMLsample folder |
From the page Patas-M Tools > MyList > Import a list, paste the XML file in the input area and click on the button Start import.
Activate the list from its file and it will be accessible from your Dolibarr menus |
Activate the list from its file and it will be accessible from your Dolibarr menus.
Requêtes de traitement
En complément de la requête d'affichage de la liste, une requête de traitement peut donner la possibilité d'effectuer de nouvelles actions, toujours à partir de requêtes SQL.
Partons d'une liste de contacts et ajoutons dans le champ 'Requête de traitement la ligne DELETE FROM 'llx_socpeople' WHERE rowid=#ROWID# permettant leur suppression.
|
Modifiez l'un des champs pour l'enregistrer au type checkable. La liste devient alors tel que ci-contre.
Les cases à cocher serviront à sélectionner les résultats de la liste auxquels appliquer le traitement indiqué dans la requête. Dans notre exemple, les contacts sélectionnés seront supprimés de la base de données. |
Sélection des champs à l'affichage des listes
En activant DataTables dans la "Configuration", vous pouvez choisir les colonnes de la liste à afficher ou non par cases à cocher depuis le bouton Autres colonnes |
Questions fréquentes
soucis généraux
Ce chapitre répertorie les difficultés rencontrées avec le module. Vous y trouverez donc des éléments de réponse quant à son utilisation. Si vous rencontrez une autre erreur que celles décrites ci-dessous lors de l'utilisation de ce module :
- Désactivez et réactivez le module,
- Vérifier sur le ChangeLog si une nouvelle version a été publiée,
- Ré-installez/mettez à jour le module,
- Vérifiez que le remplacement de fichiers natifs de Dolibarr ne soit pas nécessaire au bon fonctionnement du module.
- Vérifiez qu'aucune incompatibilité avec un autre module ne soit indiquée. Le cas échéant, suivez nos préconisations.
Si, malgré ces manipulations, l'erreur persiste, contactez-nous en utilisant le formulaire dédié (http://docs.patas-monkey.com/support/).
Les résultats de la liste ne sont pas ceux attendus
- Le meilleur moyen de s'assurer de la qualité de votre requête SQL est d'interroger directement votre base de données via phpmyadmin ou logiciel équivalent. Adapter la requête de la liste pour la coller dans la zone SQL de phpmyadmin. Si les résultats sont les mêmes que la liste, revoyez votre requête.
Dans le cas contraire, myList peut présenter un bug. Contactez-nous ! (docs.patas-monkey.com/support).
Suite à une mise à jour du module ou des listes elles-mêmes, même si vos listes indiquent qu'elles sont activées, vous devrez les réactivez en entrant en édition du champ Active et en enregistrant à nouveau.
Il est aussi possible de recharger l'ensemble des listes depuis la liste des listes avec le bouton suivant |
Message d'erreur au lancement du myList
Message d'erreur DB_ERROR_NOSUCHFIELD ou DB_ERROR_NOSUCHTABLE |
Vous avez indiqué dans votre requête un champ ou une table qui n'existent pas dans votre base de donnée ou qui n'est pas identifiable. Revoyez votre requête SQL. Il s'agit souvent d'une faute de frappe ou d'une mauvaise liaison dans votre requête. Le contenu du message vous aidera à identifier l'erreur avec les lignes Code retour dernier accès en base en erreur et Information sur le dernier accès en base en erreur. |
Liste supprimée toujours présente
Vous avez supprimé la liste sans la désactiver d'abord. Mylist ne peut plus supprimer la liste : vous devrez nettoyer votre base de données en supprimant la liste de la table llx_mylist depuis phpmyadmin.
Message d'erreur à la création de la liste
Si vous avez effectué une mise à jour de MyList depuis une ancienne version, il est possible que vous rencontriez un message d'erreur à la création d'une liste.
Pour le corriger, vous devrez effectuer la requête suivante sur votre base de données : ALTER TABLE `llx_mylist` CHANGE `model_pdf` `model_pdf` VARCHAR(255) NULL DEFAULT NULL;