diff --git a/doc/INSTALL-fr.sgml b/doc/INSTALL-fr.sgml index b4e10a9ac..6140b1b7e 100644 --- a/doc/INSTALL-fr.sgml +++ b/doc/INSTALL-fr.sgml @@ -193,6 +193,11 @@ Recopier simplement le fichier fourni Sinon, adaptez votre fichier, il doit avoir au minimum les options suivantes + +magic_quotes_gpc = Off +magic_quotes_runtime = Off +magic_quotes_sybase = Off + register_globals = on [Session] diff --git a/html/user_impress.php b/html/user_impress.php index f5502766c..c99b9fa1f 100644 --- a/html/user_impress.php +++ b/html/user_impress.php @@ -31,114 +31,46 @@ include ("check_priv.php"); include_once ("top_menu_compta.php"); ShowMenuCompta($g_dossier,$g_UserProperty); - $p_array=array(array("user_jrn.php?JRN_TYPE=VEN" ,"Entrée"), - array("user_jrn.php?JRN_TYPE=ACH","Dépense"), - array("user_jrn.php?JRN_TYPE=FIN","Financier"), - array("user_jrn.php?JRN_TYPE=OD","Op. Diverses"), - array("impress.php","Impression"), - array("","Recherche") - ); - $result=ShowItem($p_array,'H',"cell","mtitle","impress.php"); - echo "
"; - echo $result; - echo "
"; +// show sub menu +$result=ShowJrn("user_impress.php"); +echo "
"; +echo $result; + +$p_array=array(array ("user_impress.php?type=jrn","Journaux"), + array("user_impress.php?type=poste","Poste"), + array("user_impress.php?type=form","Formulaire") + ); +$default=( isset ($_GET['type']))?"user_impress.php?type=".$_GET['type']:""; +$result=ShowItem($p_array,'H',"cell","mtitle",$default); +echo $result; + +echo "
"; -// $_GET['direct'] if we want to print from -// the advanced menu in the user interface -if ( isset ($_GET['direct'])) { - if ( isset ($g_jrn) ) { - echo_debug(__FILE__,__LINE__,"g_jrn is set --> come from user_profile"); - $p_id=$g_jrn; - } else { - if (isset ($_GET["p_id"]) ) { - $p_id=$_GET["p_id"]; - } - } -} include_once("impress_inc.php"); if ( $g_UserProperty['use_admin'] == 0 ) { - $r=CheckAction($g_dossier,$g_user,IMP); - if ($r == 0 ){ + if (CheckAction($g_dossier,$g_user,IMP) == 0 ){ /* Cannot Access */ NoAccess(); } - if ( isset ($_GET["type"])) { - if ( $type=="jrn") { - $right=CheckJrn($g_dossier,$g_user,$p_id); - if ($right == 0 ){ - /* Cannot Access */ - NoAccess(); - exit -1; - } - } - } } $l_Db=sprintf("dossier%d",$g_dossier); $cn=DbConnect($l_Db); - -// if the user has the profile compta show the left menu -if ( $g_UserProperty['use_usertype'] == 'compta' or - ! isset ($_GET['direct'])) - ShowMenuJrnUserImp($cn,$g_user,$g_dossier); - -// if the user has the profile compta show the left menu -if ( $g_UserProperty['use_usertype'] == 'user') { - if ( isset ($_GET['direct'])){ - // Get the jrn_type_id - include_once('jrn.php'); - $JrnProp=GetJrnProp($g_dossier,$g_jrn); - $jrn_type=$JrnProp['jrn_def_type']; - - // Display available menus - ShowMenuJrnUser($g_dossier,$g_UserProperty,$jrn_type,$g_jrn); - - // display jrn's menu - include_once('user_menu.php'); - $menu_jrn=u_ShowMenuJrn($cn,$jrn_type); - echo '
'; - echo $menu_jrn; - echo '
'; +// something is choosen +$default=( isset ($_GET['type']))?$_GET['type']:""; + switch ($default) { + case "jrn": + include ("impress_jrn.php"); + break; + case "poste": + include ("impress_poste.php"); + break; + case "form": + include ("impress_form.php"); + break; } -} // Menu for user's profile when printing from user_jrn - -// Ask the period -if ( isset ( $_GET["action"]) ) { - echo_debug(__FILE__,__LINE__," action is set "); - $a_print=$HTTP_GET_VARS; - // p_id come from the user interface - if ( isset($p_id) and isset ( $_GET['direct'])) { - $a_print['p_id']=$p_id; - } - echo '
'; - echo '

Choississez la période

