Fix: Pb in date management
This commit is contained in:
parent
9c548f99e9
commit
6e60069403
@ -225,7 +225,7 @@ foreach($property as $key => $prop)
|
||||
$varprop.="\t\t\$sql.= \" ";
|
||||
if ($prop['istime'])
|
||||
{
|
||||
$varprop.='".(! isset($this->'.$prop['field'].') || $this->'.$prop['field'].'==\'\'?\'NULL\':$this->db->idate(';
|
||||
$varprop.='".(! isset($this->'.$prop['field'].') || strval($this->'.$prop['field'].')==\'\'?\'NULL\':$this->db->idate(';
|
||||
$varprop.="\$this->".$prop['field']."";
|
||||
$varprop.='))."';
|
||||
if ($i < sizeof($property)) $varprop.=",";
|
||||
@ -256,15 +256,24 @@ foreach($property as $key => $prop)
|
||||
{
|
||||
$varprop.="\t\t\$sql.= \" ";
|
||||
$varprop.=$prop['field'].'=';
|
||||
if ($prop['istime']) $varprop.='".$this->db->idate(';
|
||||
else $varprop.="'\".";
|
||||
if ($prop['istime']) $varprop.="\$this->".$prop['field'];
|
||||
else if ($prop['ischar']) $varprop.="addslashes(\$this->".$prop['field'].")";
|
||||
else $varprop.="\$this->".$prop['field'];
|
||||
if ($prop['istime']) $varprop.=')."';
|
||||
else $varprop.=".\"'";
|
||||
if ($i < sizeof($property)) $varprop.=",";
|
||||
$varprop.="\";";
|
||||
if ($prop['istime'])
|
||||
{
|
||||
// (strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null')
|
||||
$varprop.='".(strval($this->'.$prop['field'].')!=\'\' ? "\'".$this->db->idate(';
|
||||
$varprop.='$this->'.$prop['field'];
|
||||
$varprop.=')."\'" : \'null\').';
|
||||
$varprop.='"';
|
||||
}
|
||||
else
|
||||
{
|
||||
$varprop.="'\".";
|
||||
if ($prop['ischar']) $varprop.="addslashes(\$this->".$prop['field'].")";
|
||||
else $varprop.="\$this->".$prop['field'];
|
||||
$varprop.=".\"'";
|
||||
}
|
||||
|
||||
if ($i < sizeof($property)) $varprop.=',';
|
||||
$varprop.='";';
|
||||
$varprop.="\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,10 +151,10 @@ class ActionComm
|
||||
$sql.= "fk_facture,propalrowid,fk_commande)";
|
||||
$sql.= " VALUES (";
|
||||
$sql.= "'".$this->db->idate($now)."',";
|
||||
$sql.= ($this->datep!=''?"'".$this->db->idate($this->datep)."'":"null").",";
|
||||
$sql.= ($this->datef!=''?"'".$this->db->idate($this->datef)."'":"null").",";
|
||||
$sql.= ($this->date!=''?"'".$this->db->idate($this->date)."'":"null").",";
|
||||
$sql.= ($this->dateend!=''?"'".$this->db->idate($this->dateend)."'":"null").",";
|
||||
$sql.= (strval($this->datep)!=''?"'".$this->db->idate($this->datep)."'":"null").",";
|
||||
$sql.= (strval($this->datef)!=''?"'".$this->db->idate($this->datef)."'":"null").",";
|
||||
$sql.= (strval($this->date)!=''?"'".$this->db->idate($this->date)."'":"null").",";
|
||||
$sql.= (strval($this->dateend)!=''?"'".$this->db->idate($this->dateend)."'":"null").",";
|
||||
$sql.= ($this->durationp >= 0 && $this->durationp != ''?"'".$this->durationp."'":"null").",";
|
||||
$sql.= ($this->durationa >= 0 && $this->durationa != ''?"'".$this->durationa."'":"null").",";
|
||||
$sql.= "'".$this->type_id."', '".$this->societe->id."' ,'".addslashes($this->note)."',";
|
||||
|
||||
@ -109,11 +109,6 @@ if ($_POST["action"] == 'add_action')
|
||||
$_POST["a2month"],
|
||||
$_POST["a2day"],
|
||||
$_POST["a2year"]);
|
||||
// Si param incorrects, mktime renvoi false en PHP 5.1, -1 avant
|
||||
if (! ($datep > 0)) $datep='';
|
||||
if (! ($datep2 > 0)) $datep2='';
|
||||
if (! ($datea > 0)) $datea='';
|
||||
if (! ($datea2 > 0)) $datea2='';
|
||||
|
||||
// Initialisation objet cactioncomm
|
||||
if (! $_POST["actioncode"])
|
||||
@ -151,11 +146,11 @@ if ($_POST["action"] == 'add_action')
|
||||
//$actioncomm->date = $datea;
|
||||
$actioncomm->datef = $datep2;
|
||||
//$actioncomm->dateend = $datea2;
|
||||
if ($_POST["percentage"] < 100 && ! $actioncomm->datep) $actioncomm->datep=$actioncomm->date;
|
||||
//if ($_POST["percentage"] < 100 && strval($actioncomm->datep) != '') $actioncomm->datep=$actioncomm->date;
|
||||
if ($actioncomm->type_code == 'AC_RDV')
|
||||
{
|
||||
// RDV
|
||||
if ($actioncomm->date)
|
||||
if ($actioncomm->datef)
|
||||
{
|
||||
$actioncomm->percentage = 100;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user