diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index f72620ce790ce465866a51cabb0e8f5c25f5f51a..f02565209c3514e6aff0e561ed51aa36b2b13792 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -252,6 +252,7 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid') /** * Output a task line + * * @param $inc * @param $parent * @param $lines @@ -287,7 +288,7 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $ $lastprojectid=$lines[$i]->fk_project; } - print "<tr $bc[$var]>\n"; + print "<tr ".$bc[$var].">\n"; // Project print "<td>"; @@ -366,6 +367,7 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $ /** * Show task lines with a particular parent + * * @param $inc Counter that count number of lines legitimate to show (for return) * @param $parent Id of parent task to start * @param $lines Array of all tasks @@ -512,6 +514,7 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole if ($total>0) { print '<tr class="liste_total"><td class="liste_total">'.$langs->trans("Total").'</td>'; + if ($showproject) print '<td></td>'; print '<td></td>'; print '<td></td>'; print '<td align="right" nowrap="nowrap" class="liste_total">'.ConvertSecondToTime($total).'</td></tr>'; diff --git a/htdocs/projet/activity/list.php b/htdocs/projet/activity/list.php index 1a15568dc9093bba71096c882503196dab0f4275..5968ee6d6ca56cdf4866ee8a1f86b17481c37def 100644 --- a/htdocs/projet/activity/list.php +++ b/htdocs/projet/activity/list.php @@ -32,7 +32,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); $langs->load('projects'); -$mode=$_REQUEST["mode"]; +$mode=GETPOST("mode"); $mine=0; if ($mode == 'mine') $mine=1; @@ -45,6 +45,7 @@ $socid=0; if ($user->societe_id > 0) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); + /* * Actions */ @@ -80,6 +81,10 @@ if ($_POST["action"] == 'addtime' && $user->rights->projet->creer) $task->timespent_fk_user = $user->id; $task->timespent_date = dol_mktime(12,0,0,$_POST["{$id}month"],$_POST["{$id}day"],$_POST["{$id}year"]); $task->addTimeSpent($user); + + // header to avoid submit twice on back + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$projectid); + exit; } else { @@ -121,7 +126,8 @@ $tasksrole=$taskstatic->getUserRolesForProjectsOrTasks(0,$user,($project->id?$pr print_barre_liste($title, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num); -if ($mesg) print $mesg; + +dol_htmloutput_mesg($mesg); print '<form name="addtime" method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$project->id.'">'; @@ -143,7 +149,7 @@ print '</form>'; print "</table>"; print '</div>'; -$db->close(); - llxFooter(); + +$db->close(); ?>