FIX Edit of a time spent line
This commit is contained in:
parent
ade542eee7
commit
c986ab95cf
@ -215,11 +215,11 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel"] && $user->rights->projet->lire)
|
if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $user->rights->projet->lire)
|
||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (empty($_POST["new_durationhour"]) && empty($_POST["new_durationmin"]))
|
if (!GETPOST("new_durationhour") && !GETPOST("new_durationmin"))
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Duration")), null, 'errors');
|
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Duration")), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -227,9 +227,9 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$_POST["cancel
|
|||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
if ($_POST['taskid'] != $id)
|
if (GETPOST('taskid', 'int') != $id) // GETPOST('taskid') is id of new task
|
||||||
{
|
{
|
||||||
$id = $_POST['taskid'];
|
$id = GETPOST('taskid', 'int');
|
||||||
|
|
||||||
$object->fetchTimeSpent(GETPOST('lineid', 'int'));
|
$object->fetchTimeSpent(GETPOST('lineid', 'int'));
|
||||||
// TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids))
|
// TODO Check that ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids))
|
||||||
@ -1363,6 +1363,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
print '<input type="hidden" name="taskid" value="'.$id.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Task label
|
// Task label
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user