Enhance detection of update available
This commit is contained in:
parent
4fde184afb
commit
f1f63cd4e2
@ -55,7 +55,9 @@ $error = 0;
|
|||||||
$help_url = '';
|
$help_url = '';
|
||||||
llxHeader('', $langs->trans("ConfigAccountingExpert"), $help_url);
|
llxHeader('', $langs->trans("ConfigAccountingExpert"), $help_url);
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ConfigAccountingExpert"), '', 'title_setup');
|
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("ConfigAccountingExpert"), $linkback, 'title_setup');
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print '<span class="opacitymedium">'.$langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Accounting").' - '.$langs->transnoentitiesnoconv("Setup"))."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Accounting").' - '.$langs->transnoentitiesnoconv("Setup"))."</span><br>\n";
|
||||||
|
|||||||
@ -521,8 +521,8 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
$moreforfilter = '<div class="valignmiddle">';
|
$moreforfilter = '<div class="valignmiddle">';
|
||||||
|
|
||||||
$moreforfilter .= '<div class="floatright right pagination --module-list"><ul><li>';
|
$moreforfilter .= '<div class="floatright right pagination --module-list"><ul><li>';
|
||||||
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdateHelp'), 'fa fa-check-double ', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss'=>'reposition'));
|
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'<br>'.$langs->trans('CheckForModuleUpdateHelp'), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss'=>'reposition'));
|
||||||
$moreforfilter .= '</li><li>'.dolGetButtonTitleSeparator();
|
$moreforfilter .= dolGetButtonTitleSeparator();
|
||||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss'=>'reposition'));
|
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', ($mode == 'common' ? 2 : 1), array('morecss'=>'reposition'));
|
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', ($mode == 'common' ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
$moreforfilter .= '</li></ul></div>';
|
$moreforfilter .= '</li></ul></div>';
|
||||||
@ -584,6 +584,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
|
|
||||||
// Show list of modules
|
// Show list of modules
|
||||||
$oldfamily = '';
|
$oldfamily = '';
|
||||||
|
$foundoneexternalmodulewithupdate = 0;
|
||||||
$linenum = 0;
|
$linenum = 0;
|
||||||
foreach ($orders as $key => $value) {
|
foreach ($orders as $key => $value) {
|
||||||
$linenum++;
|
$linenum++;
|
||||||
@ -915,6 +916,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
if ($objMod->needUpdate) {
|
if ($objMod->needUpdate) {
|
||||||
$versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion;
|
$versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion;
|
||||||
print '<span class="badge badge-warning classfortooltip" title="'.dol_escape_htmltag($versionTitle).'">'.$versiontrans.'</span>';
|
print '<span class="badge badge-warning classfortooltip" title="'.dol_escape_htmltag($versionTitle).'">'.$versiontrans.'</span>';
|
||||||
|
$foundoneexternalmodulewithupdate++;
|
||||||
} else {
|
} else {
|
||||||
print $versiontrans;
|
print $versiontrans;
|
||||||
}
|
}
|
||||||
@ -934,6 +936,14 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($action == 'checklastversion') {
|
||||||
|
if ($foundoneexternalmodulewithupdate) {
|
||||||
|
setEventMessages($langs->trans("ModuleUpdateAvailable"), null, 'mesgs');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("NoExternalModuleWithUpdate"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($oldfamily) {
|
if ($oldfamily) {
|
||||||
if ($mode == 'commonkanban') {
|
if ($mode == 'commonkanban') {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -2310,9 +2310,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check for module update
|
* Check for module update
|
||||||
* TODO : store results for $this->url_last_version and $this->needUpdate
|
* TODO : store results for $this->url_last_version and $this->needUpdate
|
||||||
* Add a cron task to monitor for updates
|
* Add a cron task to monitor for updates
|
||||||
*
|
*
|
||||||
* @return int <0 if Error, 0 == no update needed, >0 if need update
|
* @return int <0 if Error, 0 == no update needed, >0 if need update
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -2122,7 +2122,8 @@ IfCLINotRequiredYouShouldDisablePHPFunctions=Except if you need to run system co
|
|||||||
NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good)
|
NoWritableFilesFoundIntoRootDir=No writable files or directories of the common programs were found into your root directory (Good)
|
||||||
RecommendedValueIs=Recommended: %s
|
RecommendedValueIs=Recommended: %s
|
||||||
ARestrictedPath=A restricted path
|
ARestrictedPath=A restricted path
|
||||||
CheckForModuleUpdate=Check for modules updates
|
CheckForModuleUpdate=Check for external modules updates
|
||||||
CheckForModuleUpdateHelp=Check for modules updates.<br>This action will connect to modules editors to check if a new version is available.
|
CheckForModuleUpdateHelp=This action will connect to editors of external modules to check if a new version is available.
|
||||||
ModuleUpdateAvailable=An update is available for this module
|
ModuleUpdateAvailable=An update is available
|
||||||
|
NoExternalModuleWithUpdate=No updates found for external modules
|
||||||
SwaggerDescriptionFile=Swagger API description file (for use with redoc for example)
|
SwaggerDescriptionFile=Swagger API description file (for use with redoc for example)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user