improve CSS

Finish new security + clean table action
This commit is contained in:
Dany De Bontridder 2011-11-13 13:28:19 +00:00
parent 79cbf13867
commit c16c32ca48
30 changed files with 602 additions and 428 deletions

View file

@ -19,7 +19,7 @@
*/
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*! \file
* \brief Administration of the repository : creation of user, folder, security,
* \brief Administration of the repository : creation of user, folder, security,
* templates... Accessible only by the administrator
*/
require_once("user_common.php");
@ -38,7 +38,7 @@ if ($User->admin != 1)
html_page_stop();
return;
}
load_all_script();
echo '<H2 class="info"> Administration Globale</H2>';
echo '<div class="topmenu">';

View file

@ -521,10 +521,13 @@ EOF;
$new=false;
require_once 'template/plugin_detail.php';
break;
case 'saldo':
require_once 'ajax_bank_saldo.php';
break;
case 'up_predef':
require_once 'ajax_update_predef.php';
break;
case 'saldo':
require_once 'ajax_bank_saldo.php';
break;
case 'up_predef':
require_once 'ajax_update_predef.php';
break;
case 'upd_receipt':
require_once 'ajax_get_receipt.php';
break;
}

View file

@ -58,7 +58,7 @@ if ( isset ($_REQUEST['sa']) )
$cmd=escapeshellcmd (PG_DUMP);
putenv("PGPASSWORD=".phpcompta_password);
putenv("PGUSER=".phpcompta_user);
putenv("PGHOST=".phpcompta_psql_host);
if ( $_REQUEST['t'] == 'd' )
{
$database=domaine."dossier".$_REQUEST['d'];

View file

@ -85,9 +85,9 @@ function update_pj()
{
var jrn=g("p_jrn").value;
var dossier=g("gDossier").value;
var querystring='gDossier='+dossier+'&l='+jrn;
var querystring='gDossier='+dossier+'&l='+jrn+"&op=upd_receipt";
var action=new Ajax.Request(
"get_pj.php",
"ajax_misc.php",
{
method:'get',
parameters:querystring,

View file

@ -240,6 +240,7 @@ function errorFid(request,json)
}
function update_value(text,li)
{
ajaxFid(ctl);
}
/**
*@brief is called when something change in ICard

View file

@ -17,8 +17,8 @@
*/
/*!\file
* \brief create the infobulle, the internalization is not yet implemented
* \code
// Example
* \code
// Example
echo JS_INFOBULLE;
echo HtmlInput::infobulle(x);
\endcode
@ -27,10 +27,10 @@
var posX=0,posy=0,offsetX=10,offsetY=10;
document.onmousemove=getPosition;
var content=new Array();
content[0]="Donnez le quickcode ou tapez une partie du nom de la fiche puis cliquer sur rechercher, si la recherche ne donne rien, il vous sera proposé de créer une nouvelle fiche";
content[0]="Donnez le quickcode ou tapez une partie du nom de la fiche, en appuyant sur le bouton, vous pourrez la chercher";
content[1]="(optionnel) La description est un commentaire libre qui sert à identifier cette opération";
content[2]="Selectionnez le journal où l'opération doit être sauvée";
content[3]="Les périodes comptables servent comme un second contrôle pour la date de l'opération. Modifiez dans vos préférence pour avoir une autre période par défaut";
content[3]="Les périodes comptables servent comme un second contrôle pour la date de l'opération. Modifiez dans vos préférence pour avoir une autre période par défaut. Pour ne plus avoir à changer la période aller dans COMPANY, et mettez \"Afficher la période comptable\" à non";
content[4]="(optionnel) L'échéance est la date limite de paiement";
content[5]="(optionnel)Le numéro d'extrait permet de retrouver plus facilement l'extrait de banque";
content[6]="Indiquez ici le prix hors tva si vous êtes affilié à la tva et que vous pouvez la déduire , sinon indiquez ici le total tva incluse et utilisez un taux tva de 0%";

View file

@ -7,7 +7,7 @@ BODY {
padding:0;
margin:0;
color:#0E7E0E;
}
.notice {
color:red;
@ -18,7 +18,7 @@ BODY {
table.result,table.document ,table.resultfooter{
color:blue;
border:1px solid blue ;
border:1px solid blue ;
width:100%;
border-spacing: 0px;
border-collapse:collapse;
@ -29,7 +29,7 @@ table.resultfooter tfoot {
}
table.result th, table.document th {
table.result th, table.document th {
font-weight:bold;
font-family:helvetica,arial,sans-serif;
border-bottom:1px solid blue;
@ -109,7 +109,7 @@ h1.title {
div.u_tmenu {
margin-top:1px;
width:100%;
width:100%;
background-color:#879ED4;
@ -122,7 +122,7 @@ div.u_subtmenu {
}
div.u_tmenu div.u_tool {
background-color:#879ED4;
background-color:#879ED4;
float:left;
}
@ -145,7 +145,7 @@ div.u_tool div.acces_direct{
div.u_subt2menu {
background-color:lightgrey;
left:1%;
left:1%;
}
div.lmenu {
@ -177,39 +177,39 @@ div.recherche_form{
border-width:1px;
}
div.redcontent{
div.redcontent{
float:left;
float:left;
padding-top:7px;
padding-left:8px;
font-size:9px;
font-family:helvetica,arial,sans-serif;
font-size:9px;
font-family:helvetica,arial,sans-serif;
width:75%;
}
div.content{
div.content{
float:left;
float:left;
padding-top:7px;
width:100%;
font-family:helvetica,arial,sans-serif;
width:100%;
font-family:helvetica,arial,sans-serif;
clear:both;
}
div.content30{
div.content30{
float:left;
float:left;
padding-top:7px;
width:35%;
font-family:helvetica,arial,sans-serif;
width:35%;
font-family:helvetica,arial,sans-serif;
}
div.no span{
position:static;
font-family:helvetica,arial,sans-serif;
font-family:helvetica,arial,sans-serif;
font-weight:bold;
color:red;
color:red;
}
.error {
@ -217,7 +217,7 @@ div.no span{
margin-left:20%;
text-align: center;
color:white;
color:white;
background-color:red;
font-weight: bolder;
font-size:120%;
@ -227,7 +227,7 @@ table.mtitle {
border:0;
text-align:center
}
td.mshort {
td.mshort {
height:15px;
width:60px;
text-align:center;
@ -238,7 +238,7 @@ td.mshort {
td.mtitle {
text-align:center;
width:95px;
height :30px;
height :30px;
font-size:10px;
background-color:#DDE6FF;
}
@ -254,11 +254,11 @@ span.mtitle {
font-size:10px;
border-style:groove
}
span.odd {
span.odd {
background-color:#ECF3FF;
display:block;
}
span.even {
span.even {
background-color:#DDE6FF;
display:block;
}
@ -266,7 +266,7 @@ span.even {
tr.odd {
background-color:#DDE6FF;
font-size:10px;
border-size:0px;
border-size:0px;
}
tr {
font-size:10px;
@ -328,7 +328,7 @@ tr.odd:hover td
background-color: #a9d6e4;
color:white;
}
tr.even:hover td
tr.even:hover td
{
text-decoration:none;
background-color: #a9d6e4;
@ -390,7 +390,7 @@ a.detail
color: blue;
}
a.detail:hover
a.detail:hover
{
font-size:9px;
font-family:helvetica,arial,sans-serif;
@ -479,9 +479,9 @@ div.redcontent input.text {
font-weight:normal;
border-color:336699;
border-style:solid;
background-color:orange;
background-color:orange;
border-width:1px;
color:blue;
color:blue;
}
div.content input.text {
font-family:helvetica,arial,sans-serif;
@ -490,7 +490,7 @@ div.content input.text {
border-style:solid;
border-width:1px;
background-color:orange;
color:blue;
color:blue;
}
@ -529,10 +529,10 @@ legend {
font-size: 120% ;
}
fieldset fieldset legend {
fieldset fieldset legend {
font-size:110%;
color:grey;
}
}
select {
border: 1px solid blue;
margin:2px;
@ -548,7 +548,7 @@ select {
background-color:yellow;
top:0;left:0;
visibility:hidden;
z-index:2;
z-index:20;
width:25em;
}
@ -589,8 +589,8 @@ div.popup_back{
height:100%;
z-index:1;
/*background-color:lightgrey;*/
background-color: rgba(203, 203,203, 0.2);
display:none;
background-color: rgba(203, 203,203, 0.2);
display:none;
}
div.popup_border_title {
@ -609,7 +609,7 @@ div.popup_border_title {
font-style: italic;
font-weight: bolder;
text-align:center;
/*border-bottom: 2px solid #201e87;*/
/*border-bottom: 2px solid #201e87;*/
color: white;
display:none;
/*opacity:1;
@ -621,12 +621,12 @@ div.popup_border_notitle {
top:20%;
left:20%;
width:60%;
height:80% ;
height:80% ;
/*background:lightgrey;*/
z-index:10;
/*border:dotted 1px black;*/
border: 3px outset #201e87;
background-color:lightblue;
background-color:lightblue;
font-family: helvetica,arial,sans-serif;
font-style: italic;
font-weight: bolder;
@ -647,7 +647,7 @@ div.popup_content {
width:100%;
height:96%;
overflow: auto;
background-color:#DFE7FF;
background-color:#DFE7FF;
font-size:10px ;
font-family: helvetica,arial,sans-serif;
font-style: normal;
@ -823,7 +823,7 @@ a#anchorbutton {
margin:1 2 1 2;
-moz-border-radius:2 2;
}
}
a#anchorbutton :hover {
cursor:pointer;
background-color:white;
@ -832,7 +832,7 @@ a#anchorbutton :hover {
margin:1 2 1 2;
}
/* </style> */
div.add_todo_list {
div.add_todo_list {
border:1px solid blue;
display:none;
background-color:#CFCDFF;
@ -857,7 +857,7 @@ h2.gest_name {
}
div.op_detail_frame {
background-color:#e4e7ed;
background-color:#e4e7ed;
height:100%; width:100%;
@ -875,7 +875,7 @@ div.inner_box {
left:10%;
border:1px solid darkblue;
border:1px solid darkblue;
}
div.op_detail_title {
@ -884,7 +884,7 @@ div.op_detail_title {
}
div#div_jrn{
div#div_jrn{
position:absolute;
border:1px solid black;
top:15%;left:100;
@ -894,7 +894,7 @@ div#div_jrn{
background-color:#EDF3FF;
}
div#div_cat{
div#div_cat{
position:absolute;
border:1px solid black;
top:15%;left:100;
@ -908,7 +908,7 @@ div.divinfo
{ color:red;text-align:right;display:block;width:30em;height:13;}
div#search_form
{
{
position:absolute;
border:1px solid black;
top:15%;left:100;
@ -918,7 +918,7 @@ div#search_form
display:none;
background-color:#e4e7ed;
}
table.result td
table.result td
{
padding-left:5px;
padding-right:5px;
@ -928,7 +928,7 @@ table.info_op
margin-left: 30%;
margin-right: 30%;
width:20%;
}
table.info_op tr
{
@ -939,13 +939,13 @@ width:5%
h2#jrn_name
{
margin-right:30%;
}
tr.footer{
font-size:14;
font-style: italic;
font-weight: bold;
}
span.remain {
font-weight: bold;
@ -955,22 +955,22 @@ div#jrn_name_div
{
float: right;
margin-right:150;
}
#predef_form {
margin-left:20%;
width:60%;
}
#direct
{
display:inline;
float:right;
}
.direct
.direct
{
font-size:6px;
border:groove 1px #00ff00;
@ -984,13 +984,13 @@ div#wait_box
margin:0;
overflow:hidden;
z-index:10;
position:absolute;
left:30%;
top:30%;
border:1px solid darkblue;
border:1px solid darkblue;
}
#wait_box h2
@ -998,11 +998,11 @@ border:1px solid darkblue;
color:black;
text-align:center;
}
div#div_jrnsearch_op{
div#div_jrnsearch_op{
border:1px solid black;
display:none;
width:50em;
background-color:#EDF3FF;
}

View file

@ -435,7 +435,7 @@ div.content a {
font-family:helvetica,arial,sans-serif;
text-decoration: none;
display: block;
color: #0000ff;
color: blue;
padding: 1px ;
}
@ -565,6 +565,10 @@ background-color:white;
visibility:hidden;
z-index:2;
width:25em;
padding-bottom: 10;
padding-top: 10;
padding-left: 10;
padding-right: 10;
}

View file

@ -35,9 +35,7 @@ table.result th {
color:#25238F;
text-align: left;
// background-color:#EDF3FF;
font-style: italic;
font-style: italic;
}
@ -566,11 +564,15 @@ background-color:white;
position:absolute;
border:1px solid black;
background-color:yellow;
padding-bottom: 10;
padding-top: 10;
padding-left: 10;
padding-right: 10;
color:black;
top:0;left:0;
visibility:hidden;
z-index:2;
width:25em;
z-index:20;
}
span.action {
@ -790,7 +792,7 @@ color:black;
cursor:inherit;
}
.button, a.button,div.content a.button {
a#anchorbutton, .button, a.button,div.content a.button {
font-size:10;
color:white;
font-weight: bold;
@ -804,13 +806,17 @@ cursor:inherit;
border-style: outset ;
border-color: blue ;
border-width:0;
padding:2 4 2 4;
padding-bottom: 4;
padding-top: 4;
padding-right: 6;
padding-left: 6;
margin-top:3px;
cursor:pointer;
margin:1 2 1 2;
-moz-border-radius:2 2;
}
.button:hover,a.button:hover,div.content a.button:hover {
a#anchorbutton:hover, .button:hover,a.button:hover,div.content a.button:hover {
cursor:pointer;
background-color:white;
border-style: inset ;
@ -836,33 +842,6 @@ margin:0;
padding:0;
text-align:center;
}
a#anchorbutton {
font-size:10;
color:white;
font-weight: bold;
text-decoration:none;
font-family: helvetica,sans-serif;
background-image: url("image/bg-submit3.gif");
background-repeat: repeat-x;
background-position: left;
border-style: outset ;
border-color: blue ;
border-width:1;
padding:2 4 2 4;
cursor:pointer;
margin:1 2 1 2;
-moz-border-radius:2 2;
}
a#anchorbutton:hover {
cursor:pointer;
background-color:white;
border-style: inset ;
color:blue;
margin:1 2 1 2;
}
/* </style> */
div.add_todo_list {
border:1px solid blue;
@ -1059,4 +1038,10 @@ font-size:110%;
display:inline;
color: #0000ff;
background-color: rgb(93, 144, 205);
}
#close_div
{
background-color:blue;
color:white;
text-decoration:none
}

View file

@ -119,7 +119,7 @@ $result.='<TD class="tool" ><A class="cell" HREF="logout.php" >'._('Deconnexion
$result.="</TR>";
$result.="</table>";
echo '<h2 class="info">'._('Bienvenue').$User->first_name.' '.$User->name.' '._("dans PhpCompta")."</h2>";
echo '<h2 class="info">'._('Bienvenue ').$User->first_name.' '.$User->name.' '._("dans PhpCompta")."</h2>";
echo '<br>'._('Choississez votre dossier');
echo '<span style="position:absolute;right:10px;top:30px">'.$result.'</span>';
echo '</div>';

View file

@ -803,12 +803,20 @@ function find_default_module()
if (empty($default_module))
{
$default_module = $cn->get_array("select me_code
from profile_menu join profile_user using (p_id)
where
user_name=$1 and p_order=(select min(p_order) from profile_menu
where user_name=$2) limit 1", array($g_user->login, $g_user->login));
return $default_module[0]['me_code'];
$default_module = $cn->get_array("select me_code
from profile_menu join profile_user using (p_id)
where
user_name=$1 and p_order=(select min(p_order) from profile_menu
where user_name=$2) limit 1", array($g_user->login, $g_user->login));
/*
* if nothing found, there is no profile for this user => exit
*/
if ( empty ($default_module))
{
echo_warning("Utilisateur n'a pas de profile");
exit();
}
return $default_module[0]['me_code'];
}
if (count($default_module) > 1)

View file

@ -0,0 +1,67 @@
<?php
/*
* This file is part of PhpCompta.
*
* PhpCompta is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* PhpCompta is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PhpCompta; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* $Revision: 4283 $ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/*!\file
* \brief respond ajax request, the get contains
* the value :
* - l for ledger
* - gDossier
* Must return at least tva, htva and tvac
*/
require_once ('constant.php');
require_once ('class_database.php');
require_once('class_dossier.php');
require_once('class_acc_ledger.php');
require_once ('class_user.php');
// Check if the needed field does exist
extract ($_GET);
foreach (array('l','gDossier') as $a)
{
if ( ! isset (${$a}) )
{
echo "error $a is not set ";
exit();
}
}
if ( is_numeric($l) == false )
{
exit();
}
$cn=new Database(dossier::id());
$User=new User($cn);
$User->Check();
$Ledger=new Acc_Ledger($cn,$l);
$prop=$Ledger->get_propertie();
$pj_seq=$Ledger->guess_pj();
$string='{"pj":"'.$pj_seq.'"}';
header("Content-type: text/json; charset: utf8",true);
echo $string;
?>

View file

@ -72,7 +72,8 @@ switch ( $r['ac_state'] )
case 'SUCCESS';
echo '<td style="background-color:green;color:white">';
break;
default:
echo '<td>';
}
?>
<?=$r['ac_state']?>

View file

@ -2619,7 +2619,7 @@ class Acc_Ledger extends jrn_def_sql
if ( $type=="" || $this->id==0) $type='ALL';
$r.='<div id="search_form" style="display:none">';
$r.=HtmlInput::anchor_action('Fermer','$(\'search_form\').style.display=\'none\';');
$r.=HtmlInput::anchor_hide('Fermer','$(\'search_form\').style.display=\'none\';');
$r.=h2info('Recherche');
$r.='<FORM METHOD="GET">';
$r.=$this->search_form($type);

View file

@ -135,6 +135,10 @@ class Database
}
else
{
if ( !is_array($p_array))
{
throw new Exception("Erreur : exec_sql attend un array");
}
if ( ! DEBUG )
$this->ret=pg_query_params($this->db,$p_string,$p_array);
else
@ -143,7 +147,8 @@ class Database
}
if ( ! $this->ret )
{
throw new Exception (" SQL ERROR $p_string ",1);
$str_error=pg_last_error($this->db);
throw new Exception (" SQL ERROR $p_string ".$str_error,1);
}
}
@ -155,7 +160,8 @@ class Database
print_r($p_array);
echo $a->getMessage();
echo $a->getTrace();
echo pg_last_error($this->db);
echo $a->getTraceAsString();
echo pg_last_error($this->db);
}
throw ($a);
}

