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,22 +211,42 @@ 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++;
}
}
$result=$object->update($user); if (! $error)
{
$result=$object->update($user);
if ($result < 0)
{
$error++;
setEventMessage($object->errors,'errors');
}
}
if (GETPOST("reportdate") && ($object->date_start!=$old_start_date)) if (! $error)
{ {
$result=$object->shiftTaskDate($old_start_date); if (GETPOST("reportdate") && ($object->date_start!=$old_start_date))
if (!$result) {
{ $result=$object->shiftTaskDate($old_start_date);
$error++; if ($result < 0)
$mesg='<div class="error">'.$langs->trans("ErrorShiftTaskDate").':'.$object->error.'</div>'; {
} $error++;
} $mesg='<div class="error">'.$langs->trans("ErrorShiftTaskDate").':'.$object->error.'</div>';
}
}
}
if ($error)
{
$action='edit';
} }
else else
{ {
$action='edit'; $object->societe->fetch(GETPOST('socid','int'));
} }
} }