diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 91333c153f8..0383fc7c27b 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -2327,4 +2327,39 @@ class Task extends CommonObjectLine return ($datetouse > 0 && ($datetouse < ($now - $conf->project->task->warning_delay))); } + + /** + * Return clicable link of object (with eventually picto) + * + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @return string HTML Code for Kanban thumb. + */ + public function getKanbanView($option = '') + { + global $langs, $conf; + $return = '
'; + $return .= '
'; + $return .= ''; + $return .= img_picto('', $this->picto); + //$return .= ''; // Can be image + $return .= ''; + $return .= '
'; + $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).''; + if (property_exists($this, 'fk_project') ) { + $return .= '
'.$this->fk_project.''; + } + if (property_exists($this, 'budget_amount')) { + $return .= '
'.$langs->trans("Budget").' : '.price($this->budget_amount, 0, $langs, 1, 0, 0, $conf->currency).''; + } + if (property_exists($this, 'fk_statut')) { + $return .= '
'.$this->fk_statut.''; + } + if (property_exists($this, 'duration_effective')) { + $return .= '
'.getTaskProgressView($this, false, false).'
'; + } + $return .= '
'; + $return .= '
'; + $return .= '
'; + return $return; + } } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 72c5eb25874..bc4c8770f0f 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -580,6 +580,9 @@ llxHeader('', $title, $help_url); $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; +if (!empty($mode)) { + $param .= '&mode='.urlencode($mode); +} if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); } @@ -697,7 +700,11 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -$newcardbutton = dolGetButtonTitle($langs->trans('NewTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?action=create', '', $user->rights->projet->creer); +$newcardbutton = ''; + +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('NewTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?action=create', '', $user->rights->projet->creer); print '
'."\n"; if ($optioncss != '') { @@ -712,6 +719,8 @@ if (!empty($type)) { print ''; } print ''; +print ''; + // Show description of content $texthelp = ''; @@ -1121,6 +1130,8 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban + $object->fk_statut = $projectstatic->getLibStatut(1); + $object->fk_project = $projectstatic->getNomUrl(1, 'task'); print $object->getKanbanView(''); if ($i == ($imaxinloop - 1)) { print '
';