From 302dbcc46e7a25f4a22cd52289ba3c5a8f3206d1 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Wed, 9 Aug 2023 16:35:33 +0200 Subject: [PATCH] #19 [Mod] add: change trad and other things --- README.md | 2 +- core/modules/modTinyURL.class.php | 4 ++-- langs/fr_FR/tinyurl.lang | 6 +++--- lib/tinyurl_function.lib.php | 2 +- tinyurlindex.php | 35 ------------------------------- 5 files changed, 7 insertions(+), 42 deletions(-) delete mode 100644 tinyurlindex.php diff --git a/README.md b/README.md index 5a86ae4..936bbf9 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ ## Fonctionnalités -- Création d'urls raccourcies pour YOURLS et Dolibarr +- Création d'URLs raccourcies pour YOURLS et Dolibarr ## Traductions diff --git a/core/modules/modTinyURL.class.php b/core/modules/modTinyURL.class.php index 0f6fa55..192db88 100644 --- a/core/modules/modTinyURL.class.php +++ b/core/modules/modTinyURL.class.php @@ -125,7 +125,7 @@ public function __construct($db) 'interventioncard' ], // Set this to 1 if features of module are opened to external users - 'moduleforexternal' => 1, + 'moduleforexternal' => 0 ]; // Data directories to create when module is enabled @@ -190,7 +190,7 @@ public function __construct($db) } // Array to add new pages in new tabs - $this->tabs = []; + $this->tabs = []; // Dictionaries. $this->dictionaries = []; diff --git a/langs/fr_FR/tinyurl.lang b/langs/fr_FR/tinyurl.lang index 3e87dbc..8ecfad6 100644 --- a/langs/fr_FR/tinyurl.lang +++ b/langs/fr_FR/tinyurl.lang @@ -19,9 +19,9 @@ # Data - Donnée ModuleTinyURLName = TinyURL -ModuleTinyURLDesc = Création d'urls raccourcies pour YOURLS et Dolibarr -TinyURLDescription = Création d'urls raccourcies pour YOURLS et Dolibarr -TinyURLDescriptionLong = Création d'urls raccourcies pour YOURLS et Dolibarr +ModuleTinyURLDesc = Création d'URLs raccourcies pour YOURLS et Dolibarr +TinyURLDescription = Création d'URLs raccourcies pour YOURLS et Dolibarr +TinyURLDescriptionLong = Création d'URLs raccourcies pour YOURLS et Dolibarr # # Config page - Page d'administration diff --git a/lib/tinyurl_function.lib.php b/lib/tinyurl_function.lib.php index b9e92c6..17dc5c4 100644 --- a/lib/tinyurl_function.lib.php +++ b/lib/tinyurl_function.lib.php @@ -69,7 +69,7 @@ function set_tiny_url_link(CommonObject $object, string $urlType) break; } - $title = dol_sanitizeFileName(dol_strtolower($conf->global->MAIN_INFO_SOCIETE_NOM) . '-' . dol_strtolower($object->ref) . (getDolGlobalInt('TINYURL_USE_SHA_URL') ? '-' . generate_random_id(8) : '')); + $title = dol_sanitizeFileName(dol_strtolower($conf->global->MAIN_INFO_SOCIETE_NOM . '-' . $object->ref) . (getDolGlobalInt('TINYURL_USE_SHA_URL') ? '-' . generate_random_id(8) : '')); // Init the CURL session $ch = curl_init(); diff --git a/tinyurlindex.php b/tinyurlindex.php deleted file mode 100644 index 44610c8..0000000 --- a/tinyurlindex.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file tinyurlindex.php - * \ingroup tinyurl - * \brief Home page of tinyurl top menu - */ - -// Load TinyURL environment -if (file_exists('tinyurl.main.inc.php')) { - require_once __DIR__ . '/tinyurl.main.inc.php'; -} elseif (file_exists('../tinyurl.main.inc.php')) { - require_once __DIR__ . '/../tinyurl.main.inc.php'; -} else { - die('Include of tinyurl main fails'); -} - -$showDashboard = false; - -require_once __DIR__ . '/../saturne/core/tpl/index/index_view.tpl.php';