diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index de49bf687a1..d368e14d6e5 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -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 ''; print ''.($i+1).''; @@ -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 ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index babdb350bda..9d5be55baa6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -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