enleve la variable globale g_jrn, remplace par param HTTP p_jrn partout

This commit is contained in:
Stan Pinte 2005-07-04 17:58:51 +00:00
parent 50e1d2d213
commit 21ca05d764
18 changed files with 126 additions and 124 deletions

View file

@ -40,15 +40,15 @@ if ( ! isset ( $_SESSION['g_dossier'] ) ) {
}
if ( isset( $p_jrn )) {
$g_jrn=$p_jrn;
$_SESSION["g_jrn"]=$g_jrn;
$p_jrn=$p_jrn;
$_SESSION["p_jrn"]=$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'],$_SESSION['g_jrn']) != 2 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) != 2 ) {
NoAccess();
exit -1;
}

View file

@ -132,11 +132,11 @@ if ( isset($_POST['add_fiche'])) {
} else { // We have to find it from the database
if ( $e_type == 'deb' ) {
$get='jrn_def_fiche_deb';
$sql="select $get as fiche from jrn_def where jrn_def_id=".$_SESSION['g_jrn'];
$sql="select $get as fiche from jrn_def where jrn_def_id=".$_GET['p_jrn'];
}
if ( $e_type == 'cred' ) {
$get='jrn_def_fiche_cred';
$sql="select $get as fiche from jrn_def where jrn_def_id=".$_SESSION['g_jrn'];
$sql="select $get as fiche from jrn_def where jrn_def_id=".$_GET['p_jrn'];
}

View file

@ -107,12 +107,12 @@ if ( isset ( $_POST['search']) ) {
// Get the field from database
if ( $e_type == 'deb' ) {
$get='jrn_def_fiche_deb';
$list_fiche=get_list_fiche($cn,$get,$_SESSION['g_jrn']);
$list_fiche=get_list_fiche($cn,$get,$_GET['p_jrn']);
$sql="select * from vw_fiche_attr where fd_id in ( $list_fiche )";
}
if ( $e_type == 'cred' ) {
$get='jrn_def_fiche_cred';
$list_fiche=get_list_fiche($cn,$get,$_SESSION['g_jrn']);
$list_fiche=get_list_fiche($cn,$get,$_GET['p_jrn']);
$sql="select * from vw_fiche_attr where fd_id in ( $list_fiche )";
}

View file

@ -46,8 +46,8 @@ if ( $User->CheckAction($cn,GJRN) == 0 ){
// Javascript
echo JS_SEARCH_POSTE;
if ( isset( $_GET['p_jrn'] )) {
$g_jrn=$_GET['p_jrn'];
$_SESSION["g_jrn"]=$g_jrn;
$p_jrn=$_GET['p_jrn'];
$_SESSION["p_jrn"]=$p_jrn;
}
@ -96,7 +96,7 @@ If ( isset ($_POST["JRN_UPD"] )) {
$l_deb_max_line,$l_cred_max_line,
$p_ech,$p_ech_lib,
$p_jrn_fiche_deb,$p_jrn_fiche_cred,
$_SESSION['g_jrn']
$_GET['p_jrn']
);
echo_debug($Sql);
$Res=ExecSql($cn,$Sql);
@ -110,7 +110,7 @@ $Res=ExecSql($cn,"select jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,".
"jrn_deb_max_line,jrn_cred_max_line,jrn_def_code".
",jrn_def_type,jrn_def_ech, jrn_def_ech_lib,jrn_def_fiche_deb,jrn_def_fiche_cred".
" from jrn_def where".
" jrn_def_id=".$_SESSION['g_jrn']);
" jrn_def_id=".$_GET['p_jrn']);
$l_line=pg_fetch_array($Res,0);
$sessid = $_REQUEST['PHPSESSID'];
$search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$sessid."','not')\">";

View file

@ -36,8 +36,8 @@ $User=new cl_user($rep);
$User->Check();
if ( isset( $_GET['$p_jrn'] )) {
$g_jrn=$_GE['p_jrn'];
$_SESSION[ "g_jrn"]=$g_jrn;
$p_jrn=$_GE['p_jrn'];
$_SESSION[ "p_jrn"]=$p_jrn;
}
$cn=DbConnect($_SESSION['g_dossier']);

View file

@ -36,8 +36,8 @@ if ( ! isset ( $_SESSION['g_dossier'] ) ) {
// Javascript
echo JS_CONCERNED_OP;
if ( isset( $p_jrn )) {
$g_jrn=$p_jrn;
$_SESSION[ "g_jrn"]=$g_jrn;
$p_jrn=$p_jrn;
$_SESSION[ "p_jrn"]=$p_jrn;
}
if (isset ($_GET['p_ctl'])) $p_ctl=$_GET['p_ctl'];

View file

@ -43,17 +43,17 @@ if ( ! isset ( $_SESSION['g_dossier'] ) ) {
$cn=DbConnect($_SESSION['g_dossier']);
if ( isset( $_GET['p_jrn'] )) {
$g_jrn=$_GET['p_jrn'];
$p_jrn=$_GET['p_jrn'];
} else {
if ( ! isset ( $_SESSION['g_jrn']) )
$g_jrn=0;
if ( ! isset ( $_GET['p_jrn']) )
$p_jrn=0;
else
$g_jrn=$_SESSION['g_jrn'];
$p_jrn=$_GET['p_jrn'];
}
if ( isset ( $_GET['action'] ) ) {
$action=$_GET['action'];
}
$_SESSION["g_jrn"]=$g_jrn;
$_SESSION["p_jrn"]=$p_jrn;
if ( isset ( $_POST['action'] ) ) {
@ -68,7 +68,7 @@ if ( ! isset ( $action )) {
echo JS_VIEW_JRN_MODIFY;
//////////////////////////////////////////////////////////////////////
if ( $action == 'update' ) {
if ( ($priv=CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn'])) < 1 ) {
if ( ($priv=CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn'])) < 1 ) {
NoAccess();
exit -1;
@ -95,7 +95,7 @@ if ( $action == 'update' ) {
// echo '</div>';
}
if ( isset($_POST['update_record']) ) {
if ( ($priv=CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$g_jrn)) !=2 ) {
if ( ($priv=CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn)) !=2 ) {
NoAccess();
exit -1;

View file

@ -71,7 +71,7 @@ if ( isset($_GET['filter'])) {
// have to find what account are available
$SqlCred="";
// Load the property
$l_line=GetJrnProperty($cn,$_SESSION['g_jrn']);
$l_line=GetJrnProperty($cn,$_GET['p_jrn']);
if ( strlen(trim ($l_line['jrn_def_class_cred']) ) > 0 ) {
$valid_cred=split(" ",$l_line['jrn_def_class_cred']);

View file

@ -37,19 +37,18 @@ if ( ! isset ( $_SESSION['g_dossier'] ) ) {
}
/* Admin. Dossier */
if ( isset( $_GET['p_jrn'] ))
{
$p_jrn=$_GET['p_jrn'];
} else
{
$p_jrn=-1;
}
if ( isset( $_GET['p_jrn'] )) {
$g_jrn=$_GET['p_jrn'];
} else {
if ( ! isset ($_SESSION['g_jrn']) )
$g_jrn=-1;
else
$g_jrn=$_SESSION['g_jrn'];
}
if ( isset ($_GET['JRN_TYPE'] ) ) {
$g_jrn=-1;
$p_jrn=-1;
}
$_SESSION["g_jrn"]=$g_jrn;
//$_SESSION["p_jrn"]=$p_jrn;
ShowMenuCompta($_SESSION['g_dossier']);
@ -60,13 +59,13 @@ if ( $User->admin == 0 ) {
/* Cannot Access */
NoAccess();
}
if ( isset ($g_jrn)) {
if (CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) == 0 ){
if ( isset ($p_jrn)) {
if (CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) == 0 ){
/* Cannot Access */
NoAccess();
exit -1;
}
} // if isset g_jrn
} // if isset p_jrn
}
// if show
@ -84,24 +83,24 @@ if ( isset ($_GET['JRN_TYPE'] ) ) {
$result=ShowJrn("user_jrn.php?JRN_TYPE=".$jrn_type);
echo "<DIV class=\"u_subtmenu\">";
echo $result;
ShowMenuJrnUser($_SESSION['g_dossier'],$_GET['JRN_TYPE'],$_SESSION['g_jrn']);
ShowMenuJrnUser($_SESSION['g_dossier'],$_GET['JRN_TYPE'],$p_jrn);
echo "</DIV>";
if ( $jrn_type=='NONE' ) include('user_action_gl.php');
if ( $jrn_type=='SALDO_FIN') include ('user_action_fin.php');
} else {
echo_debug("Selected is ".$_SESSION['g_jrn']);
echo_debug("Selected is ".$p_jrn);
// Get the jrn_type_id
include_once('jrn.php');
$JrnProp=GetJrnProp($_SESSION['g_dossier'],$_SESSION['g_jrn']);
$JrnProp=GetJrnProp($_SESSION['g_dossier'],$p_jrn);
$jrn_type=$JrnProp['jrn_def_type'];
echo_debug("Type is $jrn_type");
echo_debug("Jrn_def_type = $jrn_type");
echo '<div class="u_subtmenu">';
echo ShowJrn("user_jrn.php?JRN_TYPE=".$jrn_type);
ShowMenuJrnUser($_SESSION['g_dossier'],$jrn_type,$_SESSION['g_jrn']);
ShowMenuJrnUser($_SESSION['g_dossier'],$jrn_type,$p_jrn);
echo '</div>';
}
@ -112,28 +111,28 @@ if ( $jrn_type=='FIN' )
}
// if a journal is selected show the journal's menu
if ( $_SESSION['g_jrn'] != -1 ) {
if ( $p_jrn != -1 ) {
$result=ShowJrn( "user_jrn.php?JRN_TYPE=".$jrn_type);
// Get the jrn_type_id
include_once('jrn.php');
$JrnProp=GetJrnProp($_SESSION['g_dossier'],$_SESSION['g_jrn']);
$JrnProp=GetJrnProp($_SESSION['g_dossier'],$p_jrn);
$jrn_type=$JrnProp['jrn_def_type'];
// display jrn's menu
$menu_jrn=ShowMenuJrn($cn,$jrn_type);
$menu_jrn=ShowMenuJrn($cn,$jrn_type, $p_jrn);
// echo '<div class="searchmenu">';
// echo $result;
echo $menu_jrn;
// echo '</DIV>';
$g_dossier=$_SESSION['g_dossier'];
$g_user=$_SESSION['g_user'];
// Execute Action for g_jrn
// Execute Action for p_jrn
if ( $jrn_type=='VEN' ) include('user_action_ven.php');
if ( $jrn_type=='ACH' ) include('user_action_ach.php');
if ( $jrn_type=='FIN' ) include('user_action_fin.php');
if ( $jrn_type=='OD ' ) include('user_action_ods.php');
} // if isset g_jrn
} // if isset p_jrn
html_page_stop();
?>

View file

@ -162,9 +162,9 @@ function RefreshMe() {
window.location.reload();
}
</script>");
define ("JS_VIEW_JRN_MODIFY","<script language=\"javascript\">function modifyOperation(p_value,p_sessid)
define ("JS_VIEW_JRN_MODIFY","<script language=\"javascript\">function modifyOperation(p_value,p_sessid,p_jrn)
{
var win=window.open('modify_op.php?action=update&line='+p_value+'&PHPSESSID='+p_sessid,'Modifie','toolbar=no,width=500,height=400,scrollbars=yes,resizable=yes');
var win=window.open('modify_op.php?action=update&p_jrn='+p_jrn+'&line='+p_value+'&PHPSESSID='+p_sessid,'Modifie','toolbar=no,width=500,height=400,scrollbars=yes,resizable=yes');
}
function RefreshMe() {
window.location.reload();

View file

@ -716,6 +716,9 @@ function GetRappel($p_cn,$p_jrnx_id,$p_jrn_id,$p_exercice,$which,$p_type,$p_cent
* return:
* - array
*
*
* NOTE: problem: the formulas don't take date range parameters into account....TODO.
* --> I would like to get the sum of operations between two specified dates.
*/
function ParseFormula($p_cn,$p_label,$p_formula,$p_cond) {
while (ereg("(\[[0-9]*%*\])",$p_formula,$e) == true) {
@ -749,6 +752,7 @@ function ParseFormula($p_cn,$p_label,$p_formula,$p_cond) {
* - none
* return:
* - array
*
*
*/
function GetFormulaValue($p_cn,$p_label,$p_formula,$p_cond)

View file

@ -37,7 +37,7 @@ $action=(isset($_GET['action']))?$_GET['action']:$_POST['action'];
if ( $action == 'new' ) {
// We request a new form
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) != 2 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) != 2 ) {
NoAccess();
exit -1;
}
@ -49,7 +49,7 @@ if ( $action == 'new' ) {
// add a one-line calculator
$r=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,null,false);
$r=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,null,false);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
@ -68,7 +68,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
$r=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
$r=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
@ -83,7 +83,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
$r=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
$r=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
@ -97,13 +97,13 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
$r=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,$nb_number);
$r=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,$nb_number);
// if something goes wrong, correct it
if ( $r == null ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
$r=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
$r=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
}
echo '<div class="u_redcontent">';
echo $r;
@ -112,14 +112,14 @@ if ( $action == 'new' ) {
}
// Save the charge into database
if ( isset($_POST['save'] )) {
$r=RecordAchat($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_SESSION['g_jrn']);
$r=RecordAchat($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_GET['p_jrn']);
// Get number of lines
$nb_number=$_POST["nb_item"];
// submit button in the form
$submit='<h2 class="info">Recorded</h2>';
$r.=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true, $nb_number,true);
$r.=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true, $nb_number,true);
echo '<div class="u_redcontent">';
echo $r;
echo "</div>";
@ -130,7 +130,7 @@ if ( $action == 'new' ) {
}
if ( $action == 'voir_jrn' ) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) < 1 ) {
NoAccess();
exit -1;
}
@ -153,25 +153,25 @@ echo 'P
// Show list of sell
echo_debug ("user_action_ach.php");
// Date - date of payment - Customer - amount
$sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_SESSION['g_jrn'];
$list=ListJrn($cn,$_SESSION['g_jrn'],$sql);
$sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_GET['p_jrn'];
$list=ListJrn($cn,$_GET['p_jrn'],$sql);
echo $list;
echo '</div>';
}
if ( $action == 'voir_jrn_non_paye' ) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_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=".$_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);
$sql=SQL_LIST_UNPAID_INVOICE_DATE_LIMIT." and jr_def_id=".$_GET['p_jrn'] ;
$list=ListJrn($cn,$_GET['p_jrn'],$sql);
$sql=SQL_LIST_UNPAID_INVOICE." and jr_def_id=".$_GET['p_jrn'] ;
$list2=ListJrn($cn,$_GET['p_jrn'],$sql);
echo '<div class="u_redcontent">';
echo '<h2 class="info"> Echeance dépassée </h2>';
echo $list;
@ -183,7 +183,7 @@ if ( $action == 'voir_jrn_non_paye' ) {
//Search
if ( $action == 'search' ) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) < 1 ) {
NoAccess();
exit -1;
}
@ -192,12 +192,12 @@ if ( $action == 'search' ) {
$sessid=(isset ($_POST['PHPSESSID']))?$_POST['PHPSESSID']:$_GET['PHPSESSID'];
// display a search box
$search_box=u_ShowMenuRecherche($cn,$_SESSION['g_jrn'],$sessid,$HTTP_POST_VARS);
$search_box=u_ShowMenuRecherche($cn,$_GET['p_jrn'],$sessid,$HTTP_POST_VARS);
echo '<DIV class="u_redcontent">';
echo $search_box;
// if nofirst is set then show result
if ( isset ($_GET['nofirst'] ) ) {
$a=ListJrn($cn,$_SESSION['g_jrn'],"",$HTTP_POST_VARS);
$a=ListJrn($cn,$_GET['p_jrn'],"",$HTTP_POST_VARS);
echo $a;
}
echo '</DIV>';

View file

@ -36,7 +36,7 @@ $action=(isset($_GET['action']))?$_GET['action']:$_POST['action'];
//////////////////////////////////////////////////////////////////////
if ( $action == 'new' ) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) != 2 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) != 2 ) {
NoAccess();
exit -1;
}
@ -49,7 +49,7 @@ if ( $action == 'new' ) {
// add a one-line calculator
$r=FormFin($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,null,false);
$r=FormFin($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,null,false);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."</div>";
@ -69,7 +69,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
$r=FormFin($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
$r=FormFin($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."</div>";
@ -85,7 +85,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
$r=FormFin($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
$r=FormFin($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."</div>";
@ -100,7 +100,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
$r=FormFin($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,$nb_number);
$r=FormFin($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,$nb_number);
// if something goes wrong correct it
if ( $r == null ) {
@ -108,7 +108,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
$r=FormFin($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
$r=FormFin($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
}
echo '<div class="u_redcontent">';
@ -118,14 +118,14 @@ if ( $action == 'new' ) {
}
// Save the charge into database
if ( isset($_POST['save'] )) {
$r=RecordFin($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_SESSION['g_jrn']);
$r=RecordFin($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_GET['p_jrn']);
// Get number of lines
$nb_number=$_POST["nb_item"];
// submit button in the form
$submit='<h2 class="info">Recorded</h2>';
$r.=FormFin($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true, $nb_number,true);
$r.=FormFin($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true, $nb_number,true);
echo '<div class="u_redcontent">';
echo $r;
echo "</div>";
@ -139,13 +139,13 @@ if ( $action == 'new' ) {
//////////////////////////////////////////////////////////////////////
if ( $action == 'voir_jrn' ) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) < 1 ) {
NoAccess();
exit -1;
}
?>
<div class="u_redcontent">
<form method="post" action="user_jrn.php?action=voir_jrn">
<form method="post" action="user_jrn.php?action=voir_jrn&p_jrn=hop">
<?
$w=new widget("select");
@ -162,8 +162,8 @@ echo 'P
// Show list of sell
echo_debug ("user_action_jrn.php");
// Date - date of payment - Customer - amount
$sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_SESSION['g_jrn'];
$list=ListJrn($cn,$_SESSION['g_jrn'],$sql);
$sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_GET['p_jrn'];
$list=ListJrn($cn,$_GET['p_jrn'],$sql);
echo $list;
echo '</div>';
}

View file

@ -36,7 +36,7 @@ $action=(isset($_GET['action']))?$_GET['action']:$_POST['action'];
// action = new
if ( $action == 'new' ) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) != 2 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) != 2 ) {
NoAccess();
exit -1;
}
@ -49,7 +49,7 @@ if ( $action == 'new' ) {
// add a one-line calculator
$r=FormODS($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,null,false);
$r=FormODS($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,null,false);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
@ -68,7 +68,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout Poste">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
$r=FormODS($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
$r=FormODS($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
@ -83,7 +83,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout Poste">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
$r=FormODS($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
$r=FormODS($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
echo '<div class="u_redcontent">';
echo $r;
echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
@ -97,7 +97,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
$submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
$r=FormODS($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,$nb_number);
$r=FormODS($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,$nb_number);
// if something goes wrong, correct it
if ( $r == null ) {
@ -105,7 +105,7 @@ if ( $action == 'new' ) {
$submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout Poste">
<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
$r=FormODS($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
$r=FormODS($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false, $nb_number);
}
echo '<div class="u_redcontent">';
echo $r;
@ -114,14 +114,14 @@ if ( $action == 'new' ) {
}
// Save the charge into database
if ( isset($_POST['save'] )) {
$r=RecordODS($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_SESSION['g_jrn']);
$r=RecordODS($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_GET['p_jrn']);
// Get number of lines
$nb_number=$_POST["nb_item"];
// submit button in the form
$submit='<h2 class="info">Recorded</h2>';
$r.=FormODS($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true, $nb_number,true);
$r.=FormODS($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true, $nb_number,true);
echo '<div class="u_redcontent">';
echo $r;
echo "</div>";
@ -132,7 +132,7 @@ if ( $action == 'new' ) {
}
if ( $action == 'voir_jrn' ) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) < 1 ) {
NoAccess();
exit -1;
}
@ -155,8 +155,8 @@ echo 'P
?>
</form>
<?
$sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_SESSION['g_jrn'] ;
$list=ListJrn($cn,$_SESSION['g_jrn'],$sql);
$sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_GET['p_jrn'] ;
$list=ListJrn($cn,$_GET['p_jrn'],$sql);
echo $list;
@ -166,7 +166,7 @@ echo 'P
//Search
if ( $action == 'search' ) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) <1 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) <1 ) {
NoAccess();
exit -1;
}
@ -175,12 +175,12 @@ if ( $action == 'search' ) {
$sessid=(isset ($_POST['PHPSESSID']))?$_POST['PHPSESSID']:$_GET['PHPSESSID'];
// display a search box
$search_box=u_ShowMenuRecherche($cn,$_SESSION['g_jrn'],$sessid,$HTTP_POST_VARS);
$search_box=u_ShowMenuRecherche($cn,$_GET['p_jrn'],$sessid,$HTTP_POST_VARS);
echo '<DIV class="u_redcontent">';
echo $search_box;
// if nofirst is set then show result
if ( isset ($_GET['nofirst'] ) ) {
$a=ListJrn($cn,$_SESSION['g_jrn'],"",$HTTP_POST_VARS);
$a=ListJrn($cn,$_GET['p_jrn'],"",$HTTP_POST_VARS);
echo $a;
}
echo '</DIV>';

View file

@ -38,7 +38,7 @@ if ( $action == 'insert_vente' ) {
$nb_number=$_POST["nb_item"];
$nb_number++;
$form=FormVente($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,false,$nb_number);
$form=FormVente($cn,$_GET['p_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,false,$nb_number);
echo '<div class="u_redcontent">';
echo "here". $form;
echo '</div>';
@ -48,11 +48,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,$_SESSION['g_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,$nb_number);
$form=FormVenteView($cn,$_GET['p_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,$_SESSION['g_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,false,$nb_number);
$form=FormVente($cn,$_GET['p_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,false,$nb_number);
}
echo '<div class="u_redcontent">';
echo $form;
@ -65,7 +65,7 @@ if ( $action == 'insert_vente' ) {
{
echo_debug(__FILE__,__LINE__,"Blank form");
// Show an empty form of invoice
$form=FormVente($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],null,false);
$form=FormVente($cn,$_GET['p_jrn'],$_SESSION['g_user'],null,false);
echo '<div class="u_redcontent">';
echo $form;
echo '</div>';
@ -77,23 +77,23 @@ if ( $action == 'insert_vente' ) {
// Save the invoice
if ( isset($_POST["record_invoice"])) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) != 2 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) != 2 ) {
NoAccess();
exit -1;
}
// echo "RECORD INVOICE";
RecordInvoice($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_SESSION['g_jrn']);
RecordInvoice($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_GET['p_jrn']);
}
if (isset ($_POST['correct_new_invoice'])) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) != 2 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) != 2 ) {
NoAccess();
exit -1;
}
$nb=$_POST['nb_item'];
$form=FormVente($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,false,$nb);
$form=FormVente($cn,$_GET['p_jrn'],$_SESSION['g_user'],$HTTP_POST_VARS,false,$nb);
echo '<div class="u_redcontent">';
echo $form;
echo '</div>';
@ -101,17 +101,17 @@ if (isset ($_POST['correct_new_invoice'])) {
// Save and print the invoice
if ( isset($_POST["record_and_print_invoice"])) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) != 2 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) != 2 ) {
NoAccess();
exit -1;
}
// echo "RECORD AND PRINT INVOICE";
$comment=RecordInvoice($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_SESSION['g_jrn']);
$comment=RecordInvoice($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_GET['p_jrn']);
$nb_number=$_POST["nb_item"];
$form=FormVenteView($cn,$g_jrn,$g_user,$HTTP_POST_VARS,$nb_number,'noform',$comment);
$form=FormVenteView($cn,$p_jrn,$g_user,$HTTP_POST_VARS,$nb_number,'noform',$comment);
echo '<div class="u_redcontent">';
echo $form;
@ -121,7 +121,7 @@ if ( isset($_POST["record_and_print_invoice"])) {
if ( $action == 'voir_jrn' ) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) < 1 ) {
NoAccess();
exit -1;
}
@ -142,24 +142,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=".$_SESSION['g_jrn'] ;
$list=ListJrn($cn,$_SESSION['g_jrn'],$sql);
$sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_GET['p_jrn'] ;
$list=ListJrn($cn,$_GET['p_jrn'],$sql);
echo $list;
echo '</div>';
}
if ( $action == 'voir_jrn_non_paye' ) {
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 ) {
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_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=".$_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);
$sql=SQL_LIST_UNPAID_INVOICE_DATE_LIMIT." and jr_def_id=".$_GET['p_jrn'] ;
$list=ListJrn($cn,$_GET['p_jrn'],$sql);
$sql=SQL_LIST_UNPAID_INVOICE." and jr_def_id=".$_GET['p_jrn'] ;
$list2=ListJrn($cn,$_GET['p_jrn'],$sql);
echo '<div class="u_redcontent">';
echo '<h2 class="info"> Echeance dépassée </h2>';
echo $list;
@ -174,7 +174,7 @@ if ( $action == 'voir_jrn_non_paye' ) {
//Search
// if ( $action == 'search' ) {
// // Check privilege
// if ( CheckJrn($g_dossier,$g_user,$g_jrn) < 1 ) {
// if ( CheckJrn($g_dossier,$g_user,$p_jrn) < 1 ) {
// NoAccess();
// exit -1;
// }
@ -184,12 +184,12 @@ if ( $action == 'voir_jrn_non_paye' ) {
// // display a search box
// $search_box=u_ShowMenuRecherche($cn,$g_jrn,$sessid,$HTTP_POST_VARS);
// $search_box=u_ShowMenuRecherche($cn,$p_jrn,$sessid,$HTTP_POST_VARS);
// echo '<DIV class="u_redcontent">';
// 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,$p_jrn,"",$HTTP_POST_VARS);
// echo $a;
// }
// echo '</DIV>';

View file

@ -351,8 +351,8 @@ function ListJrn($p_cn,$p_jrn,$p_where="",$p_array=null)
//internal code
// button modify
$r.="<TD>";
$r.=sprintf('<A class="detail" HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s</A>',
$row['jr_id'],$l_sessid,$row['jr_internal']);
$r.=sprintf('<A class="detail" HREF="javascript:modifyOperation(\'%s\',\'%s\',\'%s\')" >%s</A>',
$row['jr_id'], $l_sessid, $p_jrn, $row['jr_internal']);
$r.="</TD>";
// date
$r.="<TD>";

View file

@ -297,7 +297,7 @@ function ShowMenuJrnUser($p_dossier,$p_type,$p_jrn)
//echo '</div>';
}
/* function u_ShowMenuJrn
/* function ShowMenuJrn
* Purpose : Show the menu of the jrn depending of its type
*
* parm :
@ -311,7 +311,7 @@ function ShowMenuJrnUser($p_dossier,$p_type,$p_jrn)
* return:
* - string containing the menu
*/
function ShowMenuJrn($p_cn,$p_jrn_type)
function ShowMenuJrn($p_cn,$p_jrn_type,$p_jrn)
{
$Res=ExecSql($p_cn,"select ja_name,ja_url,ja_action,ja_desc from jrn_action where ja_jrn_type='$p_jrn_type'
@ -327,9 +327,8 @@ function ShowMenuJrn($p_cn,$p_jrn_type)
$lib=str_replace($access_key,'<u>'.$access_key.'</u>',$action['ja_name']);
$ret.=sprintf('<TR><TD class="cell"><A class="mtitle" accesskey="%s" title="%s" '.
'HREF="%s?%s">%s</A></td></tR>',
$access_key, $action['ja_desc'], $action['ja_url'],$action['ja_action'],
$lib);
'HREF="%s?%s&p_jrn=%s">%s</A></td></tR>',
$access_key, $action['ja_desc'], $action['ja_url'],$action['ja_action'], $p_jrn, $lib);
}
$ret.='</TABLE>';
@ -680,4 +679,4 @@ function ShowMenuComptaForm($p_dossier) {
echo "</TABLE>";
echo '</div>';
}
?>
?>

View file

@ -20,7 +20,7 @@
/* $Revision$ */
if ( $action == 'update' ) {
if ( CheckJrn($g_dossier,$g_user,$g_jrn) < 2 ) {
if ( CheckJrn($g_dossier,$g_user,$p_jrn) < 2 ) {
NoAccess();
exit -1;
@ -44,7 +44,7 @@ if ( isset($_POST['update_record']) ) {
UpdateComment($cn,$_POST['jr_id'],$_POST['comment']);
InsertRapt($cn,$_POST['jr_id'],$_POST['rapt']);
echo '<div class="redcontent">';
ViewJrn($g_dossier,$g_user,$g_jrn,"user_jrn.php");
ViewJrn($g_dossier,$g_user,$p_jrn,"user_jrn.php");
echo '</div>';
} // if update_record