diff --git a/include/class/follow_up.class.php b/include/class/follow_up.class.php
index 380743a15..e674ee1f1 100644
--- a/include/class/follow_up.class.php
+++ b/include/class/follow_up.class.php
@@ -663,7 +663,8 @@ class Follow_Up
ag_title,dt_value,ag_ref, ag_priority,ag_state,
coalesce((select p_name from profile where p_id=ag_dest),'Aucun groupe') as dest,
(select ad_value from fiche_Detail where f_id=ag.f_id_dest and ad_id=1) as name,
- array_to_string((select array_agg(t1.t_tag) from action_tags as a1 join tags as t1 on (a1.t_id=t1.t_id) where a1.ag_id=ag.ag_id ),',') as tags
+ array_to_string((select array_agg(t1.t_tag) from action_tags as a1 join tags as t1 on (a1.t_id=t1.t_id) where a1.ag_id=ag.ag_id ),',') as tags,
+ array_to_string((select array_agg(t1.t_color) from action_tags as a1 join tags as t1 on (a1.t_id=t1.t_id) where a1.ag_id=ag.ag_id ),',') as tags_color
from action_gestion as ag
join document_type on (ag_type=dt_id)
join document_state on (ag_state=s_id)
@@ -769,7 +770,19 @@ class Follow_Up
$r.='| '.$href.
h($row['ag_title'])." | ";
$r.="".$row['s_value']." | ";
- $r.="".$href."".h($row['tags']).''.''." | ";
+ $r.="";
+ if ($row['tags']!=""){
+ $r.=$href;
+ $aColor=explode(",", $row["tags_color"]);
+ $aTags=explode(",", $row["tags"]);
+ $nb_tag=count($aTags);
+ for ( $x=0;$x<$nb_tag;$x++) {
+ $r.=sprintf('%s',$aColor[$x],$aTags[$x]);
+ $r.=" ";
+ } // end loop $x
+ $r.='';
+ }
+ $r.=" | ";
$r.="".$href.h($row['dest']).''." | ";
@@ -1488,7 +1501,7 @@ class Follow_Up
{
if ($this->ag_id==0)
return;
- $sql='select b.ag_id,b.t_id,b.at_id,a.t_tag'
+ $sql='select b.ag_id,b.t_id,b.at_id,a.t_tag,a.t_color'
.' from '
.' tags as a join action_tags as b on (a.t_id=b.t_id)'
.' where ag_id=$1 '
@@ -1537,7 +1550,7 @@ class Follow_Up
$c=count($a_tag);
for ($e=0; $e<$c; $e++)
{
- echo '';
+ echo '';
echo $a_tag[$e]['t_tag'];
if ($g_user->can_write_action($this->ag_id)==true && $p_view != 'READ')
{
diff --git a/include/class/tag.class.php b/include/class/tag.class.php
index 2f3b0a1c0..aacd77728 100644
--- a/include/class/tag.class.php
+++ b/include/class/tag.class.php
@@ -21,12 +21,24 @@ require_once NOALYSS_INCLUDE.'/database/tag_sql.class.php';
class Tag
{
+ private $data; //cn=$p_cn;
$this->data=new Tag_SQL($p_cn,$id);
}
- /**
+ public function get_data()
+ {
+ return $this->data;
+ }
+
+ public function set_data($data)
+ {
+ $this->data=$data;
+ return $this;
+ }
+
+ /**
* Show the list of available tag
* @return HTML
*/
@@ -42,11 +54,11 @@ class Tag
function select()
{
$ret=$this->data->seek("where t_actif='Y' order by t_tag");
- $ret=$this->cn->exec_sql(" select t_id,t_tag,t_description,'t' as tag_type
+ $ret=$this->cn->exec_sql(" select t_id,t_tag,t_description,'t' as tag_type ,t_color
from tags
where t_actif='Y'
union all
- select tg_id,tg_name ,'G','g' from tag_group order by 2");
+ select tg_id,tg_name ,'G','g' ,1 from tag_group order by 2");
require_once NOALYSS_TEMPLATE.'/tag_select.php';
}
/**
@@ -73,6 +85,7 @@ class Tag
$this->data->t_tag= strip_tags($p_array['t_tag']);
$this->data->t_description=strip_tags($p_array['t_description']);
$this->data->t_actif=$p_array['t_actif'];
+ $this->data->t_color=$p_array['tagcell_color'];
$this->data->save();
}
function remove($p_array)
diff --git a/include/database/tag_sql.class.php b/include/database/tag_sql.class.php
index 13698f156..9876b9c47 100644
--- a/include/database/tag_sql.class.php
+++ b/include/database/tag_sql.class.php
@@ -37,12 +37,14 @@ class Tag_SQL extends Noalyss_SQL
, "t_tag" => "t_tag"
, "t_description" => "t_description"
,'t_actif'=>'t_actif'
+ ,'t_color'=>'t_color'
);
$this->type = array(
"t_id" => "numeric"
, "t_tag" => "text"
, "t_description" => "text"
,'t_actif'=>"text"
+ ,'t_color'=>"numeric"
);
$this->default = array(
"t_id" => "auto",
diff --git a/include/template/tag_detail.php b/include/template/tag_detail.php
index d2be03ef5..a2a9847ac 100644
--- a/include/template/tag_detail.php
+++ b/include/template/tag_detail.php
@@ -16,6 +16,8 @@ $t_actif->value=[
['label'=>_('Non actif'),'value'=>'N']
];
$t_actif->selected=$data->t_actif;
+$icheckbox=new ICheckBox("tagcell_color");
+$icheckbox->javascript='onclick="uncheck_other(this,\'tagcell_color\');"';
?>
: input(); ?>
@@ -24,7 +26,29 @@ $t_actif->selected=$data->t_actif;
: input(); ?>
- =_("Etiquette(tag) actif") ?>=$t_actif->input()?>
+ =_("Couleur")?>
+
+t_id == '-1') $data->t_color=1;
+$nb_color=20;
+
+for ($i=1 ; $i != $nb_color+1 ; $i++ ) {
+?>
+ ">
+ =_("Exemple").$i ?>
+ value=$i;
+ if ( $data->t_color==$i) { $icheckbox->set_check($i);} else {$icheckbox->selected=false;}
+ echo $icheckbox->input();
+ ?>
+
+ ';?>
+
+
+
+ =_("Etiquette actif") ?>=$t_actif->input()?>
request('ac');
$row=Database::fetch_array($ret, $i);
?>
- |
+ |
|
- |
+ |
|