From 7c4599a5c5593ae59ccbe0df9296a260a747c10d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Nov 2020 01:14:45 +0100 Subject: [PATCH] Look and feel v13 --- htdocs/core/lib/project.lib.php | 4 +++- htdocs/langs/en_US/main.lang | 1 + htdocs/projet/class/task.class.php | 6 +++--- htdocs/projet/tasks.php | 10 +++++----- htdocs/projet/tasks/list.php | 4 ++-- htdocs/projet/tasks/task.php | 4 ++-- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index df4f4e79197..10789d2b367 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -483,7 +483,9 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $taskstatic->projectstatus = $lines[$i]->projectstatus; $taskstatic->progress = $lines[$i]->progress; $taskstatic->fk_statut = $lines[$i]->status; - $taskstatic->datee = $lines[$i]->date_end; + $taskstatic->date_start = $lines[$i]->date_start; + $taskstatic->date_end = $lines[$i]->date_end; + $taskstatic->datee = $lines[$i]->date_end; // deprecated $taskstatic->planned_workload = $lines[$i]->planned_workload; $taskstatic->duration_effective = $lines[$i]->duration; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 3ed9bbbae88..11278499121 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -258,6 +258,7 @@ Cards=Cards Card=Card Now=Now HourStart=Start hour +Deadline=Deadline Date=Date DateAndHour=Date and hour DateToday=Today's date diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index d971b0a1562..d1d02db3485 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -50,9 +50,9 @@ class Task extends CommonObject public $fk_element = 'fk_task'; /** - * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + * @var string String with name of icon for myobject. */ - public $picto = 'task'; + public $picto = 'projecttask'; /** * @var array List of child tables. To test if we can delete object. @@ -648,7 +648,7 @@ class Task extends CommonObject if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips $result = ''; - $label = img_picto('', $this->picto).' '.$langs->trans("ShowTask").''; + $label = img_picto('', $this->picto).' '.$langs->trans("Task").''; if (!empty($this->ref)) $label .= '
'.$langs->trans('Ref').': '.$this->ref; if (!empty($this->label)) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 0b207223351..72e8f1cbdb4 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -106,7 +106,7 @@ $arrayfields = array( 't.label'=>array('label'=>$langs->trans("LabelTask"), 'checked'=>1, 'position'=>2), 't.description'=>array('label'=>$langs->trans("Description"), 'checked'=>0, 'position'=>3), 't.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>4), - 't.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>5), + 't.datee'=>array('label'=>$langs->trans("Deadline"), 'checked'=>1, 'position'=>5), 't.planned_workload'=>array('label'=>$langs->trans("PlannedWorkload"), 'checked'=>1, 'position'=>6), 't.duration_effective'=>array('label'=>$langs->trans("TimeSpent"), 'checked'=>1, 'position'=>7), 't.progress_calculated'=>array('label'=>$langs->trans("ProgressCalculated"), 'checked'=>1, 'position'=>8), @@ -220,8 +220,8 @@ if ($action == 'createtask' && $user->rights->projet->creer) // If we use user timezone, we must change also view/list to use user timezone everywhere //$date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear'],'user'); //$date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear'],'user'); - $date_start = dol_mktime($_POST['dateohour'], $_POST['dateomin'], 0, $_POST['dateomonth'], $_POST['dateoday'], $_POST['dateoyear']); - $date_end = dol_mktime($_POST['dateehour'], $_POST['dateemin'], 0, $_POST['dateemonth'], $_POST['dateeday'], $_POST['dateeyear']); + $date_start = dol_mktime(GETPOST('dateohour', 'int'), GETPOST('dateomin', 'int'), 0, GETPOST('dateomonth', 'int'), GETPOST('dateoday', 'int'), GETPOST('dateoyear', 'int')); + $date_end = dol_mktime(GETPOST('dateehour', 'int'), GETPOST('dateemin', 'int'), 0, GETPOST('dateemonth', 'int'), GETPOST('dateeday', 'int'), GETPOST('dateeyear', 'int')); if (!$cancel) { @@ -245,7 +245,7 @@ if ($action == 'createtask' && $user->rights->projet->creer) if (!$error) { - $tmparray = explode('_', $_POST['task_parent']); + $tmparray = explode('_', GETPOST('task_parent')); $projectid = $tmparray[0]; if (empty($projectid)) $projectid = $id; // If projectid is '' $task_parent = $tmparray[1]; @@ -345,7 +345,7 @@ if ($id > 0 || !empty($ref)) //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete; - $tab = GETPOST('tab') ?GETPOST('tab') : 'tasks'; + $tab = (GETPOSTISSET('tab') ? GETPOST('tab') : 'tasks'); $head = project_prepare_head($object); print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project')); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index d626c439ce8..b9d1a19c629 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -119,7 +119,7 @@ $arrayfields = array( 't.label'=>array('label'=>$langs->trans("LabelTask"), 'checked'=>1, 'position'=>80), 't.description'=>array('label'=>$langs->trans("Description"), 'checked'=>0, 'position'=>80), 't.dateo'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1, 'position'=>100), - 't.datee'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1, 'position'=>101), + 't.datee'=>array('label'=>$langs->trans("Deadline"), 'checked'=>1, 'position'=>101), 'p.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>1), 'p.title'=>array('label'=>$langs->trans("ProjectLabel"), 'checked'=>0), 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>0), @@ -654,7 +654,7 @@ while ($i < min($num, $limit)) $object->description = $obj->description; $object->fk_statut = $obj->fk_statut; $object->progress = $obj->progress; - $object->datee = $db->jdate($obj->date_end); // deprecated + $object->date_start = $db->jdate($obj->date_start); $object->date_end = $db->jdate($obj->date_end); $object->planned_workload = $obj->planned_workload; $object->duration_effective = $obj->duration_effective; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index c2bf79af197..230dd126de8 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -417,7 +417,7 @@ if ($id > 0 || !empty($ref)) print ''; // Date end - print ''.$langs->trans("DateEnd").''; + print ''.$langs->trans("Deadline").''; print $form->selectDate($object->date_end ? $object->date_end : -1, 'datee', 1, 1, 0, '', 1, 0); print ''; @@ -513,7 +513,7 @@ if ($id > 0 || !empty($ref)) print ''; // Date start - Date end - print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; + print ''.$langs->trans("DateStart").' - '.$langs->trans("Deadline").''; $start = dol_print_date($object->date_start, 'dayhour'); print ($start ? $start : '?'); $end = dol_print_date($object->date_end, 'dayhour');