From 22a2aa55e219f3432a794ec8eaf6ca03a91f0407 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 May 2022 13:39:22 +0200 Subject: [PATCH] Show tooltip on nb of translation files --- htdocs/admin/ihm.php | 4 ++-- htdocs/admin/translation.php | 12 +++++++++--- htdocs/core/class/html.formother.class.php | 5 ++++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index dd094a45cdc..bf486ea3d4e 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -475,6 +475,7 @@ if ($mode == 'other') { print '
'; print ''; + print ''; print '
'; print '
'; @@ -577,9 +578,8 @@ if ($mode == 'other') { print ''; // Disable javascript and ajax - print '' . $langs->trans("DisableJavascript") . ''; + print '' . $form->textwithpicto($langs->trans("DisableJavascript"), $langs->trans("DisableJavascriptNote")) . ''; print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other'); - print ' ' . $langs->trans("DisableJavascriptNote") . ''; print ''; print ''; diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index bb42808ebd4..47c2a4e102f 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -271,7 +271,8 @@ $recordtoshow = array(); // Search modules dirs $modulesdir = dolGetModulesDirs(); -$nbtotaloffiles = 0; +$listoffiles = array(); +$listoffilesexternalmodules = array(); // Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root) $i = 0; @@ -298,7 +299,10 @@ foreach ($modulesdir as $keydir => $tmpsearchdir) { if ($result < 0) { print 'Failed to load language file '.$tmpfile.'
'."\n"; } else { - $nbtotaloffiles++; + $listoffiles[$langkey] = $tmpfile; + if (strpos($langkey, '@') !== false) { + $listoffilesexternalmodules[$langkey] = $tmpfile; + } } //print 'After loading lang '.$langkey.', newlang has '.count($newlang->tab_translate).' records
'."\n"; @@ -307,6 +311,8 @@ foreach ($modulesdir as $keydir => $tmpsearchdir) { $i++; } +$nbtotaloffiles = count($listoffiles); +$nbtotaloffilesexternal = count($listoffilesexternalmodules); if ($mode == 'overwrite') { print ''; @@ -477,7 +483,7 @@ if ($mode == 'searchkey') { //print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder; $title = $langs->trans("Translation"); if ($nbtotalofrecords > 0) { - $title .= ' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')'; + $title .= ' ('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')'; } print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1); diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 23881c0c9eb..1107c3b8d34 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1000,7 +1000,7 @@ class FormOther 6=>$langs->trans("Day6") ); - $select_week = ''; if ($useempty) { $select_week .= ''; } @@ -1014,6 +1014,9 @@ class FormOther $select_week .= ''; } $select_week .= ''; + + $select_week .= ajax_combobox($htmlname); + return $select_week; }