Fix tooltip on table on list of pages

This commit is contained in:
Laurent Destailleur 2023-03-15 15:17:34 +01:00
parent 9cd9150529
commit e922f5052b
2 changed files with 15 additions and 5 deletions

View File

@ -109,12 +109,18 @@ if (!$base) {
$arrayoffilesrich = dol_dir_list(DOL_DOCUMENT_ROOT.'/install/mysql/tables/', 'files', 0, '\.sql$');
$arrayoffiles = array();
$arrayoftablesautocreated = array();
foreach ($arrayoffilesrich as $value) {
//print $shortsqlfilename.' ';
$shortsqlfilename = preg_replace('/\-[a-z]+\./', '.', $value['name']);
$arrayoffiles[] = $shortsqlfilename;
$arrayoffiles[$value['name']] = $shortsqlfilename;
if ($value['name'] == $shortsqlfilename && ! preg_match('/\.key\.sql$/', $value['name'])) {
// This is a sql file automatically created
$arrayoftablesautocreated[$value['name']] = $shortsqlfilename;
}
}
// Now loop on tables really found into database
$sql = "SHOW TABLE STATUS";
$resql = $db->query($sql);
@ -123,6 +129,7 @@ if (!$base) {
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td>'.($i+1).'</td>';
@ -130,11 +137,14 @@ if (!$base) {
$tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name);
if (in_array($tablename.'.sql', $arrayoffiles)) {
$img = "info";
//print img_picto($langs->trans("ExternalModule"), $img);
if (in_array($tablename.'.sql', $arrayoftablesautocreated)) {
$img = "info";
} else {
$img = "info_black";
print img_picto($langs->trans("NotAvailableByDefaultEnabledOnModuleActivation"), $img, 'class="small opacitymedium"');
}
} else {
$img = "info_black";
//print DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql';
print img_picto($langs->trans("ExternalModule"), $img, 'class="small"');
}
print '</td>';

View File

@ -2374,5 +2374,5 @@ WarningModuleHasChangedSecurityCsrfParameter=Warning: the module %s has disabled
EMailsInGoingDesc=Incoming emails are managed by the module %s. You must enable and configure it if you need to support ingoing emails.
MAIN_IMAP_USE_PHPIMAP=Use the PHP-IMAP library for IMAP instead of native PHP IMAP. This also allows the use of an OAuth2 connection for IMAP (module OAuth must also be activated).
MAIN_CHECKBOX_LEFT_COLUMN=Show the column for field and line selection on the left (on the right by default)
NotAvailableByDefaultEnabledOnModuleActivation=Not created by default. Created on module activation only.
CSSPage=CSS Style