View file

@ -37,7 +37,7 @@
require_once('class_database.php');
require_once('ac_common.php');
class dossier
class Dossier
{
private static $variable=array("id"=>"dos_id",
"name"=>"dos_name",
@ -60,7 +60,7 @@ class dossier
*
* Show the folder where user have access. Return : nothing
++*/
function show_dossier($p_type,$p_first=0,$p_max=10,$p_Num=0)
function show_dossier($p_type,$p_first=0,$p_max=0,$p_Num=0)
{
$l_user=$_SESSION['g_user'];
if ( $p_max == 0 )
@ -106,7 +106,7 @@ class dossier
*/
function get_user_folder($sql="")
{
$sql="
select
use_id,
@ -129,7 +129,7 @@ class dossier
use_login!='phpcompta'
$sql
";
$res=$this->cn->get_array($sql);
return $res;
}
@ -244,13 +244,57 @@ class dossier
}
static function get_version($p_cn)
{
return $p_cn->get_value('select val from version');
}
static function connect()
{
$id=Dossier::id();
$cn= new Database($id);
return $cn;
}
{
return $p_cn->get_value('select val from version');
}
static function connect()
{
$id = Dossier::id();
$cn = new Database($id);
return $cn;
}
/**
*connect to folder and give to admin. the profile Admin(builtin)
* @param int $p_id dossier::id()
*/
static function synchro_admin($p_id)
{
// connect to target
$cn=new Database($p_id);
if (! $cn->exist_table("profile_menu"))
{
echo_warning("Dossier invalide");
return;
}
// connect to repo
$repo=new Database();
$a_admin=$repo->get_array("select use_login from ac_users where
use_admin=1 and use_active=1");
try
{
/**
* synchro global
*/
$cn->start();
for ($i=0;$i<count($a_admin);$i++)
{
$exist=$cn->get_value("select p_id from profile_user
where user_name=$1",array($a_admin[$i]['use_login']));
if ( $exist == "")
{
$cn->exec_sql("insert into profile_user(user_name,p_id) values($1,1)",
array($a_admin[$i]['use_login']));
}
}
$cn->commit();
} catch(Exception $e)
{
echo_warning($e->getMessage());
$cn->rollback();
}
}
}

View file

@ -208,7 +208,7 @@ class HtmlInput
*/
static function button_anchor($p_label,$p_value,$p_name="",$p_javascript="")
{
$r=sprintf('<span id="%s"> <A id="anchorbutton" style="display:inline;" href="%s" %s >%s</A></span>',
$r=sprintf('<span id="%s" class="button"> <A class="button" style="display:inline;" href="%s" %s >%s</A></span>',
$p_name,
$p_value,
$p_javascript,
@ -398,35 +398,34 @@ class HtmlInput
{
$r='';
$r.='<div style="float:right;margin:2;">';
$r.= '<A style="background-color:blue;color:white;text-decoration:none" HREF="javascript:void(0)" onclick="removeDiv(\''.$div.'\');">Fermer</A>';
$r.= '<A id="close_div" HREF="javascript:void(0)" onclick="removeDiv(\''.$div.'\');">Fermer</A>';
$r.='</div>';
return $r;
}
/**
* button Html with an action in the top
*@param $action action action to perform (message)
*@param $javascript javascript of the DIV to close
*@see Acc_Ledger::display_search_form
*@note not protected against html
*@param $div_name is the name of the div to remove
* button Html
*@param $action action action to perform (message) without onclick
*@param $javascript javascript to execute
*/
static function button_action($action,$javascript)
static function button_action($action,$javascript,$id="xx")
{
$r="";
$r.='<input type="button" id="'.$id.'"class="button" onclick="'.$javascript.'" value="'.h($action).'">';
return $r;
}
/**
* Return a html string with an anchor looking like anchor_button in the right corner
* Return a html string with an anchor to hide a div, put it in the right corner
*@param $action action action to perform (message)
*@param $javascript javascript
*@note not protected against html
*@see Acc_Ledger::display_search_form
*/
static function anchor_action($action,$javascript)
static function anchor_hide($action,$javascript)
{
$r='';
$r.='<div style="float:right">';
$r.= '<A style="background-color:blue;color:white;text-decoration:none" HREF="javascript:void(0)" onclick="'.$javascript.'");">'.$action.'</A>';
$r.='<div style="float:right;right;margin:2;">';
$r.= '<A id="close_div" HREF="javascript:void(0)" onclick="'.$javascript.'");">'.$action.'</A>';
$r.='</div>';
return $r;
}
@ -610,8 +609,8 @@ class HtmlInput
{
$p_url="javascript:void(0)";
}
$str=sprintf('<a class="line" href="%s" %s>%s</a>',
$p_url,$p_js,$p_text);
return $str;

View file

@ -42,7 +42,7 @@ class User
var $admin;
var $valid;
function User($p_cn, $p_id=-1)
function User(&$p_cn, $p_id=-1)
{
// if p_id is not set then check the connected user
if ($p_id == -1)
@ -104,7 +104,8 @@ class User
use_name,
use_login,
use_active,
use_admin
use_admin,
use_pass
from ac_users ";
$cn = new Database();
$Res = $cn->exec_sql($sql . $sql_cond, $sql_array);
@ -117,6 +118,7 @@ class User
$this->active = $row['use_active'];
$this->login = $row['use_login'];
$this->admin = $row['use_admin'];
$this->password = $row['use_pass'];
}
function save()
@ -409,7 +411,7 @@ class User
}
$sql = sprintf("insert into user_local_pref (user_id,parameter_value,parameter_type)
values ('%s','%d','PERIODE')", $this->login, $pid);
values ('%s','%d','PERIODE')", $this->id, $pid);
$Res = $this->db->exec_sql($sql);
}
@ -510,7 +512,7 @@ class User
*/
function check_module($p_module)
{
$acc=$this->db->get_value("select count(*) from v_all_menu where user_name = $1
$acc=$this->db->get_value("select count(*) from v_all_menu where user_name = $1
and me_code=$2", array($this->login,$p_module));
if ($acc == 0)
{
@ -624,14 +626,14 @@ class User
{
foreach ($default_parameter as $name => $value)
{
$Insert = sprintf($Sql, $this->login, $name, $value);
$Insert = sprintf($Sql, $this->id, $name, $value);
$cn->exec_sql($Insert);
}
}
else
{
$value = ($p_value == "") ? $default_parameter[$p_type] : $p_value;
$Insert = sprintf($Sql, $this->login, $p_type, $value);
$Insert = sprintf($Sql, $this->id, $p_type, $value);
$cn->exec_sql($Insert);
}
}
@ -991,15 +993,36 @@ class User
$sql = "insert into audit_connect (ac_user,ac_ip,ac_module,ac_url,ac_state) values ($1,$2,$3,$4,$5)";
if ($audit)
{
$cn->exec_sql($sql,
$cn->exec_sql($sql,
array(
$_SESSION['g_user'],
$_SERVER["REMOTE_ADDR"],
$p_module,
$_SERVER['REQUEST_URI'],
$_SESSION['g_user'],
$_SERVER["REMOTE_ADDR"],
$p_module,
$_SERVER['REQUEST_URI'],
$action));
}
}
function save_profile($p_id)
{
$count=$this->db->get_value("select count(*) from profile_user where user_name=$1", array($this->login));
if ($count==0)
{
$this->db->exec_sql("insert into profile_user(p_id,user_name)
values ($1,$2)",
array($p_id,$this->login));
} else {
$this->db->exec_sql("update profile_user set p_id=$1 where user_name=$2",
array($p_id,$this->login));
}
}
function get_profile()
{
$profile=$this->db->get_value("select p_id from profile_user where
user_name=$1",array($this->login));
return $profile;
}
}

View file

@ -1,49 +1,6 @@
<?php
define ("CAPA",210); //Ajout de plan analytique
define ("CAPO",220); //Ajout de poste analytique
define ("CAGA",230); //Ajout de groupe analytique
define('CAOD',235); // Ajout d'OD
define ("CAIMP",240); //Impression
define('GESTION',300); /* Access gestion */
define ("GEBQ",305); //Import en Banque
define ("GEOP",307); //Effacement d'opération
define ("GECOUR",310); //Courrier (lecture & écriture)
define ("GESUPPL",311); /* Fournisseur */
define ("GECUST",312); /* Clients */
define ("GEADM",313); /* Administration */
define ("GESTOCK",320); //gestion de stock
define ("IMPRAP",700); //Rapport
define ("IMPJRN",710); //Journaux
define ("IMPFIC",720); //Fiche
define ("IMPPOSTE",730); //Poste
define ("IMPBIL",740); //Bilan
define ("IMPBAL",750); /* Impression balance */
define ('FICADD',800); /* Ajout de fiche */
define ("FIC",805); //Création, modification et effacement de fiche
define ("FICCAT",910); //création, modification et effacement de catégorie de fiche
define ("PARCA",1100); //Mode comptabilité analytique
define ("PARPER",1110); //Ajout de période
define ("PARFIC",1120); //Catégorie des fiches
define ("PARDOC",1130); //Document
define ("PARCATDOC",1135); //Add Document category
define ("PARJRN",1140); //Modification journaux
define ("PARSEC",1245); /* Sécurité */
define ("PARTVA",1150); //TVA
define ("PARMP",1160); //Moyen de paiement
define ("PARCLO",1180); //Clôture
define ("PARPCMN",1185); /* Chagt plan comptable */
define ("PARPOS",1170); //Poste Comptable de base
define ("PARCENT",1190); //Centralisation
define ("PAREO",1200); //Écriture d'ouverture
define ("PARSTR",1210); //Mode strict
define ("PARCOORD",1220); //Coordonnées société
define ("PARRAP",1230); //Création de rapport
define ("PARPREDE",1240); //Effacement et création d'opération prédéfinie
define ("STOLE",1500); //Stock (lecture)
define ("STOWRITE",1510); //Stock (changement)
define ("EXTENSION",1600); //Extension
define ("PREVCON",1701); //Prevision
define ("PREVMOD",1702); //Prevision
global $audit; $audit=true;
?>

View file

@ -123,9 +123,9 @@ if ( isset ($_POST["DATABASE"]) )
$fev=29;
else
$fev=28;
xdebug_break();
$Res=$cn->exec_sql("delete from user_local_pref where parameter_type='PERIODE'");
$nb_day=array(31,$fev,31,30,31,30,31,31,30,31,30,30);
$nb_day=array(31,$fev,31,30,31,30,31,31,30,31,30,31);
$m=1;
foreach ($nb_day as $day)
{
@ -137,15 +137,13 @@ if ( isset ($_POST["DATABASE"]) )
$Res=$cn->exec_sql($sql);
$m++;
}
$sql=sprintf("insert into parm_periode (p_start,p_end,p_exercice)
values (to_date('31-12-%s','DD-MM-YYYY'),to_date('31-12-%s','DD-MM-YYYY'),'%s')",
$year,$year,$year);
$Res=$cn->exec_sql($sql);
$sql=" insert into jrn_periode(p_id,jrn_def_id,status) ".
"select p_id,jrn_def_id, 'OP'".
" from parm_periode cross join jrn_def";
$Res=$cn->exec_sql($sql);
Dossier::synchro_admin($l_id);
}
} // if $l_id != 0
@ -162,14 +160,8 @@ if ( $sa == 'list' )
echo HtmlInput::button_anchor(_('Rafraîchir'),'admin_repo.php?action=dossier_mgt');
echo HtmlInput::button_anchor(_('Ajouter'),'admin_repo.php?action=dossier_mgt&sa=add');
$offset=(isset($_REQUEST['offset']))?$_REQUEST['offset']:0;
$page=(isset($_REQUEST['page']))?$_REQUEST['page']:1;
$count=$cn->get_value("select count(*) from ac_dossier");
$size=(isset ($_SESSION['g_pagesize']))?$_SESSION['g_pagesize']:40;
if ( $size==-1) $size=200;
echo jrn_navigation_bar($offset,$count,$size,$page);
$repo=new Dossier(0);
$Res=$repo->show_dossier('all',$offset,$size);
$Res=$repo->show_dossier('all');
$compteur=1;
$template="";
@ -188,7 +180,7 @@ if ( $sa == 'list' )
else
$cl='class="even"';
echo "<TR $cl><TD VALIGN=\"TOP\"> ".
echo "<TR $cl><TD style=\"vertical-align:top\"> ".
$Dossier['dos_id']."</td><td> <B>".h($Dossier['dos_name'])."</B> </TD>";
$str_name=domaine.'dossier'.$Dossier['dos_id'];
$size=$cn->get_value("select pg_database_size($1)/(1024*1024)::float",
@ -217,7 +209,6 @@ if ( $sa == 'list' )
}
echo '</table>';
echo jrn_navigation_bar($offset,$count,$size,$page);
}

View file

@ -113,6 +113,7 @@ if (isset($_POST["FMOD_NAME"]))
$Res = $cn_mod->exec_sql("delete from del_jrnx");
$Res = $cn_mod->exec_sql("truncate table jrnx cascade ");
$Res = $cn_mod->exec_sql("delete from del_action");
$Res = $cn_mod->exec_sql("delete from profile_user");
$Res = $cn_mod->exec_sql('delete from operation_analytique');

View file

@ -27,59 +27,91 @@
include_once ("ac_common.php");
require_once("class_iselect.php");
require_once('class_dossier.php');
include_once ("class_user.php");
require_once('class_database.php');
require_once 'class_sort_table.php';
$gDossier=dossier::id();
$str_dossier=dossier::get();
require_once('class_database.php');
/* Admin. Dossier */
$cn=new Database($gDossier);
include_once ("class_user.php");
$User=new User($cn);
$User->Check();
$User->check_dossier($gDossier);
include_once ("user_menu.php");
$cn_dossier=new Database($gDossier);
if ( $User->check_action(PARSEC) == 0 )
{
/* Cannot Access */
NoAccess();
exit -1;
}
$cn=new Database();
/* Show all the users, included local admin */
$user_sql=$cn->exec_sql("select use_id,use_first_name,use_name,use_login,use_admin,priv_priv from ac_users natural join jnt_use_dos ".
" join priv_user on (jnt_id=priv_jnt) where use_login != 'phpcompta' and priv_priv <> 'X' and dos_id=".$gDossier.' order by use_login,use_name');
$MaxUser=Database::num_row($user_sql);
/////////////////////////////////////////////////////////////////////////
// List users
/////////////////////////////////////////////////////////////////////////
if ( ! isset($_REQUEST['action']))
{
echo '<DIV class="content" >';
$base_url=$_SERVER['PHP_SELF']."?ac=".$_REQUEST['ac']."&".dossier::get();
echo '<TABLE CELLSPACING="20" ALIGN="CENTER">';
echo '<DIV class="content" >';
$header=new Sort_Table();
$header->add('Login',$base_url,"order by use_login asc","order by use_login desc",'la','ld');
$header->add('Nom',$base_url,"order by use_name asc,use_first_name asc","order by use_name desc,use_first_name desc",'na','nd');
$header->add('Type d\'utilisateur',$base_url,"order by use_admin asc,use_login asc","order by use_admin desc,use_login desc",'ta','td');
$order=(isset($_REQUEST['ord']))?$_REQUEST['ord']:'la';
$ord_sql=$header->get_sql_order($order);
$repo=new Database();
/* Show all the users, included local admin */
$user_sql=$repo->exec_sql("select use_id,
use_first_name,
use_name,
use_login,
use_admin,
priv_priv
from ac_users natural join jnt_use_dos ".
" join priv_user on (jnt_id=priv_jnt)
where use_login != 'phpcompta' and priv_priv <> 'X'
and dos_id=$1 ".$ord_sql,
array($gDossier));
$MaxUser=Database::num_row($user_sql);
echo '<TABLE class="result" style="width:80%;margin-left:10%">';
echo "<tr>";
echo '<th>'.$header->get_header(0).'</th>';
echo '<th>'.$header->get_header(1).'</th>';
echo th('prénom');
echo th('profile');
echo '<th>'.$header->get_header(2).'</th>';
for ($i = 0;$i < $MaxUser;$i++)
{
echo '<tr>';
$l_line=Database::fetch_array($user_sql,$i);
// echo '<TR>';
if ( $i % 3 == 0 && $i != 0)
echo "</TR><TR>";
$str=($l_line['priv_priv'] == 'L')?'Local Admin':' ';
$str=($l_line['priv_priv'] == 'P')?'Uniquement Extension':$str;
$str="";
$str=($l_line['priv_priv'] == 'R')?'Utilisateur Normal':$str;
if ( $l_line['use_admin'] == 1 )
$str=' Super Admin';
$str=' Administrateur global';
printf ('<TD><A href="?p_action=sec&action=view&user_id=%s&'.$str_dossier.'">%s %s ( %s )[%s]</A></TD>',
$l_line['use_id'],
$l_line['use_first_name'],
$l_line['use_name'],
$l_line['use_login'],
$str);
// get profile
$profile=$cn->get_value("select p_name from profile
join profile_user using(p_id) where user_name=$1",array($l_line['use_login']));
$url=$base_url."&action=view&user_id=".$l_line['use_id'];
echo "<td>";
echo HtmlInput::anchor($l_line['use_login'], $url);
echo "</td>";
echo td($l_line['use_name']);
echo td($l_line['use_first_name']);
echo td($profile);
echo td($str);
echo "</TR>";
}
echo "</TR>";
echo '</TABLE>';
}
$action="";
@ -94,52 +126,70 @@ if ( isset ($_GET["action"] ))
//----------------------------------------------------------------------
if ( isset($_POST['ok']))
{
try
{
$cn->start();
$sec_User=new User($cn,$_POST['user_id']);
$sec_User=new User($cn_dossier,$_POST['user_id']);
/* Save first the ledger */
$cn_dossier=new Database(dossier::id());
$a=$cn_dossier->get_array('select jrn_def_id from jrn_def');
foreach ($a as $key)
// save profile
$sec_User->save_profile($_POST['profile']);
/* Save first the ledger */
$a=$cn->get_array('select jrn_def_id from jrn_def');
foreach ($a as $key)
{
$id=$key['jrn_def_id'];
$priv=sprintf("jrn_act%d",$id);
$count=$cn_dossier->get_value('select count(*) from user_sec_jrn where uj_login=$1 '.
$count=$cn->get_value('select count(*) from user_sec_jrn where uj_login=$1 '.
' and uj_jrn_id=$2',array($sec_User->login,$id));
if ( $count == 0 )
{
$cn_dossier->exec_sql('insert into user_sec_jrn (uj_login,uj_jrn_id,uj_priv)'.
$cn->exec_sql('insert into user_sec_jrn (uj_login,uj_jrn_id,uj_priv)'.
' values ($1,$2,$3)',
array($sec_User->login,$id,$_POST[$priv]));
}
else
{
$cn_dossier->exec_sql('update user_sec_jrn set uj_priv=$1 where uj_login=$2 and uj_jrn_id=$3',
$cn->exec_sql('update user_sec_jrn set uj_priv=$1 where uj_login=$2 and uj_jrn_id=$3',
array($_POST[$priv],$sec_User->login,$id));
}
}
/* now save all the actions */
$a=$cn_dossier->get_array('select ac_id from action');
$a=$cn->get_array('select ac_id from action');
foreach ($a as $key)
{
$id=$key['ac_id'];
$priv=sprintf("action%d",$id);
$count=$cn_dossier->get_value('select count(*) from user_sec_act where ua_login=$1 '.
if ( ! isset ($_POST[$priv]))
{
$cn->exec_sql("delete from user_sec_act where ua_act_id=$1",array($id));
continue;
}
$count=$cn->get_value('select count(*) from user_sec_act where ua_login=$1 '.
' and ua_act_id=$2',array($sec_User->login,$id));
if ( $_POST[$priv] == 1 && $count == 0)
{
$cn_dossier->exec_sql('insert into user_sec_act (ua_login,ua_act_id)'.
$cn->exec_sql('insert into user_sec_act (ua_login,ua_act_id)'.
' values ($1,$2)',
array($sec_User->login,$id));
}
if ($_POST[$priv] == 0 )
{
$cn_dossier->exec_sql('delete from user_sec_act where ua_login=$1 and ua_act_id=$2',
$cn->exec_sql('delete from user_sec_act where ua_login=$1 and ua_act_id=$2',
array($sec_User->login,$id));
}
}
}
$cn->commit();
} // end try
catch (Exception $e)
{
echo_warning ($e->getTraceAsString());
$cn->rollback();
}
}
@ -153,32 +203,23 @@ if ( isset($_POST['ok']))
if ( $action == "view" )
{
$l_Db=sprintf("dossier%d",$gDossier);
$return= HtmlInput::button_anchor('Retour à la liste','?&ac='.$_REQUEST['ac'].'&'.dossier::get(),'retour');
$cn=new Database();
$User=new User($cn,$_GET['user_id']);
$repo=new Database();
$User=new User($repo,$_GET['user_id']);
$admin=0;
$access=$User->get_folder_access($gDossier);
$str="Aucun accès";
if ( $access == 'L')
{
$str='Local Admin';
$admin=1;
}
elseif ($access=='R')
if ($access=='R')
{
$str=' Utilisateur normal';
}
elseif ($access=='P')
{
$str=' Extension uniquement';
}
if ( $User->admin==1 )
{
$str=' Super Admin';
$str=' Administrateur';
$admin=1;
}
@ -187,14 +228,22 @@ if ( $action == "view" )
if ( $admin != 0 )
{
echo '<h2 class="info"> Cet utilisateur est administrateur, il a tous les droits</h2>';
exit();
echo '<h2 class="notice"> Cet utilisateur est administrateur, il a tous les droits</h2>';
echo "<p> Impossible de modifier cet utilisateur dans cet écran, il faut passer par
l'écran administration -> utilisateur.
</p>";
echo $return;
exit();
}
//
// Check if the user can access that folder
if ( $access == 'X' )
{
echo "<H2 class=\"error\">L'utilisateur n'a pas accès à ce dossier</H2>";
echo "<p> Impossible de modifier cet utilisateur dans cet écran, il faut passer par
l'écran administration -> utilisateur.
</p>";
echo $return;
$action="";
return;
}
@ -203,32 +252,34 @@ if ( $action == "view" )
// Show access for journal
//--------------------------------------------------------------------------------
$Res=$cn_dossier->exec_sql("select jrn_def_id,jrn_def_name from jrn_def ".
$Res=$cn->exec_sql("select jrn_def_id,jrn_def_name from jrn_def ".
" order by jrn_def_name");
$sec_User=new User($cn_dossier,$_GET['user_id']);
$sec_User=new User($cn,$_GET['user_id']);
echo '<form method="post">';
$sHref=sprintf ('export.php?p_action=sec&act=PDF:sec&user_id=%s&'.$str_dossier ,
$sHref=sprintf ('export.php?act=PDF:sec&user_id=%s&'.$str_dossier ,
$_GET ['user_id']
);
echo HtmlInput::button('Imprime','imprime',"onclick=\"window.open('".$sHref."');\"");
echo HtmlInput::submit('ok','Sauve');
echo HtmlInput::reset('Annule');
echo HtmlInput::button_anchor('Retour à la liste','?p_action=sec&'.dossier::get(),'retour');
echo dossier::hidden();
echo HtmlInput::hidden('action','sec');
echo HtmlInput::hidden('user_id',$_GET['user_id']);
$i_profile=new ISelect ('profile');
$i_profile->value=$cn->make_array("select p_id,p_name from profile
order by p_name");
$i_profile->selected=$sec_User->get_profile();
echo "<p>";
echo " Profile ".$i_profile->input();
echo "</p>";
echo '<Fieldset><legend>Journaux </legend>';
echo '<table align="CENTER" width="100%">';
echo '<table>';
$MaxJrn=Database::num_row($Res);
$jrn_priv=new ISelect();
$array=array(
array ('value'=>'R','label'=>'Uniquement lecture'),
array ('value'=>'W','label'=>'Lecture et écriture'),
// array ('value'=>'O','label'=>'Uniquement opérations prédéfinies'),
array ('value'=>'X','label'=>'Aucun accès')
);
@ -238,9 +289,9 @@ if ( $action == "view" )
$l_line=Database::fetch_array($Res,$i);
echo '<TR> ';
if ( $i == 0 ) echo '<TD> <B> Journal </B> </TD>';
if ( $i == 0 ) echo '<TD class="num"> <B> Journal </B> </TD>';
else echo "<TD></TD>";
echo "<TD> $l_line[jrn_def_name] </TD>";
echo "<TD class=\"num\"> $l_line[jrn_def_name] </TD>";
$jrn_priv->name='jrn_act'.$l_line['jrn_def_id'];
$jrn_priv->value=$array;
@ -263,6 +314,7 @@ if ( $action == "view" )
echo HtmlInput::button('Imprime','imprime',"onclick=\"window.open('".$sHref."');\"");
echo HtmlInput::submit('ok','Sauve');
echo HtmlInput::reset('Annule');
echo $return;
echo '</form>';
} // end of the form
echo "</DIV>";

View file

@ -24,7 +24,7 @@ require_once('class_iradio.php');
require_once('class_ifile.php');
/*!\file
* \brief restaure a database
* \brief restaure a database
*/
if ( isset ($_REQUEST['sa'] ))
{
@ -111,6 +111,7 @@ if ( isset ($_REQUEST['sa'] ))
$new_cn->apply_patch($name,0);
echo '<span class="error">'.'Ne pas recharger la page, sinon votre base de données sera restaurée une fois de plus'.'</span>';
Dossier::synchro_admin($id);
echo $retour;
echo '</div>';

View file

@ -17,14 +17,28 @@ if ( $cn->get_value("select count(*) from profile join profile_user using (p_id)
<?=HtmlInput::default_value('ac', '', $_REQUEST)?>
<?=Dossier::hidden()?>
<?
$direct=new IText('ac');
$direct->style='class="direct"';
$direct->value='';
$direct->size=(strlen($direct->value)<10)?10:strlen($direct->value);
echo $direct->input();
$gDossier=dossier::id();
?>
<div id="ac_choices" class="autocomplete" ></div>
<?
echo HtmlInput::submit('go','aller');
?>
</form>
</form
<script type="text/javascript" charset="utf8" language="javascript">
try {
new Ajax.Autocompleter("ac","ac_choices","direct.php?gDossier=<?=$gDossier?>",
{paramName:"acs",minChars:1,indicator:null,
callback:null,
afterUpdateElement:null});} catch (e){alert(e.message);};
</script>
</div>
<?
endif;

View file

@ -8,7 +8,7 @@
$gDossier=dossier::id();
?>
<fieldset><legend><?php echo $p_legend;?></legend>
<TABLE align="right">
<TABLE >
<?php
foreach ( $p_array as $l_line){
@ -36,65 +36,16 @@
</td>
</tr>
<?php
}
} // end loop
?>
</table>
</fieldset>
<?php } ?>
<div style="float:left;width:33%">
<div style="float:top">
<?php $array=$cn_dossier->get_array(
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(1100,1400));
display_security_fieldset(_('Paramètre'),$array,$sec_User); ?>
<?php
</div>
</div>
<div style="float:left;width:33%">
<div style="float:top">
<?php $array=$cn_dossier->get_array("select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
}// end function
?>
<?php $array=$cn->get_array("select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(800,1000));
display_security_fieldset(_('Fiche'),$array,$sec_User); ?>
</div>
<div style="float:top">
<?php $array=$cn_dossier->get_array(
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(200,299));
display_security_fieldset(_('Comptabilité Analytique'),$array,$sec_User); ?>
</div>
<div style="float:top">
<?php $array=$cn_dossier->get_array(
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(700,799));
display_security_fieldset(_('Impression'),$array,$sec_User); ?>
</div>
</div>
<div style="float:left;">
<div style="float:top">
<?php $array=$cn_dossier->get_array(
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <$2 order by ac_id ",
array(1500,1600));
display_security_fieldset(_('Stock'),$array,$sec_User); ?>
</div>
<div style="float:top">
<?php $array=$cn_dossier->get_array(
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(1700,1799));
display_security_fieldset(_('Prévision'),$array,$sec_User); ?>
<div style="float:top">
<?php $array=$cn_dossier->get_array(
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(1600,1699));
display_security_fieldset(_('Extension'),$array,$sec_User); ?>
</div>
<div style="float:top">
<?php $array=$cn_dossier->get_array(
"select ac_id, ac_description from action where ac_id >=$1 and ac_id <=$2 order by ac_id ",
array(300,400));
display_security_fieldset(_('Gestion'),$array,$sec_User); ?>
</div>
</div>

View file

@ -23,15 +23,16 @@
/*!\file
*
*
* \brief user managemnt, included from admin_repo,
* \brief user managemnt, included from admin_repo,
* action=user_mgt
*
*/
require_once 'class_sort_table.php';
echo '<div class="content" style="width:80%;margin-left:10%">';
/******************************************************/
// Add user
/******************************************************/
if ( isset ($_POST["LOGIN"]) )
if ( isset ($_POST["ADD"]) )
{
$cn=new Database();
$pass5=md5($_POST['PASS']);
@ -43,14 +44,29 @@ if ( isset ($_POST["LOGIN"]) )
$login=str_replace('"',"",$login);
$login=str_replace(" ","",$login);
$login=strtolower($login);
if ( trim($login)=="")
{
alert("Le login ne peut pas être vide");
}
else
{
$Res=$cn->exec_sql("insert into ac_users(use_first_name,use_name,use_login,use_active,use_pass)
values ($1,$2,$3,1,$4)",
array($first_name,$last_name,$login,$pass5));
}
} //SET login
// View user detail
if ( isset($_REQUEST['det']))
{
require_once("user_detail.inc.php");
exit();
}
?>
<div class="content" style="width:80%;margin-left:10%">
<div id="create_user" style="display:none">
<h2>Gestion Utilisateurs</h2>
<TABLE> <TR>
<form action="admin_repo.php?action=user_mgt" method="POST">
@ -62,32 +78,32 @@ echo '<TR><TD> First Name </TD><TD><INPUT class="input_text" TYPE="TEXT" NAME="F
echo '<TD> Last Name </TD><TD><INPUT class="input_text" TYPE="TEXT" NAME="LNAME"></TD></TR>';
echo '<TR><TD> login </TD><TD><INPUT class="input_text" TYPE="TEXT" NAME="LOGIN"></TD>';
echo '<TD> password </TD><TD> <INPUT class="input_text" TYPE="TEXT" NAME="PASS"></TD></TR>';
echo '<TD> <INPUT TYPE="SUBMIT" class="button" Value="Create user" NAME="ADD"></TD>';
echo '</TABLE>';
echo HtmlInput::submit("ADD",'Créer Utilisateur');
echo HtmlInput::button_action("Fermer", "$('create_user').style.display='none';$('cu').style.display='block'");
?>
</FORM>
</div>
<?php
echo HtmlInput::button_action("Ajout utilisateur", "$('create_user').show();$('cu').hide()","cu");
// Show all the existing user on 7 columns
$repo=new Dossier(0);
/******************************************************/
// Detail of a user
/******************************************************/
if ( isset($_REQUEST['det']))
{
require_once("user_detail.inc.php");
exit();
}
$compteur=0;
$header=new Sort_Table();
$url=basename($_SERVER['PHP_SELF'])."&action=".$_REQUEST['action'];
$url=basename($_SERVER['PHP_SELF'])."?action=".$_REQUEST['action'];
$header->add("Login", $url," order by use_login asc", "order by use_login desc","la", "ld");
$header->add("Nom", $url," order by use_login asc", "order by use_login desc","la", "ld");
$header->add('Dossier',$url,' order by dossier_ag asc','order by dossier_ag desc',
'da','dd');
$header->add("Nom", $url," order by use_login asc", "order by use_login desc","na", "nd");
$header->add('Dossier',$url,' order by ag_dossier asc','order by ag_dossier desc',
'da','dd');
$ord=(isset($_REQUEST['ord']))?$_REQUEST['ord']:'la';
$sql=$header->get_sql_order($ord);
@ -101,16 +117,17 @@ if ( !empty ($a_user) )
echo '<th>'.$header->get_header(1).'</th>';
echo th("Prénom");
echo th("Actif");
echo "<th>Type</th>";
echo '<th>'.$header->get_header(2).'</th>';
echo '</tr>';
foreach ( $a_user as $r_user)
{
$compteur++;
$class=($compteur%2==0)?"odd":"even";
echo "<tr $class>";
if ( $rUser['use_active'] == 0 )
echo "<tr class=\"$class\">";
if ( $r_user['use_active'] == 0 )
{
$Active="non actif";
}
@ -122,10 +139,13 @@ if ( !empty ($a_user) )
echo "<td>";
echo HtmlInput::anchor($r_user['use_login'],$det_url);
echo "</td>";
echo td($r_user['use_name']);
echo td($r_user['use_first_name']);
echo td($Active);
$type=($r_user['use_admin']==1)?"Administrateur":"Utilisateur";
echo "<td>".$type."</td>";
echo td($r_user['ag_dossier']);
echo '</tr>';
}// foreach
echo '</table>';

View file

@ -61,8 +61,11 @@ if (isset($_POST['SAVE']))
$UserChange->admin = $_POST['Admin'];
if ( trim($_POST['password'])<>'')
{
$UserChange->pass = md5($_POST['pass']);
}
$UserChange->pass = md5($_POST['password']);
} else
{
$UserChange->pass=$UserChange->password;
}
$UserChange->save();
// Update Priv on Folder
@ -73,6 +76,7 @@ if (isset($_POST['SAVE']))
$db_id = substr($name, 4);
$cn = new Database();
$UserChange->set_folder_access($db_id, $elem);
Dossier::synchro_admin($db_id);
}
}
}
@ -97,6 +101,8 @@ $UserChange->load();
$it_pass=new IText('password');
$it_pass->value="";
?>
<h1 class="info">Modification</h1>
<? echo HtmlInput::button_anchor('Retour', 'admin_repo.php?action=user_mgt'); ?>
<FORM METHOD="POST">
<?=HtmlInput::hidden('UID',$uid)?>
@ -174,14 +180,15 @@ echo "</TD></TR>";
<!-- Show all database and rights -->
<H2 class="info"> Droit sur les dossiers pour les utilisateurs normaux </H2>
<p class="notice">
Les autres droits doivent être réglés dans les dossiers (paramètre->sécurité)
Les autres droits doivent être réglés dans les dossiers (paramètre->sécurité), le fait de changer un utilisateur d'administrateur à utilisateur
normal ne change pas le profil administrateur dans les dossiers.
Il faut aller dans CFGSECURITY pour diminuer ses privilèges.
</p>
<TABLE>
<?php
$array = array(
array('value' => 'X', 'label' => 'Aucun Accès'),
array('value' => 'R', 'label' => 'Utilisateur normal'),
array('value' => 'L', 'label' => 'Administrateur local(Tous les droits)')
array('value' => 'R', 'label' => 'Utilisateur normal')
);
$repo = new Dossier(0);
@ -218,9 +225,9 @@ foreach ($Dossier as $rDossier)
<input type="Submit" class="button" NAME="SAVE" VALUE="Sauver les changements" onclick="return confirm('Confirmer changement ?');">
<input type="Submit" class="button" NAME="DELETE" VALUE="Effacer" onclick="return confirm('Confirmer effacement ?');" >
</FORM>
<? echo HtmlInput::button_anchor('Retour', 'admin_repo.php?action=user_mgt'); ?>
</FORM>
</DIV>

26
sql/ajax-direct-form.sql Normal file
View file

@ -0,0 +1,26 @@
-- Function: comptaproc.get_pcm_tree(account_type)
DROP FUNCTION comptaproc.get_menu_tree(text);
CREATE OR REPLACE FUNCTION comptaproc.get_menu_tree(p_code text)
RETURNS SETOF text AS
$BODY$
declare
i record;
e RECORD;
begin
for i in select me_code from profile_menu where me_code_dep=p_code
loop
return next i;
for e in select get_pcm_tree from get_menu_tree(i)
loop
return next e;
end loop;
end loop;
return;
end;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100
ROWS 1000;

View file

@ -200,7 +200,7 @@ ALTER SEQUENCE profile_menu_pm_id_seq OWNED BY profile_menu.pm_id;
-- Name: profile_menu_pm_id_seq; Type: SEQUENCE SET; Schema: public; Owner: dany
--
SELECT pg_catalog.setval('profile_menu_pm_id_seq', 302, true);
SELECT pg_catalog.setval('profile_menu_pm_id_seq', 647, true);
--
@ -240,7 +240,7 @@ ALTER SEQUENCE profile_p_id_seq OWNED BY profile.p_id;
-- Name: profile_p_id_seq; Type: SEQUENCE SET; Schema: public; Owner: dany
--
SELECT pg_catalog.setval('profile_p_id_seq', 7, true);
SELECT pg_catalog.setval('profile_p_id_seq', 10, true);
--
@ -302,7 +302,7 @@ ALTER SEQUENCE profile_user_pu_id_seq OWNED BY profile_user.pu_id;
-- Name: profile_user_pu_id_seq; Type: SEQUENCE SET; Schema: public; Owner: dany
--
SELECT pg_catalog.setval('profile_user_pu_id_seq', 1, true);
SELECT pg_catalog.setval('profile_user_pu_id_seq', 5, true);
--
@ -346,7 +346,6 @@ INSERT INTO menu_ref VALUES ('TOOLPLAN', 'Import/export plan', 'tool_pcmn/index.
INSERT INTO menu_ref VALUES ('IMPORTBANK', 'Importation banque', 'importbank/index.php', NULL, 'Import. fichier CVS de la banque', 'plugin_code=IMPORTBANK', NULL, 'PL');
INSERT INTO menu_ref VALUES ('TOOL', 'Outil comptable', 'tools/index.php', NULL, 'Outil comptable', 'plugin_code=TOOL', NULL, 'PL');
INSERT INTO menu_ref VALUES ('TVA', 'Module de TVA', 'tva/index.php', NULL, 'Cette extension permet de faire les listings et declarations TVA', 'plugin_code=TVA', NULL, 'PL');
INSERT INTO menu_ref VALUES ('TEST', 'Cela va marcher', 'amortis/index.php', NULL, 'Test description', '0', NULL, 'PL');
INSERT INTO menu_ref VALUES ('ACH', 'Achat', 'compta_ach.inc.php', NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('CSV:AncBalGroup', 'Export Balance groupe analytique', NULL, NULL, NULL, NULL, NULL, 'PR');
INSERT INTO menu_ref VALUES ('OTH:Bilan', 'Export Bilan', NULL, NULL, NULL, NULL, NULL, 'PR');
@ -357,7 +356,6 @@ INSERT INTO menu_ref VALUES ('CSV:fichedetail', 'Export Fiche détail', NULL, NU
INSERT INTO menu_ref VALUES ('CFGMENU', 'Config. Menu', 'menu.inc.php', NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('MODULARITY', 'Menu et profile', NULL, NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('CFGPROFILE', 'Profile', 'profile.inc.php', NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('TESTTVA', 'Test TVA', 'tva/index.php', NULL, 'Test description', 'plugin_code=TESTTVA', NULL, 'PL');
INSERT INTO menu_ref VALUES ('SEARCH', 'Recherche', NULL, NULL, NULL, NULL, 'popup_recherche()', 'ME');
INSERT INTO menu_ref VALUES ('COMPANY', 'Sociétés', 'company.inc.php', NULL, 'Parametre societe', NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('PERIODE', 'Période', 'periode.inc.php', NULL, 'Gestion des périodes', NULL, NULL, 'ME');
@ -406,7 +404,6 @@ INSERT INTO menu_ref VALUES ('ADM', 'Administration', 'adm.inc.php', NULL, NULL,
INSERT INTO menu_ref VALUES ('FIN', 'Nouvel extrait', 'compta_fin.inc.php', NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('FINSALDO', 'Soldes', 'compta_fin_saldo.inc.php', NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('FINREC', 'Rapprochement', 'compta_fin_rec.inc.php', NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('ACCESS', 'Dossier', NULL, 'user_login.php', NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('JSSEARCH', 'Recherche', NULL, NULL, NULL, NULL, 'search_reconcile()', 'ME');
INSERT INTO menu_ref VALUES ('CFGLEDGER', 'journaux', 'cfgledger.inc.php', NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('CUSTDET', 'Fiche', 'detail_client.inc.php', NULL, NULL, NULL, NULL, 'ME');
@ -456,6 +453,7 @@ INSERT INTO menu_ref VALUES ('PRINTBAL', 'Balance', 'balance.inc.php', NULL, NUL
INSERT INTO menu_ref VALUES ('PRINTCARD', 'Catégorie de Fiches', 'impress_fiche.inc.php', NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('PRINT', 'Impression', NULL, NULL, NULL, NULL, NULL, 'ME');
INSERT INTO menu_ref VALUES ('MODOP', 'Modification d''opérations', 'modop/index.php', NULL, 'Modification opérations', 'plugin_code=MODOP', NULL, 'PL');
INSERT INTO menu_ref VALUES ('ACCESS', 'Accueil', NULL, 'user_login.php', NULL, NULL, NULL, 'ME');
--
@ -470,60 +468,46 @@ INSERT INTO profile VALUES ('Utilisateur', 6, 'Profil par défaut pour les Utili
-- Data for Name: profile_menu; Type: TABLE DATA; Schema: public; Owner: dany
--
INSERT INTO profile_menu VALUES (54, 'COMPANY', 'PARAM', 1, 1, 'E', 0);
INSERT INTO profile_menu VALUES (173, 'COMPTA', NULL, 1, 40, 'M', NULL);
INSERT INTO profile_menu VALUES (55, 'PERIODE', 'PARAM', 1, 2, 'E', 0);
INSERT INTO profile_menu VALUES (56, 'DIVPARM', 'PARAM', 1, 3, 'E', 0);
INSERT INTO profile_menu VALUES (59, 'CFGPAYMENT', 'DIVPARM', 1, 4, 'E', 0);
INSERT INTO profile_menu VALUES (60, 'CFGTVA', 'DIVPARM', 1, 5, 'E', 0);
INSERT INTO profile_menu VALUES (61, 'CFGACCOUNT', 'DIVPARM', 1, 6, 'E', 0);
INSERT INTO profile_menu VALUES (67, 'CFGCATDOC', 'DIVPARM', 1, 8, 'E', 0);
INSERT INTO profile_menu VALUES (175, 'COMPTA', NULL, 6, 40, 'M', NULL);
INSERT INTO profile_menu VALUES (68, 'CFGATTRIBCARD', 'DIVPARM', 1, 9, 'E', 0);
INSERT INTO profile_menu VALUES (69, 'CFGPCMN', 'PARAM', 1, 4, 'E', 0);
INSERT INTO profile_menu VALUES (70, 'CFGEXTENSION', 'PARAM', 1, 5, 'E', 0);
INSERT INTO profile_menu VALUES (54, 'COMPANY', 'PARAM', 1, 1, 'E', 0);
INSERT INTO profile_menu VALUES (178, 'CFGPAYMENT', 'DIVPARM', 6, 4, 'E', 0);
INSERT INTO profile_menu VALUES (179, 'CFGTVA', 'DIVPARM', 6, 5, 'E', 0);
INSERT INTO profile_menu VALUES (180, 'CFGACCOUNT', 'DIVPARM', 6, 6, 'E', 0);
INSERT INTO profile_menu VALUES (181, 'CFGCATDOC', 'DIVPARM', 6, 8, 'E', 0);
INSERT INTO profile_menu VALUES (71, 'CFGSECURITY', 'PARAM', 1, 6, 'E', 0);
INSERT INTO profile_menu VALUES (182, 'CFGATTRIBCARD', 'DIVPARM', 6, 9, 'E', 0);
INSERT INTO profile_menu VALUES (173, 'COMPTA', NULL, 1, 40, 'M', 0);
INSERT INTO profile_menu VALUES (55, 'PERIODE', 'PARAM', 1, 2, 'E', 0);
INSERT INTO profile_menu VALUES (56, 'DIVPARM', 'PARAM', 1, 3, 'E', 0);
INSERT INTO profile_menu VALUES (59, 'CFGPAYMENT', 'DIVPARM', 1, 4, 'E', 0);
INSERT INTO profile_menu VALUES (189, 'PLANANC', 'ANC', 6, 1, 'E', 0);
INSERT INTO profile_menu VALUES (190, 'CFGCARDCAT', 'DIVPARM', 6, 7, 'E', 0);
INSERT INTO profile_menu VALUES (191, 'ANCODS', 'ANC', 6, 2, 'E', 0);
INSERT INTO profile_menu VALUES (192, 'ANCGROUP', 'ANC', 6, 3, 'E', 0);
INSERT INTO profile_menu VALUES (193, 'ANCIMP', 'ANC', 6, 4, 'E', 0);
INSERT INTO profile_menu VALUES (194, 'LETTER', 'COMPTA', 6, 8, 'E', 0);
INSERT INTO profile_menu VALUES (60, 'CFGTVA', 'DIVPARM', 1, 5, 'E', 0);
INSERT INTO profile_menu VALUES (196, 'PREFERENCE', NULL, 6, 15, 'M', 1);
INSERT INTO profile_menu VALUES (197, 'LETTERCARD', 'LETTER', 6, 1, 'E', 0);
INSERT INTO profile_menu VALUES (72, 'PREDOP', 'PARAM', 1, 7, 'E', 0);
INSERT INTO profile_menu VALUES (198, 'LETTERACC', 'LETTER', 6, 2, 'E', 0);
INSERT INTO profile_menu VALUES (199, 'CUST', 'GESTION', 6, 1, 'E', 0);
INSERT INTO profile_menu VALUES (200, 'SUPPL', 'GESTION', 6, 2, 'E', 0);
INSERT INTO profile_menu VALUES (201, 'ADM', 'GESTION', 6, 3, 'E', 0);
INSERT INTO profile_menu VALUES (202, 'CARD', 'GESTION', 6, 6, 'E', 0);
INSERT INTO profile_menu VALUES (73, 'CFGDOCUMENT', 'PARAM', 1, 8, 'E', 0);
INSERT INTO profile_menu VALUES (203, 'STOCK', 'GESTION', 6, 5, 'E', 0);
INSERT INTO profile_menu VALUES (204, 'FORECAST', 'GESTION', 6, 7, 'E', 0);
INSERT INTO profile_menu VALUES (205, 'FOLLOW', 'GESTION', 6, 8, 'E', 0);
INSERT INTO profile_menu VALUES (74, 'CFGLEDGER', 'PARAM', 1, 9, 'E', 0);
INSERT INTO profile_menu VALUES (206, 'VERIFBIL', 'ADV', 6, 21, 'E', 0);
INSERT INTO profile_menu VALUES (207, 'STOCK', 'ADV', 6, 22, 'E', 0);
INSERT INTO profile_menu VALUES (208, 'PREDOP', 'ADV', 6, 23, 'E', 0);
INSERT INTO profile_menu VALUES (75, 'PLANANC', 'ANC', 1, 1, 'E', 0);
INSERT INTO profile_menu VALUES (209, 'OPEN', 'ADV', 6, 24, 'E', 0);
INSERT INTO profile_menu VALUES (65, 'CFGCARDCAT', 'DIVPARM', 1, 7, 'E', 0);
INSERT INTO profile_menu VALUES (76, 'ANCODS', 'ANC', 1, 2, 'E', 0);
INSERT INTO profile_menu VALUES (210, 'REPORT', 'ADV', 6, 25, 'E', 0);
INSERT INTO profile_menu VALUES (211, 'CARD', 'COMPTA', 6, 7, 'E', 0);
INSERT INTO profile_menu VALUES (77, 'ANCGROUP', 'ANC', 1, 3, 'E', 0);
INSERT INTO profile_menu VALUES (212, 'HIST', 'COMPTA', 6, 1, 'E', 0);
INSERT INTO profile_menu VALUES (213, 'FINSALDO', 'MENUFIN', 6, 3, 'E', 0);
INSERT INTO profile_menu VALUES (214, 'FINREC', 'MENUFIN', 6, 4, 'E', 0);
INSERT INTO profile_menu VALUES (215, 'ADV', 'COMPTA', 6, 20, 'E', 0);
INSERT INTO profile_menu VALUES (216, 'ACCESS', NULL, 6, 25, 'M', 0);
INSERT INTO profile_menu VALUES (217, 'CSV:histo', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (78, 'ANCIMP', 'ANC', 1, 4, 'E', 0);
INSERT INTO profile_menu VALUES (218, 'LOGOUT', NULL, 6, 30, 'M', 0);
INSERT INTO profile_menu VALUES (219, 'PRINT', 'GESTION', 6, 4, 'E', 0);
INSERT INTO profile_menu VALUES (220, 'new_line', NULL, 6, 35, 'M', 0);
@ -536,11 +520,10 @@ INSERT INTO profile_menu VALUES (226, 'MENUACH', 'COMPTA', 6, 3, 'E', 0);
INSERT INTO profile_menu VALUES (227, 'ACHIMP', 'MENUACH', 6, 2, 'E', 0);
INSERT INTO profile_menu VALUES (228, 'GESTION', NULL, 6, 45, 'M', 0);
INSERT INTO profile_menu VALUES (229, 'MENUODS', 'COMPTA', 6, 5, 'E', 0);
INSERT INTO profile_menu VALUES (23, 'LETTER', 'COMPTA', 1, 8, 'E', 0);
INSERT INTO profile_menu VALUES (45, 'PARAM', NULL, 1, 20, 'M', 0);
INSERT INTO profile_menu VALUES (230, 'ODS', 'MENUODS', 6, 1, 'E', 0);
INSERT INTO profile_menu VALUES (231, 'ODSIMP', 'MENUODS', 6, 2, 'E', 0);
INSERT INTO profile_menu VALUES (232, 'ANC', NULL, 6, 50, 'M', 0);
INSERT INTO profile_menu VALUES (61, 'CFGACCOUNT', 'DIVPARM', 1, 6, 'E', 0);
INSERT INTO profile_menu VALUES (234, 'VENMENU', 'COMPTA', 6, 2, 'E', 0);
INSERT INTO profile_menu VALUES (235, 'VEN', 'VENMENU', 6, 1, 'E', 0);
INSERT INTO profile_menu VALUES (236, 'VENIMP', 'VENMENU', 6, 2, 'E', 0);
@ -564,12 +547,16 @@ INSERT INTO profile_menu VALUES (253, 'PRINTCARD', 'IMP', 6, 12, 'E', 0);
INSERT INTO profile_menu VALUES (254, 'IMPORTBANK', 'EXTENSION', 6, NULL, 'S', 0);
INSERT INTO profile_menu VALUES (255, 'TOOL', 'EXTENSION', 6, NULL, 'S', 0);
INSERT INTO profile_menu VALUES (256, 'AMORTIS', 'MENUACH', 6, 10, 'E', 0);
INSERT INTO profile_menu VALUES (67, 'CFGCATDOC', 'DIVPARM', 1, 8, 'E', 0);
INSERT INTO profile_menu VALUES (258, 'CFGMENU', 'MODULARITY', 6, NULL, 'E', 0);
INSERT INTO profile_menu VALUES (259, 'CFGPROFILE', 'MODULARITY', 6, NULL, 'E', 0);
INSERT INTO profile_menu VALUES (260, 'PDF:postedetail', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (68, 'CFGATTRIBCARD', 'DIVPARM', 1, 9, 'E', 0);
INSERT INTO profile_menu VALUES (261, 'CSV:fichedetail', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (262, 'PDF:fichedetail', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (69, 'CFGPCMN', 'PARAM', 1, 4, 'E', 0);
INSERT INTO profile_menu VALUES (263, 'CSV:fiche_balance', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (70, 'CFGEXTENSION', 'PARAM', 1, 5, 'E', 0);
INSERT INTO profile_menu VALUES (264, 'PDF:fiche_balance', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (265, 'CSV:report', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (266, 'PDF:report', NULL, 6, NULL, 'P', 0);
@ -580,6 +567,7 @@ INSERT INTO profile_menu VALUES (270, 'PDF:glcompte', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (271, 'PDF:sec', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (272, 'CSV:AncList', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (273, 'CSV:AncBalSimple', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (526, 'PRINTGL', 'PRINT', 1, 20, 'E', 0);
INSERT INTO profile_menu VALUES (274, 'PDF:AncBalSimple', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (275, 'CSV:AncBalDouble', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (276, 'PDF:AncBalDouble', NULL, 6, NULL, 'P', 0);
@ -589,7 +577,23 @@ INSERT INTO profile_menu VALUES (279, 'CSV:AncTable', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (280, 'CSV:AncAccList', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (281, 'CSV:AncBalGroup', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (282, 'OTH:Bilan', NULL, 6, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (79, 'PREFERENCE', NULL, 1, 15, 'M', 1);
INSERT INTO profile_menu VALUES (71, 'CFGSECURITY', 'PARAM', 1, 6, 'E', 0);
INSERT INTO profile_menu VALUES (523, 'PRINTBAL', 'PRINT', 1, 50, 'E', 0);
INSERT INTO profile_menu VALUES (529, 'PRINTREPORT', 'PRINT', 1, 85, 'E', 0);
INSERT INTO profile_menu VALUES (72, 'PREDOP', 'PARAM', 1, 7, 'E', 0);
INSERT INTO profile_menu VALUES (73, 'CFGDOCUMENT', 'PARAM', 1, 8, 'E', 0);
INSERT INTO profile_menu VALUES (74, 'CFGLEDGER', 'PARAM', 1, 9, 'E', 0);
INSERT INTO profile_menu VALUES (75, 'PLANANC', 'ANC', 1, 1, 'E', 0);
INSERT INTO profile_menu VALUES (65, 'CFGCARDCAT', 'DIVPARM', 1, 7, 'E', 0);
INSERT INTO profile_menu VALUES (76, 'ANCODS', 'ANC', 1, 2, 'E', 0);
INSERT INTO profile_menu VALUES (77, 'ANCGROUP', 'ANC', 1, 3, 'E', 0);
INSERT INTO profile_menu VALUES (78, 'ANCIMP', 'ANC', 1, 4, 'E', 0);
INSERT INTO profile_menu VALUES (23, 'LETTER', 'COMPTA', 1, 8, 'E', 0);
INSERT INTO profile_menu VALUES (45, 'PARAM', NULL, 1, 20, 'M', 0);
INSERT INTO profile_menu VALUES (527, 'PRINTJRN', 'PRINT', 1, 10, 'E', 0);
INSERT INTO profile_menu VALUES (530, 'PRINTREC', 'PRINT', 1, 100, 'E', 0);
INSERT INTO profile_menu VALUES (524, 'PRINTBILAN', 'PRINT', 1, 90, 'E', 0);
INSERT INTO profile_menu VALUES (79, 'PREFERENCE', NULL, 1, 15, 'M', 0);
INSERT INTO profile_menu VALUES (24, 'LETTERCARD', 'LETTER', 1, 1, 'E', 0);
INSERT INTO profile_menu VALUES (27, 'LETTERACC', 'LETTER', 1, 2, 'E', 0);
INSERT INTO profile_menu VALUES (37, 'CUST', 'GESTION', 1, 1, 'E', 0);
@ -675,8 +679,9 @@ INSERT INTO profile_menu VALUES (146, 'CSV:AncTable', NULL, 1, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (147, 'CSV:AncAccList', NULL, 1, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (148, 'CSV:AncBalGroup', NULL, 1, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (149, 'OTH:Bilan', NULL, 1, NULL, 'P', 0);
INSERT INTO profile_menu VALUES (1, 'DASHBOARD', NULL, 1, 10, 'M', 0);
INSERT INTO profile_menu VALUES (302, 'TESTTVA', 'EXTENSION', 1, NULL, 'S', NULL);
INSERT INTO profile_menu VALUES (528, 'PRINTPOSTE', 'PRINT', 1, 30, 'E', 0);
INSERT INTO profile_menu VALUES (525, 'PRINTCARD', 'PRINT', 1, 40, 'E', 0);
INSERT INTO profile_menu VALUES (1, 'DASHBOARD', NULL, 1, 10, 'M', 1);
--
@ -694,6 +699,8 @@ INSERT INTO profile_menu_type VALUES ('M', 'Module');
--
INSERT INTO profile_user VALUES ('phpcompta', 1, 1);
INSERT INTO profile_user VALUES ('acama-viramar', 2, 1);
INSERT INTO profile_user VALUES ('adama', 5, 6);
--

View file

@ -1,24 +1,30 @@
\set ECHO all
\set ON_ERROR_ROLLBACK
\set ON_ERROR_STOP
begin;
drop table public.import_tmp;
drop table public.format_csv_banque;
insert into parametre values ('MY_ALPHANUM','N');
insert into parameter values ('MY_ALPHANUM','N');
delete from action where ac_id not in (800,805,910);
/*
script SQL to run
account_alphanum.sql
account_compute.sql
account_insert.sql
account-update.sql
change-pcmn-to-alphanum.sql
format_account.sql
tmp_pcmn_alphanum_ins_upd.sql
tmp_pcmn_ins.sql
trigger.tmp_pcmn.sql
account_add.sql
object-6.0.sql
-- for account repository
epad-style.sql
extension.sql
-- for account repository
change_account_repo.sql
*/
\i account_alphanum.sql
\i account_compute.sql
\i account_insert.sql
\i account-update.sql
-- \i change-pcmn-to-alphanum.sql
\i format_account.sql
\i tmp_pcmn_alphanum_ins_upd.sql
\i tmp_pcmn_ins.sql
\i trigger.tmp_pcmn.sql
\i account_add.sql
\i object-6.0.sql
\i extension.sql
-- for account repository
\i change_account_repo.sql
\i style-epad.sql
create unique index qcode_idx on fiche_detail (ad_value) where ad_id=23;
commit;