From c12bc4c58164694252c55fe25e5872f90f0e85a3 Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Thu, 27 Jun 2024 15:25:34 +0200 Subject: [PATCH] v1.9 --- ChangeLog.md | 30 ++++-- .../core/class/commonhookactions.class.php | 4 +- class/actions_listincsv.class.php | 18 +++- config.default.php | 2 +- core/modules/modListInCSV.class.php | 4 +- img/logo list in csv.svg | 90 ++++++++++++++++++ img/object_modulelistincsv.png | Bin 0 -> 2138 bytes js/listincsv.js.php | 4 + langs/es_MX/listincsv.lang | 13 +++ 9 files changed, 150 insertions(+), 15 deletions(-) create mode 100644 img/logo list in csv.svg create mode 100644 img/object_modulelistincsv.png create mode 100644 langs/es_MX/listincsv.lang diff --git a/ChangeLog.md b/ChangeLog.md index 29cc8fd..17c4ba5 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,34 +2,48 @@ ## Unreleased -## 1.8 +## release 1.9 +- NEW : DA025083 - Création d'un hook listInCSVFooterContext permettant à des modules externes d'utiliser ListInCSV. - *11/06/2024* - 1.9.0 + +## release 1.8 +- FIX : DA024994 - Problème de sélection sur la liste des demandes de congés (car elle contient des valeurs dans des inputs) - *21/05/2024* - 1.8.4 +- FIX : object test - *25/03/2024* - 1.8.3 +- FIX : Compat agefodd session onglet participant sur tableau stagiaire *20/03/2024* - 1.8.2 +- FIX : Module logo Image *18/12/2023* - 1.8.1 - FIX : Compat v19 et php8.2 *07/10/2023* - 1.8.0 -## 1.7 +## release 1.7 + - NEW : Ajout de la possibilité d'exporter la liste des prix clients *07/10/2023* - 1.7.0 -## 1.6 +## release 1.6 + - NEW : Ajout icône listincsv sur objets référents produit et tiers *07/02/2023* - 1.6.0 -## 1.5 +## release 1.5 + - NEW : Ajout de la class TechATM pour l'affichage de la page "A propos" *10/05/2022* 1.15.0 -## 1.4 +## release 1.4 + - FIX: Family name - *02/06/2022* - 1.4.3 - FIX: Delete Trigger - *02/06/2022* - 1.4.2 - FIX: context detection - *15/03/2022* - 1.4.1 - NEW: Include Dolibarr V13 stock to date - *28/02/2022* - 1.4.0 -## 1.3 +## release 1.3 + - FIX: Appel de `call_trigger()` sur un non-objet - *08/10/2021* - 1.3.1 - NEW: Déclenchement d'un trigger sur export d'un fichier avec listincsv - *19/05/2021* - 1.3.0 -## 1.2 +## release 1.2 + - FIX: La liste ne s'exporte plus - *20/05/2021* - 1.2.4 - FIX: Les champs de type "case à cocher" ne sont pas exportés - *17/05/2021* - 1.2.3 - FIX: Suppression du dossier Box ainsi que tu fichier box *11/05/2021* - 1.2.2 - FIX: $_SESSION devient newToken() *11/05/2021* - 1.2.1 - NEW: Déplacement du code qui crée le boutton vert "CSV" pour utilisation dans des modules externes avec un contexte ajax *06/05/2021* - 1.2.0 -## 1.1 +## release 1.1 + - NEW: Ajout d'une gestion de récupération des informations via un autre paramètre que l'action du formulaire le plus proche *06/05/2021* - 1.1.0 diff --git a/backport/v19/core/class/commonhookactions.class.php b/backport/v19/core/class/commonhookactions.class.php index c16585d..5496f33 100644 --- a/backport/v19/core/class/commonhookactions.class.php +++ b/backport/v19/core/class/commonhookactions.class.php @@ -25,9 +25,9 @@ */ -if (file_exists(DOL_DOCUMENT_ROOT . '/htdocs/core/class/commonhookactions.class.php')){ +if (file_exists(DOL_DOCUMENT_ROOT . '/core/class/commonhookactions.class.php')){ - require_once DOL_DOCUMENT_ROOT . '/htdocs/core/class/commonhookactions.class.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/commonhookactions.class.php'; /** * Parent class of all other hook actions classes */ diff --git a/class/actions_listincsv.class.php b/class/actions_listincsv.class.php index 2e288d6..22406bc 100644 --- a/class/actions_listincsv.class.php +++ b/class/actions_listincsv.class.php @@ -64,7 +64,7 @@ function doActions($parameters, &$object, &$action, $hookmanager) { global $db, $user; - if(GETPOSTISSET('exportlistincsv', 'bool') && method_exists($object, 'call_trigger')) { + if(GETPOSTISSET('exportlistincsv', 'bool') && is_object($object) && method_exists($object, 'call_trigger')) { $object->call_trigger('LISTINCSV_EXPORT_FILE_'.strtoupper($object->element), $user); } @@ -103,6 +103,16 @@ function printCommonFooter($parameters, &$object, &$action, $hookmanager) if(empty($context_list)) { $context_list = preg_grep('/(thirdpartycustomerprice)/i', $TContext); } + if(empty($context_list)) { + $context_list = preg_grep('/(agefoddsessionsubscribers)/i', $TContext); + } + + // Permettre à d'autres modules externes d'utiliser listInCSV + $parameters['context_list'] = &$context_list; + $reshook = $hookmanager->executeHooks('listInCSVFooterContext', $parameters); + if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + } if (!empty($context_list)) { @@ -127,11 +137,15 @@ function printCommonFooter($parameters, &$object, &$action, $hookmanager) $(document).ready(function() { $('#id-right > form#searchFormList div.titre').first().append(''); // Il peut y avoir plusieurs titre dans la page + $('div.fiche div.titre').eq(1).append(''); // Il peut y avoir plusieurs titre dans la page + if(typeof $('div.fiche div.titre').first().val() !== 'undefined') { diff --git a/config.default.php b/config.default.php index 4be23d6..e0b3ce6 100644 --- a/config.default.php +++ b/config.default.php @@ -11,7 +11,7 @@ elseif(!defined('INC_FROM_DOLIBARR')) { include($dir."main.inc.php"); } else { - global $dolibarr_main_db_host, $dolibarr_main_db_name, $dolibarr_main_db_user, $dolibarr_main_db_pass; + global $dolibarr_main_db_host, $dolibarr_main_db_name, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_type; } if(!defined('DB_HOST')) { diff --git a/core/modules/modListInCSV.class.php b/core/modules/modListInCSV.class.php index 9ffee9c..8531cc5 100644 --- a/core/modules/modListInCSV.class.php +++ b/core/modules/modListInCSV.class.php @@ -60,7 +60,7 @@ function __construct($db) // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) $this->description = "ListInCSV permet d'exporter en CSV une liste Dolibarr telle qu'elle apparaît à l'écran."; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version - $this->version = '1.8.0'; + $this->version = '1.9.0'; // Url to the file with your last numberversion of this module require_once __DIR__ . '/../../class/techatm.class.php'; @@ -73,7 +73,7 @@ function __construct($db) // Name of image file used for this module. // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' - $this->picto='listincsv@listincsv'; + $this->picto='modulelistincsv@listincsv'; // Defined all module parts (triggers, login, substitutions, menus, css, etc...) // for default path (eg: /listincsv/core/xxxxx) (0=disable, 1=enable) diff --git a/img/logo list in csv.svg b/img/logo list in csv.svg new file mode 100644 index 0000000..5b1c0fa --- /dev/null +++ b/img/logo list in csv.svg @@ -0,0 +1,90 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/img/object_modulelistincsv.png b/img/object_modulelistincsv.png new file mode 100644 index 0000000000000000000000000000000000000000..2cfdf035db2d74b31382fc85994effaff77db19f GIT binary patch literal 2138 zcmV-g2&MOlP)6ovP(Vb{nxY2OIHD%vBjVIi zI#Vl|&ctS>6H}9RQXiQ(lbJG3r)^?z+9YObOf+MriD{FfHA?XPt`8~?Uub*)8eL#P zSOFK<-P=FZt?TY8yZ6e9@$(+Qz2f5?=2_OjKA|A2H10aA&8?)@aicc2H88*NY5T2290GUykwWdE8m4Eb0 z*#ZWzMSRWQ7Xekg&b)eM`IX`z$1zw`A2D@CdXAI7x%=sPYBT7-5zouv)(-WujL=Fd61tftc-3m zb6_q%O`jdn7;w|w=DC0Pp=1@n<4fLUuIEhem= z-}|Bzd~eLN*UvNDl7U*O4mp-pZ+X4w_}}UmXTS1xpmx8<-su|)ZUVZV1drFpkr>96 zc@Wjt&*SpAeQc?QB%Vvj0U?|xb*eWn(eKh2CHE zbk{rUfAL1vZ~l3=UD6T|1OcU>loBE!E|1H9ETE~og-z#6(1{wNHBo3(AuS1Ym#h0T zKt2HqGUo8o@Oe@~1mx%6E}*5;5wK0I(c%W0-40wG{z5$fzu!|y0z?vpQi(H zSV;m*Pkpx6H$l0PBtUDYgSs2v%aw~4x9E{QW-ufPu(fsRX7_onM6>#M)!>kC@|cwuNhQ<8HiC|&3y z%-y^&G@rRcW-+(qWm>y#gq^=60dkXbcr*Jos+vx-{OC$9I_dz3QX449$Y=iWx!9e} zY^&P~z_QV=Vb+@X_3k&lzE*uab2DZ!FJm^FE|uc)xHx$2C^HA^+WHdRZSJV+40qKjqG(=T(p@dR%je#fVT)z;m?$EQE1tfA6dFfnPO85TR3_0?Z_ zClAnY)6S}@PgzyT4C7{R(}D_J;VK2OL0IOvUQ(x zcmMX;@a)cJj?|YkHF*MGocsS-hZ(7p5d?v)HS(0=!WO{ka-vs-_6}7)C)a~NYC#iIR%INhCI|E)DU$w?f;_{7n`t#^?#QlF#Benz(1LfA{- zf}@sUv4hbndwd?r2U|x2n=ftWcl!%jbL#I5F{Lpjd4iA6v4%?OJM2tNnFK&TeLVdP z32dp^8E)Esge}0fx_uZ_dRb10+^HdZcNQ4}eu-9@J5)udI~Z&l$fW+`uyr(YvZ)$? zmd;l6Djh`=e@~_TG$-t5==QkCFb`s4(lb=q&v2x^+;5B~=XH+Q%E?I@BkSgO2U$*t zWF=%WJ>^+4%!AM=bu`>;sF;>Ai3v$#8DLCAqf}#SZ{(2e7@IHc z2zq7v8xvVLVm|+EsG|5{Nr+SQp>2EqhUmKueddUaO!x`#gMS=;B0!`Qh%`?G2w-dN z^(=aimU|8UA5MxK?wwpBf$*PuEdjn9r3mP~BO1MjTR<$j*XSoeY5s=&0xTiGp~60l zM-;@@x8-l}tDpouc|2od!6XmjQV_-iA%BeYNFdNCcsPW>JKOR%917&}KO+E;t<807*qoM6N<$f(8)yQ~&?~ literal 0 HcmV?d00001 diff --git a/js/listincsv.js.php b/js/listincsv.js.php index 62a6ec9..f6a7a36 100644 --- a/js/listincsv.js.php +++ b/js/listincsv.js.php @@ -91,6 +91,9 @@ function exportTableToCSV($table, filename) { // Fix mails tronqués dans les listes par dol_trunc dans la fonction dol_print_email link=$col.find('a')[0].href; text = link.substr(7); + } else if ($col.find('input').length > 0 && $col.find('input').prop('type') === 'text') { + // Fix DA024994 liste avec des inputs + text=$col.find('input').val(); } else text = $col.text().trim(); // Spécifique pour "nettoyer" les données @@ -115,6 +118,7 @@ function exportTableToCSV($table, filename) { .split(tmpRowDelim).join(rowDelim) .split(tmpColDelim).join(colDelim) + '"'; + // Deliberate 'false', see comment below if (false && window.navigator.msSaveBlob) { diff --git a/langs/es_MX/listincsv.lang b/langs/es_MX/listincsv.lang new file mode 100644 index 0000000..190313f --- /dev/null +++ b/langs/es_MX/listincsv.lang @@ -0,0 +1,13 @@ +Module104856Name = Lista en CSV +Module104856Desc = Agrega un ícono que le permite descargar listas en formato CSV + +ATMAbout = Este módulo fue desarrollado por ATM Consulting
Puede encontrar la documentación en nuestro wiki

Para cualquier pregunta técnica o comentario, contáctenos en support@atm-consulting.fr

Para cualquier pregunta comercial, contáctenos en contact@atm-consulting.fr o +33 9 77 19 50 70

Encuentre nuestros otros módulos en Dolistore + +ListInCSVSetup = Configuración del módulo Lista en CSV +ListInCSVAbout = Acerca del módulo Lista en CSV + +NoSetupAvailable = No es necesaria ninguna configuración. Ahora está disponible un ícono junto al título de cada lista que le permite descargarla en un archivo CSV. + +FileGenerationInProgress = Generación del archivo CSV en curso. +LISTINCSVExport=Permitir exportación de listas en CSV +LISTINCSV_DELETESPACEFROMNUMBER=Eliminar espacios contenidos en números