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 0000000..2cfdf03 Binary files /dev/null and b/img/object_modulelistincsv.png differ 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