diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 8b4d1dee6ef..ab4703f19e0 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -318,7 +318,7 @@ class FormProjets * @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids. * @param string $showproject 'all' = Show project info, ''=Hide project info * @param User $usertofilter User object to use for filtering - * @return int Nbr of project if OK, <0 if KO + * @return int Nbr of tasks if OK, <0 if KO */ public function selectTasks($socid = -1, $selected = '', $htmlname = 'taskid', $maxlength = 24, $option_only = 0, $show_empty = '1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss = 'maxwidth500', $projectsListId = '', $showproject = 'all', $usertofilter = null) { diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 2ccd4555bdb..0ff43ff0029 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -89,7 +89,7 @@ if ($permission) if (empty($hideaddcontactforuser)) { ?> -
" /> @@ -115,7 +115,7 @@ if ($permission) { ?> - " /> diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 810362cfdaf..cdc0e6b3c95 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -186,7 +186,7 @@ PlannedWorkload=Planned workload PlannedWorkloadShort=Workload ProjectReferers=Related items ProjectMustBeValidatedFirst=Project must be validated first -FirstAddRessourceToAllocateTime=Assign a user resource to task to allocate time +FirstAddRessourceToAllocateTime=Assign a user resource as contact of project to allocate time InputPerDay=Input per day InputPerWeek=Input per week InputPerMonth=Input per month diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index d2955062eac..803e6796c9e 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -131,6 +131,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; + /* * Actions */ @@ -358,7 +359,7 @@ if ($id > 0 || !empty($ref)) $head = project_prepare_head($object); dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($object->public ? 'projectpub' : 'project')); - $param = 'id='.$object->id; + $param = '&id='.$object->id; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); if ($search_user_id) $param .= '&search_user_id='.urlencode($search_user_id); if ($search_taskref) $param .= '&search_taskref='.urlencode($search_taskref); @@ -634,7 +635,7 @@ elseif ($id > 0 || !empty($ref)) } } - $linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam); + $linktocreatetask = dolGetButtonTitle($langs->trans('AddTask'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/tasks.php?action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id), '', $linktocreatetaskUserRight, $linktocreatetaskParam); print ''; if ($optioncss != '') print ''; @@ -686,7 +687,7 @@ elseif ($id > 0 || !empty($ref)) } print '
'; - print ''; + print '
'; // Fields title search print ''; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 53cc8175cf0..0c9a09b37c0 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -374,7 +374,7 @@ if ($id > 0 || !empty($ref)) if ($action != 'editline' && $user->rights->projet->creer) { print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -389,7 +389,7 @@ if ($id > 0 || !empty($ref)) if ($withproject) print ''; // Ligne ajout pour contact interne - print ''; + print ''; print ''; print "\n"; - print ''; + print ''; // Date print ''; // Task + $nboftasks = 0; if (empty($id)) { print ''; } // Contributor print ''; @@ -1202,8 +1208,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) } print ''; print '
'.$langs->trans("Nature").''.$langs->trans("NatureOfContact").''.$langs->trans("ThirdParty").''.$langs->trans("Users").''.$langs->trans("ContactType").'
'; print img_object('', 'user').' '.$langs->trans("Users"); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 25c3283846c..ea74482b4a1 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2018 Laurent Destailleur + * Copyright (C) 2006-2020 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2018 Ferran Marcet @@ -53,6 +53,7 @@ $projectid = GETPOST('projectid', 'int'); $ref = GETPOST('ref', 'alpha'); $withproject = GETPOST('withproject', 'int'); $project_ref = GETPOST('project_ref', 'alpha'); +$tab = GETPOST('tab', 'aZ09'); $search_day = GETPOST('search_day', 'int'); $search_month = GETPOST('search_month', 'int'); @@ -620,8 +621,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if ($withproject) { // Tabs for project - if (empty($id)) $tab = 'timespent'; + if (empty($id) || $tab == 'timespent') $tab = 'timespent'; else $tab = 'tasks'; + $head = project_prepare_head($projectstatic); dol_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project')); @@ -958,6 +960,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; print ''; print ''; + print ''; if ($massaction == 'generateinvoice') { @@ -1139,7 +1142,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print '
'; @@ -1149,28 +1152,31 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print ''; - $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, ''); + $nboftasks = $formproject->selectTasks(-1, GETPOST('taskid', 'int'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, ''); print ''; - print img_object('', 'user', 'class="hideonsmartphone"'); $contactsofproject = $projectstatic->getListContactId('internal'); if (count($contactsofproject) > 0) { + print img_object('', 'user', 'class="hideonsmartphone"'); if (in_array($user->id, $contactsofproject)) $userid = $user->id; else $userid = $contactsofproject[0]; if ($projectstatic->public) $contactsofproject = array(); - print $form->select_dolusers((GETPOST('userid', 'int') ?GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200'); + print $form->select_dolusers((GETPOST('userid', 'int') ? GETPOST('userid', 'int') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'maxwidth200'); } else { - print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); + if ($nboftasks) { + print img_error($langs->trans('FirstAddRessourceToAllocateTime')).' '.$langs->trans('FirstAddRessourceToAllocateTime'); + } } print ''; - print ''; - print ''; + print ''; + print ''; print '
'; @@ -1504,9 +1510,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if (($action == 'editline' || $action == 'splitline') && $_GET['lineid'] == $task_time->rowid) { print ''; - print ''; + print ''; print '
'; - print ''; + print ''; } elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks { @@ -1515,19 +1521,19 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) if ($conf->MAIN_FEATURES_LEVEL >= 2) { print ' '; - print 'rowid.$param.'">'; + print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; print img_split(); print ''; } print ' '; - print 'rowid.$param.'">'; + print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; print img_edit(); print ''; print ' '; - print 'rowid.$param.'">'; - print img_delete(); + print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; + print img_delete('default', 'class="pictodelete paddingleft"'); print ''; if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined @@ -1544,6 +1550,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) print "\n"; + // Add line to split if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index ec98ae3b4d8..2e49395d9b3 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -798,9 +798,15 @@ select.flat.selectlimit { .margintoponly { margin-top: 10px !important; } +.margintoponlyshort { + margin-top: 3px !important; +} .marginbottomonly { margin-bottom: 10px !important; } +.marginbottomonlyshort { + margin-bottom: 3px !important; +} .nomargintop { margin-top: 0 !important; }