From c135d96c830d21a5bd77b68f3530bc4ee2a62e0c Mon Sep 17 00:00:00 2001
From: Dany De Bontridder
Date: Sun, 27 May 2012 22:39:17 +0000
Subject: [PATCH] #179: Commentaire sur les suivi
---
include/action.common.inc.php | 2 +-
include/class_follow_up.php | 93 ++++++++++++++++--------------
include/template/detail-action.php | 7 ++-
sql/upgrade.sql | 20 +++++++
4 files changed, 76 insertions(+), 46 deletions(-)
diff --git a/include/action.common.inc.php b/include/action.common.inc.php
index b172dd397..07974f675 100644
--- a/include/action.common.inc.php
+++ b/include/action.common.inc.php
@@ -142,7 +142,7 @@ if ( $sub_action=='detail' )
$act->ag_id=$ag_id;
$act->suppress=1;
echo $act->get();
- $act->ag_comment=Decode($act->ag_comment);
+// $act->ag_comment=Decode($act->ag_comment);
echo '
=_('Commentaire')?>
- input();
+ n°'.$acomment[$c]['agc_id']." ".h($acomment[$c]['agc_comment']).'('.h($acomment[$c]['tech_user'])." ".smaller_date($acomment[$c]['str_agc_date']).')';
+}
+echo $desc->input();
$style_enl='style="display:inline"';$style_small='style="display:none"';
-if (strlen($desc->value)>300) {$style_enl='style="display:none"';$style_small='style="display:inline"';}
?>
value="+" onclick="enlarge('ag_comment');return false;">
value="-" style="display:none" onclick="small('ag_comment');return false;">
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index c57a0fb3c..5dc6c709e 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -67,4 +67,24 @@ ALTER TABLE action_gestion
REFERENCES profile (p_id) MATCH SIMPLE
ON UPDATE SET NULL ON DELETE SET NULL;
+CREATE TABLE action_gestion_comment
+(
+ agc_id bigserial NOT NULL, -- PK
+ ag_id bigint, -- FK to action_gestion
+ agc_date timestamp with time zone,
+ agc_comment text, -- comment
+ tech_user text, -- user_login
+ CONSTRAINT action_gestion_comment_pkey PRIMARY KEY (agc_id ),
+ CONSTRAINT action_gestion_comment_ag_id_fkey FOREIGN KEY (ag_id)
+ REFERENCES action_gestion (ag_id) MATCH SIMPLE
+ ON UPDATE CASCADE ON DELETE CASCADE
+);
+ALTER TABLE action_gestion_comment ALTER COLUMN agc_date SET DEFAULT now();
+COMMENT ON COLUMN action_gestion_comment.agc_id IS 'PK';
+COMMENT ON COLUMN action_gestion_comment.ag_id IS 'FK to action_gestion';
+COMMENT ON COLUMN action_gestion_comment.agc_comment IS 'comment';
+COMMENT ON COLUMN action_gestion_comment.tech_user IS 'user_login';
+
+insert into action_gestion_comment (ag_id,agc_date,agc_comment,tech_user) select ag_id,ag_timestamp,ag_comment,ag_owner from action_gestion;
+ALTER TABLE action_gestion drop COLUMN ag_comment;