Fix: [ bug #1077 ] Project card does not update vinculated third when

modified upon refresh
This commit is contained in:
Laurent Destailleur 2013-10-23 18:26:18 +02:00
parent 8203971614
commit d5d252dada

View File

@ -211,23 +211,43 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if ($ret < 0)
{
$error++;
}
}
if (! $error)
{
$result=$object->update($user); $result=$object->update($user);
if ($result < 0)
{
$error++;
setEventMessage($object->errors,'errors');
}
}
if (! $error)
{
if (GETPOST("reportdate") && ($object->date_start!=$old_start_date)) if (GETPOST("reportdate") && ($object->date_start!=$old_start_date))
{ {
$result=$object->shiftTaskDate($old_start_date); $result=$object->shiftTaskDate($old_start_date);
if (!$result) if ($result < 0)
{ {
$error++; $error++;
$mesg='<div class="error">'.$langs->trans("ErrorShiftTaskDate").':'.$object->error.'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorShiftTaskDate").':'.$object->error.'</div>';
} }
} }
} }
else
if ($error)
{ {
$action='edit'; $action='edit';
} }
else
{
$object->societe->fetch(GETPOST('socid','int'));
}
} }
// Build doc // Build doc