diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 229303849f0..f7d8f1731d6 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2064,12 +2064,12 @@ if ($action == 'create') { print ''; - if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editdate') { print ''; } print '
'; print $langs->trans('Date'); print 'id.'">'.img_edit($langs->trans('SetDate'), 1).'
'; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) { + if ($action == 'editdate' && $usercancreate) { print '
'; print ''; print ''; @@ -2091,12 +2091,12 @@ if ($action == 'create') { print ''; - if ($action != 'editecheance' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editecheance' && $usercancreate) { print ''; } print '
'; print $langs->trans('DateEndPropal'); print 'id.'">'.img_edit($langs->trans('SetConditions'), 1).'
'; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) { + if ($action == 'editecheance' && $usercancreate) { print ''; print ''; print ''; @@ -2121,12 +2121,12 @@ if ($action == 'create') { print ''; - if ($action != 'editconditions' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editconditions' && $usercancreate) { print ''; } print '
'; print $langs->trans('PaymentConditionsShort'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'
'; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editconditions' && $usercancreate) { + if ($action == 'editconditions' && $usercancreate) { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); } else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); @@ -2140,12 +2140,12 @@ if ($action == 'create') { print ''; - if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editmode' && $usercancreate) { print ''; } print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'
'; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmode' && $usercancreate) { + if ($action == 'editmode' && $usercancreate) { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); } else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none'); @@ -2169,12 +2169,12 @@ if ($action == 'create') { print ' ('.$langs->trans('AfterOrder').')'; } print ''; - if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editavailability' && $usercancreate) { print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).''; } print ''; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editavailability' && $usercancreate) { + if ($action == 'editavailability' && $usercancreate) { $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1); } else { $form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1); @@ -2226,12 +2226,12 @@ if ($action == 'create') { print ''; - if ($action != 'editdemandreason' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) { + if ($action != 'editdemandreason' && $usercancreate) { print ''; } print '
'; print $langs->trans('Source'); print 'id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).'
'; print ''; - if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdemandreason' && $usercancreate) { + if ($action == 'editdemandreason' && $usercancreate) { $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1); } else { $form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none'); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index c544f5f7fe9..500f7b14380 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1974,7 +1974,7 @@ class Propal extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'"; - $sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; + $sql .= " WHERE rowid = ".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); @@ -2030,7 +2030,7 @@ class Propal extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_fin_validite != '' ? "'".$this->db->idate($date_fin_validite)."'" : 'null'); - $sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT; + $sql .= " WHERE rowid = ".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql);