37 require_once NOALYSS_INCLUDE.
'/lib/class_database.php';
38 require_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
39 require_once NOALYSS_INCLUDE.
'/class/class_user.php';
46 "desc"=>
"dos_description",
47 "max_email"=>
'dos_email');
80 $l_sql=
"select *, 'W' as priv_priv "
84 .
"or dos_description ~* $2 "
85 .
"ORDER BY dos_name $str_limit ";
86 $a_row=
$cn->get_array($l_sql, $p_text);
91 $l_sql=
"select * from jnt_use_dos
92 natural join ac_dossier
96 and ( dos_name ~* $2 or dos_description ~* $2)
102 $a_row=
$cn->get_array($l_sql, array($p_login, $p_text));
107 $l_sql=
' select * from ac_dossier where dos_id not in
108 (select dos_id from jnt_use_dos where use_id=$1)
109 and ( dos_name ~* $2 or dos_description ~* $2)
110 order by dos_name '.$str_limit;
111 $a_row=
$cn->get_array($l_sql, array($p_login, $p_text));
116 throw new Exception(_(
"Erreur paramètre"));
126 $nb_folder=$this->
cn->get_value(
'select count(*) from ac_dossier');
150 (select array_to_string(array_agg(dos_name),',') as ag_dossier,
151 jt.use_id as jt_use_id
152 from ac_dossier as ds
153 join jnt_use_dos as jt on (jt.dos_id=ds.dos_id)
154 group by jt.use_id) as dossier_name on (jt_use_id=ac.use_id)
160 $res=$this->
cn->get_array(
$sql,array(NOALYSS_ADMINISTRATOR));
171 exit(
'Dossier invalide ');
174 if (is_numeric(
$id)==0||
177 exit(
'gDossier Invalide : '.
$id);
184 static function get()
187 return "gDossier=".$_REQUEST[
'gDossier'];
195 return '<input type="hidden" id="gDossier" name="gDossier" value="'.$_REQUEST[
'gDossier'].
'">';
206 $name=
$cn->get_value(
"select dos_name from ac_dossier where dos_id=$1",
213 if (array_key_exists($p_string, self::$variable))
215 $idx=self::$variable[$p_string];
219 throw new Exception(
"Attribut inexistant $p_string");
224 if (array_key_exists($p_string, self::$variable))
226 $idx=self::$variable[$p_string];
227 $this->
$idx=$p_value;
230 throw new Exception(
"Attribut inexistant $p_string");
235 return var_export(self::$variable,
true);
245 if (strlen(
trim($this->dos_name))==0)
248 if ($this->
cn->get_value(
"select count(*) from ac_dossier "
249 .
" where dos_name=$1 and dos_id<>$2",
250 array($this->dos_name, $this->dos_id))!=0)
253 $sql=
"update ac_dossier set dos_name=$1,dos_description=$2 ,dos_email=$3".
254 " where dos_id = $4";
257 array(
trim($this->dos_name),
258 trim($this->dos_description),
267 $sql=
"select dos_name,dos_description,dos_email from ac_dossier where dos_id=$1";
270 $sql, array($this->dos_id)
284 return $p_cn->get_value(
'select val from version');
306 if (!
$cn->exist_table(
"profile_menu"))
314 $a_admin=
$repo->get_array(
"select use_login from ac_users where
315 use_admin=1 and use_active=1");
322 for ($i=0; $i<
count($a_admin); $i++)
331 error_log($e->getTraceAsString());
static grant_admin_access($p_login, $p_dossier)
Grant access to folder, grant administrator profile , all the ledgers and all the action...
static synchro_admin($p_id)
connect to folder and give to admin.
static num_row($ret)
wrapper for the function pg_NumRows
static get_version($p_cn)
count()
Count the number of folder in the repository.
static show_dossier($p_type, $p_login="", $p_text="", $limit=0)
Show the folder where user have access.
set_parameter($p_string, $p_value)
static name($id=0)
retrieve the name of the current dossier
static check()
check if gDossier is set
static fetch_array($ret, $p_indice=0)
wrapper for the function pg_fetch_array
echo_error($p_log, $p_line="", $p_message="")
log error into the /tmp/noalyss_error.log it doesn't work on windows
get_user_folder($sql="")
Return all the users as an array.
static hidden()
return a string to set gDossier into a FORM
function trim(s)
remove trailing and heading space
static id()
return the $_REQUEST['gDossier'] after a check
This class allow you to connect to the postgresql database, execute sql, retrieve data...
manage the current dossier, everywhere we need to know to which folder we are connected, because we can't use $_SESSION, we need to pass the dossier_id via a _GET or a POST variable private static $variable=array("id"=>"dos_id", "name"=>"dos_name", "desc"=>"dos_description");
if(isset($_REQUEST['gDossier'])&&$_REQUEST['gDossier']<>0) $repo
for($e=0;$e< count($afiche);$e++) exit
echo_warning($p_string)
warns