37require_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
44 "desc"=>
"dos_description",
45 "max_email"=>
'dos_email');
65 return $http->request(
'gDossier',
'number');
82 $str_limit=(
$limit==0)?
'':
' limit '.$limit;
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');
158 (select array_to_string(array_agg(dos_name),',') as ag_dossier,
159 jt.use_id as jt_use_id
160 from ac_dossier as ds
161 join jnt_use_dos as jt on (jt.dos_id=ds.dos_id)
162 group by jt.use_id) as dossier_name on (jt_use_id=ac.use_id)
178 $id=
$http->request(
"gDossier",
"number");
179 if (
$id > 999999 ||
$id < 0)
throw new \Exception(
_(
"Dossier max dépassé "));
180 }
catch (\Exception
$e) {
182 die(
'Dossier invalide ');
191 static function get()
193 $http=new \HttpInput();
194 return "gDossier=".$http->request(
"gDossier",
"number");
203 $http=new \HttpInput();
205 return '<input type="hidden" id="gDossier" name="gDossier" value="'.$http->request(
"gDossier",
"number").
'">';
213 $http=new \HttpInput();
216 $name=
$cn->get_value(
"select dos_name from ac_dossier where dos_id=$1", array(
$id));
222 if (array_key_exists($p_string, self::$variable))
224 $idx=self::$variable[$p_string];
228 throw new Exception(
"Attribut inexistant $p_string");
233 if (array_key_exists($p_string, self::$variable))
235 $idx=self::$variable[$p_string];
236 $this->
$idx=$p_value;
239 throw new Exception(
"Attribut inexistant $p_string");
244 return var_export(self::$variable,
true);
257 if ($this->
cn->get_value(
"select count(*) from ac_dossier "
258 .
" where dos_name=$1 and dos_id<>$2", array($this->dos_name, $this->dos_id))!=0)
261 $sql=
"update ac_dossier set dos_name=$1,dos_description=$2 ,dos_email=$3".
262 " where dos_id = $4";
264 $sql, array(trim($this->dos_name),
265 trim($this->dos_description),
274 $sql=
"select * from ac_dossier where dos_id=$1";
277 $sql, array($this->dos_id)
283 foreach ( self::$variable as
$idx)
291 return $p_cn->get_value(
'select max(val) from version');
313 if (!
$cn->exist_table(
"profile_menu"))
321 $a_admin=
$repo->get_array(
"select use_login from ac_users where
322 use_admin=1 and use_active=1");
331 Noalyss_user::grant_admin_access($a_admin[
$i][
'use_login'],
$p_id);
354 $Resdossier=
$rep->exec_sql(
"select dos_id, dos_name from ac_dossier");
355 $MaxDossier=
$rep->size($Resdossier);
360 echo
"<h2>"._(
"Mise à jour de la base de données principale").
"</h2>";
362 if (DEBUGNOALYSS == 0)
365 for (
$i=4;
$i<=$MaxVersion;
$i++)
367 if (
$cn->get_version()<=
$i)
369 $cn->execute_script(NOALYSS_INCLUDE.
'/sql/patch/ac-upgrade'.
$i.
'.sql');
372 if (DEBUGNOALYSS == 0) ob_end_clean();
376 echo
"<h2>"._(
"Mise à jour dossiers").
"</h2>";
378 for (
$e=0;
$e<$MaxDossier;
$e++)
381 $name=
$rep->format_name($db_row[
'dos_id'],
'dos');
382 echo
"<h3>Patching ".$db_row[
'dos_name'].
'</h3>';
383 echo
_(
'Base de données').
" ".
$name;
387 $db=
new Database($db_row[
'dos_id'],
'dos');
388 $db->apply_patch($db_row[
'dos_name']);
390 Noalyss_user::remove_inexistant_user($db_row[
'dos_id']);
391 $db->clean_orphan_lob();
402 $Resdossier=
$rep->exec_sql(
"select mod_id, mod_name from modeledef");
403 $MaxDossier=
$rep->size();
404 echo
"<h2>"._(
"Mise à jour modèles").
"</h2>";
406 for (
$e=0;
$e<$MaxDossier;
$e++)
409 $name=
$rep->format_name($db_row[
'mod_id'],
'mod');
410 echo
"<h3>Patching ".$db_row[
'mod_name'].
"</h3>";
411 echo
_(
'Base de données').
" ".
$name;
414 $db=
new Database($db_row[
'mod_id'],
'mod');
415 $db->apply_patch($db_row[
'mod_name']);
416 $db->clean_orphan_lob();
431 self::check($p_dossier);
432 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 or in the log folder of NOALYSS Record also t...
if(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo
_("actif, passif,charge,...")
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