Fix: missing status after set draft

This commit is contained in:
Regis Houssin 2012-03-16 17:37:18 +01:00
parent 5de859d14b
commit ccf1665837
2 changed files with 11 additions and 10 deletions

View File

@ -843,7 +843,7 @@ else if ($action == "addline" && $user->rights->propale->creer)
} }
// Mise a jour d'une ligne dans la propale // Mise a jour d'une ligne dans la propale
if ($action == 'updateligne' && $user->rights->propale->creer && $_POST["save"] == $langs->trans("Save")) else if ($action == 'updateligne' && $user->rights->propale->creer && $_POST["save"] == $langs->trans("Save"))
{ {
if (! $object->fetch($_POST["id"]) > 0) if (! $object->fetch($_POST["id"]) > 0)
{ {
@ -950,28 +950,28 @@ else if ($action == 'builddoc' && $user->rights->propale->creer)
} }
// Set project // Set project
else if ($action == 'classin') else if ($action == 'classin' && $user->rights->propale->creer)
{ {
$object->fetch($id); $object->fetch($id);
$object->setProject($_POST['projectid']); $object->setProject($_POST['projectid']);
} }
// Delai de livraison // Delai de livraison
else if ($action == 'setavailability') else if ($action == 'setavailability' && $user->rights->propale->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->availability($_POST['availability_id']); $result = $object->availability($_POST['availability_id']);
} }
// Origine de la propale // Origine de la propale
else if ($action == 'setdemandreason') else if ($action == 'setdemandreason' && $user->rights->propale->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->demand_reason($_POST['demand_reason_id']); $result = $object->demand_reason($_POST['demand_reason_id']);
} }
// Conditions de reglement // Conditions de reglement
else if ($action == 'setconditions') else if ($action == 'setconditions' && $user->rights->propale->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id','int')); $result = $object->setPaymentTerms(GETPOST('cond_reglement_id','int'));
@ -990,7 +990,7 @@ else if ($action == 'setremiseabsolue' && $user->rights->propale->creer)
} }
// Mode de reglement // Mode de reglement
else if ($action == 'setmode') else if ($action == 'setmode' && $user->rights->propale->creer)
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
@ -1090,25 +1090,25 @@ if ($id > 0 || ! empty($ref))
} }
// Confirm delete // Confirm delete
if ($action == 'delete') else if ($action == 'delete')
{ {
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp',$object->ref), 'confirm_delete','',0,1); $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp',$object->ref), 'confirm_delete','',0,1);
} }
// Confirm reopen // Confirm reopen
if ($action == 'reopen') else if ($action == 'reopen')
{ {
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp',$object->ref), 'confirm_reopen','',0,1); $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp',$object->ref), 'confirm_reopen','',0,1);
} }
// Confirmation delete product/service line // Confirmation delete product/service line
if ($action == 'ask_deleteline') else if ($action == 'ask_deleteline')
{ {
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1); $formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline','',0,1);
} }
// Confirm validate proposal // Confirm validate proposal
if ($action == 'validate') else if ($action == 'validate')
{ {
$error=0; $error=0;

View File

@ -1575,6 +1575,7 @@ class Propal extends CommonObject
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$this->statut = 0;
return 1; return 1;
} }
else else