set_echeance no in set_date
This commit is contained in:
parent
14e7ec8cf4
commit
5a4d5d7f97
@ -315,10 +315,11 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (isset($object->duree_validite) && !empty($object->fin_validite)) {
|
||||
$object->fin_validite = $datep + ($object->duree_validite * 24 * 3600);
|
||||
}
|
||||
$result = $object->set_date($user, $datep);
|
||||
if ($result > 0 && !empty($object->duree_validite) && !empty($object->fin_validite)) {
|
||||
$datev = $datep + ($object->duree_validite * 24 * 3600);
|
||||
$result = $object->set_echeance($user, $datev, 1);
|
||||
}
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $object->error);
|
||||
} elseif (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
@ -2301,13 +2302,16 @@ if ($action == 'create') {
|
||||
// Date of proposal
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DatePropal');
|
||||
print '</td>';
|
||||
if ($action != 'editdate' && $usercancreate && $caneditfield) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
// print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
// print $langs->trans('DatePropal');
|
||||
// print '</td>';
|
||||
// if ($action != 'editdate' && $usercancreate && $caneditfield) {
|
||||
// print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
// }
|
||||
|
||||
// print '</tr></table>';
|
||||
$editenable = $usercancreate && $caneditfield && $object->statut == Propal::STATUS_DRAFT;
|
||||
print $form->editfieldkey("DatePropal", 'date', '', $object, $editenable);
|
||||
print '</td><td class="valuefield">';
|
||||
if ($action == 'editdate' && $usercancreate && $caneditfield) {
|
||||
print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
|
||||
@ -384,7 +384,7 @@ class Propal extends CommonObject
|
||||
$this->socid = $socid;
|
||||
$this->id = $propalid;
|
||||
|
||||
$this->duree_validite = ((int) $conf->global->PROPALE_VALIDITY_DURATION);
|
||||
$this->duree_validite = isset($conf->global->PROPALE_VALIDITY_DURATION)?((int) $conf->global->PROPALE_VALIDITY_DURATION):0;
|
||||
}
|
||||
|
||||
|
||||
@ -2066,7 +2066,7 @@ class Propal extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."',fin_validite = '".$this->db->idate($this->fin_validite)."'";
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'";
|
||||
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user