NEW Can enter time spent from the list of time spent of project

This commit is contained in:
Laurent Destailleur 2018-02-26 12:21:01 +01:00
parent 46f70ebf8e
commit 46c2f098e0
2 changed files with 16 additions and 11 deletions

View File

@ -91,6 +91,7 @@ ListDonationsAssociatedProject=List of donations associated with the project
ListVariousPaymentsAssociatedProject=List of miscellaneous payments associated with the project ListVariousPaymentsAssociatedProject=List of miscellaneous payments associated with the project
ListActionsAssociatedProject=List of events associated with the project ListActionsAssociatedProject=List of events associated with the project
ListTaskTimeUserProject=List of time consumed on tasks of project ListTaskTimeUserProject=List of time consumed on tasks of project
ListTaskTimeForTask=List of time consumed on task
ActivityOnProjectToday=Activity on project today ActivityOnProjectToday=Activity on project today
ActivityOnProjectYesterday=Activity on project yesterday ActivityOnProjectYesterday=Activity on project yesterday
ActivityOnProjectThisWeek=Activity on project this week ActivityOnProjectThisWeek=Activity on project this week

View File

@ -410,17 +410,16 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
dol_fiche_end(); dol_fiche_end();
print '<br>'; print '<br>';
// Link to create time // Link to create time
if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes)) //if ((empty($id) && empty($ref)) || ! empty($projectidforalltimes))
{ //{
if ($user->rights->projet->all->creer || $user->rights->projet->creer) if ($user->rights->projet->all->creer || $user->rights->projet->creer)
{ {
if ($object->public || $userWrite > 0) if ($projectstatic->public || $userWrite > 0)
{ {
$linktocreatetime = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.'&withproject=1&action=createtime'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">'.$langs->trans('AddTimeSpent').'</a>'; $linktocreatetime = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?withproject=1'.($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">'.$langs->trans('AddTimeSpent').'</a>';
} }
else else
{ {
@ -431,7 +430,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
{ {
$linktocreatetime = '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTime').'</a>'; $linktocreatetime = '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTime').'</a>';
} }
} //}
} }
} }
@ -531,14 +530,17 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
dol_fiche_end(); dol_fiche_end();
$title=$langs->trans("ListTaskTimeForTask");
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1);
print load_fiche_titre($title, $linktocreatetime, 'title_generic.png');
/* /*
* Form to add time spent on task * Form to add time spent on task
*/ */
if ($user->rights->projet->lire) if ($action == 'createtime' && $object->id > 0 && $user->rights->projet->lire)
{ {
print '<br>';
print '<!-- form to add time spent on task -->'."\n"; print '<!-- form to add time spent on task -->'."\n";
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">'; print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -597,7 +599,9 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print '</td>'; print '</td>';
print '<td align="center">'; print '<td align="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">'; print '<input type="submit" name="save" class="button" value="'.$langs->trans("Add").'">';
print ' &nbsp; ';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print '</td></tr>'; print '</td></tr>';
print '</table></form>'; print '</table></form>';
@ -682,7 +686,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$title=$langs->trans("ListTaskTimeUserProject"); $title=$langs->trans("ListTaskTimeUserProject");
$linktotasks='<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("GoToListOfTasks").'</a>'; $linktotasks='<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("GoToListOfTasks").'</a>';
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1); //print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'title_generic.png', 0, '', '', 0, 1);
print load_fiche_titre($title,$linktotasks.' &nbsp; '.$linktocreatetime,'title_generic.png'); print load_fiche_titre($title,$linktotasks.' &nbsp; '.$linktocreatetime, 'title_generic.png');
} }
$i = 0; $i = 0;