This commit is contained in:
Laurent Destailleur 2023-01-13 14:09:54 +01:00
parent 276bca95d3
commit 5fc9e093eb
2 changed files with 12 additions and 10 deletions

View File

@ -776,15 +776,17 @@ if ($mode == 'common' || $mode == 'commonkanban') {
// Version (with picto warning or not)
$version = $objMod->getVersion(0);
$versiontrans = '';
$warningstring = '';
if (preg_match('/development/i', $version)) {
$versiontrans .= img_warning($langs->trans("Development"), '', 'floatleft paddingright');
$warningstring = $langs->trans("Development");
}
if (preg_match('/experimental/i', $version)) {
$versiontrans .= img_warning($langs->trans("Experimental"), '', 'floatleft paddingright');
$warningstring = $langs->trans("Experimental");
}
if (preg_match('/deprecated/i', $version)) {
$versiontrans .= img_warning($langs->trans("Deprecated"), '', 'floatleft paddingright');
$warningstring = $langs->trans("Deprecated");
}
if ($objMod->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
$versiontrans .= $objMod->getVersion(1);
}
@ -842,7 +844,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
} else {
if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
$codeenabledisable .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;token='.newToken().'&amp;module_position='.$module_position.'&amp;action=reset_confirm&amp;confirm_message_code='.urlencode($objMod->warnings_unactivation[$mysoc->country_code]).'&amp;value='.$modName.'&amp;mode='.$mode.$param.'">';
$codeenabledisable .= img_picto($langs->trans("Activated"), 'switch_on');
$codeenabledisable .= img_picto($langs->trans("Activated").($warningstring ? ' '.$warningstring : ''), 'switch_on');
$codeenabledisable .= '</a>';
if (getDolGlobalInt("MAIN_FEATURES_LEVEL") > 1) {
$codeenabledisable .= '&nbsp;';
@ -852,7 +854,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
}
} else {
$codeenabledisable .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&amp;token='.newToken().'&amp;module_position='.$module_position.'&amp;action=reset&amp;value='.$modName.'&amp;mode='.$mode.'&amp;confirm=yes'.$param.'">';
$codeenabledisable .= img_picto($langs->trans("Activated"), 'switch_on');
$codeenabledisable .= img_picto($langs->trans("Activated").($warningstring ? ' '.$warningstring : ''), 'switch_on');
$codeenabledisable .= '</a>';
if (getDolGlobalInt("MAIN_FEATURES_LEVEL") > 1) {
$codeenabledisable .= '&nbsp;';
@ -961,7 +963,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
// Output Kanban
print $objMod->getKanbanView($codeenabledisable, $codetoconfig);
} else {
print '<tr class="oddeven">'."\n";
print '<tr class="oddeven'.($warningstring ? ' info-box-content-warning' : '').'">'."\n";
if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) {
print '<td class="width50">'.$linenum.'</td>';
}
@ -995,7 +997,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
print '</td>';
// Version
print '<td class="center nowrap" width="120px">';
print '<td class="center nowrap" width="150px" title="'.dol_escape_htmltag(dol_string_nohtmltag($versiontrans)).'">';
if ($objMod->needUpdate) {
$versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion;
print '<span class="badge badge-warning classfortooltip" title="'.dol_escape_htmltag($versionTitle).'">'.$versiontrans.'</span>';
@ -1005,7 +1007,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
print "</td>\n";
// Link enable/disable
print '<td class="center valignmiddle" width="60px">';
print '<td class="center valignmiddle left" width="60px">';
print $codeenabledisable;
print "</td>\n";

View File

@ -792,8 +792,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
* For 'experimental' modules, gives 'experimental' translation
* For 'dolibarr' modules, gives Dolibarr version
*
* @param int $translated 1=Special version keys are translated, 0=Special version keys are not translated
* @return string Module version
* @param int $translated 1=Special version keys are translated, 0=Special version keys are not translated
* @return string Module version
*/
public function getVersion($translated = 1)
{