forked from Wavyzz/dolibarr
Work on Kanban view for modules
This commit is contained in:
@@ -290,7 +290,7 @@ $text='';
|
|||||||
|
|
||||||
if ($mode == 'desc')
|
if ($mode == 'desc')
|
||||||
{
|
{
|
||||||
if ($moduledesc) $text.=$moduledesc.'<br><br>';
|
if ($moduledesc) $text .= '<br>'.$moduledesc.'<br><br><br>';
|
||||||
|
|
||||||
$text.='<strong>'.$langs->trans("Version").':</strong> '.$version;
|
$text.='<strong>'.$langs->trans("Version").':</strong> '.$version;
|
||||||
|
|
||||||
|
|||||||
@@ -552,7 +552,7 @@ if ($mode == 'common')
|
|||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
// Show list of modules
|
// Show list of modules
|
||||||
|
//$conf->global->MAIN_USE_KANBAN_FOR_MODULES=1;
|
||||||
$oldfamily = '';
|
$oldfamily = '';
|
||||||
|
|
||||||
foreach ($orders as $key => $value)
|
foreach ($orders as $key => $value)
|
||||||
@@ -637,8 +637,12 @@ if ($mode == 'common')
|
|||||||
$familytext = empty($familyinfo[$familykey]['label']) ? $familykey : $familyinfo[$familykey]['label'];
|
$familytext = empty($familyinfo[$familykey]['label']) ? $familykey : $familyinfo[$familykey]['label'];
|
||||||
print load_fiche_titre($familytext, '', '');
|
print load_fiche_titre($familytext, '', '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) {
|
||||||
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
|
print '<div class="box-flex-container">';
|
||||||
|
} else {
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
|
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
$atleastoneforfamily = 0;
|
$atleastoneforfamily = 0;
|
||||||
}
|
}
|
||||||
@@ -651,9 +655,6 @@ if ($mode == 'common')
|
|||||||
$oldfamily = $familykey;
|
$oldfamily = $familykey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Version (with picto warning or not)
|
// Version (with picto warning or not)
|
||||||
$version = $objMod->getVersion(0);
|
$version = $objMod->getVersion(0);
|
||||||
$versiontrans = '';
|
$versiontrans = '';
|
||||||
@@ -669,212 +670,221 @@ if ($mode == 'common')
|
|||||||
$imginfo = "info_black";
|
$imginfo = "info_black";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">'."\n";
|
if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) {
|
||||||
if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print '<td width="20px">'.++$linenum.'</td>';
|
// Output Kanban
|
||||||
|
print $objMod->getKanbanView();
|
||||||
|
} else {
|
||||||
|
print '<tr class="oddeven">'."\n";
|
||||||
|
if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) print '<td width="20px">'.++$linenum.'</td>';
|
||||||
|
|
||||||
// Picto + Name of module
|
// Picto + Name of module
|
||||||
print ' <td width="200px">';
|
print ' <td width="200px">';
|
||||||
$alttext = '';
|
$alttext = '';
|
||||||
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
|
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
|
||||||
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
|
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
|
||||||
if (!empty($objMod->picto))
|
if (!empty($objMod->picto))
|
||||||
{
|
|
||||||
if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule"', 1);
|
|
||||||
else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule"');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print img_object($alttext, 'generic', 'class="valignmiddle"');
|
|
||||||
}
|
|
||||||
print ' <span class="valignmiddle">'.$objMod->getName().'</span>';
|
|
||||||
print "</td>\n";
|
|
||||||
|
|
||||||
// Desc
|
|
||||||
print '<td class="valignmiddle tdoverflowmax300">';
|
|
||||||
print nl2br($objMod->getDesc());
|
|
||||||
print "</td>\n";
|
|
||||||
|
|
||||||
// Help
|
|
||||||
print '<td class="center nowrap" style="width: 82px;">';
|
|
||||||
//print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1);
|
|
||||||
print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
// Version
|
|
||||||
print '<td class="center nowrap" width="120px">';
|
|
||||||
print $versiontrans;
|
|
||||||
if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) {
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
|
||||||
if (!empty($objMod->url_last_version)) {
|
|
||||||
$newversion = getURLContent($objMod->url_last_version);
|
|
||||||
if (isset($newversion['content'])) {
|
|
||||||
if (version_compare($newversion['content'], $versiontrans) > 0) {
|
|
||||||
print " <span class='butAction' title='".$langs->trans('LastStableVersion')."'>".$newversion['content']."</span>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "</td>\n";
|
|
||||||
|
|
||||||
// Activate/Disable and Setup (2 columns)
|
|
||||||
if (!empty($conf->global->$const_name)) // If module is already activated
|
|
||||||
{
|
|
||||||
$disableSetup = 0;
|
|
||||||
|
|
||||||
// Link enable/disabme
|
|
||||||
print '<td class="center valignmiddle" width="60px">';
|
|
||||||
if (!empty($arrayofwarnings[$modName]))
|
|
||||||
{
|
{
|
||||||
print '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
|
if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule"', 1);
|
||||||
|
else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule"');
|
||||||
}
|
}
|
||||||
if (!empty($objMod->disabled))
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("Disabled");
|
print img_object($alttext, 'generic', 'class="valignmiddle"');
|
||||||
}
|
}
|
||||||
elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1)))
|
print ' <span class="valignmiddle">'.$objMod->getName().'</span>';
|
||||||
{
|
print "</td>\n";
|
||||||
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
|
|
||||||
else {
|
|
||||||
print img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium');
|
|
||||||
//print $langs->trans("Required");
|
|
||||||
}
|
|
||||||
if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
|
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset_confirm&confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&value='.$modName.'&mode='.$mode.$param.'">';
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
print '</a>';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset&value='.$modName.'&mode='.$mode.'&confirm=yes'.$param.'">';
|
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
|
||||||
print '</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print '</td>'."\n";
|
|
||||||
|
|
||||||
// Link config
|
// Desc
|
||||||
if (!empty($objMod->config_page_url) && !$disableSetup)
|
print '<td class="valignmiddle tdoverflowmax300">';
|
||||||
{
|
print nl2br($objMod->getDesc());
|
||||||
$backtourlparam = '';
|
print "</td>\n";
|
||||||
if ($search_keyword != '') $backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.$search_keyword; // No urlencode here, done later
|
|
||||||
if ($search_nature > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.$search_nature;
|
|
||||||
if ($search_version > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.$search_version;
|
|
||||||
if ($search_status > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.$search_status;
|
|
||||||
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
|
|
||||||
|
|
||||||
if (is_array($objMod->config_page_url))
|
// Help
|
||||||
{
|
print '<td class="center nowrap" style="width: 82px;">';
|
||||||
print '<td class="tdsetuppicto right" width="60px">';
|
//print $form->textwithpicto('', $text, 1, $imginfo, 'minheight20', 0, 2, 1);
|
||||||
$i = 0;
|
print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$objMod->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
|
||||||
foreach ($objMod->config_page_url as $page)
|
print '</td>';
|
||||||
{
|
|
||||||
$urlpage = $page;
|
// Version
|
||||||
if ($i++)
|
print '<td class="center nowrap" width="120px">';
|
||||||
{
|
print $versiontrans;
|
||||||
print '<a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>';
|
if (!empty($conf->global->CHECKLASTVERSION_EXTERNALMODULE)) {
|
||||||
// print '<a href="'.$page.'">'.ucfirst($page).'</a> ';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||||
}
|
if (!empty($objMod->url_last_version)) {
|
||||||
else
|
$newversion = getURLContent($objMod->url_last_version);
|
||||||
{
|
if (isset($newversion['content'])) {
|
||||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs))
|
if (version_compare($newversion['content'], $versiontrans) > 0) {
|
||||||
{
|
print " <span class='butAction' title='".$langs->trans('LastStableVersion')."'>".$newversion['content']."</span>";
|
||||||
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
|
}
|
||||||
print '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
print "</td>\n";
|
||||||
$urltouse = $urlpage;
|
|
||||||
print '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
// Activate/Disable and Setup (2 columns)
|
||||||
}
|
if (!empty($conf->global->$const_name)) // If module is already activated
|
||||||
}
|
{
|
||||||
}
|
$disableSetup = 0;
|
||||||
print "</td>\n";
|
|
||||||
}
|
// Link enable/disabme
|
||||||
elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs))
|
print '<td class="center valignmiddle" width="60px">';
|
||||||
{
|
|
||||||
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a></td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.$objMod->config_page_url.'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a></td>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // Module not yet activated
|
|
||||||
{
|
|
||||||
// Link enable/disable
|
|
||||||
print '<td class="center valignmiddle" width="60px">';
|
|
||||||
if (!empty($objMod->always_enabled))
|
|
||||||
{
|
|
||||||
// Should never happened
|
|
||||||
}
|
|
||||||
elseif (!empty($objMod->disabled))
|
|
||||||
{
|
|
||||||
print $langs->trans("Disabled");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Module qualified for activation
|
|
||||||
$warningmessage = '';
|
|
||||||
if (!empty($arrayofwarnings[$modName]))
|
if (!empty($arrayofwarnings[$modName]))
|
||||||
|
{
|
||||||
|
print '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||||
|
}
|
||||||
|
if (!empty($objMod->disabled))
|
||||||
{
|
{
|
||||||
print '<!-- This module is a core module and it may have a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
|
print $langs->trans("Disabled");
|
||||||
foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage)
|
|
||||||
{
|
|
||||||
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
|
|
||||||
{
|
|
||||||
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext))
|
elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1)))
|
||||||
{
|
{
|
||||||
print '<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.') -->'."\n";
|
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
|
||||||
foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry)
|
else {
|
||||||
{
|
print img_picto($langs->trans("Required"), 'switch_on', '', false, 0, 0, '', 'opacitymedium');
|
||||||
$keymodulelowercase = strtolower(preg_replace('/^mod/', '', $keymodule));
|
//print $langs->trans("Required");
|
||||||
if (in_array($keymodulelowercase, $conf->modules)) // If module that request warning is on
|
}
|
||||||
{
|
if (!empty($conf->multicompany->enabled) && $user->entity) $disableSetup++;
|
||||||
foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage)
|
|
||||||
{
|
|
||||||
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
|
|
||||||
{
|
|
||||||
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
|
|
||||||
$warningmessage .= ($warningmessage ? "\n" : "").($warningmessage ? "\n" : "").$langs->trans("Module").' : '.$objMod->getName();
|
|
||||||
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("Publisher").' : '.$objMod->editor_name;
|
|
||||||
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("ModuleTriggeringThisWarning").' : '.$modules[$keymodule]->getName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print '<!-- Message to show: '.$warningmessage.' -->'."\n";
|
else
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=set&value='.$modName.'&mode='.$mode.$param.'"';
|
{
|
||||||
if ($warningmessage) print ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
|
if (!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
|
||||||
print '>';
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset_confirm&confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&value='.$modName.'&mode='.$mode.$param.'">';
|
||||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
print "</a>\n";
|
print '</a>';
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
else {
|
||||||
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset&value='.$modName.'&mode='.$mode.'&confirm=yes'.$param.'">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '</td>'."\n";
|
||||||
|
|
||||||
// Link config
|
// Link config
|
||||||
print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
if (!empty($objMod->config_page_url) && !$disableSetup)
|
||||||
|
{
|
||||||
|
$backtourlparam = '';
|
||||||
|
if ($search_keyword != '') $backtourlparam .= ($backtourlparam ? '&' : '?').'search_keyword='.$search_keyword; // No urlencode here, done later
|
||||||
|
if ($search_nature > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_nature='.$search_nature;
|
||||||
|
if ($search_version > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_version='.$search_version;
|
||||||
|
if ($search_status > -1) $backtourlparam .= ($backtourlparam ? '&' : '?').'search_status='.$search_status;
|
||||||
|
$backtourl = $_SERVER["PHP_SELF"].$backtourlparam;
|
||||||
|
|
||||||
|
if (is_array($objMod->config_page_url))
|
||||||
|
{
|
||||||
|
print '<td class="tdsetuppicto right" width="60px">';
|
||||||
|
$i = 0;
|
||||||
|
foreach ($objMod->config_page_url as $page)
|
||||||
|
{
|
||||||
|
$urlpage = $page;
|
||||||
|
if ($i++)
|
||||||
|
{
|
||||||
|
print '<a href="'.$urlpage.'" title="'.$langs->trans($page).'">'.img_picto(ucfirst($page), "setup").'</a>';
|
||||||
|
// print '<a href="'.$page.'">'.ucfirst($page).'</a> ';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (preg_match('/^([^@]+)@([^@]+)$/i', $urlpage, $regs))
|
||||||
|
{
|
||||||
|
$urltouse = dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1);
|
||||||
|
print '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$urltouse = $urlpage;
|
||||||
|
print '<a href="'.$urltouse.(preg_match('/\?/', $urltouse) ? '&' : '?').'save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</td>\n";
|
||||||
|
}
|
||||||
|
elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs))
|
||||||
|
{
|
||||||
|
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a></td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.$objMod->config_page_url.'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 6px"').'</a></td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Module not yet activated
|
||||||
|
{
|
||||||
|
// Link enable/disable
|
||||||
|
print '<td class="center valignmiddle" width="60px">';
|
||||||
|
if (!empty($objMod->always_enabled))
|
||||||
|
{
|
||||||
|
// Should never happened
|
||||||
|
}
|
||||||
|
elseif (!empty($objMod->disabled))
|
||||||
|
{
|
||||||
|
print $langs->trans("Disabled");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Module qualified for activation
|
||||||
|
$warningmessage = '';
|
||||||
|
if (!empty($arrayofwarnings[$modName]))
|
||||||
|
{
|
||||||
|
print '<!-- This module is a core module and it may have a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||||
|
foreach ($arrayofwarnings[$modName] as $keycountry => $cursorwarningmessage)
|
||||||
|
{
|
||||||
|
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
|
||||||
|
{
|
||||||
|
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($objMod->isCoreOrExternalModule() == 'external' && !empty($arrayofwarningsext))
|
||||||
|
{
|
||||||
|
print '<!-- This module is an external module and it may have a warning to show (note: your country is '.$mysoc->country_code.') -->'."\n";
|
||||||
|
foreach ($arrayofwarningsext as $keymodule => $arrayofwarningsextbycountry)
|
||||||
|
{
|
||||||
|
$keymodulelowercase = strtolower(preg_replace('/^mod/', '', $keymodule));
|
||||||
|
if (in_array($keymodulelowercase, $conf->modules)) // If module that request warning is on
|
||||||
|
{
|
||||||
|
foreach ($arrayofwarningsextbycountry as $keycountry => $cursorwarningmessage)
|
||||||
|
{
|
||||||
|
if (preg_match('/^always/', $keycountry) || ($mysoc->country_code && preg_match('/^'.$mysoc->country_code.'/', $keycountry)))
|
||||||
|
{
|
||||||
|
$warningmessage .= ($warningmessage ? "\n" : "").$langs->trans($cursorwarningmessage, $objMod->getName(), $mysoc->country_code, $modules[$keymodule]->getName());
|
||||||
|
$warningmessage .= ($warningmessage ? "\n" : "").($warningmessage ? "\n" : "").$langs->trans("Module").' : '.$objMod->getName();
|
||||||
|
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("Publisher").' : '.$objMod->editor_name;
|
||||||
|
if (!empty($objMod->editor_name)) $warningmessage .= ($warningmessage ? "\n" : "").$langs->trans("ModuleTriggeringThisWarning").' : '.$modules[$keymodule]->getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '<!-- Message to show: '.$warningmessage.' -->'."\n";
|
||||||
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=set&value='.$modName.'&mode='.$mode.$param.'"';
|
||||||
|
if ($warningmessage) print ' onclick="return confirm(\''.dol_escape_js($warningmessage).'\');"';
|
||||||
|
print '>';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print "</a>\n";
|
||||||
|
}
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
// Link config
|
||||||
|
print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"').'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($oldfamily)
|
if ($oldfamily)
|
||||||
{
|
{
|
||||||
print "</table>\n";
|
if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
} else {
|
||||||
|
print "</table>\n";
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|||||||
@@ -2256,4 +2256,65 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
|||||||
{
|
{
|
||||||
return $this->_remove(array(), $options);
|
return $this->_remove(array(), $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return Kanban view of a module
|
||||||
|
*
|
||||||
|
* @return string HTML code of Kanban view
|
||||||
|
*/
|
||||||
|
public function getKanbanView()
|
||||||
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
|
// Define imginfo
|
||||||
|
$imginfo = "info";
|
||||||
|
if ($this->isCoreOrExternalModule() == 'external')
|
||||||
|
{
|
||||||
|
$imginfo = "info_black";
|
||||||
|
}
|
||||||
|
|
||||||
|
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($this)));
|
||||||
|
|
||||||
|
// Activate/Disable and Setup (2 columns)
|
||||||
|
if (!empty($conf->global->$const_name)) // If module is already activated
|
||||||
|
{
|
||||||
|
$disableSetup = 0;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
print '
|
||||||
|
<div class="box-flex-item info-box-module">
|
||||||
|
<div class="info-box info-box-sm info-box-weather info-box-weather-level4">
|
||||||
|
<span class="info-box-icon">';
|
||||||
|
|
||||||
|
$alttext = '';
|
||||||
|
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
|
||||||
|
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
|
||||||
|
if (!empty($this->picto))
|
||||||
|
{
|
||||||
|
if (preg_match('/^\//i', $this->picto)) print img_picto($alttext, $this->picto, 'class="inline-block valignmiddle width50"', 1);
|
||||||
|
else print img_object($alttext, $this->picto, 'class="inline-block valignmiddle width50"');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_object($alttext, 'generic', 'class="inline-block valignmiddle width50"');
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<img src="/dolibarr_dev/htdocs/theme/eldy/img/weather/weather-storm.png" alt="" class="inline-block valignmiddle width50"></span>
|
||||||
|
<div class="info-box-content info-box-text-module">
|
||||||
|
<span class="info-box-title">'.$this->getName().'</span>
|
||||||
|
<span class="info-box-desc twolinesmax">'.nl2br($this->getDesc()).'</span>';
|
||||||
|
|
||||||
|
print '<a href="javascript:document_preview(\''.DOL_URL_ROOT.'/admin/modulehelp.php?id='.$this->numero.'\',\'text/html\',\''.dol_escape_js($langs->trans("Module")).'\')">'.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'</a>';
|
||||||
|
|
||||||
|
print '
|
||||||
|
<span class="progress-description"><span class="opacitymedium">'.$this->getVersion(1).'</span></span>
|
||||||
|
</div><!-- /.info-box-content -->
|
||||||
|
</div><!-- /.info-box -->
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,6 +316,13 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES
|
|||||||
height: 0;
|
height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.info-box-module {
|
||||||
|
min-width: 350px;
|
||||||
|
max-width: 350px;
|
||||||
|
}
|
||||||
|
.info-box-module .info-box-content {
|
||||||
|
height: 7em;
|
||||||
|
}
|
||||||
/* Disabled. This break the responsive on smartphone
|
/* Disabled. This break the responsive on smartphone
|
||||||
.box{
|
.box{
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
@@ -327,4 +334,8 @@ if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENES
|
|||||||
.box-flex-container {
|
.box-flex-container {
|
||||||
margin: 0 0 0 0 !important;
|
margin: 0 0 0 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.info-box-module {
|
||||||
|
width: 280px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user