From 082b2051494480570d8d5827786330cc1669d2b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Apr 2020 15:12:42 +0200 Subject: [PATCH] WIP Work on Kanban view for module list --- htdocs/admin/modulehelp.php | 62 ++++++++++--------- htdocs/admin/modules.php | 41 ++++++++---- htdocs/core/modules/DolibarrModules.class.php | 16 ++--- htdocs/langs/en_US/main.lang | 2 + htdocs/langs/en_US/projects.lang | 2 - htdocs/projet/ganttview.php | 3 +- htdocs/projet/tasks.php | 2 +- htdocs/theme/eldy/info-box.inc.php | 27 +++++++- 8 files changed, 98 insertions(+), 57 deletions(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 08ddbd4ad6a..1429888405c 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -243,10 +243,36 @@ $moduledesc=$objMod->getDesc(); $moduleauthor=$objMod->getPublisher(); $moduledir=strtolower(preg_replace('/^mod/i', '', get_class($objMod))); +$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); + +$text = ''.$langs->trans("LastActivationDate").': '; +if (! empty($conf->global->$const_name)) $text.=dol_print_date($objMod->getLastActivationDate(), 'dayhour'); +else $text.=$langs->trans("Disabled"); +$tmp = $objMod->getLastActivationInfo(); +$authorid = $tmp['authorid']; +if ($authorid > 0) +{ + $tmpuser = new User($db); + $tmpuser->fetch($authorid); + $text.='
'.$langs->trans("LastActivationAuthor").': '; + $text.= $tmpuser->getNomUrl(1); +} +$ip = $tmp['ip']; +if ($ip) +{ + $text.='
'.$langs->trans("LastActivationIP").': '; + $text.= $ip; +} + +$moreinfo = $text; + +$title = ($modulename?$modulename:$moduledesc); print '
'; -print load_fiche_titre(($modulename?$modulename:$moduledesc), $moreinfo, 'object_'.$objMod->picto); +$picto = 'object_'.$objMod->picto; + +print load_fiche_titre(($modulename?$modulename:$moduledesc), $moreinfo, $picto); print '
'; dol_fiche_head($head, $mode, $title, -1); @@ -256,8 +282,6 @@ if (! $modulename) dol_syslog("Error for module ".$key." - Property name of module looks empty", LOG_WARNING); } -$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); - // Load all lang files of module if (isset($objMod->langfiles) && is_array($objMod->langfiles)) { @@ -292,44 +316,22 @@ if ($mode == 'desc') { if ($moduledesc) $text .= '
'.$moduledesc.'


'; - $text.=''.$langs->trans("Version").': '.$version; + $text.=''.$langs->trans("Version").': '.$version; $textexternal=''; if ($objMod->isCoreOrExternalModule() == 'external') { - $textexternal.='
'.$langs->trans("Origin").': '.$langs->trans("ExternalModule", $dirofmodule); - if ($objMod->editor_name != 'dolibarr') $textexternal.='
'.$langs->trans("Publisher").': '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name); + $textexternal.='
'.$langs->trans("Origin").': '.$langs->trans("ExternalModule", $dirofmodule); + if ($objMod->editor_name != 'dolibarr') $textexternal.='
'.$langs->trans("Publisher").': '.(empty($objMod->editor_name)?$langs->trans("Unknown"):$objMod->editor_name); $editor_url = $objMod->editor_url; if (! preg_match('/^http/', $editor_url)) $editor_url = 'http://'.$editor_url; - if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i', $objMod->editor_url)) $textexternal.='
'.$langs->trans("Url").': '.$objMod->editor_url.''; + if (! empty($objMod->editor_url) && ! preg_match('/dolibarr\.org/i', $objMod->editor_url)) $textexternal.= ($objMod->editor_name != 'dolibarr' ? ' - ' : '').img_object('', 'globe').' '.$objMod->editor_url.''; $text.=$textexternal; $text.='
'; } else { - $text.='
'.$langs->trans("Origin").': '.$langs->trans("Core").'
'; - } - $text.='
'.$langs->trans("LastActivationDate").': '; - if (! empty($conf->global->$const_name)) $text.=dol_print_date($objMod->getLastActivationDate(), 'dayhour'); - else $text.=$langs->trans("Disabled"); - $text.='
'; - - $tmp = $objMod->getLastActivationInfo(); - $authorid = $tmp['authorid']; - if ($authorid > 0) - { - $tmpuser = new User($db); - $tmpuser->fetch($authorid); - $text.=''.$langs->trans("LastActivationAuthor").': '; - $text.= $tmpuser->getNomUrl(1); - $text.='
'; - } - $ip = $tmp['ip']; - if ($ip) - { - $text.=''.$langs->trans("LastActivationIP").': '; - $text.= $ip; - $text.='
'; + $text.='
'.$langs->trans("Origin").': '.$langs->trans("Core").'
'; } $moduledesclong=$objMod->getDescLong(); diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 91003d7cc12..1fa71b74f75 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -480,13 +480,14 @@ $nbofactivatedmodules = count($conf->modules); $moreinfo = $langs->trans("TotalNumberOfActivatedModules", ($nbofactivatedmodules - 1), count($modules)); if ($nbofactivatedmodules <= 1) $moreinfo .= ' '.img_warning($langs->trans("YouMustEnableOneModule")); -print load_fiche_titre($langs->trans("ModulesSetup"), $moreinfo, 'title_setup'); +print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); // Start to show page -if ($mode == 'common') print ''.$langs->trans("ModulesDesc")."
\n"; -if ($mode == 'marketplace') print ''.$langs->trans("ModulesMarketPlaceDesc")."
\n"; -if ($mode == 'deploy') print ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."
\n"; -if ($mode == 'develop') print ''.$langs->trans("ModulesDevelopDesc")."
\n"; +if ($mode == 'common') print ''.$langs->trans("ModulesDesc")."
\n"; +if ($mode == 'commonkanban') print ''.$langs->trans("ModulesDesc")."
\n"; +if ($mode == 'marketplace') print ''.$langs->trans("ModulesMarketPlaceDesc")."
\n"; +if ($mode == 'deploy') print ''.$langs->trans("ModulesDeployDesc", $langs->transnoentitiesnoconv("AvailableModules"))."
\n"; +if ($mode == 'develop') print ''.$langs->trans("ModulesDevelopDesc")."
\n"; $head = modules_prepare_head(); @@ -494,7 +495,7 @@ $head = modules_prepare_head(); print "
\n"; -if ($mode == 'common') +if ($mode == 'common' || $mode == 'commonkanban') { dol_set_focus('#search_keyword'); @@ -504,12 +505,17 @@ if ($mode == 'common') print ''; print ''; print ''; + print ''; - dol_fiche_head($head, $mode, '', -1); + $newmode = $mode; + if ($newmode == 'commonkanban') $newmode = 'common'; - $moreforfilter = ''; + dol_fiche_head($head, $newmode, '', -1); + + $moreforfilter = '
'; + $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= $langs->trans('Keyword').': '; + $moreforfilter .= $langs->trans('Keyword').': '; $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= $langs->trans('Origin').': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1); @@ -532,6 +538,16 @@ if ($mode == 'common') $moreforfilter .= ''; $moreforfilter .= ' '; $moreforfilter .= ''; + $moreforfilter .= '
'; + $moreforfilter .= '
'; + + $moreforfilter .= '
'; + $moreforfilter .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.$param, '', 1, array('morecss'=>'reposition')); + $moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-list-alt paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', 1, array('morecss'=>'reposition')); + $moreforfilter .= '
'; + + $moreforfilter .= '
'.$moreinfo.'
'; + $moreforfilter .= '
'; if (!empty($moreforfilter)) @@ -552,7 +568,6 @@ if ($mode == 'common') if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); // Show list of modules - //$conf->global->MAIN_USE_KANBAN_FOR_MODULES=1; $oldfamily = ''; foreach ($orders as $key => $value) @@ -637,7 +652,7 @@ if ($mode == 'common') $familytext = empty($familyinfo[$familykey]['label']) ? $familykey : $familyinfo[$familykey]['label']; print load_fiche_titre($familytext, '', ''); - if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) { + if ($mode == 'commonkanban') { print '
'; } else { print '
'; @@ -670,7 +685,7 @@ if ($mode == 'common') $imginfo = "info_black"; } - if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) { + if ($mode == 'commonkanban') { // Output Kanban print $objMod->getKanbanView(); } else { @@ -880,7 +895,7 @@ if ($mode == 'common') if ($oldfamily) { - if (! empty($conf->global->MAIN_USE_KANBAN_FOR_MODULES)) { + if ($mode == 'commonkanban') { print '
'; } else { print "\n"; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 9ea058de919..d9cf40f4b68 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2286,31 +2286,31 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it print '
-
- '; +
+
'; $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"'); + if (preg_match('/^\//i', $this->picto)) print img_picto($alttext, $this->picto, 'class="inline-block valignmiddle"', 1); + else print img_object($alttext, $this->picto, 'class="inline-block valignmiddle"'); } else { - print img_object($alttext, 'generic', 'class="inline-block valignmiddle width50"'); + print img_object($alttext, 'generic', 'class="inline-block valignmiddle"'); } - - print ' + print 'getVersion(1).'">'.$this->getVersion(1).''; + print '
'.$this->getName().' '.nl2br($this->getDesc()).''; print ''.img_picto($langs->trans("ClickToShowDescription"), $imginfo).''; + //print ''.$this->getVersion(1).''; print ' - '.$this->getVersion(1).'
'; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index d5ae9ca5124..cbe3c3e46bf 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -830,6 +830,8 @@ Gender=Gender Genderman=Man Genderwoman=Woman ViewList=List view +ViewGantt=Gantt view +ViewKanban=Kanban view Mandatory=Mandatory Hello=Hello GoodBye=GoodBye diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 4a4c70d2bb7..810362cfdaf 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -87,8 +87,6 @@ WhichIamLinkedToProject=which I'm linked to project Time=Time ListOfTasks=List of tasks GoToListOfTimeConsumed=Go to list of time consumed -GoToListOfTasks=Show as list -GoToGanttView=show as Gantt GanttView=Gantt View ListProposalsAssociatedProject=List of the commercial proposals related to the project ListOrdersAssociatedProject=List of sales orders related to the project diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index db4a5642dec..62a8f2235f2 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $id = GETPOST('id', 'intcomma'); @@ -234,7 +235,7 @@ if ($user->rights->projet->all->creer || $user->rights->projet->creer) { $linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam); -$linktolist = dolGetButtonTitle($langs->trans('GoToListOfTasks'), '', 'fa fa-list-alt paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition')); +$linktolist = dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id, '', 1, array('morecss'=>'reposition')); //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1); print load_fiche_titre($title, $linktolist.'   '.$linktocreatetask, 'generic'); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index a95d7162a87..d473db7c753 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -647,7 +647,7 @@ elseif ($id > 0 || !empty($ref)) print ''; $title = $langs->trans("ListOfTasks"); - $linktotasks = dolGetButtonTitle($langs->trans('GoToGanttView'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition')); + $linktotasks = dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition')); //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1); print load_fiche_titre($title, $linktotasks.'   '.$linktocreatetask, 'generic'); diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index 88357f02404..0bcfe977871 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -64,12 +64,15 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> line-height: 90px; background: rgba(0, 0, 0, 0.2); } -.info-box-sm .info-box-icon{ +.info-box-sm .info-box-icon { height: 80px; width: 80px; font-size: 25px; line-height: 80px; } +.info-box-module .info-box-icon { + height: 106px; +} .info-box-icon > img { max-width: 100%; } @@ -92,13 +95,33 @@ if (!defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?> transition: opacity 0.5s, visibility 0s 0.5s; } +.info-box-icon-version { + box-sizing: border-box; + display: block; + position: absolute; + width: 90px; + bottom: 0px; + color: #ffffff; + background-color: rgba(0,0,0,0.1); + cursor: default; + + font-size: 10px; + line-height: 22px; + padding: 0px 3px; + text-align: center; + opacity: 1; + -webkit-transition: opacity 0.5s, visibility 0s 0.5s; + transition: opacity 0.5s, visibility 0s 0.5s; +} + + global->MAIN_DISABLE_GLOBAL_BOXSTATS) && !empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD)) { ?> .info-box-icon-text{ opacity: 1; } -.info-box-sm .info-box-icon-text{ +.info-box-sm .info-box-icon-text, .info-box-sm .info-box-icon-version{ overflow: hidden; width: 80px; }