noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 92/119: Follow-Up create doc new Tags COMMENT


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 92/119: Follow-Up create doc new Tags COMMENTS
Date: Mon, 26 Oct 2020 18:27:33 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 1e574aac74b763a6434a8728e6bdb25d2c830dba
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Mon Oct 12 18:38:38 2020 +0200

    Follow-Up create doc new Tags COMMENTS
---
 include/class/document.class.php | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/include/class/document.class.php b/include/class/document.class.php
index 2752d88..dc029f8 100644
--- a/include/class/document.class.php
+++ b/include/class/document.class.php
@@ -548,7 +548,6 @@ class Document
         $p_tag=strtoupper($p_tag);
         $p_tag=str_replace('=','',$p_tag);
         $r="Tag inconnu";
-
         switch ($p_tag)
         {
                case 'DATE':
@@ -1168,10 +1167,13 @@ class Document
                 if ( ! isset ($p_array['repo'])) return "";
                 $ret=$this->db->get_value('select r_phone from 
public.stock_repository where r_id=$1',array($p_array['repo']));
                 return $ret;
+        // Follow up
+        //Title
         case 'TITLE':
             if ( isset($p_array['ag_title']))                 return 
$p_array['ag_title'];
             return "";
             break;
+        // Description
         case 'DESCRIPTION':
             if ( isset($p_array['ag_id'])) {
                 // retrieve first comment
@@ -1183,17 +1185,39 @@ class Document
             }
             return "";
             break;
+        // Comment
         case 'COMMENT':
             if ( isset($p_array['ag_id'])) {
                 // retrieve first comment
-                $aComment=$this->db->get_array("select agc_comment "
+                $description=$this->db->get_array("select agc_comment ,"
+                        . " to_char(agc_date,'DD-MM-YY HH24:MI') as str_date ,"
+                        . " tech_user "
+                        . "  from action_gestion_comment "
+                        . "where ag_id=$1 order by 1 asc limit 2"
+                        ,[$p_array['ag_id']]);
+                if ( count($description) == 2 ) {
+                    return $description[1]['agc_comment'];
+                }
+            }
+            return "";
+            break;
+        // Comments
+        case 'COMMENTS':
+            if ( isset($p_array['ag_id'])) {
+                // retrieve first comment
+                $aComment=$this->db->get_array("select agc_comment ,"
+                        ." to_char(agc_date,'DD-MM-YY HH24:MI') as str_date ,"
+                        . " tech_user "
                         . "  from action_gestion_comment "
                         . "where ag_id=$1 order by 1"
                         ,[$p_array['ag_id']]);
                 $nb_comment=count($aComment);
                 $description="";
                 for ($i=0;$i< $nb_comment;$i++) {
-                    $description.=$aComment[$i]['agc_comment']."\n";
+                    $description.= sprintf(_('le %s , %s écrit %s'."\n"),
+                            $aComment[$i]['str_date'],
+                            $aComment[$i]['tech_user'],
+                            $aComment[$i]['agc_comment']);
                 }
                 return $description;
             }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]