Go to the documentation of this file.
37 require_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
44 "desc"=>
"dos_description",
45 "max_email"=>
'dos_email');
78 $l_sql=
"select *, 'W' as priv_priv "
81 .
"dos_name ilike '%'|| $2 ||'%'"
82 .
"or dos_description ilike '%'|| $2 || '%' "
83 .
"ORDER BY dos_name $str_limit ";
89 $l_sql=
"select * from jnt_use_dos
90 natural join ac_dossier
94 and ( dos_name ilike '%'|| $2 || '%' or dos_description ilike '%'|| $2|| '%' )
100 $a_row=
$cn->get_array($l_sql, array($p_login, $p_text));
105 $l_sql=
" select * from ac_dossier where dos_id not in
106 (select dos_id from jnt_use_dos where use_id=$1)
107 and ( dos_name ilike '%'|| $2|| '%' or dos_description ilike '%'|| $2 || '%')
108 order by dos_name ".$str_limit;
109 $a_row=
$cn->get_array($l_sql, array($p_login, $p_text));
114 throw new Exception(_(
"Erreur paramètre"));
124 $nb_folder=$this->
cn->get_value(
'select count(*) from ac_dossier');
148 (select array_to_string(array_agg(dos_name),',') as ag_dossier,
149 jt.use_id as jt_use_id
150 from ac_dossier as ds
151 join jnt_use_dos as jt on (jt.dos_id=ds.dos_id)
152 group by jt.use_id) as dossier_name on (jt_use_id=ac.use_id)
158 $res=$this->
cn->get_array(
$sql, array(NOALYSS_ADMINISTRATOR));
169 exit(
'Dossier invalide ');
172 if (is_numeric(
$id)==0||
175 exit(
'gDossier Invalide : '.
$id);
182 static function get()
185 return "gDossier=".$_REQUEST[
'gDossier'];
193 return '<input type="hidden" id="gDossier" name="gDossier" value="'.$_REQUEST[
'gDossier'].
'">';
204 $name=
$cn->get_value(
"select dos_name from ac_dossier where dos_id=$1", array(
$_REQUEST[
'gDossier']));
210 if (array_key_exists($p_string, self::$variable))
212 $idx=self::$variable[$p_string];
216 throw new Exception(
"Attribut inexistant $p_string");
221 if (array_key_exists($p_string, self::$variable))
223 $idx=self::$variable[$p_string];
224 $this->
$idx=$p_value;
227 throw new Exception(
"Attribut inexistant $p_string");
232 return var_export(self::$variable,
true);
242 if (strlen(trim($this->dos_name))==0)
245 if ($this->
cn->get_value(
"select count(*) from ac_dossier "
246 .
" where dos_name=$1 and dos_id<>$2", array($this->dos_name, $this->dos_id))!=0)
249 $sql=
"update ac_dossier set dos_name=$1,dos_description=$2 ,dos_email=$3".
250 " where dos_id = $4";
252 $sql, array(trim($this->dos_name),
253 trim($this->dos_description),
262 $sql=
"select dos_name,dos_description,dos_email from ac_dossier where dos_id=$1";
265 $sql, array($this->dos_id)
279 return $p_cn->get_value(
'select max(val) from version');
301 if (!
$cn->exist_table(
"profile_menu"))
309 $a_admin=
$repo->get_array(
"select use_login from ac_users where
310 use_admin=1 and use_active=1");
342 $Resdossier=
$rep->exec_sql(
"select dos_id, dos_name from ac_dossier");
343 $MaxDossier=
$rep->size($Resdossier);
348 echo
"<h2>"._(
"Mise à jour de la base de données principale").
"</h2>";
350 if (DEBUGNOALYSS == 0)
353 for (
$i=4;
$i<=$MaxVersion;
$i++)
355 if (
$cn->get_version()<=
$i)
357 $cn->execute_script(NOALYSS_INCLUDE.
'/sql/patch/ac-upgrade'.
$i.
'.sql');
360 if (DEBUGNOALYSS == 0) ob_end_clean();
364 echo
"<h2>"._(
"Mise à jour dossiers").
"</h2>";
366 for (
$e=0;
$e<$MaxDossier;
$e++)
369 $name=
$rep->format_name($db_row[
'dos_id'],
'dos');
370 echo
"<h3>Patching ".$db_row[
'dos_name'].
'</h3>';
371 echo _(
'Base de données').
" ".
$name;
375 $db=
new Database($db_row[
'dos_id'],
'dos');
376 $db->apply_patch($db_row[
'dos_name']);
379 $db->clean_orphan_lob();
390 $Resdossier=
$rep->exec_sql(
"select mod_id, mod_name from modeledef");
391 $MaxDossier=
$rep->size();
392 echo
"<h2>"._(
"Mise à jour modèles").
"</h2>";
394 for (
$e=0;
$e<$MaxDossier;
$e++)
397 $name=
$rep->format_name($db_row[
'mod_id'],
'mod');
398 echo
"<h3>Patching ".$db_row[
'mod_name'].
"</h3>";
399 echo _(
'Base de données').
" ".
$name;
402 $db=
new Database($db_row[
'mod_id'],
'mod');
403 $db->apply_patch($db_row[
'mod_name']);
404 $db->clean_orphan_lob();
419 put_global([ [
"key"=>
"gDossier",
"value"=>$p_dossier]]);
static hidden()
return a string to set gDossier into a FORM
echo_warning($p_string)
warns
static get_version($p_cn)
static check()
check if gDossier is set
static fetch_array($ret, $p_indice=0)
wrapper for the function pg_fetch_array
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 ...
count()
Count the number of folder in the repository.
set_parameter($p_string, $p_value)
get_user_folder($sql="")
Return all the users as an array.
static remove_inexistant_user($p_dossier)
static num_row($ret)
wrapper for the function pg_NumRows
static set_current($p_dossier)
Set the current dossier to $p_dossier.
for($e=0; $e< count($afiche); $e++) exit
echo_error($p_log, $p_line="", $p_message="")
log error into the /tmp/noalyss_error.log it doesn't work on windows
put_global($array)
Put in superglobal (get,post,request) the value contained in the parameter field (me_parameter)
static id()
return the $_REQUEST['gDossier'] after a check
static synchro_admin($p_id)
connect to folder and give to admin.
contains the class for connecting to Noalyss
if(isset($_REQUEST['gDossier']) && $http->request("gDossier","number", 0) !=0) $repo
static show_dossier($p_type, $p_login="", $p_text="", $limit=0)
Show the folder where user have access.
record_log($p_message)
Record an error message into the log file of the server.
static name($id=0)
retrieve the name of the current dossier
static grant_admin_access($p_login, $p_dossier)
Grant access to folder, grant administrator profile , all the ledgers and all the action.