Fix: Deleting task do not return to correct page

This commit is contained in:
Laurent Destailleur 2015-03-14 11:56:28 +01:00
parent 0ef2369399
commit 605a7dee0e

View File

@ -110,17 +110,14 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->supprimer) if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->supprimer)
{ {
if ($object->fetch($id,$ref) >= 0 ) if ($object->fetch($id,$ref) >= 0)
{ {
$result=$projectstatic->fetch($object->fk_projet); $result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
{
$projectstatic->societe->fetch($projectstatic->socid);
}
if ($object->delete($user) > 0) if ($object->delete($user) > 0)
{ {
header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id); header('Location: '.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject?'&withproject=1':''));
exit; exit;
} }
else else