diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index f4bb4542843b7..ea08cfcc98d3a 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -45,7 +45,6 @@ class ActionComm extends CommonObject var $code; var $label; - var $date; var $datec; // Date creation record (datec) var $datem; // Date modification record (tms) var $author; // Object user that create action @@ -53,7 +52,6 @@ class ActionComm extends CommonObject var $datep; // Date action start (datep) var $datef; // Date action end (datep2) - var $dateend; // ?? var $durationp = -1; // -1=Unkown duration var $fulldayevent = 0; // 1=Event on full day var $punctual = 1; // Milestone @@ -123,11 +121,11 @@ function add($user,$notrigger=0) if (empty($this->punctual)) $this->punctual = 0; if (empty($this->transparency)) $this->transparency = 0; if ($this->percentage > 100) $this->percentage = 100; - if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; + //if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; if (! empty($this->datep) && ! empty($this->datef)) $this->durationp=($this->datef - $this->datep); - if (! empty($this->date) && ! empty($this->dateend)) $this->durationa=($this->dateend - $this->date); + //if (! empty($this->date) && ! empty($this->dateend)) $this->durationa=($this->dateend - $this->date); if (! empty($this->datep) && ! empty($this->datef) && $this->datep > $this->datef) $this->datef=$this->datep; - if (! empty($this->date) && ! empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date; + //if (! empty($this->date) && ! empty($this->dateend) && $this->date > $this->dateend) $this->dateend=$this->date; if (! isset($this->fk_project) || $this->fk_project < 0) $this->fk_project = 0; if ($this->elementtype=='facture') $this->elementtype='invoice'; if ($this->elementtype=='commande') $this->elementtype='order'; @@ -444,11 +442,11 @@ function update($user,$notrigger=0) if (empty($this->transparency)) $this->transparency = 0; if (empty($this->fulldayevent)) $this->fulldayevent = 0; if ($this->percentage > 100) $this->percentage = 100; - if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; + //if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep); - if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date); + //if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date); if ($this->datep && $this->datef && $this->datep > $this->datef) $this->datef=$this->datep; - if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date; + //if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date; if ($this->fk_project < 0) $this->fk_project = 0; // Check parameters @@ -460,15 +458,12 @@ function update($user,$notrigger=0) $this->db->begin(); - //print 'eeea'.$this->datep.'-'.(strval($this->datep) != '').'-'.$this->db->idate($this->datep); $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm "; $sql.= " SET percent = '".$this->percentage."'"; if ($this->fk_action > 0) $sql.= ", fk_action = '".$this->fk_action."'"; $sql.= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'":"null"); $sql.= ", datep = ".(strval($this->datep)!='' ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql.= ", datep2 = ".(strval($this->datef)!='' ? "'".$this->db->idate($this->datef)."'" : 'null'); - //$sql.= ", datea = ".(strval($this->date)!='' ? "'".$this->db->idate($this->date)."'" : 'null'); - //$sql.= ", datea2 = ".(strval($this->dateend)!='' ? "'".$this->db->idate($this->dateend)."'" : 'null'); $sql.= ", note = ".($this->note ? "'".$this->db->escape($this->note)."'":"null"); $sql.= ", fk_soc =". ($this->societe->id > 0 ? "'".$this->societe->id."'":"null"); $sql.= ", fk_project =". ($this->fk_project > 0 ? "'".$this->fk_project."'":"null"); diff --git a/htdocs/install/mysql/tables/llx_actioncomm.sql b/htdocs/install/mysql/tables/llx_actioncomm.sql index 59b31bcc3897d..275abc533702b 100644 --- a/htdocs/install/mysql/tables/llx_actioncomm.sql +++ b/htdocs/install/mysql/tables/llx_actioncomm.sql @@ -25,9 +25,9 @@ create table llx_actioncomm id integer AUTO_INCREMENT PRIMARY KEY, ref_ext varchar(128), entity integer DEFAULT 1 NOT NULL, -- multi company id - datep datetime, -- date debut planifiee - datep2 datetime, -- deprecated - datea datetime, -- date debut realisation + datep datetime, -- date start + datep2 datetime, -- date end + datea datetime, -- deprecated datea2 datetime, -- deprecated fk_action integer, -- type of action (optionnal link with llx_c_actioncomm or null)