Skip to content

Commit

Permalink
NEW Can enter time spent from the list of time spent of project
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 26, 2018
1 parent 46f70eb commit 46c2f09
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions htdocs/langs/en_US/projects.lang
Expand Up @@ -91,6 +91,7 @@ ListDonationsAssociatedProject=List of donations associated with the project
ListVariousPaymentsAssociatedProject=List of miscellaneous payments associated with the project
ListActionsAssociatedProject=List of events associated with the project
ListTaskTimeUserProject=List of time consumed on tasks of project
ListTaskTimeForTask=List of time consumed on task
ActivityOnProjectToday=Activity on project today
ActivityOnProjectYesterday=Activity on project yesterday
ActivityOnProjectThisWeek=Activity on project this week
Expand Down
26 changes: 15 additions & 11 deletions htdocs/projet/tasks/time.php
Expand Up @@ -410,17 +410,16 @@

dol_fiche_end();


print '<br>';

// 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 ($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
{
Expand All @@ -431,7 +430,7 @@
{
$linktocreatetime = '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTime').'</a>';
}
}
//}
}
}

Expand Down Expand Up @@ -531,14 +530,17 @@
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
*/

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 method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
Expand Down Expand Up @@ -597,7 +599,9 @@
print '</td>';

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 '</table></form>';
Expand Down Expand Up @@ -682,7 +686,7 @@
$title=$langs->trans("ListTaskTimeUserProject");
$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 load_fiche_titre($title,$linktotasks.' &nbsp; '.$linktocreatetime,'title_generic.png');
print load_fiche_titre($title,$linktotasks.' &nbsp; '.$linktocreatetime, 'title_generic.png');
}

$i = 0;
Expand Down

0 comments on commit 46c2f09

Please sign in to comment.