37require_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
44 "desc"=>
"dos_description",
45 "max_email"=>
'dos_email');
65 return $http->request(
'gDossier',
'number');
85 $l_sql=
"select *, 'W' as priv_priv "
88 .
"dos_name ilike '%'|| $2 ||'%'"
89 .
"or dos_description ilike '%'|| $2 || '%' "
90 .
"ORDER BY dos_name $str_limit ";
96 $l_sql=
"select * from jnt_use_dos
97 natural join ac_dossier
101 and ( dos_name ilike '%'|| $2 || '%' or dos_description ilike '%'|| $2|| '%' )
107 $a_row=
$cn->get_array($l_sql, array($p_login, $p_text));
112 $l_sql=
" select * from ac_dossier where dos_id not in
113 (select dos_id from jnt_use_dos where use_id=$1)
114 and ( dos_name ilike '%'|| $2|| '%' or dos_description ilike '%'|| $2 || '%')
115 order by dos_name ".$str_limit;
116 $a_row=
$cn->get_array($l_sql, array($p_login, $p_text));
121 throw new Exception(_(
"Erreur paramètre"));
131 $nb_folder=$this->
cn->get_value(
'select count(*) from ac_dossier');
157 (select array_to_string(array_agg(dos_name),',') as ag_dossier,
158 jt.use_id as jt_use_id
159 from ac_dossier as ds
160 join jnt_use_dos as jt on (jt.dos_id=ds.dos_id)
161 group by jt.use_id) as dossier_name on (jt_use_id=ac.use_id)
179 $id=
$http->request(
"gDossier",
"number");
180 if (
$id > 999999 ||
$id < 0)
throw new \Exception(_(
"Dossier max dépassé "));
181 }
catch (\Exception
$e) {
183 die(
'Dossier invalide ');
192 static function get()
194 $http=new \HttpInput();
195 return "gDossier=".$http->request(
"gDossier",
"number");
204 $http=new \HttpInput();
206 return '<input type="hidden" id="gDossier" name="gDossier" value="'.$http->request(
"gDossier",
"number").
'">';
214 $http=new \HttpInput();
217 $name=
$cn->get_value(
"select dos_name from ac_dossier where dos_id=$1", array(
$id));
229 throw new Exception(
"Attribut inexistant $p_string");
237 $this->
$idx=$p_value;
240 throw new Exception(
"Attribut inexistant $p_string");
258 if ($this->
cn->get_value(
"select count(*) from ac_dossier "
259 .
" where dos_name=$1 and dos_id<>$2", array($this->dos_name, $this->dos_id))!=0)
262 $sql=
"update ac_dossier set dos_name=$1,dos_description=$2 ,dos_email=$3".
263 " where dos_id = $4";
265 $sql, array(trim($this->dos_name),
266 trim($this->dos_description),
275 $sql=
"select * from ac_dossier where dos_id=$1";
278 $sql, array($this->dos_id)
292 return $p_cn->get_value(
'select max(val) from version');
314 if (!
$cn->exist_table(
"profile_menu"))
322 $a_admin=
$repo->get_array(
"select use_login from ac_users where
323 use_admin=1 and use_active=1");
332 Noalyss_user::grant_admin_access($a_admin[
$i][
'use_login'],
$p_id);
355 $Resdossier=
$rep->exec_sql(
"select dos_id, dos_name from ac_dossier");
356 $MaxDossier=
$rep->size($Resdossier);
361 echo
"<h2>"._(
"Mise à jour de la base de données principale").
"</h2>";
363 if (DEBUGNOALYSS == 0)
366 for (
$i=4;
$i<=$MaxVersion;
$i++)
368 if (
$cn->get_version()<=
$i)
370 $cn->execute_script(NOALYSS_INCLUDE.
'/sql/patch/ac-upgrade'.
$i.
'.sql');
373 if (DEBUGNOALYSS == 0) ob_end_clean();
377 echo
"<h2>"._(
"Mise à jour dossiers").
"</h2>";
379 for (
$e=0;
$e<$MaxDossier;
$e++)
382 $name=
$rep->format_name($db_row[
'dos_id'],
'dos');
383 echo
"<h3>Patching ".$db_row[
'dos_name'].
'</h3>';
384 echo _(
'Base de données').
" ".
$name;
388 $db=
new Database($db_row[
'dos_id'],
'dos');
389 $db->apply_patch($db_row[
'dos_name']);
391 Noalyss_user::remove_inexistant_user($db_row[
'dos_id']);
392 $db->clean_orphan_lob();
403 $Resdossier=
$rep->exec_sql(
"select mod_id, mod_name from modeledef");
404 $MaxDossier=
$rep->size();
405 echo
"<h2>"._(
"Mise à jour modèles").
"</h2>";
407 for (
$e=0;
$e<$MaxDossier;
$e++)
410 $name=
$rep->format_name($db_row[
'mod_id'],
'mod');
411 echo
"<h3>Patching ".$db_row[
'mod_name'].
"</h3>";
412 echo _(
'Base de données').
" ".
$name;
415 $db=
new Database($db_row[
'mod_id'],
'mod');
416 $db->apply_patch($db_row[
'mod_name']);
417 $db->clean_orphan_lob();
433 put_global([ [
"key"=>
"gDossier",
"value"=>$p_dossier]]);
put_global($array)
Put in superglobal (get,post,request) the value contained in the parameter field (me_parameter)
noalyss_strlentrim($p_string)
echo_warning($p_string)
warns
record_log($p_message)
Record an error message into the log file of the server.
if(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
contains the class for connecting to Noalyss
manage the current dossier, everywhere we need to know to which folder we are connected,...
static upgrade()
Upgrade check if the folder ACCOUNT_REPOSITORY needs to be upgrade thanks the variable DBVERSIONREPO ...
get_user_folder($sql="")
Return all the users as an array but NOALYSS_ADMINISTRATOR, that user cannot be changed by the interf...
count()
Count the number of folder in the repository.
static synchro_admin($p_id)
connect to folder and give to admin.
static get_version($p_cn)
static id()
return the 'gDossier' value after a check
static check()
check if gDossier is set ?? dead code ???
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 hidden()
return a string to set gDossier into a FORM
static set_current($p_dossier)
Set the current dossier to $p_dossier.
static name($id=0)
retrieve the name of the current dossier