noalyss Version-9
follow_up_filter.class.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright Author Dany De Bontridder danydb@noalyss.eu
21
23{
24 protected $name;
25 protected $json_content;
26
28 {
29 $this->name=$name;
30 $this->json_content=$json_content;
31 }
32
33 /**
34 * @return mixed
35 */
36 public function getName():string
37 {
38 return $this->name;
39 }
40
41 /**
42 * @param mixed $name
43 */
44 public function setName($name): Follow_Up_Filter
45 {
46 $this->name = $name;
47 return $this;
48 }
49
50 /**
51 * @return mixed
52 */
53 public function getaContent():array
54 {
56 }
57
58 /**
59 * @param mixed $json_content
60 */
62 {
63 $this->json_content = $json_content;
64 return $this;
65 }
66
67 public function save() {
68 global $cn,$g_user;
69 $this->name=trim($this->name);
70
71 $exist=$cn->get_value("select count(*) from action_gestion_filter where af_user=$1 and
72 af_name=$2" , [$g_user->getLogin(),$this->name]);
73 if ( $exist == 0 ) {
74 $cn->exec_sql("insert into action_gestion_filter(af_user,af_name,af_search) values ($1,$2,$3)",
75 [$g_user->getLogin(),$this->name,$this->json_content]);
76 } else {
77 $cn->exec_sql("update action_gestion_filter set af_search=$3 where
78 af_user=$1 and
79 af_name=$2" ,
80 [$g_user->getLogin(),$this->name,$this->json_content]);
81 }
82
83 }
84
85 /**
86 * @brief display the list of recorded search
87 * @param $login string Login of the user
88 * @return void
89 */
90 public static function display_list($login):void
91 {
92
93 require NOALYSS_TEMPLATE."/follow_up_filter-display_list.php";
94 }
95}
global $g_user
if no group available , then stop
$from_poste name
__construct($name, $json_content)
static display_list($login)
display the list of recorded search
setaContent($json_content)