diff --git a/html/admin_repo.php b/html/admin_repo.php index 3ec416b79..d41d5fd89 100644 --- a/html/admin_repo.php +++ b/html/admin_repo.php @@ -25,7 +25,10 @@ include_once("debug.php"); html_page_start($g_UserProperty['use_theme']); echo_debug(__FILE__,__LINE__,"entering admin_repo"); -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); if ($g_UserProperty['use_admin'] != 1) { html_page_stop(); return; @@ -132,11 +135,14 @@ $template=""; // show all dossiers if ( $Res != null ) { - echo ""; foreach ( $Res as $Dossier) { - if ( $compteur%5 == 0 ) echo ""; - echo " $Dossier[dos_name]
$Dossier[dos_description]"; + if ( $compteur%2 == 0 ) + $cl='class="odd"'; + else + $cl='class="even"'; + + echo " $Dossier[dos_name] $Dossier[dos_description]"; $compteur++; } diff --git a/html/annulation.php b/html/annulation.php index 84342d17c..31f807db5 100644 --- a/html/annulation.php +++ b/html/annulation.php @@ -34,7 +34,10 @@ if ( ! isset ( $g_dossier ) ) { include_once ("postgres.php"); include_once("jrn.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); if ( isset( $p_jrn )) { session_register("g_jrn"); diff --git a/html/central.php b/html/central.php index 79dad1c55..486fcf2a5 100644 --- a/html/central.php +++ b/html/central.php @@ -29,7 +29,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include ("check_priv.php"); include_once("preference.php"); diff --git a/html/compta.php b/html/compta.php index cb61b4206..6714ffdb3 100644 --- a/html/compta.php +++ b/html/compta.php @@ -32,8 +32,14 @@ if ( isset ( $dos ) ) { } include_once ("postgres.php"); echo_debug(__FILE__,__LINE__,"user is $g_user"); -/* CheckUser */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); echo_debug(__FILE__,__LINE__,"theme ".$g_UserProperty['use_theme']); diff --git a/html/dossier_prefs.php b/html/dossier_prefs.php index 7682e787f..653339550 100644 --- a/html/dossier_prefs.php +++ b/html/dossier_prefs.php @@ -28,7 +28,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include("preference.php"); include_once ("top_menu_compta.php"); diff --git a/html/enc_jrn.php b/html/enc_jrn.php index 8cc7a9c3a..fe87c9b0c 100644 --- a/html/enc_jrn.php +++ b/html/enc_jrn.php @@ -34,7 +34,10 @@ if ( ! isset ( $g_dossier ) ) { include_once ("postgres.php"); include_once ("check_priv.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); if ( isset( $p_jrn )) { session_register("g_jrn"); $g_jrn=$p_jrn; diff --git a/html/facturation.php b/html/facturation.php index 284b802fc..3d1aaf41e 100644 --- a/html/facturation.php +++ b/html/facturation.php @@ -26,8 +26,14 @@ if ( ! isset ( $g_dossier ) ) { exit -2; } include_once ("postgres.php"); -/* CheckUser */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include ("top_menu_compta.php"); ShowMenuCompta($g_dossier,$g_UserProperty); diff --git a/html/fiche.php b/html/fiche.php index e62e74ee2..07a0c8b54 100644 --- a/html/fiche.php +++ b/html/fiche.php @@ -29,9 +29,12 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); include_once ("top_menu_compta.php"); -//echo ''; + echo JS_SEARCH_POSTE; -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include ("check_priv.php"); ShowMenuCompta($g_dossier,$g_UserProperty); @@ -70,7 +73,8 @@ if ( isset($_POST['add_modele']) and $write != 0) { AddModele($cn,$HTTP_POST_VARS); } -ShowMenuComptaLeft($g_dossier,MENU_FICHE); +ShowMenuFiche($g_dossier); + if ( isset ( $_GET["action"]) ) { $action=$_GET["action"]; // View the details of the selected cat. of cards diff --git a/html/fiche_new.php b/html/fiche_new.php index be04d8bfc..97b6adcc1 100644 --- a/html/fiche_new.php +++ b/html/fiche_new.php @@ -31,7 +31,10 @@ include_once ("postgres.php"); include_once ("check_priv.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); // TODO add security here // Get The priv on the selected folder if ( $g_UserProperty['use_admin'] == 0 ) { diff --git a/html/fiche_search.php b/html/fiche_search.php index 898be9bd4..c787e992a 100644 --- a/html/fiche_search.php +++ b/html/fiche_search.php @@ -30,10 +30,16 @@ if ( ! isset ( $g_dossier ) ) { include_once ("postgres.php"); include_once("jrn.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include_once ("check_priv.php"); // Get The priv on the selected folder diff --git a/html/form.php b/html/form.php index ec7a13f58..a7fd378fb 100644 --- a/html/form.php +++ b/html/form.php @@ -29,7 +29,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include_once("form_inc.php"); diff --git a/html/impress.php b/html/impress.php index cca152571..a2d9470db 100644 --- a/html/impress.php +++ b/html/impress.php @@ -26,7 +26,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include ("check_priv.php"); include_once ("top_menu_compta.php"); ShowMenuCompta($g_dossier,$g_UserProperty); diff --git a/html/jrn_add.php b/html/jrn_add.php index baf34c8fb..44e0d065c 100644 --- a/html/jrn_add.php +++ b/html/jrn_add.php @@ -28,7 +28,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include_once("check_priv.php"); include_once ("top_menu_compta.php"); ShowMenuCompta($g_dossier,$g_UserProperty); diff --git a/html/jrn_detail.php b/html/jrn_detail.php index abc93eb57..58f82cd23 100644 --- a/html/jrn_detail.php +++ b/html/jrn_detail.php @@ -26,7 +26,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include_once ("top_menu_compta.php"); ShowMenuCompta($g_dossier,$g_UserProperty); diff --git a/html/jrn_op_detail.php b/html/jrn_op_detail.php index 62417c69f..e5653f773 100644 --- a/html/jrn_op_detail.php +++ b/html/jrn_op_detail.php @@ -30,7 +30,10 @@ if ( ! isset ( $g_dossier ) ) { include_once ("postgres.php"); include_once("jrn.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); if ( isset( $p_jrn )) { session_register("g_jrn"); diff --git a/html/jrn_search.php b/html/jrn_search.php index a4e86f83d..30b6e2e53 100644 --- a/html/jrn_search.php +++ b/html/jrn_search.php @@ -27,7 +27,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); // Javascript echo JS_CONCERNED_OP; if ( isset( $p_jrn )) { diff --git a/html/jrn_update.php b/html/jrn_update.php index e173be8bd..4bde295b6 100644 --- a/html/jrn_update.php +++ b/html/jrn_update.php @@ -27,7 +27,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include_once ("check_priv.php"); diff --git a/html/line_update.php b/html/line_update.php index a9eb47bf2..230bbfee3 100644 --- a/html/line_update.php +++ b/html/line_update.php @@ -29,7 +29,10 @@ include_once ("postgres.php"); include_once("check_priv.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); if ( $g_UserProperty['use_admin'] == 0 ) { $r=CheckAction($g_dossier,$g_user,SECU); diff --git a/html/login.php b/html/login.php index b945cfc87..19f9163b3 100644 --- a/html/login.php +++ b/html/login.php @@ -34,7 +34,10 @@ if ( isset ($_POST["p_user"] ) ) { $cn=DbConnect("account_repository"); // Verif if User and Pass match DB // if no, then redirect to the login page - CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); $g_UserProperty=GetUserProperty($cn,$g_user); session_register("g_UserProperty"); if ( isset ( $_GET["PHPSESSID"]) ) diff --git a/html/modify_op.php b/html/modify_op.php index 711d16fd3..365cbbc3b 100644 --- a/html/modify_op.php +++ b/html/modify_op.php @@ -33,7 +33,10 @@ if ( ! isset ( $g_dossier ) ) { include_once ("postgres.php"); include_once("jrn.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); $dossier=sprintf("dossier%d",$g_dossier); $cn=DbConnect($dossier); diff --git a/html/pcmn_update.php b/html/pcmn_update.php index 3f687c44d..adde7118f 100644 --- a/html/pcmn_update.php +++ b/html/pcmn_update.php @@ -27,7 +27,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include_once ("top_menu_compta.php"); diff --git a/html/poste_search.php b/html/poste_search.php index 0ea82ad0e..b6248adf1 100644 --- a/html/poste_search.php +++ b/html/poste_search.php @@ -24,7 +24,10 @@ html_page_start($g_UserProperty['use_theme']); include_once ("postgres.php"); include_once("jrn.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); //echo ''; echo JS_SEARCH_POSTE; diff --git a/html/priv_user.php b/html/priv_user.php index 8f0842cdd..a4fdcc2dd 100644 --- a/html/priv_user.php +++ b/html/priv_user.php @@ -25,7 +25,10 @@ html_page_start($g_UserProperty['use_theme']); echo_debug(__FILE__,__LINE__,"entering priv_users"); -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); if ($g_UserProperty['use_admin'] != 1) { html_page_stop(); return; diff --git a/html/rate_chg.php b/html/rate_chg.php index 5bd0cf669..0a1acfb5e 100644 --- a/html/rate_chg.php +++ b/html/rate_chg.php @@ -35,7 +35,10 @@ function SaveRate(p_code,p_rate) } Check(); if ( $g_UserProperty['use_admin'] ) return; $dossier=sprint("dossier%d",$g_dossier); $cn=DbConnect($dossier); diff --git a/html/recherche.php b/html/recherche.php index de22ce2b4..009578601 100644 --- a/html/recherche.php +++ b/html/recherche.php @@ -59,7 +59,7 @@ if ( $g_UserProperty['use_admin'] == 0 ) { // display a search box $search_box=u_ShowMenuRecherche($cn,0,$sessid,$HTTP_POST_VARS); - echo '
'; + echo '
'; echo $search_box; // if nofirst is set then show result if ( isset ($_GET['nofirst'] ) ) { diff --git a/html/show_tva.php b/html/show_tva.php index 1beaa01f6..73745f3d0 100644 --- a/html/show_tva.php +++ b/html/show_tva.php @@ -23,7 +23,10 @@ include_once ("ac_common.php"); html_page_start($g_UserProperty['use_theme']); include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); if ( ! isset ( $g_dossier ) ) { echo "You must choose a Dossier "; diff --git a/html/stock.php b/html/stock.php index b2813b650..33dd66837 100644 --- a/html/stock.php +++ b/html/stock.php @@ -34,7 +34,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); // Synchronize rights SyncRight($g_dossier,$g_user); @@ -168,4 +171,4 @@ if ( $a != null ) { } echo '
'; html_page_stop(); -?> \ No newline at end of file +?> diff --git a/html/style-light.css b/html/style-light.css index e1ae38ea1..5aa0089b3 100644 --- a/html/style-light.css +++ b/html/style-light.css @@ -100,12 +100,22 @@ div.debit{ border-style:solid; border-width:1pt; } +div.recherche{ + position: absolute; + top:100px; + left:100px; + width:700px; + font-size:9px; + font-family:sans-serif; + +} div.redcontent{ position: absolute; - top:150px; + top:100px; left:250px; - width:600px; - font-size:12px; + width:700px; + font-size:9px; + font-family:sans-serif; } div.u_redcontent{ @@ -113,7 +123,8 @@ div.u_redcontent{ top:130px; left:150px; width:700px; - font-size:9pt; + font-size:9px; + font-family:sans-serif; } div.ccontent{ diff --git a/html/test.php b/html/test.php index b01bfdc8f..ab6666849 100644 --- a/html/test.php +++ b/html/test.php @@ -58,11 +58,6 @@ foreach (array('magic_quotes_gpc','magic_quotes_runtime') as $a) { } } -if ( ini_get('register_globals') != true ) - print ("

register_globals has a bad value !!!

"); - else - print 'register_globals : Ok
'; - if ( ereg("\.\.\/include",ini_get('include_path')) == false ) print ("

include_path incorrect !!!".ini_get('include_path')."

"); else diff --git a/html/user_advanced.php b/html/user_advanced.php index 9b55fd35b..590196d94 100644 --- a/html/user_advanced.php +++ b/html/user_advanced.php @@ -28,12 +28,21 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include_once ("postgres.php"); echo_debug(__FILE__,__LINE__,"user is $g_user"); -/* CheckUser */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); // We don't check permissions here in fact, permission are tested in the // functions diff --git a/html/user_compta.php b/html/user_compta.php index f5cc66519..cc6b2a681 100644 --- a/html/user_compta.php +++ b/html/user_compta.php @@ -35,8 +35,14 @@ if ( isset ( $dos ) ) { } include_once ("postgres.php"); echo_debug(__FILE__,__LINE__,"user is $g_user"); -/* CheckUser */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); // Synchronize rights SyncRight($g_dossier,$g_user); diff --git a/html/user_login.php b/html/user_login.php index 88dfaf48b..346eca329 100644 --- a/html/user_login.php +++ b/html/user_login.php @@ -20,7 +20,10 @@ // $Revision$ include_once ("ac_common.php"); include_once("postgres.php"); -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); html_page_start($g_UserProperty['use_theme']); include_once("user_menu.php"); //u_ShowMenu($g_UserProperty['use_admin']); diff --git a/html/user_pref.php b/html/user_pref.php index 9bfbdf15c..075adb676 100644 --- a/html/user_pref.php +++ b/html/user_pref.php @@ -46,7 +46,10 @@ if ( isset ($g_jrn) ) { } /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); // show the top menu depending of the use_style // comta style diff --git a/html/user_sec.php b/html/user_sec.php index df53cfb4a..dc21f2267 100644 --- a/html/user_sec.php +++ b/html/user_sec.php @@ -28,7 +28,10 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$rep=DbConnect(); +include_once ("class_user.php"); +$User=new cl_user($rep); +$User->Check(); include_once ("top_menu_compta.php"); ShowMenuCompta($g_dossier,$g_UserProperty); diff --git a/include/compta_menu.php b/include/compta_menu.php index d4597e233..9e7b9b29f 100644 --- a/include/compta_menu.php +++ b/include/compta_menu.php @@ -108,9 +108,12 @@ function c_ShowMenuJrnUser($p_dossier,$p_user) echo ''; include_once("postgres.php"); + include_once("class_user.php"); + $l_jrn=sprintf("dossier%d",$p_dossier); $Cn=DbConnect($l_jrn); - if ( CheckAdmin() ==0) { + $User=new cl_user($Cn); + if ( $User->Admin() ==0) { $Ret=ExecSql($Cn,"select jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv, jrn_deb_max_line,jrn_cred_max_line from jrn_def join jrn_type on jrn_def_type=jrn_type_id @@ -131,7 +134,7 @@ function c_ShowMenuJrnUser($p_dossier,$p_user) for ($i=0;$i<$Max;$i++) { $l_line=pg_fetch_array($Ret,$i); // Admin have always rights - if ( CheckAdmin() == 0 ){ + if ( $User->Admin() == 0 ){ $right=CheckJrn($p_dossier,$p_user,$l_line['jrn_def_id']); }else { $right=3; diff --git a/include/postgres.php b/include/postgres.php index 7af2eea8a..61aca6066 100644 --- a/include/postgres.php +++ b/include/postgres.php @@ -31,7 +31,7 @@ * Automatically redirect * ++*/ -function CheckUser() +/* obsolete function CheckUser() { global $g_user,$g_pass,$IsValid; echo_debug(__FILE__,__LINE__,"CheckUser"); @@ -66,6 +66,7 @@ function CheckUser() return $ret; } +*/ /*++ * function : ShowDossier * Parameter : p_type string : all for all dossiers lim for only the @@ -75,7 +76,7 @@ function CheckUser() * Show the folder where user have access ++*/ function ShowDossier($p_type,$p_first=0,$p_max=10,$p_Num=0) { - global $g_user; + $l_user=$_SESSION['g_user']; if ( $p_max == 0 ) { $l_step=""; } else { @@ -90,7 +91,7 @@ function ShowDossier($p_type,$p_first=0,$p_max=10,$p_Num=0) { natural join ac_dossier natural join ac_users inner join priv_user on priv_jnt=jnt_id where - use_login='".$g_user."' and priv_priv !='NO' + use_login='".$l_user."' and priv_priv !='NO' order by dos_name "; $p_Num=CountSql($cn,$l_sql); } @@ -110,13 +111,15 @@ function ShowDossier($p_type,$p_first=0,$p_max=10,$p_Num=0) { } // Check if the user has admin right // to be complete -function CheckAdmin() { - global $g_user,$g_pass; +/* obsolete function CheckAdmin() { + $l_user=$_SESSION($g_user); + $l_pass=$_SESSION($g_pass); + $res=0; - if ( $g_user != 'phpcompta') { - $pass5=md5($g_pass); - $sql="select use_id from ac_users where use_login='$g_user' + if ( $l_user != 'phpcompta') { + $pass5=md5($l_pass); + $sql="select use_id from ac_users where use_login='$l_user' and use_active=1 and use_admin=1 and use_pass='$pass5'"; $cn=DbConnect(); @@ -126,6 +129,8 @@ function CheckAdmin() { return $isAdmin; } +*/ + /* function DbConnect * purpose : connect to the database * parameter : p_db : db_name @@ -407,4 +412,4 @@ function GetArray($p_cn,$p_sql) { echo_debug(__FILE__,__LINE__,var_export($array,true)); return $array; } -?> \ No newline at end of file +?> diff --git a/include/top_menu_compta.php b/include/top_menu_compta.php index 67cb51b4a..79c5ff1d0 100644 --- a/include/top_menu_compta.php +++ b/include/top_menu_compta.php @@ -145,7 +145,7 @@ function ShowMenuComptaRight($p_dossier=0,$p_auser,$p_more="") * - none * */ -function ShowMenuAdminGlobalRight($p_dossier=0) +/* obsolete function ShowMenuAdminGlobalRight($p_dossier=0) { include_once("ac_common.php"); echo '
'; @@ -163,6 +163,7 @@ printf( '
Reto echo "
"; echo '
'; } +*/ /* function ShowMenuPcmn($p_start=1) * Purpose : Show the menu from the pcmn page * diff --git a/include/user_menu.php b/include/user_menu.php index 8fc32f095..2af38e69f 100644 --- a/include/user_menu.php +++ b/include/user_menu.php @@ -232,6 +232,7 @@ function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn) { include_once ("debug.php"); include_once("constant.php"); + include_once("class_user.php"); echo_debug(__FILE__,__LINE__,"U_SHOWMENUJRNUSER PTYPE=$p_type"); // echo '
'; echo ''; @@ -241,7 +242,8 @@ function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn) $l_jrn=sprintf("dossier%d",$p_dossier); $Cn=DbConnect($l_jrn); - if ( CheckAdmin() ==0) { + $User=new cl_user($Cn); + if ( $User->Admin() ==0) { $Ret=ExecSql($Cn,"select jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv, jrn_deb_max_line,jrn_cred_max_line from jrn_def join jrn_type on jrn_def_type=jrn_type_id @@ -264,7 +266,7 @@ function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn) for ($i=0;$i<$Max;$i++) { $l_line=pg_fetch_array($Ret,$i); // Admin have always rights - if ( CheckAdmin() == 0 ){ + if ( $User->Admin() == 0 ){ $right=CheckJrn($p_dossier,$p_user,$l_line['jrn_def_id']); }else { $right=3; @@ -442,4 +444,71 @@ function ShowJrn($p_menu="") $result=ShowItem($p_array,'H',"cell","mtitle",$p_menu); return $result; } + +/* function ShowMenuFiche + ************************************************** + * Purpose : + * + * parm : + * - + * gen : + * - + * return: + */ +function ShowMenuFiche($p_dossier) +{ + $l_dossier=sprintf("dossier%d",$p_dossier); + $cn=DbConnect($l_dossier); + echo '
'; + // TODO + // Only for developper + // A test must be added + echo ''; + $Res=ExecSql($cn,"select fd_id,fd_label from fiche_def order by fd_label"); + $Max=pg_NumRows($Res); + for ( $i=0; $i < $Max;$i++) { + $l_line=pg_fetch_array($Res,$i); + printf(' + + ', + $l_line['fd_label'], + $l_line['fd_id'], + $l_line['fd_id']); + } + echo "
+ Creation
%sVoir + Modifier
"; + echo '
'; +} +/* function ShowMenuAdminGlobalRight($p_dossier=0) + * Purpose : + * Same as previous : show the right menu + * parm : + * - p_dossier + * gen : + * - none + * return: + * - none + * + */ +function ShowMenuAdminGlobalRight($p_dossier=0) +{ + include_once("ac_common.php"); + echo '
'; + echo ''; + echo ''; + echo ''; + if ( $p_dossier != 0) { +printf( '', + $p_dossier); + } + + echo ''; + echo "
Accueil
Preference
Retour Dossier
'; + html_button_logout(); + echo '
"; + echo '
'; +} + ?>