diff --git a/html/annulation.php b/html/annulation.php index 2fd5883f0..54219e0bf 100644 --- a/html/annulation.php +++ b/html/annulation.php @@ -32,12 +32,10 @@ include_once("jrn.php"); require_once("class_widget.php"); /* Admin. Dossier */ include_once ("class_user.php"); +require_once('class_dossier.php'); +$gDossier=dossier::id(); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); $User=new cl_user($cn); $User->Check(); @@ -50,7 +48,7 @@ if ( isset( $_GET['p_jrn'] )) { // Check privilege // CheckJrn verify that the user is not an admin // an admin has all right - if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) != 2 ) { + if ( CheckJrn($gDossier,$_SESSION['g_user'],$_GET['p_jrn']) != 2 ) { NoAccess(); exit -1; } @@ -81,6 +79,7 @@ soit par son écriture inverse ?

+ @@ -88,6 +87,7 @@ soit par son écriture inverse ?
+ @@ -376,13 +376,13 @@ if ( isset ($e_ech) ) { echo "
Echeance $e_ech
"; } for ( $i = 0; $i < $max_deb;$i++) { - $lib=GetPosteLibelle($_SESSION['g_dossier'],${"e_class_deb$i"}); + $lib=GetPosteLibelle($gDossier,${"e_class_deb$i"}); echo '
'; echo ${"e_class_deb$i"}." $lib "."".${"e_mont_deb$i"}.""; echo "
"; } for ( $i = 0; $i < $max_cred;$i++) { - $lib=GetPosteLibelle($_SESSION['g_dossier'],${"e_class_cred$i"}); + $lib=GetPosteLibelle($gDossier,${"e_class_cred$i"}); echo '
'; echo ${"e_class_cred$i"}." $lib "."".${"e_mont_cred$i"}.""; echo '
'; @@ -399,8 +399,8 @@ if ( $a != null ) { }//for }// if ( $a != null ) { -echo ' - +echo dossier::hidden(). +' diff --git a/html/bal_csv.php b/html/bal_csv.php index 9bea91d02..b5a500c54 100644 --- a/html/bal_csv.php +++ b/html/bal_csv.php @@ -26,9 +26,11 @@ header('Content-Disposition: attachment;filename="balance.csv"',FALSE); include_once ("ac_common.php"); include_once("class_balance.php"); include_once ("postgres.php"); +require_once('class_dossier.php'); +$gDossier=dossier::id(); include("class_jrn.php"); -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); include ('class_user.php'); diff --git a/html/bilan.php b/html/bilan.php index a850e99b9..18bbee55d 100644 --- a/html/bilan.php +++ b/html/bilan.php @@ -27,8 +27,11 @@ include_once("postgres.php"); require_once ('header_print.php'); include ('class_user.php'); +require_once('class_dossier.php'); +$gDossier=dossier::id(); + /* Admin. Dossier */ -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); $User=new cl_user($cn); $User->Check(); diff --git a/html/central.php b/html/central.php index a4ee0a179..457fbed0d 100644 --- a/html/central.php +++ b/html/central.php @@ -26,10 +26,9 @@ include_once ("ac_common.php"); html_page_start($_SESSION['g_theme']); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} +require_once('class_dossier.php'); +$gDossier=dossier::id(); + include_once ("postgres.php"); /* Admin. Dossier */ $rep=DbConnect(); @@ -41,14 +40,14 @@ include_once("preference.php"); include_once ("user_menu.php"); -echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php"); +echo ShowMenuCompta("user_advanced.php?".dossier::get()); -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); include_once("central_inc.php"); echo '
'; -echo ShowMenuAdvanced("central.php"); +echo ShowMenuAdvanced("central.php?".dossier::get()); echo '
'; $User->AccessRequest($cn,CENTRALIZE); @@ -72,6 +71,7 @@ if ( $_POST["periode"] != "" ) { $ret=FormPeriode($cn,0,NOTCENTRALIZED); if ( $ret != null) { echo ''; + echo dossier::hidden(); echo $ret; echo ''; echo '
'; diff --git a/html/commercial.php b/html/commercial.php index 9682b8f89..9e714b665 100644 --- a/html/commercial.php +++ b/html/commercial.php @@ -30,18 +30,15 @@ include_once ("ac_common.php"); require_once("constant.php"); include_once ("postgres.php"); echo JS_AJAX_FICHE; +require_once('class_dossier.php'); +$gDossier=dossier::id(); -if ( isset ($_REQUEST['dos'] ) ) { - $_SESSION['g_dossier']=$_REQUEST['dos']; - $g_name=GetDossierName($_SESSION['g_dossier']); - $_SESSION["g_name"]=$g_name; - -} +$g_name=dossier::name(); include_once ("postgres.php"); /* Admin. Dossier */ -$rep=DbConnect($_SESSION['g_dossier']); +$rep=DbConnect($gDossier); require_once ("class_user.php"); $User=new cl_user($rep); $User->Check(); @@ -64,22 +61,23 @@ if ( isset ( $_POST['p_size']) ) { /// html_page_start($_SESSION['g_theme'],"","richtext.js"); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { +if ( ! isset ( $gDossier ) ) { echo "Vous devez choisir un dossier "; exit -2; } include_once("preference.php"); include_once("user_menu.php"); +$str_dossier=dossier::get(); echo '
'; -echo "

Commercial ".$_SESSION['g_name']." "; +echo "

Commercial ".dossier::name()." "; echo '
- - - - + + + + - + @@ -87,26 +85,27 @@ echo '
$p_action=(isset ($_REQUEST['p_action']))?$_REQUEST['p_action']:""; // TODO Menu with all the customer + echo ShowItem(array( - array('?p_action=client','Client'), - array('?p_action=facture','Vente/Facture'), - array('?p_action=fournisseur','Fournisseur'), - array('?p_action=depense','Achat/Dépense'), - array('?p_action=impress','Impression'), - array('?p_action=stock','Stock'), - array('?p_action=bank','Banque'), - array('?p_action=fiche','Fiche'), - array('?p_action=contact','Contact'), - array('?p_action=admin','Administration'), - array('?p_action=suivi_courrier','Document'), + array('?p_action=client&'.$str_dossier,'Client'), + array('?p_action=facture&'.$str_dossier,'Vente/Facture'), + array('?p_action=fournisseur&'.$str_dossier,'Fournisseur'), + array('?p_action=depense&'.$str_dossier,'Achat/Dépense'), + array('?p_action=impress&'.$str_dossier,'Impression'), + array('?p_action=stock&'.$str_dossier,'Stock'), + array('?p_action=bank&'.$str_dossier,'Banque'), + array('?p_action=fiche&'.$str_dossier,'Fiche'), + array('?p_action=contact&'.$str_dossier,'Contact'), + array('?p_action=admin&'.$str_dossier,'Administration'), + array('?p_action=suivi_courrier&'.$str_dossier,'Document'), ), - 'H',"mtitle","mtitle","?p_action=$p_action",' width="100%"'); + 'H',"mtitle","mtitle","?p_action=$p_action&".$str_dossier,' width="100%"'); // echo '
'; -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); $User->AccessRequest($cn,SEC_GESTION); echo JS_VIEW_JRN_MODIFY; echo JS_AJAX_FICHE; diff --git a/html/compta.php b/html/compta.php index ad815aae0..81c3625d5 100644 --- a/html/compta.php +++ b/html/compta.php @@ -23,17 +23,15 @@ /*! \file * \brief Main page for the printing */ - +require_once('class_dossier.php'); +$gDossier=dossier::id(); include_once ("ac_common.php"); html_page_start($_SESSION['g_theme']); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} + include_once ("postgres.php"); /* Admin. Dossier */ -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); require_once ('class_user.php'); @@ -43,11 +41,11 @@ $User->Check(); require_once ("check_priv.php"); include_once ("user_menu.php"); echo '
'; - -echo ShowMenuCompta($_SESSION['g_dossier']); +$action=$_REQUEST['p_action']; +echo ShowMenuCompta("user_advanced.php?".dossier::get()); echo '
'; // Get action -$action=$_REQUEST['p_action']; + // call impress sub-menu @@ -58,6 +56,7 @@ if ( $action == 'impress' ) { require_once('impress.inc.php'); } if ( $action == 'fiche') { + require_once('fiche.inc.php'); } diff --git a/html/comptanalytic.php b/html/comptanalytic.php index b3ebce944..994025cd7 100644 --- a/html/comptanalytic.php +++ b/html/comptanalytic.php @@ -29,34 +29,27 @@ require_once("constant.php"); require_once("postgres.php"); require_once("ac_common.php"); - -if ( isset ($_GET['dos']) ) - $_SESSION['g_dossier']=$_GET['dos']; - -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "Vous devez choisir un dossier "; - exit -2; -} -$cn=DbConnect($_SESSION['g_dossier']); +require_once('class_dossier.php'); +$gDossier=dossier::id(); +$str_dossier=dossier::get(); +$cn=DbConnect($gDossier); require_once ("class_user.php"); $User=new cl_user($cn); $User->Check(); -$g_name=GetDossierName($_SESSION['g_dossier']); -$_SESSION["g_name"]=$g_name; html_page_start($_SESSION['g_theme']); //----------------------------------------------------------------- //Header echo '
'; -echo "

Analytique ".$_SESSION['g_name']." "; +echo "

Analytique ".dossier::name()." "; echo '
- - - - + + + +

'; @@ -79,9 +72,9 @@ if ( isset ($_REQUEST['p_action'])) } } echo ShowItem(array( - array('?p_action=ca_pa','Plan Analytique',"Plan Analytique",0), - array('?p_action=ca_od','Opérations Diverses',"Permet d'enregistrer des opérations sur la compta analytique",1), - array('?p_action=ca_imp','Impression',"impression de rapport",2) + array('?p_action=ca_pa&'.$str_dossier,'Plan Analytique',"Plan Analytique",0), + array('?p_action=ca_od&'.$str_dossier,'Opérations Diverses',"Permet d'enregistrer des opérations sur la compta analytique",1), + array('?p_action=ca_imp&'.$str_dossier,'Impression',"impression de rapport",2) ), 'H',"mtitle","mtitle",$def,' width="100%"'); echo '
'; diff --git a/html/ecrit_ouv.php b/html/ecrit_ouv.php index 3563c49d3..28d4655a1 100644 --- a/html/ecrit_ouv.php +++ b/html/ecrit_ouv.php @@ -26,14 +26,13 @@ include_once ("ac_common.php"); require_once('class_widget.php'); require_once('class_poste.php'); html_page_start($_SESSION['g_theme']); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} +require_once('class_dossier.php'); +$gDossier=dossier::id(); + include_once ("postgres.php"); /* Admin. Dossier */ include_once ("class_user.php"); -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); $User=new cl_user($cn); $User->Check(); @@ -41,21 +40,21 @@ include_once ("check_priv.php"); include_once ("user_menu.php"); echo '
'; -echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php"); +echo ShowMenuCompta("user_advanced.php?".dossier::get()); echo '
'; // \todo add a check for permission -echo ShowMenuAdvanced("ecrit_ouv.php"); +echo ShowMenuAdvanced(8); $User->AccessRequest($cn,EXP_IMP_ECR); echo ''; echo '
'; diff --git a/html/export_ouv.php b/html/export_ouv.php index 07267aa22..584a588c2 100644 --- a/html/export_ouv.php +++ b/html/export_ouv.php @@ -26,10 +26,9 @@ include_once ("ac_common.php"); require_once("class_poste.php"); header('Content-type: application/csv'); header('Content-Disposition: attachment;filename="export_ouv.csv"',FALSE); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} +require_once('class_dossier.php'); +$gDossier=dossier::id(); + include_once ("postgres.php"); /* Admin. Dossier */ $rep=DbConnect(); @@ -41,7 +40,7 @@ include_once ("check_priv.php"); include_once ("user_menu.php"); -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); $User->AccessRequest($cn,EXP_IMP_ECR); @@ -94,4 +93,4 @@ if ( round($sum,4) != 0.0 ) printf ("DIFFERENCE = $msg \n"); } -?> \ No newline at end of file +?> diff --git a/html/fiche_csv.php b/html/fiche_csv.php index 8e6b46e5a..ecb259ceb 100644 --- a/html/fiche_csv.php +++ b/html/fiche_csv.php @@ -28,8 +28,11 @@ include_once ("ac_common.php"); include_once('class_fiche.php'); include_once ("postgres.php"); include_once("check_priv.php"); +require_once('class_dossier.php'); +$gDossier=dossier::id(); + if ( isset ($_REQUEST['with_amount'])) include_once("class_poste.php"); -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); $rep=DbConnect(); include ('class_user.php'); diff --git a/html/fiche_new.php b/html/fiche_new.php index 671f8ea0d..0c6f01089 100644 --- a/html/fiche_new.php +++ b/html/fiche_new.php @@ -35,13 +35,10 @@ $User=new cl_user($rep); $User->Check(); html_page_start($User->theme,"onLoad='window.focus();'"); +require_once('class_dossier.php'); +$gDossier=dossier::id(); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} - -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); // TODO add security here // Get The priv on the selected folder if ( $User->CheckAction($cn,FICHE_WRITE)== 0) { @@ -63,6 +60,7 @@ foreach ($_GET as $key=>$element) { function new_fiche($p_cn,$p_type) { $fiche=new fiche($p_cn); $r='
'; + $r.=dossier::hidden(); $r.=''; $l_sessid=(isset ($_POST["PHPSESSID"]))?$_POST["PHPSESSID"]:$_GET["PHPSESSID"]; @@ -160,6 +158,7 @@ if ( sizeof($a)>1 and !isset ($_POST['cat'])) { echo "Choix catégories fiche"; echo ''; + echo dossier::hidden(); foreach ($a as $element) { $fiche_def=new fiche_def($cn,$element); $fiche_def->Get(); @@ -169,6 +168,6 @@ if ( sizeof($a)>1 and !isset ($_POST['cat'])) } echo ''; - echo ""; + echo "
"; } ?> diff --git a/html/fiche_search.php b/html/fiche_search.php index d86997103..8feedcb71 100644 --- a/html/fiche_search.php +++ b/html/fiche_search.php @@ -43,13 +43,11 @@ if ( isset ( $_GET['search']) ) -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} +require_once('class_dossier.php'); +$gDossier=dossier::id(); include_once ("check_priv.php"); -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); // Get The priv on the selected folder if ( $User->CheckAction($cn,FICHE_READ) == 0 ){ /* Cannot Access */ @@ -85,7 +83,7 @@ function SetData (name_ctl,value,value_2,value_3,value_4,value_5,value_6) { } $element) { diff --git a/html/fid.php b/html/fid.php index 60b0db951..c094026b2 100644 --- a/html/fid.php +++ b/html/fid.php @@ -5,9 +5,11 @@ include ("constant.php"); include ("postgres.php"); include("user_common.php"); include("debug.php"); +require_once('class_dossier.php'); +$gDossier=dossier::id(); echo_debug('fid.php',__LINE__,"Recherche fid.php".$_GET["FID"]); -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); if ( isset($_SESSION['isValid']) && $_SESSION['isValid'] == 1) { $d=$_GET['d']; diff --git a/html/form.php b/html/form.php index ba42a2577..1767cc989 100644 --- a/html/form.php +++ b/html/form.php @@ -26,10 +26,9 @@ include_once ("user_menu.php"); html_page_start($_SESSION['g_theme']); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} +require_once('class_dossier.php'); +$gDossier=dossier::id(); + include_once ("postgres.php"); /* Admin. Dossier */ $rep=DbConnect(); @@ -41,13 +40,13 @@ include_once("form_inc.php"); include_once ("user_menu.php"); echo '
'; -echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php"); +echo ShowMenuCompta("user_advanced.php?".dossier::get()); echo '
'; include ("check_priv.php"); -$cn=DbConnect($_SESSION['g_dossier']); -echo ShowMenuAdvanced("form.php"); +$cn=DbConnect($gDossier); +echo ShowMenuAdvanced(6); // Get The priv on the selected folder $User->AccessRequest($cn,FORM); @@ -65,14 +64,8 @@ if ( isset ($_POST["del_form"]) ) { // echo "
"; } -ShowMenuComptaForm($_SESSION['g_dossier']); +ShowMenuComptaForm(); -if ( isset($_GET["PHPSESSID"] )) { - $sessid=$_GET["PHPSESSID"]; -} -if ( isset($_POST["PHPSESSID"] )) { - $sessid=$_POST["PHPSESSID"]; -} if ( isset( $_REQUEST['PHPSESSID'])) { $sessid = $_REQUEST['PHPSESSID']; } diff --git a/html/form_csv.php b/html/form_csv.php index e1f2c2861..41c65bff4 100644 --- a/html/form_csv.php +++ b/html/form_csv.php @@ -28,9 +28,11 @@ include("class_rapport.php"); include("impress_inc.php"); header('Content-type: application/csv'); header('Content-Disposition: attachment;filename="rapport.csv"',FALSE); +require_once('class_dossier.php'); +$gDossier=dossier::id(); /* Admin. Dossier */ -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); $User=new cl_user($cn); diff --git a/html/form_pdf.php b/html/form_pdf.php index a057e8def..9556f8512 100644 --- a/html/form_pdf.php +++ b/html/form_pdf.php @@ -31,8 +31,11 @@ include_once("class.ezpdf.php"); include_once("impress_inc.php"); require_once('class_user.php'); require_once ('header_print.php'); +require_once('class_dossier.php'); +$gDossier=dossier::id(); + +$cn=DbConnect($gDossier); -$cn=DbConnect($_SESSION['g_dossier']); foreach ($_POST as $key=>$element) { ${"$key"}=$element; } diff --git a/html/import.php b/html/import.php index 8cc6b8c54..c3021fb25 100644 --- a/html/import.php +++ b/html/import.php @@ -29,11 +29,11 @@ include_once ("constant.php"); include_once ("postgres.php"); include_once ("check_priv.php"); include_once ("class_widget.php"); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} -$cn=DbConnect($_SESSION['g_dossier']); + +require_once('class_dossier.php'); +$gDossier=dossier::id(); + +$cn=DbConnect(); include ('class_user.php'); $User=new cl_user($cn); $User->Check(); @@ -47,12 +47,12 @@ include_once("import_inc.php"); include_once ("user_menu.php"); echo '
'; -echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php"); +echo ShowMenuCompta("user_advanced.php?".dossier::get()); echo '
'; -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); -echo ShowMenuAdvanced("import.php"); +echo ShowMenuAdvanced(7); $User->AccessRequest($cn,IMP_BQE); echo JS_AJAX_FICHE; diff --git a/html/jrn_add.php b/html/jrn_add.php index dc1df0f53..d09db9f13 100644 --- a/html/jrn_add.php +++ b/html/jrn_add.php @@ -26,10 +26,9 @@ include_once ("ac_common.php"); include_once("jrn.php"); html_page_start($_SESSION['g_theme']); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} +require_once('class_dossier.php'); +$gDossier=dossier::id(); + include_once ("postgres.php"); /* Admin. Dossier */ $rep=DbConnect(); @@ -40,12 +39,12 @@ include_once("check_priv.php"); include_once ("user_menu.php"); echo '
'; -echo ShowMenuCompta($_SESSION['g_dossier']); +echo ShowMenuCompta(); echo '
'; -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); $User->AccessRequest($cn,GJRN); @@ -102,7 +101,7 @@ echo_debug('jrn_add.php',__LINE__,"nom journal $p_jrn_name"); } echo ShowMenuAdvanced(); echo ''; $sessid=$_REQUEST['PHPSESSID']; @@ -110,6 +109,7 @@ $search=''; echo '
'; +echo dossier::hidden(); echo ''; echo ''; diff --git a/html/jrn_csv.php b/html/jrn_csv.php index 2309fc03b..12e8dd0e1 100644 --- a/html/jrn_csv.php +++ b/html/jrn_csv.php @@ -26,10 +26,13 @@ header('Content-type: application/csv'); header('Content-Disposition: attachment;filename="jrn.csv"',FALSE); include_once ("ac_common.php"); +require_once('class_dossier.php'); +$gDossier=dossier::id(); + include_once ("postgres.php"); include_once("check_priv.php"); include("class_jrn.php"); -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); $rep=DbConnect(); include ('class_user.php'); diff --git a/html/jrn_detail.php b/html/jrn_detail.php index 2845b251c..b97818fda 100644 --- a/html/jrn_detail.php +++ b/html/jrn_detail.php @@ -21,13 +21,11 @@ /*! \file * \brief Show and let modify ledger parameter */ +require_once('class_dossier.php'); +$gDossier=dossier::id(); include_once ("ac_common.php"); html_page_start($_SESSION['g_theme']); -if ( ! isset ( $_SESSION['g_dossier'] ) ) { - echo "You must choose a Dossier "; - exit -2; -} include_once ("postgres.php"); /* Admin. Dossier */ $rep=DbConnect(); @@ -40,12 +38,12 @@ include_once ("user_menu.php"); echo '
'; -echo ShowMenuCompta($_SESSION['g_dossier']); +echo ShowMenuCompta(); echo '
'; include_once("check_priv.php"); -$cn=DbConnect($_SESSION['g_dossier']); +$cn=DbConnect($gDossier); $User->AccessRequest($cn,GJRN); // Javascript @@ -126,7 +124,7 @@ If ( isset ($_POST["JRN_UPD"] )) { } echo ShowMenuAdvanced(); echo ''; ?> "); define ("JS_SHOW_TVA","