';
- $r=FormODS($cn,$g_jrn,$g_user,$submit,$HTTP_POST_VARS,true,$nb_number);
+ $r=FormODS($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,$nb_number);
// if something goes wrong, correct it
if ( $r == null ) {
@@ -106,7 +105,7 @@ if ( $action == 'new' ) {
$submit='
';
- $r=FormODS($cn,$g_jrn,$g_user,$submit,$HTTP_POST_VARS,false, $nb_number);
+ $r=FormODS($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
}
echo '
';
echo $r;
@@ -115,14 +114,14 @@ if ( $action == 'new' ) {
}
// Save the charge into database
if ( isset($_POST['save'] )) {
- $r=RecordODS($cn,$HTTP_POST_VARS,$g_user,$g_jrn);
+ $r=RecordODS($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_SESSION['g_jrn']);
// Get number of lines
$nb_number=$_POST["nb_item"];
// submit button in the form
$submit='
Recorded
';
- $r.=FormODS($cn,$g_jrn,$g_user,$submit,$HTTP_POST_VARS,true, $nb_number);
+ $r.=FormODS($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true, $nb_number);
echo '
';
echo $r;
echo "
";
@@ -133,7 +132,7 @@ if ( $action == 'new' ) {
}
if ( $action == 'voir_jrn' ) {
// Check privilege
- if ( CheckJrn($g_dossier,$g_user,$g_jrn) < 1 ) {
+ if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 ) {
NoAccess();
exit -1;
}
@@ -156,8 +155,8 @@ echo 'P
?>
- $sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=$g_jrn ";
- $list=ListJrn($cn,$g_jrn,$sql);
+ $sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_SESSION['g_jrn'] ;
+ $list=ListJrn($cn,$_SESSION['g_jrn'],$sql);
echo $list;
@@ -167,7 +166,7 @@ echo 'P
//Search
if ( $action == 'search' ) {
// Check privilege
- if ( CheckJrn($g_dossier,$g_user,$g_jrn) <1 ) {
+ if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) <1 ) {
NoAccess();
exit -1;
}
@@ -176,12 +175,12 @@ if ( $action == 'search' ) {
$sessid=(isset ($_POST['PHPSESSID']))?$_POST['PHPSESSID']:$_GET['PHPSESSID'];
// display a search box
- $search_box=u_ShowMenuRecherche($cn,$g_jrn,$sessid,$HTTP_POST_VARS);
+ $search_box=u_ShowMenuRecherche($cn,$_SESSION['g_jrn'],$sessid,$HTTP_POST_VARS);
echo '
';
echo $search_box;
// if nofirst is set then show result
if ( isset ($_GET['nofirst'] ) ) {
- $a=ListJrn($cn,$g_jrn,"",$HTTP_POST_VARS);
+ $a=ListJrn($cn,$_SESSION['g_jrn'],"",$HTTP_POST_VARS);
echo $a;
}
echo '
';
diff --git a/include/user_action_ven.php b/include/user_action_ven.php
index 8a5f1cc62..49fa3552c 100644
--- a/include/user_action_ven.php
+++ b/include/user_action_ven.php
@@ -21,7 +21,7 @@
echo_debug(__FILE__,__LINE__,"include user_action_ven.php");
include_once("form_input.php");
include_once("class_widget.php");
-$cn=DbConnect($g_dossier);
+$cn=DbConnect($_SESSION['g_dossier']);
// default action is insert_vente
if ( ! isset ($_GET['action']) && ! isset ($_POST["action"]) ) {
// echo u_ShowMenuJrn($cn,$jrn_type);
@@ -39,7 +39,7 @@ if ( $action == 'insert_vente' ) {
$nb_number=$_POST["nb_item"];
$nb_number++;
- $form=FormVente($cn,$g_jrn,$g_user,$HTTP_POST_VARS,false,$nb_number);
+ $form=FormVente($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,false,$nb_number);
echo '
';
echo "here". $form;
echo '
';
@@ -49,11 +49,11 @@ if ( $action == 'insert_vente' ) {
// We want to see the encoded invoice
if ( isset ($_POST["view_invoice"])) {
$nb_number=$_POST["nb_item"];
- $form=FormVenteView($cn,$g_jrn,$g_user,$HTTP_POST_VARS,$nb_number);
+ $form=FormVenteView($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,$nb_number);
// Check failed : invalid date or quantity
if ( $form== null) {
echo_error("Cannot validate ");
- $form=FormVente($cn,$g_jrn,$g_user,$HTTP_POST_VARS,false,$nb_number);
+ $form=FormVente($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,false,$nb_number);
}
echo '
';
echo $form;
@@ -66,7 +66,7 @@ if ( $action == 'insert_vente' ) {
{
echo_debug(__FILE__,__LINE__,"Blank form");
// Show an empty form of invoice
- $form=FormVente($cn,$g_jrn,$g_user,null,false);
+ $form=FormVente($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],null,false);
echo '
';
echo $form;
echo '
';
@@ -78,23 +78,23 @@ if ( $action == 'insert_vente' ) {
// Save the invoice
if ( isset($_POST["record_invoice"])) {
// Check privilege
- if ( CheckJrn($g_dossier,$g_user,$g_jrn) != 2 ) {
+ if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) != 2 ) {
NoAccess();
exit -1;
}
// echo "RECORD INVOICE";
- RecordInvoice($cn,$HTTP_POST_VARS,$g_user,$g_jrn);
+ RecordInvoice($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_SESSION['g_jrn']);
}
if (isset ($_POST['correct_new_invoice'])) {
// Check privilege
- if ( CheckJrn($g_dossier,$g_user,$g_jrn) != 2 ) {
+ if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) != 2 ) {
NoAccess();
exit -1;
}
$nb=$_POST['nb_item'];
- $form=FormVente($cn,$g_jrn,$g_user,$HTTP_POST_VARS,false,$nb);
+ $form=FormVente($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,false,$nb);
echo '
';
echo $form;
echo '
';
@@ -102,13 +102,13 @@ if (isset ($_POST['correct_new_invoice'])) {
// Save and print the invoice
if ( isset($_POST["record_and_print_invoice"])) {
// Check privilege
- if ( CheckJrn($g_dossier,$g_user,$g_jrn) != 2 ) {
+ if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) != 2 ) {
NoAccess();
exit -1;
}
// echo "RECORD AND PRINT INVOICE";
- $comment=RecordInvoice($cn,$HTTP_POST_VARS,$g_user,$g_jrn);
+ $comment=RecordInvoice($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_SESSION['g_jrn']);
$nb_number=$_POST["nb_item"];
$form=FormVenteView($cn,$g_jrn,$g_user,$HTTP_POST_VARS,$nb_number,'noform',$comment);
@@ -120,7 +120,7 @@ if ( isset($_POST["record_and_print_invoice"])) {
if ( $action == 'voir_jrn' ) {
// Check privilege
- if ( CheckJrn($g_dossier,$g_user,$g_jrn) < 1 ) {
+ if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 ) {
NoAccess();
exit -1;
}
@@ -141,24 +141,24 @@ echo 'P
// Show list of sell
// Date - date of payment - Customer - amount
- $sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=$g_jrn ";
- $list=ListJrn($cn,$g_jrn,$sql);
+ $sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_SESSION['g_jrn'] ;
+ $list=ListJrn($cn,$_SESSION['g_jrn'],$sql);
echo $list;
echo '
';
}
if ( $action == 'voir_jrn_non_paye' ) {
// Check privilege
- if ( CheckJrn($g_dossier,$g_user,$g_jrn) < 1 ) {
+ if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 ) {
NoAccess();
exit -1;
}
// Show list of unpaid sell
// Date - date of payment - Customer - amount
- $sql=SQL_LIST_UNPAID_INVOICE_DATE_LIMIT." and jr_def_id=$g_jrn ";
- $list=ListJrn($cn,$g_jrn,$sql);
- $sql=SQL_LIST_UNPAID_INVOICE." and jr_def_id=$g_jrn ";
- $list2=ListJrn($cn,$g_jrn,$sql);
+ $sql=SQL_LIST_UNPAID_INVOICE_DATE_LIMIT." and jr_def_id=".$_SESSION['g_jrn'] ;
+ $list=ListJrn($cn,$_SESSION['g_jrn'],$sql);
+ $sql=SQL_LIST_UNPAID_INVOICE." and jr_def_id=".$_SESSION['g_jrn'] ;
+ $list2=ListJrn($cn,$_SESSION['g_jrn'],$sql);
echo '
';
echo '
Echeance dépassée
';
echo $list;
diff --git a/include/user_menu.php b/include/user_menu.php
index 8c55cc2e8..942cea701 100644
--- a/include/user_menu.php
+++ b/include/user_menu.php
@@ -196,7 +196,7 @@ function u_ShowMenuCompta($p_dossier)
* - string containing the html menu
*
*/
-function u_ShowMenuComptaRight($p_dossier=0,$p_admin,$p_more="")
+function u_ShowMenuComptaRight($p_dossier=0,$p_admin=0)
{
include_once("ac_common.php");
$i=0;
@@ -228,7 +228,7 @@ function u_ShowMenuComptaRight($p_dossier=0,$p_admin,$p_more="")
*
*/
-function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn)
+function u_ShowMenuJrnUser($p_dossier,$p_type,$p_jrn)
{
include_once ("debug.php");
include_once("constant.php");
@@ -242,13 +242,14 @@ function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn)
$Cn=DbConnect($p_dossier);
$User=new cl_user($Cn);
+ $User->Check();
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
join user_sec_jrn on uj_jrn_id=jrn_def_id
where
- uj_login='$p_user'
+ uj_login='".$User->id."'
and uj_priv !='X'
and jrn_def_type='$p_type'
");
@@ -266,7 +267,7 @@ function u_ShowMenuJrnUser($p_dossier,$p_user,$p_type,$p_jrn)
$l_line=pg_fetch_array($Ret,$i);
// Admin have always rights
if ( $User->Admin() == 0 ){
- $right=CheckJrn($p_dossier,$p_user,$l_line['jrn_def_id']);
+ $right=CheckJrn($p_dossier,$_SESSION['g_user'],$l_line['jrn_def_id']);
}else {
$right=3;
}