2
0
forked from Wavyzz/dolibarr

Work on Kanban view for modules

This commit is contained in:
Laurent Destailleur
2020-03-27 01:59:17 +01:00
parent a02e3e1e61
commit 354cb8c1b0
4 changed files with 279 additions and 197 deletions

View File

@@ -2256,4 +2256,65 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
{
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>';
}
}