21if ( !defined (
'ALLOWED')) die(
'Forbidden');
38 $max_email=
$http->post(
"max_email");
39 $dos->set_parameter(
'name',
$name);
40 $dos->set_parameter(
'desc',
$desc);
41 $dos->set_parameter(
"max_email", $max_email);
44echo
'<div class="content">';
52 $dos=
$http->post(
'DATABASE');
54 }
catch (Exception
$ex) {
55 echo
$ex->getMessage();
61 echo _(
"Le nom du dossier est vide");
79 $encoding=
$repo->get_value(
"select encoding from pg_database where ".
80 " datname=$1",array($template_name));
83 alert(_(
'Désolé vous devez migrer ce modèle en unicode'));
84 echo
'<span class="error">';
85 echo _(
'le modele ').domaine.
'mod'.
$http->post(
"FMOD_ID",
"number")._(
" doit être migré en unicode.");
86 echo _(
'Pour le passer en unicode, faites-en une sauvegarde puis restaurez le fichier reçu').
'</span>';
95 $max_email=
$http->post(
"max_email",
"number");
99 if (
isNumber($max_email) == 0) $max_email=-1;
100 $Res=
$repo->exec_sql(
"insert into ac_dossier(dos_name,dos_description,dos_email)
101 values ($1,$2,$3)",array($dos,
$desc,$max_email));
102 $l_id=
$repo->get_current_seq(
'dossier_id');
109 $msg=_(
"Desole la creation de ce dossier a echoue,\n la cause la plus probable est".
110 ' deux fois le même nom de dossier');
132 echo
"$year"._(
" est une année invalide");
133 $Res=
$repo->exec_sql(
"delete from ac_dossier where dos_id=$1",[$l_id]);
137 $Sql=sprintf(
"CREATE DATABASE %sDOSSIER%d encoding='UTF8' TEMPLATE %sMOD%d",
143 if (
$repo->exec_sql($Sql)==
false)
148 $repo->exec_sql(
"delete from ac_dossier where dos_id=$l_id");
149 echo
"<h2 class=\"error\">"._(
" Base de donnée ").domaine.
"mod".
$_POST[
'FMOD_ID'].
" ".
150 _(
"est accèdée, déconnectez-vous d'abord").
"</h2>";
157 $Res=
$cn->exec_sql(
"delete from parm_periode");
162 $Res=
$cn->exec_sql(
"delete from user_local_pref where parameter_type='PERIODE'");
163 $nb_day=array(31,$fev,31,30,31,30,31,31,30,31,30,31);
165 foreach ($nb_day as $day)
169 $sql=sprintf(
"insert into parm_periode (p_start,p_end,p_exercice)
170 values (to_date('%s','DD-MM-YYYY'),to_date('%s','DD-MM-YYYY'),'%s')",
175 $sql=
" insert into jrn_periode(p_id,jrn_def_id,status) ".
176 "select p_id,jrn_def_id, 'OP'".
177 " from parm_periode cross join jrn_def";
181 Noalyss_user::remove_inexistant_user($l_id);
182 Noalyss_user::audit_admin(sprintf(
'CREATE DATABASE %s %s',$l_id,$dos));
186 echo
h2(
"$l_id - $dos");
187 $db->apply_patch($db->format_name($l_id,
"dos"));
189 echo
'<p class="text-center">';
199 $Sql=sprintf(
"CREATE DATABASE %sDOSSIER%d encoding='UTF8' ",
205 if (
$repo->exec_sql($Sql)==
false)
210 $repo->exec_sql(
"delete from ac_dossier where dos_id=$l_id");
211 echo _(
"Echec création ");
214 Noalyss_user::audit_admin(sprintf(
'CREATE DATABASE %s %s',$l_id,$dos));
221<
h2> <?php echo _(
'Dossier Management')?></
h2>
229 echo
HtmlInput::button(_(
'Ajouter'),_(
'Ajouter un dossier'),
" onclick=\$('folder_add_id').show()");
232 $url=$_SERVER[
'PHP_SELF'].
"?sa=list&action=".
$_REQUEST[
'action'];
233 $header->add(_(
"id"),
$url,
" order by dos_id asc",
" order by dos_id desc",
"da",
"dd");
234 $header->add(_(
"Nom"),
$url,
" order by dos_name asc",
" order by dos_name desc",
"na",
"nd");
235 $header->add(_(
"Description"),
$url,
" order by dos_description asc",
" order by dos_description desc",
"da",
"dd");
240 $Res=$repocn->get_array(
"select * from ac_dossier $sql_order");
244 echo
'<div class="content">';
245 echo
'<span style="display:block">';
246 echo _(
'Cherche').Icon_Action::infobulle(23);
249 echo
'<TABLE id="t_dossier" class="table_large" >';
251 $r.=
'<th>'.$header->get_header(0).
'</td>';
252 $r.=
'<th>'.$header->get_header(1).
'</td>';
253 $r.=
'<th>'.$header->get_header(2).
'</td>';
254 $r.=
th(_(
'Taille')).th(_(
'Nom base de données'));
261 foreach (
$Res as $Dossier)
264 if ( $compteur%2 == 0 )
269 echo
"<TR id=\"folder{$Dossier['dos_id']}\" $cl><TD style=\"vertical-align:top\"> ".
270 $Dossier[
'dos_id'].
"</td><td> <B>".
h($Dossier[
'dos_name']).
"</B> </TD>";
273 echo
"<TD><I> ".h($Dossier[
'dos_description']).
"</I></td>";
275 $database_exist=$repocn->exist_database(
$str_name);
277 if ($database_exist > 0 )
279 $size=$repocn->get_value(
"select pg_database_size($1)/(1024*1024)::float",
281 echo
td(
nbm(
$size).
"MB",
' style="text-align:right"');
283 echo
td(_(
"Dossier inexistant"),
'style="color:red"');
286 if ( $database_exist > 0)
288 echo
td(
HtmlInput::anchor(_(
'Effacer'),
'?action=dossier_mgt&sa=del&d='.$Dossier[
'dos_id'],
" onclick=\"folder_drop('".$Dossier[
'dos_id'].
"')\""));
291 .$Dossier[
'dos_id'],
" onclick=\"folder_modify('".$Dossier[
'dos_id'].
"')\""));
294 .$Dossier[
'dos_id']));
297 echo
td(
HtmlInput::anchor(_(
'Effacer'),
'?action=dossier_mgt&sa=del&d='.$Dossier[
'dos_id'],
" onclick=\"folder_drop('".$Dossier[
'dos_id'].
"')\""));
310<div
id=
"folder_add_id" class=
"inner_box" style=
"display:none;top:50px">
317 $Res=
$repo->exec_sql(
"select mod_id,mod_name,mod_desc from
318 modeledef order by mod_name");
323 echo _(
"pas de modèle disponible");
332 $template.=
'<OPTION VALUE="'.$mod[
'mod_id'].
'"> '.
h($mod[
'mod_name'].
" - ".mb_substr($mod[
'mod_desc'],0,30));
334 $template.=
'<option value="0" > ** '._(
'Aucun modèle (dossier vide, devant être restauré manuellement)').
' ** ';
343 <FORM
ACTION=
"admin-noalyss.php?action=dossier_mgt" METHOD=
"POST" onsubmit=
"waiting_box();return true;">
346 <TD><?php echo _(
'Nom du dossier');
347 ?></
td><
td> <INPUT TYPE=
"TEXT" class=
"input_text" NAME=
"DATABASE"> </TD>
349 <TD><?php echo _(
'Description');
350 ?></
td><
td> <TEXTAREA
class=
"input_text" COLS=
"60" ROWS=
"2" NAME=
"DESCRIPTION" ></TEXTAREA> </TD>
354 <?php echo _(
'Max. email / jour (-1 = illimité)') ;?>
365 <TR> <TD><?php echo _(
'Modèle');
368 <TR><TD><?php echo _(
'Année')?> </TD><TD><input
class=
"input_text" type=
"text" size=4
name=
"YEAR" value=<?php echo
'"'.$m_date.
'"'; ?>></TD></TR>
370 <TD> <INPUT TYPE=SUBMIT
class=
"button" VALUE=
"<?php echo _('Creation Dossier'); ?>"> </TD>
387 $ctl_code=
$http->request(
"ctlcode");
388 if (
$ctl != $ctl_code)
390 echo _(
'Désolé, le code est invalide');
397 $name=
$cn->get_value(
"select dos_name from ac_dossier where dos_id=$1",array(
$dossier_id));
400 echo
"<h2 class=\"error\"> $msg "._(
'inexistant').
"</h2>";
411 if ( $database_exist == 1)
413 $sql=
"drop database ".$str_name;
415 if (
$cn->exec_sql(
$sql)==
false)
419 echo
"<h2 class=\"error\"> ";
420 echo _(
'Base de donnée ').domaine.
"dossier".
$_REQUEST[
'd'].
421 _(
"est accèdée, déconnectez-vous d'abord").
"</h2>";
428 $sql=
"delete from jnt_use_dos where dos_id=$1";
430 $sql=
"delete from ac_dossier where dos_id=$1";
432 print '<h2 class="error">';
433 printf (_(
"Le dossier %s est effacé").
'</h2>',
h(
$name));
434 Noalyss_user::audit_admin(sprintf(
'DROP DATABASE %s %s',
$dossier_id,
$name));
h2($p_string, $p_class="", $raw="")
th($p_string, $p_extra='', $raw='')
noalyss_strlentrim($p_string)
tr($p_string, $p_extra='')
sql_string($p_string)
Fix the problem with the quote char for the database.
td($p_string='', $p_extra='')
surround the string with td
nbm($p_number, $p_dec=2)
format the number with a sep.
alert($p_msg, $buffer=false)
alert in javascript
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
h( $row[ 'oa_description'])
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 synchro_admin($p_id)
connect to folder and give to admin.
This class handles only the numeric input, the input will call a javascript to change comma to period...
static echo_file($msg, $print=true)
display the file
Description of class_syn_sort_table.
for($i=0;$i< $count;$i++) $template
for($e=0; $e< count($afiche); $e++) exit
if(count($array)==0) $size
if(count($a_accounting)==0) $header