diff --git a/html/style.css b/html/style.css index 40dfc72d1..c50e297dc 100644 --- a/html/style.css +++ b/html/style.css @@ -593,7 +593,7 @@ td.num { text-align:right; } tr.priority1 { - background-color:red; + background-color: coral; } span.action a.action { border:2px outset ; diff --git a/include/ac_common.php b/include/ac_common.php index bf43dca02..c6d42e869 100644 --- a/include/ac_common.php +++ b/include/ac_common.php @@ -739,7 +739,11 @@ function format_date($p_date, $p_from_format = 'YYYY-MM-DD',$p_to_format='DD.MM. case 'YYYY-MM-DD': $str_date = $date[0] . '-' . $date[1] . '-' . $date[2]; break; - } + case 'YYYYMMDD': + $str_date = $date[0] . $date[1] . $date[2]; + break; + + } return $str_date; } diff --git a/include/class_follow_up.php b/include/class_follow_up.php index 9c12735ec..1c9102165 100644 --- a/include/class_follow_up.php +++ b/include/class_follow_up.php @@ -76,6 +76,7 @@ class Follow_Up var $ag_priority; /*!< $ag_priority is the priority 1 High, 2 medium, 3 low */ var $ag_dest; /*!< $ag_dest person who is in charged */ var $ag_contact; /*!< $ag_contact contact */ + var $ag_remind_date; /*!< $ag_contact contact */ /*! constructor * \brief constructor * \param p_cn database connection @@ -132,31 +133,19 @@ class Follow_Up $date->name="ag_timestamp"; $date->value=$this->ag_timestamp; - // for insert mode only - if ( $upd == false ) - { - // Doc Type - $doc_type=new ISelect(); - $doc_type->name="dt_id"; - $doc_type->value=$this->db->make_array("select dt_id,dt_value from document_type order by dt_value"); - $doc_type->selected=$this->dt_id; - $doc_type->readonly=false; - $str_doc_type=$doc_type->input(); - } - else - { - /*// Doc Type - $doc_type=new IHidden(); - $doc_type->name="dt_id"; - $doc_type->value=$this->dt_id; - $str_doc_type=$doc_type->input().$this->db->get_value("select dt_value from document_type where dt_id=".$this->dt_id);*/ - $doc_type=new ISelect(); - $doc_type->name="dt_id"; - $doc_type->value=$this->db->make_array("select dt_id,dt_value from document_type order by dt_value"); - $doc_type->selected=$this->dt_id; - $doc_type->readonly=false; - $str_doc_type=$doc_type->input(); - } + $remind_date=new IDate(); + $remind_date->readonly=$readonly; + $remind_date->name="ag_remind_date"; + $remind_date->value=$this->ag_remind_date; + + + // Doc Type + $doc_type=new ISelect(); + $doc_type->name="dt_id"; + $doc_type->value=$this->db->make_array("select dt_id,dt_value from document_type order by dt_value"); + $doc_type->selected=$this->dt_id; + $doc_type->readonly=false; + $str_doc_type=$doc_type->input(); // Description $desc=new ITextArea(); @@ -540,7 +529,7 @@ class Follow_Up { $sql="select ag_id, ag_comment,to_char (ag_timestamp,'DD.MM.YYYY') as ag_timestamp,". " f_id_dest,ag_title,ag_comment,ag_ref,d_id,ag_type,ag_state, ". - " ag_ref_ag_id, ag_dest, ag_hour, ag_priority, ag_cal,ag_contact ". + " ag_ref_ag_id, ag_dest, ag_hour, ag_priority, ag_cal,ag_contact,to_char (ag_remind_date,'DD.MM.YYYY') as ag_remind_date ". " from action_gestion left join document using (ag_id) where ag_id=".$this->ag_id; $r=$this->db->exec_sql($sql); $row=Database::fetch_all($r); @@ -559,6 +548,7 @@ class Follow_Up $this->ag_hour=$row[0]['ag_hour']; $this->ag_priority=$row[0]['ag_priority']; $this->ag_cal=$row[0]['ag_cal']; + $this->ag_remind_date=$row[0]['ag_remind_date']; $action_detail=new Follow_Up_Detail($this->db); $action_detail->set_parameter('ag_id',$this->ag_id); @@ -620,10 +610,21 @@ class Follow_Up $ag_cal='I'; $this->ag_ref_ag_id=(strlen(trim($this->ag_ref_ag_id))==0)?0:$this->ag_ref_ag_id; // save into the database - $sql="insert into action_gestion". + if ($this->ag_remind_date != null || $this->ag_remind_date !='') + { + $sql="insert into action_gestion". "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_comment,ag_ref,ag_ref_ag_id, ag_dest, ". - " ag_hour, ag_priority,ag_cal,ag_owner,ag_contact,ag_state) ". - " values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15)"; + " ag_hour, ag_priority,ag_cal,ag_owner,ag_contact,ag_state,ag_remind_date) ". + " values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,to_date($16,'DD.MM.YYYY'))"; + } else + { + $this->ag_remind_date=null; + $sql="insert into action_gestion". + "(ag_id,ag_timestamp,ag_type,ag_title,f_id_dest,ag_comment,ag_ref,ag_ref_ag_id, ag_dest, ". + " ag_hour, ag_priority,ag_cal,ag_owner,ag_contact,ag_state,ag_remind_date) ". + " values ($1,to_date($2,'DD.MM.YYYY'),$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16)"; + + } $this->db->exec_sql($sql,array($this->ag_id, /* 1 */ $this->ag_timestamp, /* 2 */ $this->dt_id, /* 3 */ @@ -638,7 +639,8 @@ class Follow_Up $ag_cal, /* 12 */ $_SESSION['g_user'], /* 13 */ $contact->id, /* 14 */ - $this->ag_state /* 15 */ + $this->ag_state, /* 15 */ + $this->ag_remind_date ) ); @@ -671,6 +673,7 @@ class Follow_Up $table=new Sort_Table(); $table->add('Date',$url,'order by ag_timestamp asc','order by ag_timestamp desc','da','dd'); + $table->add('Date Limite',$url,'order by ag_remind_date asc','order by ag_remind_date desc','ra','rd'); $table->add('Réf.',$url,'order by ag_ref asc','order by ag_ref desc','ra','rd'); $table->add('Expéditeur',$url,'order by name asc','order by name desc','ea','ed'); $table->add('Titre',$url,'order by ag_title asc','order by ag_title desc','ta','td'); @@ -685,7 +688,7 @@ class Follow_Up $p_filter_doc=" 1=1 "; $sql=" - select ag_id,to_char(ag_timestamp,'DD.MM.YYYY') as my_date,ag_ref_ag_id,f_id_dest". + select ag_id,to_char(ag_timestamp,'DD.MM.YYYY') as my_date,to_char(ag_remind_date,'DD.MM.YYYY') as my_remind,ag_ref_ag_id,f_id_dest". ",ag_title,dt_value,ag_ref, ag_priority,ag_state, (select ad_value from fiche_Detail where f_id=action_gestion.f_id_dest and ad_id=1) as name from action_gestion @@ -710,10 +713,11 @@ class Follow_Up $r.='