modif pour date livraison
This commit is contained in:
parent
2ab9622cf8
commit
0f7e4bb232
@ -1601,7 +1601,7 @@ class Form
|
|||||||
* - La date du jour si set_time vaut ''
|
* - La date du jour si set_time vaut ''
|
||||||
* - Aucune date (champs vides) si set_time vaut -1
|
* - Aucune date (champs vides) si set_time vaut -1
|
||||||
*/
|
*/
|
||||||
function select_date($set_time='', $prefix='re', $h = 0, $m = 0, $empty=0)
|
function select_date($set_time='', $prefix='re', $h = 0, $m = 0, $empty=0,$form_name="")
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
@ -1673,12 +1673,17 @@ class Form
|
|||||||
}
|
}
|
||||||
print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_calendar.js"></script>';
|
print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_calendar.js"></script>';
|
||||||
$timearray=getDate($set_time);
|
$timearray=getDate($set_time);
|
||||||
|
// print '<br>'.$timearray['mon'];
|
||||||
$formated_date=dolibarr_print_date($set_time,$conf->format_date_short);
|
$formated_date=dolibarr_print_date($set_time,$conf->format_date_short);
|
||||||
print '<input id="'.$prefix.'" type="text" name="'.$prefix.'" size="10" value="'.$formated_date.'"> ';
|
print '<input id="'.$prefix.'" type="text" name="'.$prefix.'" size="10" value="'.$formated_date.'"> ';
|
||||||
print '<input type="hidden" name="'.$prefix.'day" value="'.$timearray['mday'].'">'."\n";
|
print '<input type="hidden" name="'.$prefix.'day" value="'.$timearray['mday'].'">'."\n";
|
||||||
print '<input type="hidden" name="'.$prefix.'month" value="'.$timearray['mon'].'">'."\n";
|
print '<input type="hidden" name="'.$prefix.'month" value="'.$timearray['mon'].'">'."\n";
|
||||||
print '<input type="hidden" name="'.$prefix.'year" value="'.$timearray['year'].'">'."\n";
|
print '<input type="hidden" name="'.$prefix.'year" value="'.$timearray['year'].'">'."\n";
|
||||||
print '<A HREF="javascript:showCalendar(document.forms[3].'.$prefix.')">'.img_cal().'</a>';
|
if($form_name =="")
|
||||||
|
print '<A HREF="javascript:showCalendar(document.forms[3].'.$prefix.')">'.img_cal().'</a>';
|
||||||
|
else
|
||||||
|
print '<A HREF="javascript:showCalendar(document.forms[\''.$form_name.'\'].'.$prefix.')">'.img_cal().'</a>';
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Affiche date en select
|
* Affiche date en select
|
||||||
|
|||||||
@ -731,7 +731,6 @@ class Propal
|
|||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".$this->db->idate($date_fin_validite);
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".$this->db->idate($date_fin_validite);
|
||||||
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
|
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
|
||||||
|
|
||||||
if ($this->db->query($sql) )
|
if ($this->db->query($sql) )
|
||||||
{
|
{
|
||||||
$this->fin_validite = $date_fin_validite;
|
$this->fin_validite = $date_fin_validite;
|
||||||
@ -745,6 +744,32 @@ class Propal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* \brief Définit une date de livraison
|
||||||
|
* \param user Objet utilisateur qui modifie
|
||||||
|
* \param date_livraison date de livraison
|
||||||
|
* \return int <0 si ko, >0 si ok
|
||||||
|
*/
|
||||||
|
function set_date_livraison($user, $date_livraison)
|
||||||
|
{
|
||||||
|
if ($user->rights->propale->creer)
|
||||||
|
{
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET date_livraison = ".$this->db->idate($date_livraison);
|
||||||
|
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
|
||||||
|
|
||||||
|
if ($this->db->query($sql) )
|
||||||
|
{
|
||||||
|
$this->date_livraison = $date_livraison;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$this->db->error();
|
||||||
|
dolibarr_syslog("Propal::set_date_livraison Erreur SQL");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user