'; - ViewImp($a_print,$cn); - echo '
'; -}//if ( isset ( $_GET["action"] )) - -// The period is given, now show the result -if ( isset ( $_POST["print"]) ) { - echo '
'; - $result=Imp($HTTP_POST_VARS,$cn); - if ($result== NO_PERIOD_SELECTED) { - echo ""; - return; - } - if ($result== NO_POST_SELECTED) { - echo ""; - return; - } - - if ( $_POST["action"]=="viewhtml") { - echo ""; - echo $result; - echo "
"; - } - - echo ''; -}//if ( isset ( $_GET["action"] )) html_page_stop(); ?> diff --git a/html/user_jrn.php b/html/user_jrn.php index 005f11316..ea228eab9 100644 --- a/html/user_jrn.php +++ b/html/user_jrn.php @@ -45,16 +45,15 @@ $l_Db=sprintf("dossier%d",$g_dossier); $cn=DbConnect($l_Db); ShowMenuCompta($g_dossier,$g_UserProperty); -// ShowMenuComptaRight($g_dossier,$g_UserProperty); + if ( $g_UserProperty['use_admin'] == 0 ) { - $r=CheckAction($g_dossier,$g_user,ENCJRN); - if ($r == 0 ){ + // check if user can access + if (CheckAction($g_dossier,$g_user,ENCJRN) == 0 ){ /* Cannot Access */ NoAccess(); } if ( isset ($g_jrn)) { - $right=CheckJrn($g_dossier,$g_user,$g_jrn); - if ($right == 0 ){ + if ($CheckJrn($g_dossier,$g_user,$g_jrn) == 0 ){ /* Cannot Access */ NoAccess(); exit -1; @@ -100,15 +99,14 @@ if ( isset ($_GET['JRN_TYPE'] ) ) { // if a journal is selected show the journal's menu if ( $g_jrn != -1 ) { - $p_array=array(array("user_jrn.php?JRN_TYPE=VEN" ,"Entrée"), - array("user_jrn.php?JRN_TYPE=ACH","Dépense"), - array("user_jrn.php?JRN_TYPE=FIN","Financier"), - array("user_jrn.php?JRN_TYPE=OD","Op. Diverses"), - array("impress.php","Impression"), - array("","Recherche") - ); - $result=ShowItem($p_array,'H',"cell","mtitle","user_jrn.php?JRN_TYPE=".$jrn_type); - +// $p_array=array(array("user_jrn.php?JRN_TYPE=VEN" ,"Entrée"), +// array("user_jrn.php?JRN_TYPE=ACH","Dépense"), +// array("user_jrn.php?JRN_TYPE=FIN","Financier"), +// array("user_jrn.php?JRN_TYPE=OD","Op. Diverses"), +// array("impress.php","Impression"), +// array("","Recherche") +// ); + $result=ShowJrn( "user_jrn.php?JRN_TYPE=".$jrn_type); // Get the jrn_type_id include_once('jrn.php'); $JrnProp=GetJrnProp($g_dossier,$g_jrn); diff --git a/include/top_menu_compta.php b/include/top_menu_compta.php index 30740d4e2..e80577070 100644 --- a/include/top_menu_compta.php +++ b/include/top_menu_compta.php @@ -438,15 +438,8 @@ function ShowMenuJrnUserImp($p_cn,$p_user,$p_dossier) $right=3; } - printf ('',$l_line['jrn_def_name']); - - - printf ('', - $l_line['jrn_def_id'],YES); - - printf ('', - $l_line['jrn_def_id'],YES - ); + printf ('',$l_line['jrn_def_id'],$l_line['jrn_def_name']); } $NoPriv=CountSql($p_cn,"select jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv, @@ -459,10 +452,8 @@ function ShowMenuJrnUserImp($p_cn,$p_user,$p_dossier) "); // Pour voir tout les journal ? if ( $NoPriv == 0 ) { - printf (''); - printf ('',NO); - printf ('',NO); - + printf (''); + } echo "
%sHtmlPdf
%s
Grand Livre HtmlPdf
Grand Livre
"; // Formulaire @@ -493,16 +484,11 @@ function ShowMenuJrnUserImp($p_cn,$p_user,$p_dossier) echo ' Poste '; - printf ('Poste'); - - - printf ('Html' - ); - - printf ('Pdf' - ); + printf ('Poste + + + '); echo ""; diff --git a/include/user_common.php b/include/user_common.php index a86749a99..48632d8f2 100644 --- a/include/user_common.php +++ b/include/user_common.php @@ -356,9 +356,12 @@ function ListJrn($p_cn,$p_jrn,$p_where="",$p_array=null) $r.=""; // cancel operation $r.=sprintf('', - "Effacer",$row['jr_grpt_id'],$l_sessid); + "Annuler",$row['jr_grpt_id'],$l_sessid); $r.=""; } + else { + $r.=" Opération annulée"; + } // end row $r.=""; diff --git a/include/user_menu.php b/include/user_menu.php index c5d289638..2cea02b3e 100644 --- a/include/user_menu.php +++ b/include/user_menu.php @@ -418,4 +418,27 @@ $left_menu=ShowItem(array( 'V'); return $left_menu; } +/* function ShowJrn + ************************************************** + * Purpose : Return a string containing the menu + * main menu when you click on Journaux + * parm : + * - $p_menu the current menu (selected) + * gen : + * - none + * return: a string + */ +function ShowJrn($p_menu="") +{ + + $p_array=array(array("user_jrn.php?JRN_TYPE=VEN" ,"Entrée"), + array("user_jrn.php?JRN_TYPE=ACH","Dépense"), + array("user_jrn.php?JRN_TYPE=FIN","Financier"), + array("user_jrn.php?JRN_TYPE=OD","Op. Diverses"), + array("user_impress.php","Impression"), + array("user_search.php","Recherche") + ); + $result=ShowItem($p_array,'H',"cell","mtitle",$p_menu); + return $result; +} ?>