Replace $_SESSION[g_dossier] by a variable gDossier, this parameter is passed thanks the class dossier

This commit is contained in:
sparkyx 2007-08-17 23:29:02 +00:00
parent afd2c2cc50
commit f837f6da8b
114 changed files with 954 additions and 791 deletions

View file

@ -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 ?
</p>
<span>
<FORM METHOD="POST" ACTION="annulation.php?p_jrn=<?php echo $_GET['p_jrn'];?>&jrn_op=<?php echo $_GET['jrn_op'];?>">
<?php echo dossier::hidden(); ?>
<INPUT TYPE="HIDDEN" NAME="annul">
<INPUT TYPE="HIDDEN" NAME="p_id" value="<?php echo $_POST['p_id']; ?>">
<INPUT TYPE="HIDDEN" NAME="op_date" value="<?php echo $_POST['op_date']; ?>">
@ -88,6 +87,7 @@ soit par son &eacute;criture inverse ?
</FORM>
<FORM METHOD="GET" ACTION="annulation.php">
<?php echo dossier::hidden(); ?>
<INPUT TYPE="HIDDEN" NAME="p_jrn" value="<?php echo $_REQUEST['p_jrn']; ?>">
<INPUT TYPE="HIDDEN" NAME="p_id" value="<?php echo $_REQUEST['p_id']; ?>">
<INPUT TYPE="HIDDEN" NAME="jrn_op" value="<?php echo $_REQUEST['jrn_op']; ?>">
@ -376,13 +376,13 @@ if ( isset ($e_ech) ) {
echo "<DIV> Echeance $e_ech </DIV>";
}
for ( $i = 0; $i < $max_deb;$i++) {
$lib=GetPosteLibelle($_SESSION['g_dossier'],${"e_class_deb$i"});
$lib=GetPosteLibelle($gDossier,${"e_class_deb$i"});
echo '<div style="background-color:#BFC2D5;">';
echo ${"e_class_deb$i"}." $lib "."<B>".${"e_mont_deb$i"}."</B>";
echo "</div>";
}
for ( $i = 0; $i < $max_cred;$i++) {
$lib=GetPosteLibelle($_SESSION['g_dossier'],${"e_class_cred$i"});
$lib=GetPosteLibelle($gDossier,${"e_class_cred$i"});
echo '<div style="background-color:#E8F4FF;">';
echo ${"e_class_cred$i"}." $lib "."<B>".${"e_mont_cred$i"}."</B>";
echo '</div>';
@ -399,8 +399,8 @@ if ( $a != null ) {
}//for
}// if ( $a != null ) {
echo '
echo dossier::hidden().
'
<input type="hidden" name="p_id" value="'.$_GET['jrn_op'].'">
<input type="submit" name="annul" value="Mise à zéro ou effacement">
<input type="button" name="cancel" value="Retour" onClick="window.close();">

View file

@ -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');

View file

@ -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();

View file

@ -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 '<div class="u_subtmenu">';
echo ShowMenuAdvanced("central.php");
echo ShowMenuAdvanced("central.php?".dossier::get());
echo '</div>';
$User->AccessRequest($cn,CENTRALIZE);
@ -72,6 +71,7 @@ if ( $_POST["periode"] != "" ) {
$ret=FormPeriode($cn,0,NOTCENTRALIZED);
if ( $ret != null) {
echo '<FORM METHOD="POST" action="central.php">';
echo dossier::hidden();
echo $ret;
echo '<INPUT TYPE="SUBMIT" name="central" VALUE="Centralise">';
echo '</FORM>';

View file

@ -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 '<div class="u_tmenu">';
echo "<H2 class=\"info\">Commercial ".$_SESSION['g_name']." ";
echo "<H2 class=\"info\">Commercial ".dossier::name()." ";
echo '<div align="right" title="Recherche">
<input type="IMAGE" src="image/search.png" width="36" onclick="openRecherche(\''.$_REQUEST['PHPSESSID'].'\','.$_SESSION['g_dossier'].');">
<A HREF="?p_action=pref" title="Pr&eacute;f&eacute;rence"><IMG SRC="image/preference.png" width="36" border="0" ></A>
<A HREF="user_compta.php?dos='.$_SESSION['g_dossier'].'" title="Comptabilit&eacute;"><IMG SRC="image/compta.png" width="36" border="0" ></A>
<A HREF="comptanalytic.php?dos='.$_SESSION['g_dossier'].'" title="CA"><IMG SRC="image/undefined.png" width="36" border="0" ></A>
<input type="IMAGE" src="image/search.png" width="36" onclick="openRecherche(\''.$_REQUEST['PHPSESSID'].'\','.$gDossier.');">
<A HREF="?p_action=pref&'.$str_dossier.'" title="Pr&eacute;f&eacute;rence"><IMG SRC="image/preference.png" width="36" border="0" ></A>
<A HREF="user_compta.php?gDossier='.$gDossier.'" title="Comptabilit&eacute;"><IMG SRC="image/compta.png" width="36" border="0" ></A>
<A HREF="comptanalytic.php?gDossier='.$gDossier.'" title="CA"><IMG SRC="image/undefined.png" width="36" border="0" ></A>
<A HREF="parametre.php?dos='.$_SESSION['g_dossier'].'" title="Param&egrave;tre"><IMG SRC="image/param.png" width="36" border="0" ></A>
<A HREF="parametre.php?gDossier='.$gDossier.'" title="Param&egrave;tre"><IMG SRC="image/param.png" width="36" border="0" ></A>
<A HREF="login.php" title="Accueil"><IMG src="image/home.png" width="36" title="Accueil" border="0" ></A>
<A HREF="logout.php" title="Sortie"><IMG src="image/logout.png" title="Logout" width="36" border="0"></A>
@ -87,26 +85,27 @@ echo '<div align="right" title="Recherche">
$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&eacute;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&eacute;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 '</div>';
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
$User->AccessRequest($cn,SEC_GESTION);
echo JS_VIEW_JRN_MODIFY;
echo JS_AJAX_FICHE;

View file

@ -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 '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier']);
$action=$_REQUEST['p_action'];
echo ShowMenuCompta("user_advanced.php?".dossier::get());
echo '</div>';
// 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');
}

View file

@ -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 '<div class="u_tmenu">';
echo "<H2 class=\"info\">Analytique ".$_SESSION['g_name']." ";
echo "<H2 class=\"info\">Analytique ".dossier::name()." ";
echo '<div align="right" title="Recherche">
<input type="IMAGE" src="image/search.png" width="36" onclick="openRecherche(\''.$_REQUEST['PHPSESSID'].'\','.$_SESSION['g_dossier'].');">
<A HREF="?p_action=pref" title="Pr&eacute;f&eacute;rence"><IMG SRC="image/preference.png" width="36" border="0" ></A>
<A HREF="user_compta.php?dos='.$_SESSION['g_dossier'].'" title="Comptabilit&eacute;"><IMG SRC="image/compta.png" width="36" border="0" ></A>
<A HREF="parametre.php?dos='.$_SESSION['g_dossier'].'" title="Param&egrave;tre"><IMG SRC="image/param.png" width="36" border="0" ></A>
<input type="IMAGE" src="image/search.png" width="36" onclick="openRecherche(\''.$_REQUEST['PHPSESSID'].'\','.dossier::id().');">
<A HREF="?p_action=pref&'.$str_dossier.'" title="Pr&eacute;f&eacute;rence"><IMG SRC="image/preference.png" width="36" border="0" ></A>
<A HREF="user_compta.php?'.$str_dossier.'" title="Comptabilit&eacute;"><IMG SRC="image/compta.png" width="36" border="0" ></A>
<A HREF="parametre.php?'.$str_dossier.'" title="Param&egrave;tre"><IMG SRC="image/param.png" width="36" border="0" ></A>
<A HREF="login.php" title="Accueil"><IMG src="image/home.png" width="36" title="Accueil" border="0" ></A>
<A HREF="logout.php" title="Sortie"><IMG src="image/logout.png" title="Logout" width="36" border="0"></A>
</div> </h2>';
@ -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&eacute;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&eacute;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 '</div>';

View file

@ -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 '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php");
echo ShowMenuCompta("user_advanced.php?".dossier::get());
echo '</div>';
// \todo add a check for permission
echo ShowMenuAdvanced("ecrit_ouv.php");
echo ShowMenuAdvanced(8);
$User->AccessRequest($cn,EXP_IMP_ECR);
echo '<div class="lmenu">';
$str_dossier=dossier::get();
echo ShowItem ( array (
array ("ecrit_ouv.php?export","Export"),
array ("ecrit_ouv.php?import","Import")
array ("ecrit_ouv.php?export&".$str_dossier,"Export"),
array ("ecrit_ouv.php?import&".$str_dossier,"Import")
),'V');
echo '</div>';
echo '<div class="redcontent">';

View file

@ -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");
}
?>
?>

View file

@ -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');

View file

@ -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='<FORM action="fiche_new.php" method="post">';
$r.=dossier::hidden();
$r.='<INPUT TYPE="HIDDEN" name="fiche" value="'.$p_type.'">';
$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 '<FORM METHOD="POST" ACTION="'.$_SERVER['REQUEST_URI'].'">';
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 '<INPUT TYPE="SUBMIT" value="Choisir">';
echo "<FORM>";
echo "</FORM>";
}
?>

View file

@ -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) {
}
</script>
<?php
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
$r="";
foreach ($_GET as $key=>$element) {

View file

@ -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'];

View file

@ -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 '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php");
echo ShowMenuCompta("user_advanced.php?".dossier::get());
echo '</div>';
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 "</DIV>";
}
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'];
}

View file

@ -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);

View file

@ -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;
}

View file

@ -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 '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php");
echo ShowMenuCompta("user_advanced.php?".dossier::get());
echo '</div>';
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
echo ShowMenuAdvanced("import.php");
echo ShowMenuAdvanced(7);
$User->AccessRequest($cn,IMP_BQE);
echo JS_AJAX_FICHE;

View file

@ -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 '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier']);
echo ShowMenuCompta();
echo '</div>';
$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 '<div class="lmenu">';
MenuJrn($_SESSION['g_dossier']);
MenuJrn();
echo '</div>';
$sessid=$_REQUEST['PHPSESSID'];
@ -110,6 +109,7 @@ $search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$sessid."
echo '<DIV CLASS="u_redcontent">';
echo '<FORM ACTION="jrn_add.php" METHOD="POST">';
echo dossier::hidden();
echo '<INPUT TYPE="HIDDEN" NAME="JRN_ADD">';
echo '<TABLE>';

View file

@ -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');

View file

@ -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 '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier']);
echo ShowMenuCompta();
echo '</div>';
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 '<div class="lmenu">';
MenuJrn($_SESSION['g_dossier']);
MenuJrn();
echo '</div>';
?>
<script language="javascript">
@ -148,6 +146,7 @@ $search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$sessid."
echo '<DIV CLASS="u_redcontent">';
echo '<H2 class="info">'.$l_line['jrn_def_name'].'</H2>';
echo '<FORM ACTION="jrn_detail.php?p_jrn='.$_GET['p_jrn'].'" METHOD="POST">';
echo dossier::hidden();
echo '<INPUT TYPE="HIDDEN" NAME="JRN_UPD">';
echo '<TABLE>';
@ -258,6 +257,7 @@ for ($i=0;$i<$num;$i++) {
<TD><INPUT TYPE="SUBMIT" VALUE="Sauve"></TD>
<TD><INPUT TYPE="RESET" VALUE="Reset"></TD>
<TD><form method="post">
<?php echo dossier::hidden(); ?>
<INPUT TYPE="submit" name="efface" value="Efface" onClick="return m_confirm();">
<input type="hidden" name="p_jrn" value="<? echo $_GET['p_jrn'];?>">
</form>

View file

@ -25,10 +25,9 @@
* \brief Send a ledger in a pdf format
*/
if ( ! isset($_SESSION['g_dossier']) ) {
echo "INVALID G_DOSSIER UNKNOWN !!! ";
exit();
}
require_once('class_dossier.php');
$gDossier=dossier::id();
include_once('class_user.php');
include_once("jrn.php");
include_once("ac_common.php");
@ -41,7 +40,7 @@ include_once("check_priv.php");
require_once ('header_print.php');
echo_debug('jrn_pdf.php',__LINE__,"imp pdf journaux");
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
$l_type="JRN";
$centr=" Non centralisé";
$l_centr=0;

View file

@ -34,11 +34,9 @@ $User->Check();
html_page_start($User->theme,"onLoad='window.focus();'");
if ( ! isset ( $_SESSION['g_dossier'] ) ) {
echo "You must choose a Dossier ";
phpinfo();
exit -2;
}
require_once('class_dossier.php');
$gDossier=dossier::id();
// Javascript
echo JS_CONCERNED_OP;
if ( isset( $p_jrn )) {
@ -61,7 +59,7 @@ $c_internal="";
$c_date="";
$condition="";
$part=" where ";
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
// if search then build the condition
if ( isset ($_GET["search"]) ) {
$c1=0;
@ -113,6 +111,7 @@ if ( $User->admin != 1 ) {
<div style="font-size:11px;">
<?php
echo '<FORM ACTION="jrn_search.php" METHOD="GET">';
echo dossier::hidden();
if (isset($paid))
echo '<div class="info"> Uniquement les non op&eacute;rations non pay&eacute;es<input type="hidden" name="paid" value="paid"></div>';
else

View file

@ -21,12 +21,12 @@
/*! \file
* \brief create, modify parameter ledger
*/
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();
@ -39,22 +39,22 @@ include_once ("check_priv.php");
include_once ("user_menu.php");
echo '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php");
echo ShowMenuCompta("user_advanced.php?".dossier::get());
echo '</div>';
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
echo '<div class="u_subtmenu">';
echo ShowMenuAdvanced("jrn_update.php");
echo ShowMenuAdvanced("jrn_update.php?".dossier::get());
echo '</div>';
$User->AccessRequest($cn,GJRN);
echo '<div class="lmenu">';
MenuJrn($_SESSION['g_dossier']);
MenuJrn($gDossier);
echo '</div>';
html_page_stop();
?>

View file

@ -135,8 +135,9 @@ function ajaxFid(p_ctl,p_deb,p_jrn){
clean_Fid(p_ctl);
} else {
var gDossier=document.getElementById('gDossier').value;
queryString="?FID="+document.getElementById(p_ctl).value;
queryString=queryString+"&d="+p_deb+"&j="+p_jrn;
queryString=queryString+"&d="+p_deb+"&j="+p_jrn+'&gDossier='+gDossier;
ajaxRequest.open("GET", "fid.php"+queryString, true);
ajaxRequest.send(null);

View file

@ -24,7 +24,7 @@
* info from fiche
*
*/
function op_remove(p_sessid,p_oa_group) {
function op_remove(p_sessid,p_dossier,p_oa_group) {
var a=confirm("Etes-vous sur de vouloir effacer cette operation ?\n");
if ( a == false ) return;
var ajaxRequest; // The variable that makes Ajax possible!
@ -46,7 +46,7 @@ function op_remove(p_sessid,p_oa_group) {
}
}
}
queryString="?PHPSESSID"+p_sessid+"&oa="+p_oa_group;
queryString="?PHPSESSID"+p_sessid+"&oa="+p_oa_group+"&gDossier="+p_dossier;
ajaxRequest.open("GET", "remove_op.php"+queryString, true);
ajaxRequest.send(null);

View file

@ -25,9 +25,9 @@
*/
function cancelOperation(p_value,p_sessid,p_jrn)
function cancelOperation(p_value,p_sessid,p_dossier,p_jrn)
{
var win=window.open('annulation.php?p_jrn='+p_jrn+'&jrn_op='+p_value+'&PHPSESSID='+p_sessid,'Annule','toolbar=no,width=400,height=400,scrollbars=yes,resizable=yes');
var win=window.open('annulation.php?p_jrn='+p_jrn+'&jrn_op='+p_value+'&PHPSESSID='+p_sessid+'&gDossier='+p_dossier,'Annule','toolbar=no,width=400,height=400,scrollbars=yes,resizable=yes');
}
function RefreshMe() {
window.location.reload();

View file

@ -29,9 +29,9 @@
* \param p_ctl ctl name
* \param p_montant amount to search (if 0 get it from the e_other_amount
*/
function SearchJrn(p_sessid,p_ctl,p_montant,p_paid)
function SearchJrn(p_sessid,p_dossier,p_ctl,p_montant,p_paid)
{
var url='jrn_search.php?p_ctl='+p_ctl+'&PHPSESSID='+p_sessid+'&'+p_paid;
var url='jrn_search.php?p_ctl='+p_ctl+'&PHPSESSID='+p_sessid+'&gDossier='+p_dossier+'&'+p_paid;
if ( p_montant == 0 ) {

View file

@ -31,9 +31,10 @@
* \param p_vue easy or expert view of the operation
*/
function modifyOperation(p_value,p_sessid,p_jrn,p_vue)
function modifyOperation(p_value,p_sessid,p_dossier,p_jrn,p_vue)
{
var win=window.open('modify_op.php?action=update&p_jrn='+p_jrn+'&line='+p_value+'&PHPSESSID='+p_sessid+'&p_view='+p_vue,'','toolbar=no,width=690,height=410,scrollbars=yes,resizable=yes');
var win=window.open('modify_op.php?action=update&p_jrn='+p_jrn+'&line='+p_value+'&PHPSESSID='+p_sessid+'&p_view='+p_vue+'&gDossier='+p_dossier,'','toolbar=no,width=690,height=410,scrollbars=yes,resizable=yes');
win.focus();
}
@ -42,15 +43,15 @@ function modifyOperation(p_value,p_sessid,p_jrn,p_vue)
* \param p_sessid PHPSESSID
*/
function viewOperation(p_value,p_sessid)
function viewOperation(p_value,p_sessid,p_dossier)
{
var win=window.open('modify_op.php?action=view_ca&line='+p_value+'&PHPSESSID='+p_sessid,'','toolbar=no,width=690,height=410,scrollbars=yes,resizable=yes');
var win=window.open('modify_op.php?action=view_ca&line='+p_value+'&PHPSESSID='+p_sessid+'&gDossier='+p_dossier,'','toolbar=no,width=690,height=410,scrollbars=yes,resizable=yes');
win.focus();
}
function RefreshMe() {
window.location.reload();
}
function dropLink(p_value,p_value2,p_sessid) {
var win=window.open('modify_op.php?action=delete&line='+p_value+'&line2='+p_value2+'&PHPSESSID='+p_sessid,'Liaison','toolbar=no,width=500,height=400,scrollbars=yes,resizable=yes');
function dropLink(p_value,p_value2,p_sessid,p_dossier) {
var win=window.open('modify_op.php?action=delete&line='+p_value+'&line2='+p_value2+'&PHPSESSID='+p_sessid+'&gDossier='+p_dossier,'Liaison','toolbar=no,width=500,height=400,scrollbars=yes,resizable=yes');
}

View file

@ -69,5 +69,5 @@ function HandleSubmit(e) {
*/
function openRecherche(p_sessid,p_dossier,p_style) {
if ( p_style == 'E' ) { p_style="expert";}
var w=window.open("recherche.php?p_dossier="+p_dossier+"&PHPSESSID="+p_sessid+'&'+p_style,'','statusbar=no,scrollbars=yes,toolbar=no');
var w=window.open("recherche.php?gDossier="+p_dossier+"&PHPSESSID="+p_sessid+'&'+p_style,'','statusbar=no,scrollbars=yes,toolbar=no');
}

View file

@ -24,9 +24,10 @@
* open a windows for searching a card
*/
function showfiche(p_sessid,qcode)
function showfiche(p_sessid,p_qcode)
{
var a=window.open('show_fiche.php?PHPSESSID='+p_sessid+'&q='+qcode,'','toolbar=no,width=350,height=450,scrollbar=yes,statusbar=no');
p_dossier=document.getElementById("gDossier").value;
var a=window.open('show_fiche.php?PHPSESSID='+p_sessid+'&gDossier='+p_dossier+'&q='+qcode,'','toolbar=no,width=350,height=450,scrollbar=yes,statusbar=no');
}
@ -37,11 +38,15 @@ function SearchCard(p_sessid,type,name,jrn)
{
var search=document.getElementById(name).value;
var a=window.open('fiche_search.php?first&search&fic_search='+search+'&p_jrn='+jrn+'&PHPSESSID='+p_sessid+'&type='+type+'&name='+name,'item','toolbar=no,width=350,height=450,scrollbars=yes,statusbar=no');
var gDossier=document.getElementById('gDossier').value;
var a=window.open('fiche_search.php?first&search&fic_search='+search+'&p_jrn='+jrn+'&PHPSESSID='+p_sessid+'&type='+type+'&name='+name+'&gDossier='+gDossier,'item','toolbar=no,width=350,height=450,scrollbars=yes,statusbar=no');
}
function NewCard(p_sessid,type,name,jrn)
{
var a=window.open('fiche_new.php?p_jrn='+jrn+'&PHPSESSID='+p_sessid+'&type='+type+'&name='+name,'item','toolbar=no,width=350,height=450,scrollbars=yes,statusbar=no');
var search=document.getElementById(name).value;
var gDossier=document.getElementById('gDossier').value;
var a=window.open('fiche_new.php?p_jrn='+jrn+'&PHPSESSID='+p_sessid+'&type='+type+'&name='+name+'&gDossier='+gDossier,'item','toolbar=no,width=350,height=450,scrollbars=yes,statusbar=no');
}
/* SetValue( p_ctl,p_value )
/* p_ctl is the name of the control

View file

@ -24,15 +24,15 @@
* open a windows for searching an account (poste comptable)
*/
function SearchPoste(p_sessid,p_ctl,p_jrn)
function SearchPoste(p_sessid,p_dossier,p_ctl,p_jrn)
{
var comment=document.getElementById(p_ctl).value;
var win=window.open('poste_search.php?p_jrn='+p_jrn+'&p_ctl='+p_ctl+'&PHPSESSID='+p_sessid+"&p_comment="+comment+"&search",'Cherche','toolbar=no,width=600,height=600,scrollbars=yes,resizable=yes');
var win=window.open('poste_search.php?gDossier='+p_dossier+'p_jrn='+p_jrn+'&p_ctl='+p_ctl+'&PHPSESSID='+p_sessid+"&p_comment="+comment+"&search",'Cherche','toolbar=no,width=600,height=600,scrollbars=yes,resizable=yes');
}
function SearchPosteFilter(p_sessid,p_ctl,p_filter,jrn)
function SearchPosteFilter(p_sessid,p_dossier,p_ctl,p_filter,jrn)
{
var win=window.open('poste_search.php?p_jrn='+jrn+'&p_ctl='+p_ctl+'&PHPSESSID='+p_sessid+'&filter='+p_filter,'Cherche','toolbar=no,width=600,height=600,scrollbars=yes,resizable=yes');
var win=window.open('poste_search.php?gDossier='+p_dossier+'p_jrn='+jrn+'&p_ctl='+p_ctl+'&PHPSESSID='+p_sessid+'&filter='+p_filter,'Cherche','toolbar=no,width=600,height=600,scrollbars=yes,resizable=yes');
}
function GetIt() {
window.close();

View file

@ -22,11 +22,9 @@
* \brief Modify the "Plan Comptable"
*/
include_once ("ac_common.php");
require_once('class_dossier.php');
$gDossier=dossier::id();
if ( !isset ($_SESSION['g_dossier'])) {
echo "You must choose a Dossier ";
exit -2;
}
include_once ("postgres.php");
include_once("check_priv.php");
@ -37,7 +35,7 @@ $User=new cl_user($rep);
$User->Check();
html_page_start($User->theme,"onLoad='window.focus();'");
$User->AccessRequest(DbConnect($_SESSION['g_dossier']),MPCMN);
$User->AccessRequest(DbConnect($gDossier),MPCMN);
include ("user_menu.php");
@ -48,7 +46,7 @@ if ( isset ($_POST["update"] ) ) {
echo_debug('line_update.php',__LINE__,"name $name $element");
}
echo JS_UPDATE_PCMN;
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
$p_val=trim($_POST["p_val"]);
$p_lib=FormatString($_POST["p_name"]);
$p_parent=trim($_POST["p_val_parent"]);

View file

@ -27,7 +27,10 @@ require_once("postgres.php");
// Check User
include ('class_user.php');
/* Admin. Dossier */
$cn=DbConnect($_SESSION['g_dossier']);
require_once('class_dossier.php');
$gDossier=dossier::id();
$cn=DbConnect($gDossier);
$User=new cl_user($cn);
$User->Check();

View file

@ -40,12 +40,10 @@ $User=new cl_user($rep);
$User->Check();
html_page_start($User->theme,"onLoad='window.focus();'");
if ( ! isset ( $_SESSION['g_dossier'] ) ) {
echo "You must choose a Dossier ";
exit -2;
}
require_once('class_dossier.php');
$gDossier=dossier::id();
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
if ( isset( $_GET['p_jrn'] )) {
$p_jrn=$_GET['p_jrn'];
@ -94,7 +92,7 @@ function hide (p_div) {
echo_debug(__FILE__,__LINE__,"action is $action");
//-----------------------------------------------------
if ( $action == 'update' ) {
if ( ($priv=CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn'],true)) < 1 ) {
if ( ($priv=CheckJrn($gDossier,$_SESSION['g_user'],$_GET['p_jrn'],true)) < 1 ) {
NoAccess();
exit -1;
@ -119,6 +117,7 @@ if ( $action == 'update' ) {
$view.='<h2 class="info">Vue simple</h2>';
$view.='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="modify_op.php">';
$view.=dossier::hidden();
$view.=ShowOperationUser($cn,$p_id);
$view.='<input type="button" onclick="hide(\'simple\');show(\'expert\');" value="Vue expert">';
$view.='<INPUT TYPE="Hidden" name="action" value="update_record">';
@ -138,6 +137,7 @@ if ( $action == 'update' ) {
$view.='<h2 class="info">Vue expert</h2>';
$view.='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="modify_op.php">';
$view.=dossier::hidden();
$view.=ShowOperationExpert($cn,$p_id);
$view.='<input type="button" onclick="hide(\'expert\');show(\'simple\')" value="Vue simple">';
$view.='<INPUT TYPE="Hidden" name="action" value="update_record">';
@ -187,7 +187,7 @@ if ( $action=="view_ca") {
// update the record and upload files
//----------------------------------------------------------------------
if ( isset($_POST['update_record']) ) {
if ( ($priv=CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn,true)) !=2 ) {
if ( ($priv=CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn,true)) !=2 ) {
NoAccess();
exit -1;

View file

@ -27,18 +27,9 @@ include_once ("ac_common.php");
html_page_start($_SESSION['g_theme']);
include_once ("postgres.php");
require_once("class_widget.php");
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;
}
if ( ! isset ( $_SESSION['g_dossier'] ) ) {
echo "You must choose a Dossier ";
exit -2;
}
include_once ("postgres.php");
/* Admin. Dossier */
$rep=DbConnect();
@ -49,7 +40,7 @@ $User->Check();
include_once("preference.php");
include_once("user_menu.php");
echo "<H2 class=\"info\"> Param&egrave;tre ".$_SESSION['g_name'].
echo "<H2 class=\"info\"> Param&egrave;tre ".dossier::name().
'
<div align="right">
<A HREF="login.php" title="Accueil"><IMG src="image/home.png" width="36" border="0" ></A>
@ -59,7 +50,7 @@ echo "<H2 class=\"info\"> Param&egrave;tre ".$_SESSION['g_name'].
include_once ("check_priv.php");
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
$User->AccessRequest($cn,PARM);
@ -111,6 +102,7 @@ if ( $p_action == "change" ) {
$p_code=$_GET['p_code'];
echo '<TR> <FORM ACTION="parametre.php" METHOD="POST">';
echo dossier::hidden();
echo '<INPUT TYPE="HIDDEN" VALUE="'.$p_mid.'" NAME="p_id">';
echo '<TD> <INPUT TYPE="text" NAME="p_devise" VALUE="'.$p_code.'"></TD>';
echo '<TD> <INPUT TYPE="text" NAME="p_rate" VALUE="'.$p_rate.'"></TD>';
@ -180,6 +172,7 @@ if ( $p_action=='company') {
$all=new widget("text");
$all->table=1;
echo '<form method="post" action="?p_action=company">';
echo dossier::hidden();
echo "<table class=\"result\">";
echo "<tr>".$all->IOValue("p_name",$my->MY_NAME,"Nom société")."</tr>";
echo "<tr>".$all->IOValue("p_tel",$my->MY_TEL,"Téléphone")."</tr>";

View file

@ -24,11 +24,9 @@
include_once ("ac_common.php");
html_page_start($_SESSION['g_theme']);
require_once("constant.php");
require_once('class_dossier.php');
$gDossier=dossier::id();
if ( ! isset ( $_SESSION['g_dossier'] ) ) {
echo "You must choose a Dossier ";
exit -2;
}
include_once ("postgres.php");
/* Admin. Dossier */
$rep=DbConnect();
@ -40,9 +38,9 @@ $User->Check();
include_once ("user_menu.php");
include_once ("check_priv.php");
echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php");
echo ShowMenuCompta("user_advanced.php");
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
echo JS_UPDATE_PCMN;
@ -58,7 +56,7 @@ if ( isset ($_GET['p_start'])) {
}
echo '<div class="u_subtmenu">';
echo ShowMenuAdvanced("pcmn_update.php?p_start=1");
echo ShowMenuAdvanced("pcmn_update.php?p_start=1&".dossier::get());
echo '</div>';
$User->AccessRequest($cn,MPCMN);
@ -139,6 +137,9 @@ $MaxRow=pg_NumRows($Ret);
?>
<FORM ACTION="pcmn_update.php" METHOD="POST">
<?php
echo dossier::hidden();
?>
<TABLE ALIGN="center" BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TH> Classe </TH>
@ -160,6 +161,7 @@ $MaxRow=pg_NumRows($Ret);
</TD>
</TR>
<?php
$str_dossier=dossier::get();
for ($i=0; $i <$MaxRow; $i++) {
$A=pg_fetch_array($Ret,$i);
@ -187,7 +189,7 @@ for ($i=0; $i <$MaxRow; $i++) {
echo '</TD>';
echo $td;
printf ('<A href="pcmn_update.php?l=%d&action=del">Delete</A>',$A['pcm_val']);
printf ('<A href="pcmn_update.php?l=%d&action=del&%s">Delete</A>',$A['pcm_val'],$str_dossier);
echo "</TD>";
echo "</TR>";

View file

@ -27,9 +27,11 @@ include ('class_user.php');
include("class_poste.php");
header('Content-type: application/csv');
header('Content-Disposition: attachment;filename="poste.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);

View file

@ -30,8 +30,10 @@ include_once("class.ezpdf.php");
include_once("impress_inc.php");
include("poste.php");
require_once ('header_print.php');
require_once('class_dossier.php');
$gDossier=dossier::id();
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
foreach ($_POST as $key=>$element) {
${"$key"}=$element;
}

View file

@ -34,16 +34,14 @@ $User->Check();
echo JS_SEARCH_POSTE;
if ( ! isset ( $_SESSION['g_dossier'] ) ) {
echo "You must choose a Dossier ";
exit -2;
}
require_once('class_dossier.php');
$gDossier=dossier::id();
$c_comment="";
$c_class="";
$condition="";
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
if ( isset($_GET['search']) ) {
$c1=0;
foreach( $_GET as $key=>$element){
@ -68,7 +66,7 @@ if ( isset($_GET['filter']) && $_GET['filter'] != 'all') {
$SqlCred="";
// Load the property
$l_line=GetJrnProp($_SESSION['g_dossier'],$_GET['p_jrn']);
$l_line=GetJrnProp($gDossier,$_GET['p_jrn']);
if ( strlen(trim ($l_line['jrn_def_class_cred']) ) > 0 ) {
$valid_cred=split(" ",$l_line['jrn_def_class_cred']);
@ -122,6 +120,7 @@ if ( isset($_GET['p_ctl'])) {
echo_debug('poste_search.php',__LINE__,"condition = $condition");
echo '<FORM ACTION="poste_search.php'.$url.'" METHOD="GET">';
echo dossier::hidden();
if ( isset($p_ctl) ) {
if ($p_ctl != 'not') echo '<INPUT TYPE="hidden" name="p_ctl" value="'.$p_ctl.'">';
}

View file

@ -39,8 +39,10 @@ include_once("poste.php");
include_once("class_balance.php");
include_once("preference.php");
require_once ('header_print.php');
require_once('class_dossier.php');
$gDossier=dossier::id();
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
$rep=DbConnect();
include ('class_user.php');
$User=new cl_user($rep);

View file

@ -27,9 +27,11 @@ include ('class_user.php');
include("class_fiche.php");
header('Content-type: application/csv');
header('Content-Disposition: attachment;filename="poste.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);

View file

@ -30,8 +30,10 @@ include_once("class.ezpdf.php");
include_once("impress_inc.php");
require_once("class_fiche.php");
require_once ('header_print.php');
require_once('class_dossier.php');
$gDossier=dossier::id();
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
foreach ($_POST as $key=>$element) {
${"$key"}=$element;
}

View file

@ -18,6 +18,7 @@
*/
/* $Revision$ */
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
require_once('class_dossier.php');
include_once("ac_common.php");
include("user_menu.php");
include_once ("constant.php");
@ -29,16 +30,13 @@ include_once("class_widget.php");
*/
html_page_start($_SESSION['g_theme']);
if ( ! isset ( $_SESSION['g_dossier'] ) ) {
echo "You must choose a Dossier ";
exit -2;
}
$gDossier=dossier::id();
include_once ("postgres.php");
include_once ("check_priv.php");
/* Admin. Dossier */
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
include ('class_user.php');
$User=new cl_user($cn);
$User->Check();

View file

@ -30,8 +30,10 @@
require_once ("postgres.php");
require_once ("debug.php");
require_once ("class_user.php");
require_once('class_dossier.php');
$gDossier=dossier::id();
/*!\todo Add the security here */
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
ExecSql($cn,"delete from operation_analytique where oa_group=".$_GET['oa']);
echo_debug(__FILE__,__LINE__,$_GET);
?>

View file

@ -24,16 +24,14 @@
* \brief Print the user security in pdf
*/
if ( ! isset($_SESSION['g_dossier']) ) {
echo "INVALID G_DOSSIER UNKNOWN !!! ";
exit();
}
require_once('class_dossier.php');
$gDossier=dossier::id();
include_once("ac_common.php");
include_once("postgres.php");
include_once("class.ezpdf.php");
require_once("check_priv.php");
echo_debug('sec_pdf.php',__LINE__,"imp pdf securité");
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
//-----------------------------------------------------
// Security
@ -77,7 +75,7 @@ $Res=ExecSql($cn,"select jrn_def_id,jrn_def_name from jrn_def ");
for ($e=0;$e < pg_NumRows($Res);$e++) {
$row=pg_fetch_array($Res,$e);
$a_jrn[$e]['jrn_name']=$row['jrn_def_name'];
$priv=CheckJrn($_SESSION['g_dossier'],$SecUser->login,$row['jrn_def_id']);
$priv=CheckJrn($gDossier,$SecUser->login,$row['jrn_def_id']);
switch($priv) {
case 0:
$a_jrn[$e]['priv']="pas d'accès";
@ -107,7 +105,7 @@ $Max=pg_NumRows($Res);
for ( $i =0 ; $i < $Max; $i++ ) {
$l_line=pg_fetch_array($Res,$i);
$action['lib']=$l_line['ac_description'];
$right=CheckAction($_SESSION['g_dossier'],$SecUser->login,$l_line['ac_id']);
$right=CheckAction($gDossier,$SecUser->login,$l_line['ac_id']);
switch ($right) {
case 0:
$action['priv']="Pas d'accès";

View file

@ -24,11 +24,8 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
// $Revision$
if ( ! isset($g_dossier) ) {
echo "INVALID G_DOSSIER UNKNOWN !!! ";
exit();
}
require_once('class_dossier.php');
$gDossier=dossier::id();
include_once("jrn.php");
include_once("ac_common.php");
@ -37,8 +34,8 @@ include_once("class.ezpdf.php");
include_once("impress_inc.php");
include_once("preference.php");
echo_debug('send_jrn_pdf.php',__LINE__,"imp pdf journaux");
$l_Db=sprintf("dossier%d",$g_dossier);
$cn=DbConnect($g_dossier);
$l_Db=sprintf("dossier%d",$gDossier);
$cn=DbConnect($gDossier);
$l_type="JRN";
$centr=" Non centralisé";
$l_centr=0;

View file

@ -26,8 +26,9 @@
include_once ("postgres.php");
require_once("ac_common.php");
require_once( "class_document.php");
$cn=DbConnect($_SESSION['g_dossier']);
require_once('class_dossier.php');
$gDossier=dossier::id();
$cn=DbConnect($gDossier);
require_once ('class_user.php');

View file

@ -26,8 +26,9 @@
include_once ("postgres.php");
require_once("ac_common.php");
$cn=DbConnect($_SESSION['g_dossier']);
require_once('class_dossier.php');
$gDossier=dossier::id();
$cn=DbConnect($gDossier);
require_once ('class_user.php');

View file

@ -34,6 +34,8 @@ require_once ('postgres.php');
require_once ('debug.php');
require_once ('ac_common.php');
require_once('class_widget.php');
require_once('class_dossier.php');
$gDossier=dossier::id();
$User=new cl_user(DbConnect());
$User->Check();
@ -45,7 +47,7 @@ if ( ! isset ($_REQUEST['q'])) {
exit();
}
// connect to the database
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
if ( $User->CheckAction($cn,FICHE_READ) == 0 ){
/* Cannot Access */
echo '<h2 class="error"> Vous n\' avez pas accès</h2>';

View file

@ -20,6 +20,9 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
// Verify parameters
include_once ("ac_common.php");
require_once('class_dossier.php');
$gDossier=dossier::id();
if ( !isset ($_GET['jrn'] ) ||
!isset($_GET['jr_grpt_id'])) {
echo_error("Missing parameters");
@ -30,7 +33,7 @@ include_once ("postgres.php");
$jr_grpt_id=$_GET['jr_grpt_id'];
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
include_once ('class_user.php');

View file

@ -29,14 +29,10 @@ $rep=DbConnect();
include_once ("class_user.php");
$User=new cl_user($rep);
$User->Check();
require_once('class_dossier.php');
$gDossier=dossier::id();
html_page_start($User->theme,"onLoad='window.focus();'");
if ( ! isset ( $_SESSION['g_dossier'] ) ) {
echo "You must choose a Dossier ";
phpinfo();
exit -2;
}
?>
<script>
function GetIt(ctl,tva_id) {
@ -47,7 +43,7 @@ function GetIt(ctl,tva_id) {
<?php
$condition="";
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
$Res=ExecSql($cn,"select * from tva_rate order by tva_rate desc");
$Max=pg_NumRows($Res);
echo "<TABLE BORDER=\"1\">";

View file

@ -156,8 +156,6 @@ div.no span{
}
div.u_content span {
position :float;
float:left;
margin-left:40px;
}
table.document {

View file

@ -162,8 +162,6 @@ font-color:red;
}
div.u_content span {
position :float;
float:left;
margin-left:40px;
}
table.document {

View file

@ -19,18 +19,16 @@
// Auteur Dany De Bontridder ddebontridder@yahoo.fr
include_once ("ac_common.php");
require_once("check_priv.php");
require_once('class_dossier.php');
/* $Revision$ */
/*! \file
* \brief Obsolete
* \todo Obsolete ?
*/
$gDossier=dossier::id();
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();
@ -49,14 +47,18 @@ echo_debug('user_advanced.php',__LINE__,"user is ".$_SESSION['g_user']);
include_once ("user_menu.php");
echo '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier']);
echo ShowMenuCompta("user_advanced.php?".dossier::get());
echo '</div>';
$p_action="";
if ( isset($_REQUEST['p_action'] )) {
$p_action="?p_action=".$_REQUEST['p_action']."&".dossier::get();
}
echo ShowMenuAdvanced();
echo ShowMenuAdvanced("user_advanced.php".$p_action);
if ( isset($_REQUEST['p_action']) && $_REQUEST['p_action'] == "periode" ) {
if ( $User->admin == 0 && CheckAction($_SESSION['g_dossier'],$_SESSION['g_user'],GESTION_PERIODE) == 0 )
if ( $User->admin == 0 && CheckAction($gDossier,$_SESSION['g_user'],GESTION_PERIODE) == 0 )
NoAccess();
$p_action=$_REQUEST['p_action'];

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Auteur Dany De Bontridder ddebontridder@yahoo.fr
require_once('class_dossier.php');
include_once ("ac_common.php");
/* $Revision$ */
include_once ("class_user.php");
@ -31,27 +33,17 @@ $User=new cl_user($rep);
$User->Check();
html_page_start($User->theme);
$gDossier=dossier::id();
if ( isset ( $_GET['dos'] ) ) {
$g_dossier=$_GET['dos'];
$_SESSION[ "g_dossier"]=$g_dossier;
echo_debug('user_compta.php',__LINE__,"admin_dossier = $g_dossier ");
$g_name=GetDossierName($g_dossier);
$_SESSION["g_name"]=$g_name;
} else {
echo "You must choose a Dossier ";
exit -2;
}
echo_debug('user_compta.php',__LINE__,"user is ".$_SESSION['g_user']);
// Synchronize rights
SyncRight($_SESSION['g_dossier'],$_SESSION['g_user']);
SyncRight($gDossier,$_SESSION['g_user']);
// Get The priv on the selected folder
if ( $User->admin == 0 ) {
$r=GetPriv($_SESSION['g_dossier'],$_SESSION['g_user']);
$r=GetPriv($gDossier,$_SESSION['g_user']);
if ($r == 0 ){
/* Cannot Access */
NoAccess();
@ -64,7 +56,7 @@ if ( $User->admin == 0 ) {
include_once ("user_menu.php");
echo '<div class="u_tmenu">';
echo ShowMenuCompta($g_dossier);
echo ShowMenuCompta();
echo '</div>';
html_page_stop();

View file

@ -24,13 +24,12 @@
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 */
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
require_once ('class_user.php');
@ -41,7 +40,7 @@ require_once ("check_priv.php");
include_once ("user_menu.php");
echo '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier']);
echo ShowMenuCompta($gDossier);
echo '</div>';
// show sub menu
@ -65,7 +64,7 @@ echo "</DIV>";
include_once("impress_inc.php");
$User->AccessRequest(DbConnect($_SESSION['g_dossier']),IMP);
$User->AccessRequest(DbConnect($gDossier),IMP);
// something is choosen

View file

@ -23,6 +23,7 @@
/*! \file
* \brief Main page for encoding in the ledger
*/
require_once('class_dossier.php');
include_once("ac_common.php");
include_once("user_menu.php");
include_once ("constant.php");
@ -31,7 +32,10 @@ include_once ("check_priv.php");
include_once ("class_widget.php");
require_once("jrn.php");
$cn=DbConnect($_SESSION['g_dossier']);
// Check if dossier set
$gDossier=dossier::id();
$cn=DbConnect($gDossier);
include_once ('class_user.php');
$User=new cl_user($cn);
$User->Check();
@ -40,30 +44,26 @@ html_page_start($User->theme,
"OnLoad=\"SetFocus('e_date',0);checkTotal();\" ",
"js/compute.js");
// Check if dossier set
if ( ! isset ( $_SESSION['g_dossier'] ) ) {
echo "You must choose a Dossier ";
exit -2;
}
/* Get the _REQUEST value for p_jrn (jrn_def.jrn_def_id) and jrn_type (jrn_def.jrn_def_code) */
$p_jrn=(isset($_REQUEST['p_jrn']))?$_REQUEST['p_jrn']:-1;
$jrn_type=(isset($_REQUEST['jrn_type']))?$_REQUEST['jrn_type']:-1;
echo '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier'],"user_jrn.php?jrn_type=".$jrn_type);
echo ShowMenuCompta("user_jrn.php?jrn_type=".$jrn_type."&".dossier::get());
echo '</div>';
if ( $User->admin == 0 ) {
// check if user can access
// Acces Grand livre
if ($jrn_type== 'NONE' && CheckAction($_SESSION['g_dossier'],$_SESSION['g_user'],ENCJRN) == 0 ){
if ($jrn_type== 'NONE' && CheckAction($gDossier,$_SESSION['g_user'],ENCJRN) == 0 ){
/* Cannot Access */
NoAccess();
}
if ( $jrn_type != 'NONE' && CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) == 0 ){
if ( $jrn_type != 'NONE' && CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) == 0 ){
/* Cannot Access */
NoAccess();
@ -80,7 +80,7 @@ if ( $p_jrn != -1 )
// echo '</DIV>';
echo '<div class="u_subt2menu">';
// show the available ledger of the type jrn_type
ShowMenuJrnUser($_SESSION['g_dossier'],$jrn_type,$p_jrn);
ShowMenuJrnUser($gDossier,$jrn_type,$p_jrn);
echo '</div>';
echo '<div class="lmenu">';
// show the menu for this journal (Nouveau, voir,...)
@ -89,7 +89,7 @@ if ( $p_jrn != -1 )
echo '</div>';
$g_dossier=$_SESSION['g_dossier'];
$g_user=$_SESSION['g_user'];
echo JS_AJAX_FICHE;
// Execute Action for p_jrn
@ -107,12 +107,12 @@ else
} else {
// no journal are selected so we select the first one
$p_jrn=GetFirstJrnIdForJrnType($_SESSION['g_dossier'],$jrn_type);
$p_jrn=GetFirstJrnIdForJrnType($gDossier,$jrn_type);
// display jrn's menu
// echo '</DIV>';
echo '<div class="u_subt2menu">';
ShowMenuJrnUser($_SESSION['g_dossier'],$jrn_type,$p_jrn);
ShowMenuJrnUser($gDossier,$jrn_type,$p_jrn);
echo '</div>';
echo '<div class="lmenu">';
$menu_jrn=ShowMenuJrn($cn,$jrn_type, $p_jrn);

View file

@ -32,9 +32,6 @@ $User->Check();
html_page_start($_SESSION['g_theme']);
include_once("user_menu.php");
if ( isset ($_SESSION['g_dossier']))
unset ($_SESSION['g_dossier']);
$priv=($User->admin==1)?"Administrateur":"Utilisateur";
echo '<div class="info"> Bienvenue '.$User->first_name.' '.

View file

@ -28,6 +28,7 @@ include_once ("postgres.php");
/* Admin. Dossier */
$Rep=DbConnect();
include_once ("class_user.php");
require_once('class_dossier.php');
$cn=DbConnect();
@ -35,9 +36,9 @@ $cn=DbConnect();
* account_repository database
*/
if ( isset ($_SESSION['g_dossier']))
if ( isset ($_REQUEST['gDossier']))
{
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($_REQUEST['gDossier']);
}
else
{
@ -69,12 +70,12 @@ if ( isset ( $_POST['p_size']) ) {
// comta style
include_once ("user_menu.php");
if ( isset ($_SESSION['g_dossier']) )
if ( isset ($_REQUEST['gDossier']) )
{
if ( $_SESSION['g_dossier'] != 0 )
if ( $_REQUEST['gDossier'] != 0 )
{
echo '<div class="u_tmenu">';
echo ShowMenuCompta($_SESSION['g_dossier']);
echo ShowMenuCompta();
echo "</div>";
}
}

View file

@ -27,10 +27,10 @@
include_once ("ac_common.php");
include_once("check_priv.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();
$str_dossier=dossier::get();
include_once ("postgres.php");
/* Admin. Dossier */
$rep=DbConnect();
@ -40,14 +40,14 @@ $User->Check();
include_once ("user_menu.php");
$cn_dossier=DbConnect($_SESSION['g_dossier']);
$cn_dossier=DbConnect($gDossier);
if ( $User->CheckAction($cn_dossier,GJRN) == 0 ) {
/* Cannot Access */
NoAccess();
exit -1;
}
echo "<H2 class=\"info\">".$_SESSION['g_name'];
echo "<H2 class=\"info\">".dossier::name();
echo '<div align="right">
<A HREF="login.php" title="Accueil"><INPUT TYPE="IMAGE" width="36" src="image/home.png" ></A>
<A HREF="logout.php" title="Sortie"><input type="IMAGE" title="Logout" src="image/logout.png" width="36"></A>
@ -58,7 +58,7 @@ echo ShowMenuParam("user_sec.php");
$cn=DbConnect();
$User=ExecSql($cn,"select use_id,use_first_name,use_name,use_login from ac_users natural join jnt_use_dos where use_login != 'phpcompta' and dos_id=".$_SESSION['g_dossier']);
$User=ExecSql($cn,"select use_id,use_first_name,use_name,use_login from ac_users natural join jnt_use_dos where use_login != 'phpcompta' and dos_id=".$gDossier);
$MaxUser=pg_NumRows($User);
@ -71,7 +71,7 @@ for ($i = 0;$i < $MaxUser;$i++) {
if ( $i % 3 == 0 && $i != 0)
echo "</TR><TR>";
printf ('<TD><A href="user_sec.php?action=view&user_id=%s">%s %s ( %s )</A></TD>',
printf ('<TD><A href="user_sec.php?action=view&user_id=%s&'.$str_dossier.'">%s %s ( %s )</A></TD>',
$l_line['use_id'],
$l_line['use_first_name'],
$l_line['use_name'],
@ -93,7 +93,7 @@ foreach ($_GET as $name=>$value)
if ( $action == "change_jrn" ) {
// Check if the user can access that folder
if ( CheckDossier($_GET['login'],$_SESSION['g_dossier']) == 0 ) {
if ( CheckDossier($_GET['login'],$gDossier) == 0 ) {
echo "<H2 class=\"error\">Cet utilisateur ne peut pas acc&eacute;der ce dossier</H2>";
$action="";
return;
@ -101,9 +101,9 @@ if ( $action == "change_jrn" ) {
$login=$_GET['login'];
$jrn=$_GET['jrn'];
$access=$_GET['access'];
$l_Db=sprintf("dossier%d",$_SESSION['g_dossier']);
$l_Db=sprintf("dossier%d",$gDossier);
echo_debug('user_sec.php',__LINE__,"select * from user_sec_jrn where uj_login='$login' and uj_jrn_id=$jrn");
$cn_dossier=DbConnect($_SESSION['g_dossier']);
$cn_dossier=DbConnect($gDossier);
$l2_Res=ExecSql($cn_dossier,
"select * from user_sec_jrn where uj_login='$login' and uj_jrn_id=$jrn");
$l2_count=pg_NumRows($l2_Res);
@ -117,13 +117,13 @@ if ( $action == "change_jrn" ) {
}
if ( $action == "change_act" ) {
// Check if the user can access that folder
if ( CheckDossier($_GET['login'],$_SESSION['g_dossier']) == 0 ) {
if ( CheckDossier($_GET['login'],$gDossier) == 0 ) {
echo "<H2 class=\"error\">he cannot access this folder</H2>";
$action="";
return;
}
$l_Db=sprintf("dossier%d",$_SESSION['g_dossier']);
$cn_dossier=DbConnect($_SESSION['g_dossier']);
$l_Db=sprintf("dossier%d",$gDossier);
$cn_dossier=DbConnect($gDossier);
if ( $_GET['access']==0) {
echo_debug('user_sec.php',__LINE__,"delete right");
$Res=ExecSql($cn_dossier,
@ -140,8 +140,8 @@ if ( $action == "change_act" ) {
}
// Action == View detail for users
if ( $action == "view" ) {
$l_Db=sprintf("dossier%d",$_SESSION['g_dossier']);
$cn_dossier=DbConnect($_SESSION['g_dossier']);
$l_Db=sprintf("dossier%d",$gDossier);
$cn_dossier=DbConnect($gDossier);
$cn=DbConnect();
$User=ExecSql($cn,
"select use_id,use_first_name,use_name,use_login
@ -155,13 +155,13 @@ if ( $action == "view" ) {
$l2_line['use_name'],
$l2_line['use_login']);
// Check if the user can access that folder
if ( CheckDossier($l2_line['use_login'],$_SESSION['g_dossier']) == 0 ) {
if ( CheckDossier($l2_line['use_login'],$gDossier) == 0 ) {
echo "<H2 class=\"error\">he cannot access this folder</H2>";
$action="";
return;
}
// Print button
printf ('<TD><A href="sec_pdf.php?user_id=%s">Imprime</A></TD>',
printf ('<TD><A href="sec_pdf.php?user_id=%s&'.$str_dossier.'">Imprime</A></TD>',
$l2_line['use_id']
);
@ -180,27 +180,27 @@ if ( $action == "view" ) {
$l_change="action=change_jrn&jrn=$l_line[jrn_def_id]&login=$l2_line[use_login]&user_id=$l2_line[use_id]";
if ( $admin == 0) {
$right= CheckJrn($_SESSION['g_dossier'],$l2_line['use_login'],$l_line['jrn_def_id'] );
$right= CheckJrn($gDossier,$l2_line['use_login'],$l_line['jrn_def_id'] );
echo_debug('user_sec.php',__LINE__,"Privilege is $right");
} else $right = 3;
if ( $right == 0 ) {
echo "<TD BGCOLOR=RED>";
echo "Pas d'accès";
echo "</TD>";
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=R"> Lecture</A></TD>';
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=W"> Ecriture</A></TD>';
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=R&'.$str_dossier.'"> Lecture</A></TD>';
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=W&'.$str_dossier.'"> Ecriture</A></TD>';
}
if ( $right == 1 ) {
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=X"> Pas d\'accès</A></TD>';
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=X&'.$str_dossier.'"> Pas d\'accès</A></TD>';
echo "<TD BGCOLOR=\"#3BCD27\">";
echo "Lecture ";
echo "</TD>";
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=W"> Ecriture</A></TD>';
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=W&'.$str_dossier.'"> Ecriture</A></TD>';
}
if ( $right == 2 ) {
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=X"> Pas d\'accès</A></TD>';
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=R"> Lecture</A></TD>';
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=X&'.$str_dossier.'"> Pas d\'accès</A></TD>';
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&access=R&'.$str_dossier.'"> Lecture</A></TD>';
echo "<TD BGCOLOR=\"#3BCD27\">";
echo "Ecriture ";
@ -236,7 +236,7 @@ if ( $action == "view" ) {
$l_change="action=change_act&act=".$l_line['ac_id']."&login=".$l2_line['use_login']."&user_id=".$l2_line['use_id'];
if ( $admin ==0 ) {
$right=CheckAction($_SESSION['g_dossier'],$l2_line['use_login'],$l_line['ac_id']);
$right=CheckAction($gDossier,$l2_line['use_login'],$l_line['ac_id']);
} else {
$right = 2;
}
@ -245,11 +245,11 @@ if ( $action == "view" ) {
echo "Pas d'accès";
echo "</TD>";
$l_change=$l_change."&access=1";
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'"> Accès </A></TD>';
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&'.$str_dossier.'"> Accès </A></TD>';
}
if ( $right == 1) {
$l_change=$l_change."&access=0";
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'"> Pas d\'accès </A></TD>';
echo '<TD class="mtitle"> <A CLASS="mtitle" HREF="user_sec.php?'.$l_change.'&'.$str_dossier.'"> Pas d\'accès </A></TD>';
echo "<TD BGCOLOR=\"#3BCD27\">";
echo "Accès ";
echo "</TD>";

View file

@ -44,6 +44,7 @@ function ShowActionList($cn,$retour,$h_url)
<span style="position:float;float:left">
<form method="get" action="commercial.php">
<?php
echo dossier::hidden();
$a=(isset($_GET['query']))?$_GET['query']:"";
printf ('<span>Titre ou référence: <input type="text" name="query" value="%s"></span>',
$a);
@ -72,6 +73,7 @@ function ShowActionList($cn,$retour,$h_url)
<br>
<form style="position:float;float:left" method="get" action="commercial.php">
<?php echo dossier::hidden(); ?>
<input type="submit" name="submit_query" value="Ajout Action">
<input type="hidden" name="p_action" value="suivi_courrier">
<input type="hidden" name="sa" value="add_action">
@ -214,6 +216,7 @@ if ( isset ($_POST['add_action_here']) )
echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
// $act->ag_comment=(isset($_POST['ag_comment']))?Decode($_POST['ag_comment']):"";
echo dossier::hidden();
$act->ag_comment="";
echo_debug("action.inc",__LINE__,"call display");
echo $act->Display('NEW',false);
@ -236,12 +239,13 @@ if ( isset ($_POST['add_action_here']) )
if ( $sub_action=='detail' )
{
echo '<div class="u_redcontent">';
echo '<A class="mtitle" HREF="commercial.php?p_action=suivi_courrier"><input type="button" value="Retour"></A>';
echo '<A class="mtitle" HREF="commercial.php?p_action=suivi_courrier&'.$str_dossier.'"><input type="button" value="Retour"></A>';
$act=new action($cn);
$act->ag_id=$_REQUEST['ag_id'];
echo $act->get();
$act->ag_comment=Decode($act->ag_comment);
echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" enctype="multipart/form-data" method="post" onsubmit="return submitForm();" >';
echo dossier::hidden();
echo JS_SEARCH_CARD;
echo $act->display('UPD',false);
echo '<input type="hidden" name="p_action" value="suivi_courrier">';
@ -254,6 +258,7 @@ if ( $sub_action=='detail' )
echo $upload->Submit("add_action_here","Ajoute une action à celle-ci");
echo '</form>';
echo '<form action="commercial.php" method="post" >';
echo dossier::hidden();
echo $upload->Submit("delete","Efface cette action");
echo '<input type="hidden" name="p_action" value="suivi_courrier">';
@ -273,7 +278,7 @@ if ( $sub_action == 'delete' )
if ( ! isset ($_POST['confirm_delete']))
{
echo '<div class="u_redcontent">';
echo '<A class="mtitle" HREF="commercial.php?p_action=suivi_courrier"><input type="button" value="Retour"></A>';
echo '<A class="mtitle" HREF="commercial.php?p_action=suivi_courrier&'.$str_dossier.'"><input type="button" value="Retour"></A>';
$act=new action($cn);
$act->ag_id=$_REQUEST['ag_id'];
echo $act->get();
@ -283,6 +288,8 @@ if ( $sub_action == 'delete' )
echo $act->display('READ',false);
// display the form
echo '<form action="commercial.php?p_action=suivi_courrier" method="post" >';
echo dossier::hidden();
echo '<input type="hidden" name="p_action" value="suivi_courrier">';
echo '<input type="hidden" name="sa" value="delete">';
echo '<input type="hidden" name="ag_id" value="'.$act->ag_id.'">';
@ -315,7 +322,7 @@ if ( $sub_action == "list" )
// Add an action
if ( $sub_action == "add_action" )
{
echo '<A class="one" HREF="commercial.php?p_action=suivi_courrier"><input type="button" value="Retour"></A>';
echo '<A class="one" HREF="commercial.php?p_action=suivi_courrier&'.$str_dossier.'"><input type="button" value="Retour"></A>';
echo_debug('action',__LINE__,var_export($_POST,true));
echo $retour;
$act=new action($cn);
@ -335,6 +342,8 @@ if ( $sub_action == "add_action" )
echo JS_SEARCH_CARD;
// Add hidden tag
echo '<form name="RTEDemo" action="commercial.php?p_action=suivi_courrier" method="post" onsubmit="return submitForm();">';
echo dossier::hidden();
$act->ag_comment=(isset($_POST['ag_comment']))?Decode($_POST['ag_comment']):"";
echo_debug("action.inc",__LINE__,"call display");
@ -398,7 +407,7 @@ if ( $sub_action == "save_action_st2" )
$act->gen=isset($_POST['p_gen'])?'on':'off';
// insert into action_gestion
echo $act->SaveStage2();
echo '<A class="one" HREF="commercial.php?p_action=suivi_courrier"><INPUT TYPE="BUTTON" VALUE="Retour Liste"></A>';
echo '<A class="one" HREF="commercial.php?p_action=suivi_courrier&'.$str_dossier.'"><INPUT TYPE="BUTTON" VALUE="Retour Liste"></A>';
}
//--------------------------------------------------------------------------------

View file

@ -76,12 +76,13 @@ if ( $sub_action == "" )
if ( $sub_action=="blank")
{
$retour=sprintf('<A class="mtitle" HREF="%s"><input type="button" value="Retour"></A>',
"commercial.php?p_action=admin");
"commercial.php?p_action=admin&$str_dossier");
echo '<div class="u_redcontent">';
echo $retour;
$c=new Admin($cn);
echo '<form method="post" action="commercial.php"';
echo dossier::hidden();
echo '<input type="hidden" name="p_action" value="admin">';
echo '<input type="hidden" name="sa" value="insert">';
echo '<input type="hidden" name="fd_id" value="'.$_GET['fd_id'].'">';
@ -98,9 +99,10 @@ if ( $sub_action == "list" )
{
?>
<div class="u_content">
<span>
<span style="position:float;float:left">
<form method="get" action="commercial.php">
<?php
echo dossier::hidden();
$a=(isset($_GET['query']))?$_GET['query']:"";
printf ('<input type="text" name="query" value="%s">',
$a);
@ -109,8 +111,9 @@ if ( $sub_action == "list" )
<input type="hidden" name="p_action" value="admin">
</form>
</span>
<span>
<span style="position:float;float:left">
<form method="get" action="commercial.php">
<?php echo dossier::hidden(); ?>
<input type="hidden" name="url" <?php $url=urlencode($_SERVER['REQUEST_URI']);echo 'value="'.$url.'"'; ?>
<input type="hidden" name="p_action" value="admin">
@ -158,6 +161,8 @@ if ( $sub_action == 'detail' )
urldecode($_REQUEST['url']));
echo $retour;
echo '<form action="'.$_REQUEST['url'].'" method="post">';
echo dossier::hidden();
echo $sup->Display(false);
$w=new widget("hidden");
$w->name="p_action";

View file

@ -46,6 +46,7 @@ if ( isset ($_POST['view'] ) ) {
echo "<table>";
echo '<TR>';
echo '<TD><form method="POST" ACTION="print_balance.php">'.
dossier::hidden().
$submit->Submit('bt_pdf',"Export PDF").
$hid->IOValue("p_action","impress").
$hid->IOValue("from_periode",$_POST['from_periode']).
@ -56,6 +57,7 @@ if ( isset ($_POST['view'] ) ) {
echo "</form></TD>";
echo '<TD><form method="POST" ACTION="bal_csv.php">'.
$submit->Submit('bt_csv',"Export CSV").
dossier::hidden().
$hid->IOValue("p_action","impress").
$hid->IOValue("from_periode",$_POST['from_periode']).
$hid->IOValue("to_periode",$_POST['to_periode']).
@ -72,6 +74,7 @@ if ( isset ($_POST['view'] ) ) {
// Show the form for period
echo '<FORM action="?p_action=impress&type=bal" method="post">';
echo dossier::hidden();
$w=new widget("select");
$w->table=1;
// filter on the current year

View file

@ -36,14 +36,14 @@ require_once("check_priv.php");
// to enter a new invoice
if ( ! isset ($_REQUEST['p_jrn'])) {
// no journal are selected so we select the first one
$p_jrn=GetFirstJrnIdForJrnType($_SESSION['g_dossier'],'FIN');
$p_jrn=GetFirstJrnIdForJrnType($gDossier,'FIN');
} else
{
$p_jrn=$_REQUEST['p_jrn'];
}
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) < 1 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) < 1 ) {
NoAccess();
exit -1;
}
@ -64,13 +64,13 @@ $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
if ( $sub_action == "solde" )
{
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) < 1 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) < 1 ) {
NoAccess();
exit -1;
}
echo '<div class="u_subtmenu">';
echo ShowMenuJrnUser($_SESSION['g_dossier'],'FIN',0,'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&p_action=bank&sa=list">Liste</A></td>'.
echo ShowMenuJrnUser($gDossier,'FIN',0,'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&'.dossier::get().'&p_action=bank&sa=list">Liste</A></td>'.
'<td class="selectedcell">Solde</td>');
echo '</div>';
require_once("poste.php");
@ -121,13 +121,13 @@ echo ShowMenuJrnUser($_SESSION['g_dossier'],'FIN',0,'<td class="cell"><A class="
if ( $sub_action == "list")
{
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) < 1 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) < 1 ) {
NoAccess();
exit -1;
}
// show the menu with the list item selected
echo '<div class="u_subtmenu">';
echo ShowMenuJrnUser($_SESSION['g_dossier'],'FIN',0,'<td class="selectedcell">Liste</td>'.
echo ShowMenuJrnUser($gDossier,'FIN',0,'<td class="selectedcell">Liste</td>'.
'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&p_action=bank&sa=solde">Solde</A></td>');
echo '</div>';
@ -135,6 +135,7 @@ if ( $sub_action == "list")
echo '<form>';
echo dossier::hidden();
$hid=new widget("hidden");
$hid->name="p_action";
@ -213,8 +214,9 @@ if ( $sub_action == "list")
}
//-----------------------------------------------------
echo '<div class="u_subtmenu">';
echo ShowMenuJrnUser($_SESSION['g_dossier'],'FIN',$p_jrn,'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&p_action=bank&sa=list">Liste</A></td>'.
'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&p_action=bank&sa=solde">Solde</A></td>');
echo ShowMenuJrnUser($gDossier,'FIN',$p_jrn,
'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&p_action=bank&sa=list&'.dossier::get().'">Liste</A></td>'.
'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&p_action=bank&sa=solde&'.dossier::get().'">Solde</A></td>');
echo '</div>';
//-----------------------------------------------------
// if we request to add an item
@ -222,7 +224,7 @@ echo '</div>';
// or if we ask to correct the invoice
if ( isset ($_POST['add_item']) || isset ($_POST['correct']) )
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) != 2 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
NoAccess();
exit -1;
}
@ -247,7 +249,7 @@ if ( isset ($_POST['add_item']) || isset ($_POST['correct']) )
//
if ( isset($_POST['save']))
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) != 2 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
NoAccess();
exit -1;
}
@ -273,7 +275,7 @@ if ( isset($_POST['save']))
//
if ( isset ($_POST['view_invoice']) )
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) != 2 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
NoAccess();
exit -1;
}
@ -306,7 +308,7 @@ if ( isset ($_POST['view_invoice']) )
// By default we add a new invoice
if ( $p_jrn != -1 )
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) != 2 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
exit -1;
}

View file

@ -50,7 +50,7 @@ foreach ($m as $line)
} else {
echo '<td class="mtitle">'.
'<a class="mtitle" href="?p_action=ca_od&sa=pa&pa_id='.$line['id'].'&new"> '.
'<a class="mtitle" href="?p_action=ca_od&sa=pa&pa_id='.$line['id'].'&new&'.$str_dossier.'"> '.
$line['name'].
'</a>'.'</td>';
}
@ -68,12 +68,12 @@ echo '
<table>
<tr>
<td class="mtitle" >
<A class="mtitle" HREF="?p_action=ca_od&pa_id='.$_REQUEST['pa_id'].'&new"> Nouveau </A>
<A class="mtitle" HREF="?p_action=ca_od&pa_id='.$_REQUEST['pa_id'].'&new&'.$str_dossier.'"> Nouveau </A>
</td>
</tr>
<tr>
<td class="mtitle" >
<A class="mtitle" HREF="?p_action=ca_od&pa_id='.$_REQUEST['pa_id'].'&see"> Liste op&eacute;rations </A
<A class="mtitle" HREF="?p_action=ca_od&pa_id='.$_REQUEST['pa_id'].'&see&'.$str_dossier.'"> Liste op&eacute;rations </A
</td>
</tr>
</table>
@ -118,6 +118,7 @@ if ( isset($_GET['new'])) {
$wSubmit->table=0;
echo '<div class="u_redcontent">';
echo '<form method="post">';
echo dossier::hidden();
echo $wSubmit->IOValue();
echo $a->form();
echo $wSubmit->Submit("save","Sauver");

View file

@ -47,6 +47,7 @@ if ( isset($_REQUEST['sa']))
$ret.= '<div class="u_redcontent">';
$ret.= '<h2 class="info">Nouveau plan</h2>';
$ret.= '<form method="post">';
$ret.=dossier::hidden();
$ret.= $new->form();
$wSa=new widget("HIDDEN","","sa","pa_write");
$wSa->value="pa_write";
@ -96,13 +97,15 @@ if ( isset($_REQUEST['sa']))
$ret.= '<div class="u_redcontent">';
$ret.= '<h2 class="info">Mise &agrave; jour</h2>';
$ret.= '<form method="post">';
$ret.=dossier::hidden();
$ret.= $new->form();
$ret.= $wSa->IOValue();
$ret.= $wAction->IOValue();
$ret.= $wSa->Submit("submit","Enregistre");
$ret.=sprintf('<A class="mtitle" HREF="%s">'.
'<input type="button" value="Efface"></A>',
"?p_action=ca_pa&pa_id=".$_GET['pa_id']."&sa=pa_delete");
"?p_action=ca_pa&pa_id=".$_GET['pa_id']."&sa=pa_delete&$str_dossier");
$ret.= '</form>';
$ret.= '</div>';
@ -127,6 +130,7 @@ if ( isset($_REQUEST['sa']))
$wSa=new widget("hidden","sa","sa","po_write");
$ret.='<div class="u_redcontent">';
$ret.='<form method="post">';
$ret.=dossier::hidden();
$ret.=$po->form();
$ret.=$wSa->IOValue();
$ret.=$wSa->Submit("add","Ajout");
@ -158,11 +162,13 @@ if ( isset($_REQUEST['sa']))
$po->get_by_id();
$ret.='<div class="u_redcontent">';
$ret.='<form method="post">';
$ret.=dossier::hidden();
$ret.=$po->form();
$ret.=$wHidden->IOValue();
$ret.='<input type="submit" value="Correction">';
$ret.=sprintf('<A class="mtitle" HREF="?p_action=ca_pa&sa=po_delete&po_id=%s&pa_id=%s">'.
'<input type="button" value="Efface"></A>',
$ret.=sprintf('<A class="mtitle" HREF="?p_action=ca_pa&sa=po_delete&po_id=%s&pa_id=%s&'.$str_dossier.'">'.
'<input type="button" value="Efface" onClick="return confirm(\' Voulez-vous vraiment effacer ce poste\');"></A>',
$po->id,
$_REQUEST['pa_id']
);
@ -210,7 +216,8 @@ if ( isset($_REQUEST['sa']))
$ret.="<TR class=\"$class\">";
$ret.="<TD>".
'<a class="mtitle" href="?p_action=ca_pa&sa=po_detail&po_id='.$obj->id.'&pa_id='.$_REQUEST['pa_id'].'">'.
'<a class="mtitle" href="?p_action=ca_pa&sa=po_detail&po_id='.$obj->id.'&pa_id='.$_REQUEST['pa_id'].'&'.
$str_dossier.'">'.
$obj->name.
'</a>';
"</td>";
@ -221,7 +228,7 @@ if ( isset($_REQUEST['sa']))
}
$ret.="</table>";
$ret.=sprintf('<A class="mtitle" HREF="?p_action=ca_pa&sa=po_add&pa_id=%s">'.
$ret.=sprintf('<A class="mtitle" HREF="?p_action=ca_pa&sa=po_add&pa_id=%s&'.$str_dossier.'">'.
'<input type="button" value="Ajout"></A>',
$_GET['pa_id']
);
@ -247,7 +254,7 @@ if ( empty($list) )
echo '<div class="lmenu">';
echo '<TABLE>';
echo '<TR><TD class="mtitle">';
echo '<a class="mtitle" href="?p_action=ca_pa&sa=add_pa">Ajout d\'un plan comptable</a>';
echo '<a class="mtitle" href="?p_action=ca_pa&sa=add_pa'.$str_dossier.'">Ajout d\'un plan comptable</a>';
echo '</TD></TR>';
echo '</TABLE>';
@ -267,11 +274,11 @@ if ( empty($list) )
{
echo '<TR>';
echo '<TD >'.
'<a class="mtitle" href="?p_action=ca_pa&sa=pa_detail&pa_id='.$line['id'].'">'.
'<a class="mtitle" href="?p_action=ca_pa&sa=pa_detail&pa_id='.$line['id'].'&'.$str_dossier.'">'.
$line['name'].
'</TD>';
echo '<td class="mtitle">'.
'<a class="mtitle" href="?p_action=ca_pa&sa=list&pa_id='.$line['id'].'">'.
'<a class="mtitle" href="?p_action=ca_pa&sa=list&pa_id='.$line['id'].'&'.$str_dossier.'">'.
"Postes".
"</a>";
@ -282,7 +289,7 @@ if ( empty($list) )
{
echo '<TABLE>';
echo '<TR><TD class="mtitle">';
echo '<a class="mtitle" href="?p_action=ca_pa&sa=add_pa">Ajout d\'un plan comptable</a>';
echo '<a class="mtitle" href="?p_action=ca_pa&sa=add_pa&'.$str_dossier.'">Ajout d\'un plan comptable</a>';
echo '</TD></TR>';
echo '</TABLE>';
}

View file

@ -473,6 +473,7 @@ class action
// Preparing the return string
$r=$retour."<form method=\"post\">";
$r.=dossier::hidden();
$r.="<p>Date : ".$date->IOValue()."</p>";
$r.="<p>Etat $str_state".$state->IOValue()."</p>";
$r.="<p>Type du document $str_type".$doc_type->IOValue()."</p>";
@ -581,6 +582,7 @@ class action
// readonly and upload of a file
$r.="<hr>";
$r.='<form enctype="multipart/form-data" method="post">';
$r.=dossier::hidden();
echo_debug("class_action",__LINE__,"call display");
$r.=$this->Display('READ',false);
// Add the hidden tag
@ -653,6 +655,7 @@ class action
*/
function myList($p_filter="",$p_search="")
{
$str_dossier=dossier::get();
// for the sort
$sort="";
$image_asc='<IMAGE SRC="image/down.png" border="0" >';
@ -664,22 +667,22 @@ class action
$sort_date='<th><A class="mtitle" href="?'.$url.'&s=date_a">'.$image_asc.'</A>'.
'Date'.
'<A class="mtitle" href="?'.$url.'&s=date_d">'.$image_desc.'</A></th>';
$sort_exp='<th><A class="mtitle" href="?'.$url.'&s=exp">'.$image_asc.'</A>'.
'<A class="mtitle" href="?'.$url.'&s=date_d&'.$str_dossier.'">'.$image_desc.'</A></th>';
$sort_exp='<th><A class="mtitle" href="?'.$url.'&s=exp&'.$str_dossier.'">'.$image_asc.'</A>'.
'Expéditeur'.
'<A class="mtitle" href="?'.$url.'&s=exp_d">'.$image_desc.'</A></th>';
$sort_dest='<th><A class="mtitle" href="?'.$url.'&s=dest">'.$image_asc.'</A>'.
'<A class="mtitle" href="?'.$url.'&s=exp_d&'.$str_dossier.'">'.$image_desc.'</A></th>';
$sort_dest='<th><A class="mtitle" href="?'.$url.'&s=dest&'.$str_dossier.'">'.$image_asc.'</A>'.
'Destinataire'.
'<A class="mtitle" href="?'.$url.'&s=dest_d">'.$image_desc.'</A></th>';
$sort_titre='<th><A class="mtitle" href="?'.$url.'&s=ti">'.$image_asc.'</A>'.
'<A class="mtitle" href="?'.$url.'&s=dest_d&'.$str_dossier.'">'.$image_desc.'</A></th>';
$sort_titre='<th><A class="mtitle" href="?'.$url.'&s=ti&'.$str_dossier.'">'.$image_asc.'</A>'.
'Titre'.
'<A class="mtitle" href="?'.$url.'&s=ti_d">'.$image_desc.'</A></th>';
$sort_concerne='<th><A class="mtitle" href="?'.$url.'&s=conc">'.$image_asc.'</A>'.
'<A class="mtitle" href="?'.$url.'&s=ti_d&'.$str_dossier.'">'.$image_desc.'</A></th>';
$sort_concerne='<th><A class="mtitle" href="?'.$url.'&s=conc&'.$str_dossier.'">'.$image_asc.'</A>'.
'Concerne'.
'<A class="mtitle" href="?'.$url.'&s=conc_d">'.$image_desc.'</A></th>';
$sort_reference='<th><A class="mtitle" href="?'.$url.'&s=ref">'.$image_asc.'</A>'.
'<A class="mtitle" href="?'.$url.'&s=conc_d&'.$str_dossier.'">'.$image_desc.'</A></th>';
$sort_reference='<th><A class="mtitle" href="?'.$url.'&s=ref&'.$str_dossier.'">'.$image_asc.'</A>'.
'Référence'.
'<A class="mtitle" href="?'.$url.'&s=ref_d">'.$image_desc.'</A></th>';
'<A class="mtitle" href="?'.$url.'&s=ref_d&'.$str_dossier.'">'.$image_desc.'</A></th>';
if ( isset($_GET['s'])){
{
@ -837,7 +840,7 @@ class action
$_REQUEST['PHPSESSID'],$qdest);
if ( $qdest != 'Interne' )
{
$r.="<td>".'<A HREF="'.$jsdest.'">'.$qdest." : ".$fdest->getName().'</A></td>';
$r.="<td>".'<A HREF="'.$jsdest.'&'.$str_dossier.'">'.$qdest." : ".$fdest->getName().'</A></td>';
}
else
$r.="<td>Interne </td>";
@ -852,7 +855,7 @@ class action
$_REQUEST['PHPSESSID'],$qexp);
if ( $qexp != 'Interne' )
{
$r.="<td>".'<A HREF="'.$jsexp.'">'.$qexp." : ".$fexp->getName().'</A></td>';
$r.="<td>".'<A HREF="'.$jsexp.'&'.$str_dossier.'">'.$qexp." : ".$fexp->getName().'</A></td>';
}
else
$r.="<td>Interne </td>";
@ -869,13 +872,13 @@ class action
{
foreach ($retSql as $line)
{
$ref.='<A href="commercial.php?p_action=suivi_courrier&query='.$line['ag_ref'].'">'.
$ref.='<A href="commercial.php?p_action=suivi_courrier&query='.$line['ag_ref'].'&'.$str_dossier.'">'.
$line['ag_ref']."<A>";
}
}
}
$r.='<td><A HREF="commercial.php?p_action=suivi_courrier&sa=detail&ag_id='.$row['ag_id'].'">'.
$r.='<td><A HREF="commercial.php?p_action=suivi_courrier&sa=detail&ag_id='.$row['ag_id'].'&'.$str_dossier.'">'.
$row['ag_title']."</A></td>";
$r.="<td>".$row['dt_value']."</td>";
$r.="<td>".$row['ag_ref']."</td>";

View file

@ -64,6 +64,7 @@ class Admin extends fiche{
*/
function Summary($p_search)
{
$str_dossier=dossier::get();
$p_search=FormatString($p_search);
$url=urlencode($_SERVER['REQUEST_URI']);
$script=$_SERVER['PHP_SELF'];
@ -100,8 +101,8 @@ class Admin extends fiche{
return $r;
foreach ($step_admin as $admin ) {
$r.="<TR>";
$e=sprintf('<A HREF="%s?p_action=admin&sa=detail&f_id=%d&url=%s" title="Détail"> ',
$script,$admin->id,$url);
$e=sprintf('<A HREF="%s?p_action=admin&sa=detail&f_id=%d&%s&url=%s" title="Détail"> ',
$script,$admin->id,$str_dossier,$url);
$r.="<TD> $e".$admin->strAttribut(ATTR_DEF_QUICKCODE)."</A></TD>";
$r.="<TD>".$admin->strAttribut(ATTR_DEF_NAME)."</TD>";
@ -110,12 +111,12 @@ class Admin extends fiche{
" ".$admin->strAttribut(ATTR_DEF_PAYS).
"</TD>";
$r.="<td>";
$r.=sprintf('<A class="mtitle" HREF="%s?p_action=contact&qcode=%s&url=%s" title="Contact">Contact</A> - ',
$script,$admin->strAttribut(ATTR_DEF_QUICKCODE),$url);
$r.=sprintf('<A class="mtitle" HREF="%s?p_action=suivi_courrier&sa=list&qcode=%s&url=%s" title="Action">Action</A> - ',
$script,$admin->strAttribut(ATTR_DEF_QUICKCODE) ,$url);
$r.=sprintf('<A class="mtitle" HREF="%s?liste&p_action=bank&sa=list&qcode=%s&url=%s&p_periode=-1" title="Financier">Financier</A> - ',
$script,$admin->strAttribut(ATTR_DEF_QUICKCODE) ,$url);
$r.=sprintf('<A class="mtitle" HREF="%s?p_action=contact&qcode=%s&%s&url=%s" title="Contact">Contact</A> - ',
$script,$admin->strAttribut(ATTR_DEF_QUICKCODE),$str_dossier,$url);
$r.=sprintf('<A class="mtitle" HREF="%s?p_action=suivi_courrier&sa=list&qcode=%s&%s&url=%s" title="Action">Action</A> - ',
$script,$admin->strAttribut(ATTR_DEF_QUICKCODE) ,$str_dossier,$url);
$r.=sprintf('<A class="mtitle" HREF="%s?liste&p_action=bank&sa=list&qcode=%s&%s&url=%s&p_periode=-1" title="Financier">Financier</A> - ',
$script,$admin->strAttribut(ATTR_DEF_QUICKCODE) ,$str_dossier,$url);
$r.='</TD>';

View file

@ -195,6 +195,7 @@ where
*/
function Summary($p_search)
{
$str_dossier=dossier::get();
$p_search=FormatString($p_search);
$url=urlencode($_SERVER['REQUEST_URI']);
$script=$_SERVER['PHP_SELF'];
@ -230,12 +231,13 @@ where
<th>Solde</th>
<th colspan="4">Action </th>
</TR>';
echo_debug(__FILE__,__LINE__,$step_client);
if ( sizeof ($step_client ) == 0 )
return $r;
foreach ($step_client as $client ) {
$r.="<TR>";
$e=sprintf('<A HREF="%s?p_action=client&sa=detail&f_id=%d&url=%s" title="Détail"> ',
$script,$client->id,$url);
$e=sprintf('<A HREF="%s?p_action=client&sa=detail&f_id=%d&%s&url=%s" title="Détail"> ',
$script,$client->id,$str_dossier,$url);
$r.="<TD> $e".$client->strAttribut(ATTR_DEF_QUICKCODE)."</A></TD>";
$r.="<TD>".$client->strAttribut(ATTR_DEF_NAME)."</TD>";
@ -256,16 +258,16 @@ where
$r.=sprintf('<TD align="right"> %15.2f&euro;</TD>',$a['solde']);
$r.="<TD>";
$r.=sprintf('<A HREF="%s?p_action=contact&qcode=%s&url=%s" title="Contact">Contact</A></td>',
$script,$client->strAttribut(ATTR_DEF_QUICKCODE),$url);
$r.=sprintf('<td><A HREF="%s?p_action=suivi_courrier&sa=list&qcode=%s&url=%s" title="Action">Courrier</A></td> ',
$script,$client->strAttribut(ATTR_DEF_QUICKCODE) ,$url);
$r.=sprintf('<A HREF="%s?p_action=contact&qcode=%s&%s&url=%s" title="Contact">Contact</A></td>',
$script,$client->strAttribut(ATTR_DEF_QUICKCODE),$str_dossier,$url);
$r.=sprintf('<td><A HREF="%s?p_action=suivi_courrier&sa=list&qcode=%s&%s&url=%s" title="Action">Courrier</A></td> ',
$script,$client->strAttribut(ATTR_DEF_QUICKCODE) ,$str_dossier,$url);
$r.='<td><A HREF="commercial.php?p_action=facture&sa=list&p_periode=-1&qcode='.$client->strAttribut(ATTR_DEF_QUICKCODE).'&url='.$url.'" title="Historique Facture">Facture</A></td>';
$r.=sprintf('<td><A class="mtitle" HREF="%s?liste&p_action=bank&sa=list&qcode=%s&url=%s&p_periode=-1" title="Financier">Financier</A></td>',
$script,$client->strAttribut(ATTR_DEF_QUICKCODE) ,$url);
$r.='<td><A HREF="commercial.php?p_action=facture&sa=list&p_periode=-1&'.$str_dossier.'&qcode='.$client->strAttribut(ATTR_DEF_QUICKCODE).'&url='.$url.'" title="Historique Facture">Facture</A></td>';
$r.=sprintf('<td><A class="mtitle" HREF="%s?liste&p_action=bank&sa=list&qcode=%s&%s&url=%s&p_periode=-1" title="Financier">Financier</A></td>',
$script,$client->strAttribut(ATTR_DEF_QUICKCODE) ,$str_dossier,$url);
$r.='</TD>';

View file

@ -47,11 +47,13 @@ class Document_modele {
* \return table in HTML Code
*/
function myList() {
$s=dossier::get();
$sql="select md_id,md_name,dt_value from document_modele join document_type on(dt_id=md_type)";
$Res=ExecSql($this->cn,$sql);
$all=pg_fetch_all($Res);
if ( pg_NumRows($Res) == 0 ) return "";
$r='<p><form method="post">';
$r.=dossier::hidden();
$r.="<table>";
$r.="<tr> <th> Nom </th> <th>Type</Th><th>Fichier</th><th> Effacer</th>";
$r.="</tr>";
@ -64,7 +66,7 @@ class Document_modele {
$r.=$row['dt_value'];
$r.="</td>";
$r.="<td>";
$r.='<A HREF="show_document_modele.php?md_id='.$row['md_id'].'">Document</a>';
$r.='<A HREF="show_document_modele.php?md_id='.$row['md_id'].'&'.$s.'">Document</a>';
$r.="</td>";
$r.="<TD>";
$c=new widget("checkbox");
@ -262,6 +264,7 @@ class Document_modele {
{
$r="<p>";
$r.='<form enctype="multipart/form-data" action="'.$p_action.'" method="post">';
$r.=dossier::hidden();
$t=new widget("text");
$t->name="md_name";
$r.=" Nom ".$t->IOValue()."";

View file

@ -20,32 +20,62 @@
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
/* !\file the class for the dossier
/* !\file
* \brief the class for the dossier, everywhere we need to know to
* which folder we are connected, because we can't use $_SESSION, we
* need to pass the dossier_id via a _GET or a POST variable
*/
/* \brief manage the current dossier
/* \brief manage the current dossier, everywhere we need to know to
* which folder we are connected, because we can't use $_SESSION, we
* need to pass the dossier_id via a _GET or a POST variable
*
*/
class dossier {
var $id;
require_once('postgres.php');
include_once('debug.php');
require_once('ac_common.php');
function dossier() {
class dossier {
/*!\brief return the $_REQUEST['gDossier'] after a check */
static function id() {
echo_debug(__FILE__,__LINE__,"id");
echo_debug(__FILE__,__LINE__,$_REQUEST);
self::check();
return $_REQUEST['gDossier'];
}
/*!\brief check if gDossier is set */
static function check() {
if ( ! isset ($_REQUEST['gDossier']) ){
echo_error ('Dossier Invalide');
exit;
echo_error ('Dossier inconnu ');
exit('Dossier invalide');
}
$this->id=$_REQUEST['gDossier'];
}
function get() {
return $this->id;
/*!\brief return a string to put to gDossier into a GET */
static function get() {
echo_debug(__FILE__,__LINE__,"get");
echo_debug(__FILE__,__LINE__,$_REQUEST);
self::check();
return "gDossier=".$_REQUEST['gDossier'];
}
static function hidden {
return '<input type="hidden" name="gDossier" value="'.$this->id.'">';
/*!\brief return a string to set gDossier into a FORM */
static function hidden() {
echo_debug(__FILE__,__LINE__,"hidden");
echo_debug(__FILE__,__LINE__,$_REQUEST);
self::check();
return '<input type="hidden" id="gDossier" name="gDossier" value="'.$_REQUEST['gDossier'].'">';
}
function get_name() {
/*!\brief retrieve the name of the current dossier */
static function name() {
echo_debug(__FILE__,__LINE__,"get_name");
echo_debug(__FILE__,__LINE__,$_REQUEST);
self::check();
$cn=DbConnect();
$name=getDbValue($cn,"select dos_name from ac_dossier where dos_id=".$this->id);
$name=getDbValue($cn,"select dos_name from ac_dossier where dos_id=".$_REQUEST['gDossier']);
return $name;
}
}

View file

@ -182,19 +182,19 @@ class fiche {
function GetByDef($p_frd_id,$p_offset=-1,$p_search="") {
if ( $p_offset == -1 )
{
$sql="select *
$sql="select *
from
fiche join fiche_Def using (fd_id)
where frd_id=".$p_frd_id." $p_search order by f_id";
}
else
{
$limit=$_SESSION['g_pagesize'];
$sql="select *
$limit=($_SESSION['g_pagesize']!=-1)?"limit ".$_SESSION['g_pagesize']:"";
$sql="select *
from
fiche join fiche_Def using (fd_id)
where frd_id=".$p_frd_id." $p_search order by f_id
limit ".$limit." offset ".$p_offset;
where frd_id=".$p_frd_id." $p_search order by f_id "
.$limit." offset ".$p_offset;
}
@ -210,6 +210,7 @@ class fiche {
$all[$i]=$t;
}
echo_debug(__FILE__,__LINE__,$all);
return $all;
}
function ShowTable() {
@ -269,31 +270,35 @@ class fiche {
$array=$f->getAttribut();
$r='<table>';
foreach ($array as $attr)
{
$msg="";
if ( $attr->ad_id == ATTR_DEF_ACCOUNT)
{
$r.=JS_SEARCH_POSTE;
$w=new widget("js_search_poste");
// account created automatically
$sql="select account_auto($p_fiche_def)";
echo_debug("class_fiche",__LINE__,$sql);
$ret_sql=ExecSql($this->cn,$sql);
$a=pg_fetch_array($ret_sql,0);
if ( $a['account_auto'] == 't' )
$msg="<TD> <font color=\"red\">Rappel: Poste créé automatiquement !</font></TD> ";
else
{
// if there is a class base in fiche_def_ref, this account will be the
// the default one
if ( strlen(trim($f->class_base)) != 0 )
{
$msg="<TD> <font color=\"red\">Rappel: Poste par défaut sera ".
$f->class_base.
" !</font></TD> ";
}
$msg="";
if ( $attr->ad_id == ATTR_DEF_ACCOUNT)
{
$r.=JS_SEARCH_POSTE;
$w=new widget("js_search_poste");
// account created automatically
$sql="select account_auto($p_fiche_def)";
echo_debug("class_fiche",__LINE__,$sql);
$ret_sql=ExecSql($this->cn,$sql);
$a=pg_fetch_array($ret_sql,0);
$label=new widget("span");
$label->name="av_text".$attr->ad_id."_label";
if ( $a['account_auto'] == 't' )
$msg.="<TD>".$label->IOValue()."<br> <font color=\"red\">Rappel: Poste créé automatiquement !</font></TD> ";
else
{
// if there is a class base in fiche_def_ref, this account will be the
// the default one
if ( strlen(trim($f->class_base)) != 0 )
{
$msg.="<TD>".$label->IOValue()."<br> <font color=\"red\">Rappel: Poste par défaut sera ".
$f->class_base.
" !</font></TD> ";
}
}
}
}
elseif ( $attr->ad_id == ATTR_DEF_TVA)

View file

@ -331,25 +331,27 @@ class fiche_def {
echo '<FORM METHOD="POST" action="?p_action=fiche&action=vue'.$str.'">';
echo dossier::hidden();
echo '<INPUT TYPE="HIDDEN" name="fiche" value="'.$this->id.'">';
echo '<INPUT TYPE="SUBMIT" name="add" Value="Ajout fiche">';
echo '</FORM>';
$str_dossier=dossier::get();
echo '<table>';
for ( $i = 0; $i < $Max; $i++) {
$l_line=pg_fetch_array($Res,$i);
if ( $i%2 == 0)
echo '<TR class="odd">';
else
echo '<TR class="even">';
$l_line=pg_fetch_array($Res,$i);
if ( $i%2 == 0)
echo '<TR class="odd">';
else
echo '<TR class="even">';
$span_mod='<TD><A href="?p_action=fiche&action=detail&fiche_id='.$l_line['f_id'].$str.'&fiche='.$_GET['fiche'].'">'.$l_line['quick_code'].'</A></TD>';
$span_mod='<TD><A href="?p_action=fiche&'.$str_dossier.'&action=detail&fiche_id='.$l_line['f_id'].$str.'&fiche='.$_GET['fiche'].'">'.$l_line['quick_code'].'</A></TD>';
echo $span_mod.'<TD>'.$l_line['vw_name']."</TD>";
echo '</tr>';
}
echo '</table>';
echo '<FORM METHOD="POST" action="?p_action=fiche&action=vue'.$str.'">';
echo dossier::hidden();
echo '<INPUT TYPE="HIDDEN" name="fiche" value="'.$this->id.'">';
echo '<INPUT TYPE="SUBMIT" name="add" Value="Ajout fiche">';
echo '</FORM>';

View file

@ -128,7 +128,7 @@ class operation
if ( pg_NumRows($RetSql) == 0 )
return "Pas d'enregistrement trouv&eacute;";
$gDossier=dossier::id();
$array=pg_fetch_all($RetSql);
$ret.="";
@ -144,7 +144,7 @@ class operation
{
$efface=new widget('button');
$efface->js="op_remove('".$_REQUEST['PHPSESSID']."',".$oldgroup.")";
$efface->js="op_remove('".$_REQUEST['PHPSESSID']."',".$gDossier.",".$oldgroup.")";
$efface->name="Efface";
$efface->label="Efface";
$ret.="<td>".$efface->IOValue()."</td>";
@ -155,7 +155,7 @@ class operation
if ( $jr_id != 0) {
// get the old jr_id
$detail=new widget('button');
$detail->js="viewOperation($jr_id,'".$_REQUEST['PHPSESSID']."')";
$detail->js="viewOperation($jr_id,'".$_REQUEST['PHPSESSID']."',$gDossier)";
$detail->name="Detail";
$detail->label="Detail";
$ret.="<td>".$detail->IOValue()."</td>";
@ -199,7 +199,7 @@ class operation
}
$efface=new widget('button');
$efface->js="op_remove('".$_REQUEST['PHPSESSID']."',".$oldgroup.")";
$efface->js="op_remove('".$_REQUEST['PHPSESSID']."',$gDossier,".$oldgroup.")";
$efface->name="Efface";
$efface->label="Efface";
$ret.="<td>".$efface->IOValue()."</td>";
@ -208,7 +208,7 @@ class operation
$jr_id=$this->get_jrid();
if ( $jr_id != 0 ){
$detail=new widget('button');
$detail->js="viewOperation($jr_id,'".$_REQUEST['PHPSESSID']."')";
$detail->js="viewOperation($jr_id,'".$_REQUEST['PHPSESSID'].",$gDossier')";
$detail->name="Detail";
$detail->label="Detail";
$ret.="<td>".$detail->IOValue()."</td>";

View file

@ -249,10 +249,12 @@ function GetSoldeDetail($p_cond="") {
echo '<TR>';
echo '<TD><form method="GET" ACTION="">'.
dossier::hidden().
$submit->Submit('bt_other',"Autre poste").
$hid->IOValue("type","poste").$hid->IOValue('p_action','impress')."</form></TD>";
echo '<TD><form method="POST" ACTION="poste_pdf.php">'.
dossier::hidden().
$submit->Submit('bt_pdf',"Export PDF").
$hid->IOValue("type","poste").
$hid->IOValue('p_action','impress').
@ -264,6 +266,7 @@ function GetSoldeDetail($p_cond="") {
echo "</form></TD>";
echo '<TD><form method="POST" ACTION="poste_csv.php">'.
dossier::hidden().
$submit->Submit('bt_csv',"Export CSV").
$hid->IOValue("type","poste").
$hid->IOValue('p_action','impress').
@ -279,4 +282,4 @@ function GetSoldeDetail($p_cond="") {
}
}
}

View file

@ -82,6 +82,7 @@ class Supplier extends fiche{
*/
function Summary($p_search)
{
$str_dossier=dossier::get();
$p_search=FormatString($p_search);
$url=urlencode($_SERVER['REQUEST_URI']);
$script=$_SERVER['PHP_SELF'];
@ -121,7 +122,7 @@ class Supplier extends fiche{
return $r;
foreach ($step_supplier as $supplier ) {
$r.="<TR>";
$e=sprintf('<A HREF="%s?p_action=fournisseur&sa=detail&f_id=%d&url=%s" title="Détail"> ',
$e=sprintf('<A HREF="%s?p_action=fournisseur&'.$str_dossier.'&sa=detail&f_id=%d&url=%s" title="Détail"> ',
$script,$supplier->id,$url);
$r.="<TD> $e".$supplier->strAttribut(ATTR_DEF_QUICKCODE)."</A></TD>";
@ -149,8 +150,8 @@ class Supplier extends fiche{
$r.='<td><A HREF="commercial.php?p_action=depense&sa=list&p_periode=-1&qcode='.$supplier->strAttribut(ATTR_DEF_QUICKCODE).'&url='.$url.'" title="Historique Facture">Facture</A></td>';
$r.=sprintf('<td><A class="mtitle" HREF="%s?liste&p_action=bank&sa=list&qcode=%s&url=%s&p_periode=-1" title="Financier">Financier</A></td>',
$r.='<td><A HREF="commercial.php?p_action=depense&sa=list&'.$str_dossier.'&p_periode=-1&qcode='.$supplier->strAttribut(ATTR_DEF_QUICKCODE).'&url='.$url.'" title="Historique Facture">Facture</A></td>';
$r.=sprintf('<td><A class="mtitle" HREF="%s?liste&p_action=bank&sa=list&'.$str_dossier.'&qcode=%s&url=%s&p_periode=-1" title="Financier">Financier</A></td>',
$script,$supplier->strAttribut(ATTR_DEF_QUICKCODE) ,$url);

View file

@ -327,7 +327,7 @@ class widget {
// Do we need to filter ??
if ( $this->extra2 == null ) {
$r=sprintf('<TD>
<INPUT class="inp" TYPE="button" onClick=SearchPoste(\'%s\',\'%s\',\'%s\') value="Recherche">
<INPUT class="inp" TYPE="button" onClick=SearchPoste(\'%s\','.dossier::id().',\'%s\',\'%s\') value="Recherche">
%s</TD><TD>
<INPUT TYPE="Text" NAME="%s" ID="%s" VALUE="%s" SIZE="8">
@ -343,10 +343,10 @@ class widget {
} else { // $p_list is not null, so we have a filter
$r=sprintf('<TD>
<INPUT TYPE="button" onClick=SearchPosteFilter(\'%s\',\'%s\',\'%s\',\'%s\') value="Recherche">
<INPUT TYPE="button" onClick=SearchPosteFilter(\'%s\','.dossier::id().',\'%s\',\'%s\',\'%s\') value="Recherche">
%s</TD><TD>
<INPUT TYPE="Text" NAME="%s" VALUE="%s" SIZE="8">
<INPUT TYPE="Text" NAME="%s" id="%s" VALUE="%s" SIZE="8">
</TD>',
$l_sessid,
$this->name,
@ -354,6 +354,7 @@ class widget {
$this->extra,
$this->label,
$this->name,
$this->name,
$this->value
);
@ -496,7 +497,7 @@ class widget {
// type=span
if ( strtolower($this->type)=="span") {
$r=sprintf('<span id="%s" >%s </span>',
$r=sprintf('<span style="inline" id="%s" >%s </span>',
$this->name,
$this->value
);
@ -517,8 +518,8 @@ class widget {
$l_sessid=$_REQUEST['PHPSESSID'];
$r.=sprintf("<input type=\"button\" value=\"Tva\"
onClick=\"
ShowTva('%s','%s');\"></TD>",
$l_sessid,$this->name);
ShowTva('%s',%d,'%s');\"></TD>",
$l_sessid,dossier::id(),$this->name);
return $r;
}
@ -531,7 +532,7 @@ class widget {
$l_sessid=$_REQUEST['PHPSESSID'];
$r=sprintf("$td
<INPUT TYPE=\"button\" onClick=SearchJrn('%s','%s',%s,'%s') value=\"Recherche\">
<INPUT TYPE=\"button\" onClick=SearchJrn('%s',".dossier::id().",'%s',%s,'%s') value=\"Recherche\">
%s $etd $td
<INPUT TYPE=\"Text\" style=\"border:solid 1px blue;\" NAME=\"%s\" VALUE=\"%s\" SIZE=\"8\">
$etd",

View file

@ -78,12 +78,13 @@ if ( $sub_action=="blank")
{
$retour=sprintf('<A class="mtitle" HREF="%s"><input type="button" value="Retour"></A>',
"commercial.php?p_action=client");
"commercial.php?p_action=client&$str_dossier");
echo '<div class="u_redcontent">';
echo $retour;
$c=new Customer($cn);
echo '<form method="post" action="commercial.php"';
echo dossier::hidden();
echo '<input type="hidden" name="p_action" value="client">';
echo '<input type="hidden" name="sa" value="insert">';
echo '<input type="hidden" name="fd_id" value="'.$_GET['fd_id'].'">';
@ -100,9 +101,10 @@ if ( $sub_action == "list" )
{
?>
<div class="u_content">
<span>
<span style="position:float;float:left">
<form method="get" action="commercial.php">
<?php
<?php
echo dossier::hidden();
$a=(isset($_GET['query']))?$_GET['query']:"";
printf ('<input type="text" name="query" value="%s">',
$a);
@ -111,8 +113,9 @@ if ( $sub_action == "list" )
<input type="hidden" name="p_action" value="client">
</form>
</span>
<span>
<span style="position:float;float:left">
<form method="get" action="commercial.php">
<?php echo dossier::hidden(); ?>
<input type="hidden" name="url" <?php $url=urlencode($_SERVER['REQUEST_URI']);echo 'value="'.$url.'"'; ?>
<input type="hidden" name="p_action" value="client">
@ -149,6 +152,7 @@ if ( $sub_action == 'detail' )
urldecode($_REQUEST['url']));
echo $retour;
echo '<form action="'.$_REQUEST['url'].'" method="post">';
echo dossier::hidden();
echo $client->Display(false);
$w=new widget("hidden");
$w->name="p_action";

View file

@ -27,7 +27,7 @@ $_ENV['TMP']="/tmp";
define ("phpcompta_password","dany");
define ("phpcompta_psql_port","5432");
define ("phpcompta_user","phpcompta");
define ("domaine","rel240_");
define ("domaine","rel300_");
define ("DEBUG","true");
@ -183,9 +183,9 @@ define ("JS_COMPUTE_ODS",
"<SCRIPT language=\"javascript\" src=\"js/compute.js\"> </SCRIPT>");
define ("JS_SHOW_TVA","<SCRIPT language=\"javascript\">
function ShowTva(p_sessid,ctl)
function ShowTva(p_sessid,p_dossier,ctl)
{
var win=window.open('show_tva.php?ctl='+ctl+'&PHPSESSID='+p_sessid,'Montre','scrollbar,toolbar=no,width=300,height=300,resizable=yes');
var win=window.open('show_tva.php?ctl='+ctl+'&PHPSESSID='+p_sessid+'&gDossier='+p_dossier,'Montre','scrollbar,toolbar=no,width=300,height=300,resizable=yes');
}
function GetIt(ctl,tva_id) {
self.opener.SetValue(ctl,tva_id)

View file

@ -89,12 +89,13 @@ if ( $sub_action == "" )
if ( $sub_action=="blank")
{
$retour_action=sprintf('<A class="mtitle" HREF="%s"><input type="button" value="Retour"></A>',
"commercial.php?p_action=contact");
"commercial.php?p_action=contact&$str_dossier");
echo '<div class="u_redcontent">';
echo $retour_action;
$c=new contact($cn);
echo '<form method="post" action="commercial.php"';
echo dossier::hidden();
echo '<input type="hidden" name="p_action" value="client">';
echo '<input type="hidden" name="sa" value="insert">';
echo '<input type="hidden" name="fd_id" value="'.$_GET['fd_id'].'">';
@ -113,7 +114,8 @@ if ( $sub_action == "list" )
<div class="u_content">
<span>
<form method="get" action="commercial.php">
<?php
<?php
echo dossier::hidden();
$a=(isset($_GET['query']))?$_GET['query']:"";
printf ('<input type="text" name="query" value="%s">',
$a);
@ -124,7 +126,8 @@ if ( $sub_action == "list" )
<form>
<?php
<?php
echo dossier::hidden();
$qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
echo JS_SEARCH_CARD;
$w=new widget('js_search_only');
@ -148,6 +151,7 @@ if ( $sub_action == "list" )
</span>
<span>
<form method="get" action="commercial.php">
<? echo dossier::hidden(); ?>
<input type="hidden" name="url" <?php $url=urlencode($_SERVER['REQUEST_URI']);echo 'value="'.$url.'"'; ?>
<input type="hidden" name="p_action" value="contact">
@ -195,6 +199,7 @@ if ( $sub_action == 'detail' )
$contact=new contact($cn,$f_id);
echo $retour;
echo '<form action="'.$_SERVER['REQUEST_URI'].'" method="post">';
echo dossier::hidden();
echo $contact->Display(false);
$w=new widget("hidden");
$w->name="p_action";
@ -205,7 +210,7 @@ if ( $sub_action == 'detail' )
echo $w->IOValue();
echo $w->Submit('mod','Sauver les modifications');
echo '<A HREF="commercial.php?p_action=contact"><INPUT TYPE="button" value="Retour"></A>';
echo '<A HREF="commercial.php?p_action=contact&'.$str_dossier.'"><INPUT TYPE="button" value="Retour"></A>';
echo $w->Submit('delete','Effacer cette fiche');
echo '</form>';
echo $retour;

View file

@ -35,7 +35,7 @@ $msg_tva='<i>Si le montant de TVA est &eacute;gal &agrave; 0, il sera automatiqu
// to enter a new invoice
if ( ! isset ($_REQUEST['p_jrn'])) {
// no journal are selected so we select the first one
$p_jrn=GetFirstJrnIdForJrnType($_SESSION['g_dossier'],'ACH');
$p_jrn=GetFirstJrnIdForJrnType(dossier::id(),'ACH');
} else
{
@ -57,13 +57,13 @@ $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
//
if ( $sub_action == "list")
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) < 1 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) < 1 ) {
NoAccess();
exit -1;
}
// show the menu with the list item selected
echo '<div class="u_subtmenu">';
echo ShowMenuJrnUser($_SESSION['g_dossier'],'ACH',0,'<td class="selectedcell">Liste</td>');
echo ShowMenuJrnUser($gDossier,'ACH',0,'<td class="selectedcell">Liste</td>');
echo '</div>';
// Ask to update payment
if ( isset ( $_GET['paid']))
@ -97,7 +97,7 @@ if ( $sub_action == "list")
echo '<form method= "GET" action="commercial.php">';
echo dossier::hidden();
$hid=new widget("hidden");
$hid->name="p_action";
@ -130,8 +130,9 @@ if ( $sub_action == "list")
$w->extra='all';
$w->table=0;
$sp= new widget("span");
echo $sp->IOValue("qcode_label","",$qcode);
echo $w->IOValue();
echo $sp->IOValue("qcode_label","QuickCode",$qcode);
echo $w->Submit('gl_submit','Rechercher');
echo '<br>'.$retour;
@ -180,10 +181,10 @@ if ( $sub_action == "list")
}
//-----------------------------------------------------
echo '<div class="u_subtmenu">';
echo ShowMenuJrnUser($_SESSION['g_dossier'],
echo ShowMenuJrnUser($gDossier,
'ACH',
$p_jrn,
'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&p_action=depense&sa=list">Liste</A></td>');
'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&p_action=depense&sa=list&'.$str_dossier.'">Liste</A></td>');
echo '</div>';
//-----------------------------------------------------
// if we request to add an item
@ -191,7 +192,7 @@ echo '</div>';
// or if we ask to correct the invoice
if ( isset ($_POST['add_item']) || isset ($_POST["correct"]) )
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) != 2 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
NoAccess();
exit -1;
}
@ -217,7 +218,7 @@ if ( isset ($_POST['add_item']) || isset ($_POST["correct"]) )
//
if ( isset($_POST['save']))
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) != 2 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
NoAccess();
exit -1;
}
@ -243,7 +244,7 @@ if ( isset($_POST['save']))
if ( isset ($_POST['view_invoice']) )
{
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) < 1 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) < 1 ) {
NoAccess();
exit -1;
}
@ -274,7 +275,7 @@ if ( isset ($_POST['view_invoice']) )
// By default we add a new invoice
if ( $p_jrn != -1 )
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) != 2 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
exit -1;
}

View file

@ -36,7 +36,7 @@ require_once("check_priv.php");
// to enter a new invoice
if ( ! isset ($_REQUEST['p_jrn'])) {
// no journal are selected so we select the first one
$p_jrn=GetFirstJrnIdForJrnType($_SESSION['g_dossier'],'VEN');
$p_jrn=GetFirstJrnIdForJrnType($gDossier,'VEN');
} else
{
$p_jrn=$_REQUEST['p_jrn'];
@ -58,13 +58,13 @@ $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
if ( $sub_action == "list")
{
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) < 1 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) < 1 ) {
NoAccess();
exit -1;
}
// show the menu with the list item selected
echo '<div class="u_subtmenu">';
echo ShowMenuJrnUser($_SESSION['g_dossier'],'VEN',0,'<td class="selectedcell">Liste</td>');
echo ShowMenuJrnUser($gDossier,'VEN',0,'<td class="selectedcell">Liste</td>');
echo '</div>';
// Ask to update payment
if ( isset ( $_GET['paid']))
@ -98,6 +98,7 @@ if ( $sub_action == "list")
echo '<form method= "GET" action="commercial.php">';
echo dossier::hidden();
$hid=new widget("hidden");
@ -176,7 +177,7 @@ echo $w->Submit('gl_submit','Rechercher');
}
//-----------------------------------------------------
echo '<div class="u_subtmenu">';
echo ShowMenuJrnUser($_SESSION['g_dossier'],'VEN',$p_jrn,'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&p_action=facture&sa=list">Liste</A></td>');
echo ShowMenuJrnUser($gDossier,'VEN',$p_jrn,'<td class="cell"><A class="mtitle" HREF="commercial.php?liste&p_action=facture&sa=list&'.$str_dossier.'">Liste</A></td>');
echo '</div>';
//-----------------------------------------------------
// if we request to add an item
@ -184,7 +185,7 @@ echo '</div>';
// or if we ask to correct the invoice
if ( isset ($_POST['add_item']) || isset ($_POST["correct_new_invoice"]) )
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) != 2 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
NoAccess();
exit -1;
}
@ -203,7 +204,7 @@ if ( isset ($_POST['add_item']) || isset ($_POST["correct_new_invoice"]) )
//
if ( isset($_POST['record_and_print_invoice']))
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) != 2 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
NoAccess();
exit -1;
}
@ -248,7 +249,7 @@ if ( isset($_POST['record_and_print_invoice']))
if ( isset ($_POST['view_invoice']) )
{
// Check privilege
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) < 1 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) < 1 ) {
NoAccess();
exit -1;
}
@ -276,7 +277,7 @@ if ( isset ($_POST['view_invoice']) )
// By default we add a new invoice
if ( $p_jrn != -1 )
{
if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) != 2 ) {
if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
exit -1;
}

View file

@ -26,7 +26,9 @@ require_once('class_fiche.php');
include_once ("postgres.php");
include_once ("user_menu.php");
require_once ("check_priv.php");
require_once('class_dossier.php');
$gDossier=dossier::id();
$str_dossier=dossier::get();
echo JS_SEARCH_POSTE;
echo JS_AJAX_FICHE;
@ -35,13 +37,13 @@ if ( !isset($sessid))
{
$sessid=$_REQUEST["PHPSESSID"];
}
$search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$sessid."','class_base','')\">";
$search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchPoste(\''.$sessid."',".dossier::id().",'class_base','')\">";
include_once("fiche_inc.php");
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
echo_debug(__FILE__,__LINE__,"Connected");
// Security check
$read=$User->CheckAction($cn,FICHE_READ);
$write=$User->CheckAction($cn,FICHE_WRITE);
@ -53,6 +55,7 @@ if ($read+$write == 0 ){
function ShowRecherche() {
echo '<DIV class="u_redcontent">';
echo '<form method="GET" action="?">';
echo dossier::hidden();
$w=new widget('text');
$search_text=(isset($_REQUEST['search_text']))?$_REQUEST['search_text']:"";
$h=new widget('hidden');
@ -75,6 +78,7 @@ function ShowFicheDefInput($p_fiche_def)
$r.= '<H2 class="info">'.$p_fiche_def->label.'</H2>';
$r.= '<FORM action="?p_action=fiche" method="POST">';
$r.=dossier::hidden();
$r.= '<INPUT TYPE="HIDDEN" NAME="fd_id" VALUE="'.$p_fiche_def->id.'">';
$r.= $p_fiche_def->DisplayAttribut("remove");
@ -105,11 +109,11 @@ if ( isset ($_POST["add_line"]) ) {
$r.= "<h2 class=\"error\"> Pas d'accès </h2>";
else
{
$fiche_def=new fiche_def($cn,$_REQUEST['fd_id']);
// Insert Line
$fiche_def->InsertAttribut($_REQUEST['ad_id']);
$r.=ShowFicheDefInput($fiche_def);
$fiche_def=new fiche_def($cn,$_REQUEST['fd_id']);
// Insert Line
$fiche_def->InsertAttribut($_REQUEST['ad_id']);
$r.=ShowFicheDefInput($fiche_def);
}
$r.= '</DIV>';
@ -137,19 +141,19 @@ if ( isset ($_POST['remove_line']))
// Change the name of the card model
if ( isset ($_POST["change_name"] ) ) {
$r= '<DIV class="u_redcontent">';
if ( $write ==0)
$r.= "<h2 class=\"error\"> Pas d'accès </h2>";
else
{
$fiche_def=new fiche_def($cn,$_REQUEST['fd_id']);
$r.=ShowFicheDefInput($fiche_def);
}
if ( $write ==0)
$r.= "<h2 class=\"error\"> Pas d'accès </h2>";
else
{
$fiche_def=new fiche_def($cn,$_REQUEST['fd_id']);
$r.=ShowFicheDefInput($fiche_def);
}
$r.= '</DIV>';
$recherche=false;
}
//var_dump($_GET);
ShowMenuFiche($_SESSION['g_dossier']);
ShowMenuFiche($gDossier);
echo $r;
//------------------------------------------------------------------------------
@ -180,7 +184,7 @@ if ( isset ( $_GET["action"]) ) {
echo '<H2 class="info"> Vos changements ne seront pas sauvés</h2>';
$t=true;
}
$str="";
$str="&".dossier::get();
$fiche=new fiche($cn,$_GET["fiche_id"]);
$fiche->get_categorie();
$fiche_def=new fiche_def($cn,$fiche->fd_id);
@ -202,6 +206,7 @@ if ( isset ( $_GET["action"]) ) {
}
if ( $write != 0 )
echo '<form method="post" action="?p_action=fiche&action=vue&fiche='.$_GET['fiche'].$str.'">';
echo dossier::hidden();
echo $fiche->Display($t);
echo '<input type="hidden" name="f_id" value="'.$_GET['fiche_id'].'">';
if ( $write != 0 ) {
@ -210,7 +215,7 @@ if ( isset ( $_GET["action"]) ) {
}
$str="";
echo '<a class="mtitle" href="?p_action=fiche&action=vue&fiche='.$fiche->fiche_def.$str.
echo '<a class="mtitle" href="?p_action=fiche&action=vue&'.$str_dossier.'&fiche='.$fiche->fiche_def.$str.
'"><input type="button" value="annuler"></A>';
if ( $write != 0 ) echo '</form>';
echo '</DIV>';
@ -235,9 +240,9 @@ if ( isset ( $_GET["action"]) ) {
{
$fiche_def=new fiche_def($cn,$_GET['fiche']);
echo ShowFicheDefInput($fiche_def);
$fiche_def=new fiche_def($cn,$_GET['fiche']);
echo ShowFicheDefInput($fiche_def);
}
echo '</DIV>';
$recherche=false;
@ -246,7 +251,7 @@ if ( isset ( $_GET["action"]) ) {
// Search a card
if ( $action == "search" )
{
ShowRecherche();
ShowRecherche();
$sql="select distinct f_id,fd_id,av_text from fiche join jnt_fic_att_value using (f_id)
join attr_value using (jft_id) where
upper(av_text) like upper('%".FormatString($_GET["search_text"])."%') order by av_text,f_id";
@ -254,24 +259,24 @@ if ( isset ( $_GET["action"]) ) {
// test on the size
//
if ( sizeof($all) != 0 )
{
echo '<DIV class="u_redcontent">';
echo "Nombre de résultat : ".sizeof($all).'<br>';
foreach ($all as $f_id){
$fiche=new fiche($cn,$f_id['f_id']);
echo '<A class="mtitle" href="?p_action=fiche&action=detail&fiche_id='.$f_id['f_id'].
'&fiche='.$f_id['fd_id'].'">'.
$fiche->getName().'</A><br>';
}
echo '</div>';
}
{
echo '<DIV class="u_redcontent">';
echo "Nombre de résultat : ".sizeof($all).'<br>';
foreach ($all as $f_id){
$fiche=new fiche($cn,$f_id['f_id']);
echo '<A class="mtitle" href="?p_action=fiche&'.$str_dossier.'&action=detail&fiche_id='.$f_id['f_id'].
'&fiche='.$f_id['fd_id'].'">'.
$fiche->getName().'</A><br>';
}
echo '</div>';
}
else
{
echo '<DIV class="u_redcontent">';
echo "Aucun résultat trouvé";
echo '</div>';
{
echo '<DIV class="u_redcontent">';
echo "Aucun résultat trouvé";
echo '</div>';
}
}
$recherche=false;
@ -283,20 +288,21 @@ if ( isset ($_POST["fiche"]) && isset ($_POST["add"] ) ) {
echo "<h2 class=\"error\"> Pas d'accès </h2>";
else
{
$fiche_def=new fiche_def($cn,$_POST['fiche']);
$fiche_def->Get();
echo '<h2 class="info">'.$fiche_def->label.'</h2>';
$url=$_SERVER['REQUEST_URI'];
$fiche=new fiche($cn,0);
$fiche_def=new fiche_def($cn,$_POST['fiche']);
$fiche_def->Get();
echo '<h2 class="info">'.$fiche_def->label.'</h2>';
$url=$_SERVER['REQUEST_URI'];
$fiche=new fiche($cn,0);
echo '<form method="post" action="'.$url.'&fiche='.$_POST['fiche'].'">';
echo dossier::hidden();
echo $fiche->blank($_POST['fiche']);
echo '<input type="submit" name="add_fiche" value="Ajout">';
echo '<a class="mtitle" href="'.$url.'&fiche='.$_POST['fiche'].'">'.
'<input type="button" value="annuler"></A>';
echo '<form method="post" action="'.$url.'&fiche='.$_POST['fiche'].'">';
echo $fiche->blank($_POST['fiche']);
echo '<input type="submit" name="add_fiche" value="Ajout">';
echo '<a class="mtitle" href="'.$url.'&fiche='.$_POST['fiche'].'">'.
'<input type="button" value="annuler"></A>';
echo '</form>';
echo '</form>';
}
echo '</DIV>';
$recherche=false;
@ -311,8 +317,8 @@ if (isset($_POST['delete']) ) {
echo "<h2 class=\"error\"> Pas d'accès </h2>";
else
{
$fiche=new fiche($cn,$_POST["f_id"]);
$fiche->remove();
$fiche=new fiche($cn,$_POST["f_id"]);
$fiche->remove();
}
$fiche_def=new fiche_def($cn,$_GET['fiche']);
$fiche_def->myList();
@ -351,12 +357,12 @@ if ( isset ($_POST["update_fiche"]) ) {
echo "<h2 class=\"error\"> Pas d'accès </h2>";
else
{
$fiche=new fiche($cn,$_POST['f_id']);
$fiche->Save();
$fiche=new fiche($cn,$_POST['f_id']);
$fiche->Save();
}
$fiche_def=new fiche_def($cn,$_GET['fiche']);
$fiche_def->myList();
$fiche_def=new fiche_def($cn,$_GET['fiche']);
$fiche_def->myList();

View file

@ -45,7 +45,7 @@ function CreateCategory ($p_cn,$p_js,$p_array=null,$p_ligne=1)
// Creating form
$display='<FORM ACTION="?p_action=fiche" METHOD="POST">';
$display.=dossier::hidden();
// Number of line of the card
$display.='<INPUT TYPE="HIDDEN" NAME="INC" VALUE="'.$p_ligne.'">';

View file

@ -54,6 +54,7 @@ function EncodeForm($p_line,$p_sessid,$p_array=null) {
$form0="";
}
echo "<FORM ACTION=\"form.php\" METHOD=\"POST\">";
echo dossier::hidden();
printf ("Nom du rapport : <INPUT TYPE=\"TEXT\" NAME=\"form_nom\" VALUE=\"%s\">",
$form_nom);
printf ('<INPUT TYPE="HIDDEN" NAME="line" value="%s"',

View file

@ -31,12 +31,15 @@ require_once ('postgres.php');
require_once ('debug.php');
require_once ('class.ezpdf.php');
require_once ('class_own.php');
require_once('class_dossier.php');
date_default_timezone_set ('Europe/Brussels');
function header_pdf($p_cn,&$p_pdf) {
$own=new own($p_cn);
$soc=$own->MY_NAME;
$date=date('d / m / Y');
$dossier=" Dossier : ".domaine.$_SESSION['g_dossier']." ".$_SESSION['g_name'];
$dossier=" Dossier : ".dossier::name();
$p_pdf->ezText($dossier." ".$soc." ".$date,9);
}
function header_txt($p_cn) {
@ -44,7 +47,7 @@ function header_txt($p_cn) {
$soc=$own->MY_NAME;
$date=date('d / m / Y');
$dossier=" Dossier : ".domaine.$_SESSION['g_dossier']." ".$_SESSION['g_name'];
$dossier=" Dossier : ".dossier::name();
return $dossier." ".$soc." ".$date;
}

View file

@ -112,7 +112,7 @@ function ShowBox($p_val,$counter,$p_cn,$p_form='form'){
if ( isset($p_val['poste_comptable']))
{
$w->value=$p_val['poste_comptable'];
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect(dossier::id());
$f=new fiche($p_cn);
$f->GetByQCode($p_val['poste_comptable']);
$s->value=$f->strAttribut(ATTR_DEF_NAME);
@ -163,6 +163,7 @@ function VerifImport($p_cn){
echo JS_CONCERNED_OP;
while($val = pg_fetch_array($Res)){
echo '<form METHOD="POST" action="import.php?action=verif">';
echo dossier::hidden();
ShowBox($val,$i,$p_cn,'form');
echo '</form>';
$i++;
@ -204,12 +205,14 @@ function ConfirmTransfert($p_cn,$periode){
while($val = pg_fetch_array($Res)){
echo '<form method="post" action="import.php">';
echo dossier::hidden();
echo '<input type="hidden" name="action" value="remove">';
ShowBox($val,$i,$p_cn,'remove');
echo '</form>';
$i++;
}
echo '<form method="post" action="import.php">';
echo dossier::hidden();
echo '<input type="hidden" name="action" value="transfer">';
echo '<input type="submit" name="sub" value="Commencer le transfert">';
echo '</form>';
@ -346,6 +349,7 @@ function TransferCSV($p_cn, $periode){
function ShowFormTransfert($p_cn){
$w=new widget("select");
echo '<FORM METHOD="POST" action="import.php?action=import" enctype="multipart/form-data">';
echo dossier::hidden();
echo '<INPUT TYPE="file" name="fupload" size="20"><br>';
// ask for the journal target
$jrn=make_array ($p_cn,"select jrn_def_id,jrn_def_name from jrn_def where jrn_def_type='FIN';");

View file

@ -24,28 +24,28 @@
* \brief Main page for the printing
*/
require_once("check_priv.php");
$str_dossier=dossier::get();
// show sub menu
echo "<DIV class=\"u_subtmenu\">";
echo JS_AJAX_FICHE;
$p_array=array(array ("?p_action=impress&type=jrn","Journaux"),
array("?p_action=impress&type=poste","Poste"),
array("?p_action=impress&type=fiche","Fiche"),
array("?p_action=impress&type=rapport","Rapport"),
array('?p_action=impress&type=bal','Balance des comptes'),
array("?p_action=impress&type=bilan","Bilan"),
array("?p_action=impress&type=list_client","Liste Clients Assujettis")
$p_array=array(array ("?p_action=impress&type=jrn&".$str_dossier,"Journaux"),
array("?p_action=impress&type=poste&".$str_dossier,"Poste"),
array("?p_action=impress&type=fiche&".$str_dossier,"Fiche"),
array("?p_action=impress&type=rapport&".$str_dossier,"Rapport"),
array('?p_action=impress&type=bal&'.$str_dossier,'Balance des comptes'),
array("?p_action=impress&type=bilan&".$str_dossier,"Bilan"),
array("?p_action=impress&type=list_client&".$str_dossier,"Liste Clients Assujettis")
);
$default=( isset ($_GET['type']))?"?p_action=impress&type=".$_GET['type']:"";
$default=( isset ($_GET['type']))?"?p_action=impress&type=".$_GET['type']."&$str_dossier":"";
$result=ShowItem($p_array,'H',"cell","mtitle",$default);
echo $result;
echo "</DIV>";
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
$User->AccessRequest($cn,IMP);

View file

@ -40,6 +40,7 @@ $w->table=1;
echo '<div class="u_redcontent">';
echo '<FORM ACTION="bilan.php" METHOD="POST">';
echo dossier::hidden();
echo '<TABLE>';
print '<TR>';

View file

@ -22,8 +22,8 @@
include_once('postgres.php');
include_once('class_fiche.php');
include_once("class_widget.php");
$cn=DbConnect($_SESSION['g_dossier']);
$gDossier=dossier::id();
$cn=DbConnect($gDossier);
//-----------------------------------------------------
if ( isset ($_REQUEST['fd_id'])) {
@ -39,7 +39,7 @@ if ( isset ($_REQUEST['fd_id'])) {
$w=new widget("select");
$fiche_def=new fiche_def($cn);
echo '<form method="POST" ACTION="fiche_csv.php">'.
echo '<form method="POST" ACTION="fiche_csv.php">'.dossier::hidden().
$submit->Submit('bt_csv',"Export CSV").
$hid->IOValue("type","fiche").
$hid->IOValue("p_action","impress").
@ -50,7 +50,7 @@ if ( isset ($_REQUEST['fd_id'])) {
echo $hid->IOValue("to_periode",$_REQUEST['to_periode']);
}
echo "</form>";
echo '<form method="Post" action="?p_action=impress&type=fiche">'.$submit->Submit("bt_submit","Autres fiches")."</form>";
echo '<form method="Post" action="?p_action=impress&type=fiche">'.$submit->Submit("bt_submit","Autres fiches").dossier::hidden()."</form>";
$fiche_def->id=$_REQUEST['fd_id'];
@ -58,7 +58,7 @@ if ( isset ($_REQUEST['fd_id'])) {
// propose de calculer aussi le solde
//--
if ( $fiche_def->HasAttribute(ATTR_DEF_ACCOUNT) == true ) {
echo '<form method="POST" ACTION="?p_action=impress&type=fiche">';
echo '<form method="POST" ACTION="?p_action=impress&type=fiche">'.dossier::hidden();
// filter on the current year
$filter_year=" where p_exercice='".$User->getExercice()."'";
@ -140,10 +140,10 @@ if ( isset ($_REQUEST['fd_id'])) {
$i=0;
foreach ($fiche_def->all as $l_fiche) {
$a[$i]=array("?p_action=impress&type=fiche&fd_id=".$l_fiche->id,$l_fiche->label);
$a[$i]=array("?".dossier::get()."&p_action=impress&type=fiche&fd_id=".$l_fiche->id,$l_fiche->label);
$i++;
}
echo ShowItem($a,'V');
}
?>
?>

View file

@ -27,8 +27,9 @@
* \param array (type,action,central,filter...)
* \param connection
* \return none
*
*\todo it seems not to be used ==> to clean
*/
/*
function ViewImp($p_array,$p_cn) {
include_once("preference.php");
require_once("class_user.php");
@ -77,13 +78,14 @@ function ViewImp($p_array,$p_cn) {
echo '</FORM>';
echo "</DIV>";
}
*/
/*!
* \brief Show the html printing result
* \param array
* \param db connection
* \return ImpHtml
*
*/
* \todo not used ==> to clean
function Imp($p_array,$p_cn) {
if ( ! isset($p_array['action'])) {
echo_error ("IMP no action specified"); return;
@ -93,14 +95,16 @@ function Imp($p_array,$p_cn) {
}
echo_error ("IMP no action specified"); return;
}
*/
/*!
* \brief Show the html result
* \param array (type,periode,
* \param connection
* \return error if something goes wrong or
* the page result
* \todo not used ==> to clean
*
*
*/
function ImpHtml($p_array,$p_cn)
{
foreach($p_array as $key=>$element) {
@ -236,6 +240,8 @@ function ImpHtml($p_array,$p_cn)
}//jrn
}
*/
/*!
* \brief Get dat for poste
*

View file

@ -23,6 +23,9 @@
*/
include_once("class_widget.php");
require_once('class_dossier.php');
$gDossier=dossier::id();
//-----------------------------------------------------
// If print is asked
// First time in html
@ -56,11 +59,11 @@ include("class_jrn.php");
echo '<h2 class="info">'.$Jrn->name.'</h2>';
echo "<table>";
echo '<TR>';
echo '<TD><form method="GET" ACTION="?">'.
echo '<TD><form method="GET" ACTION="?">'.dossier::hidden().
$submit->Submit('bt_other',"Autre journal").
$hid->IOValue("type","jrn").$hid->IOValue('p_action','impress')."</form></TD>";
echo '<TD><form method="GET" ACTION="jrn_pdf.php">'.
echo '<TD><form method="GET" ACTION="jrn_pdf.php">'.dossier::hidden().
$submit->Submit('bt_pdf',"Export PDF").
$hid->IOValue("type","jrn").
$hid->IOValue("p_action","impress").
@ -71,7 +74,7 @@ include("class_jrn.php");
echo $hid->IOValue("p_simple",$_POST['p_simple']);
echo "</form></TD>";
echo '<TD><form method="GET" ACTION="jrn_csv.php">'.
echo '<TD><form method="GET" ACTION="jrn_csv.php">'.dossier::hidden().
$submit->Submit('bt_csv',"Export CSV").
$hid->IOValue("type","jrn").
$hid->IOValue("p_action","impress").
@ -206,7 +209,7 @@ if ( count($ret) < 1 )
// Form
//-----------------------------------------------------
echo '<div class="u_content">';
echo '<FORM ACTION="?p_action=impress&type=jrn" METHOD="POST">';
echo '<FORM ACTION="?p_action=impress&type=jrn" METHOD="POST">'.dossier::hidden();
echo '<TABLE width="90%" align="center"><TR>';
$w=new widget("select");
$w->table=1;

View file

@ -36,7 +36,8 @@ if ( isset($_POST['bt_html'] )) {
echo "
<div class=\"u_redcontent\"
<form method=\"post\" action=\"listing_client.php\">
<form method=\"post\" action=\"listing_client.php\"> ".
dossier::hidden()."
<input type=\"submit\" name=\"bt_disk\" value=\"expérimental !! déclaration magnétique\" disable>
<input type=\"hidden\" name=\"year\" value=\"".$_POST['year']."\">
</form>
@ -69,6 +70,7 @@ $w->table=1;
echo '<div class="u_redcontent">';
echo '<FORM ACTION="?p_action=impress&type=list_client" METHOD="POST">';
echo dossier::hidden();
echo '<TABLE>';
print '<TR>';

View file

@ -119,6 +119,7 @@ echo '<div class="u_content">';
echo JS_SEARCH_POSTE;
echo JS_SEARCH_CARD;
echo '<FORM ACTION="?p_action=impress&type=poste" METHOD="POST">';
echo dossier::hidden();
echo '<TABLE><TR>';
$span=new widget("span");

View file

@ -67,11 +67,13 @@ if ( isset( $_POST['bt_html'] ) ) {
echo '<table >';
echo '<TR>';
echo '<TD><form method="GET" ACTION="?">'.
dossier::hidden().
$submit->Submit('bt_other',"Autre Rapport").
$hid->IOValue("type","rapport").$hid->IOValue("p_action","impress")."</form></TD>";
echo '<TD><form method="POST" ACTION="form_pdf.php">'.
$submit->Submit('bt_pdf',"Export PDF").
dossier::hidden().
$hid->IOValue("type","rapport").
$hid->IOValue("p_action","impress").
$hid->IOValue("form_id",$Form->id).
@ -83,6 +85,7 @@ if ( isset( $_POST['bt_html'] ) ) {
echo "</form></TD>";
echo '<TD><form method="POST" ACTION="form_csv.php">'.
$submit->Submit('bt_csv',"Export CSV").
dossier::hidden().
$hid->IOValue("type","form").
$hid->IOValue("p_action","impress").
$hid->IOValue("form_id",$Form->id).
@ -133,6 +136,8 @@ if ( sizeof($ret) == 0 ) {
//-----------------------------------------------------
echo '<div class="u_content">';
echo '<FORM ACTION="?p_action=impress&type=rapport" METHOD="POST">';
echo dossier::hidden();
echo '<TABLE><TR>';
$w=new widget("select");
$w->table=1;

View file

@ -44,7 +44,7 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
echo_debug('jrn.php',__LINE__,"function UpdateJrn");
// own
$own=new own($p_cn);
$gDossier=dossier::id();
$l_array=GetDataJrnJrId($p_cn,$p_jr_id);
if ( $l_array == null ) {
echo_error ("Not data found for UpdateJrn p_jr_id = $p_jr_id");
@ -57,6 +57,7 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
// Build the form
$col_vide="<TD></TD>";
$disable=($p_mode==0)?"disabled":"";
$str_dossier=dossier::get();
for ( $i =0 ; $i < sizeof($l_array); $i++) {
$content=$l_array[$i] ;
@ -176,10 +177,11 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
if ( $content['jr_pj_name'] != "")
$r.='<TD>Effacer PJ <INPUT TYPE="CHECKBOX" name="to_remove" ></TD>';
}
$r.="<TD>".sprintf('<A class="detail" HREF="show_pj.php?jrn=%s&jr_grpt_id=%s">%s</A>',
$content['jr_id'],
$content['jr_grpt_id'],
$content['jr_pj_name'])."</TD>";
$r.="<TD>".sprintf('<A class="detail" HREF="show_pj.php?jrn=%s&jr_grpt_id=%s&%s">%s</A>',
$content['jr_id'],
$content['jr_grpt_id'],
$str_dossier,
$content['jr_pj_name'])."</TD>";
$r.="</TR></TABLE>";
if ( $p_mode == 1 ) {
@ -201,17 +203,18 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
$r.= '<div style="margin-left:30px;">';
foreach ($a as $key => $element) {
$r.=sprintf ('%s <INPUT TYPE="BUTTON" VALUE="Détail" onClick="modifyOperation(\'%s\',\'%s\')">',
$r.=sprintf ('%s <INPUT TYPE="BUTTON" VALUE="Détail" onClick="modifyOperation(\'%s\',\'%s\',%d)">',
GetInternal($p_cn,$element),
$element,
$sessid);
$r.=sprintf('<INPUT TYPE="button" value="Efface" onClick="dropLink(\'%s\',\'%s\',\'%s\')"><BR>',
$content['jr_id'],$element,$sessid);
$sessid,
$gDossier);
$r.=sprintf('<INPUT TYPE="button" value="Efface" onClick="dropLink(\'%s\',\'%s\',\'%s\',%d)"><BR>',
$content['jr_id'],$element,$sessid,$gDossier);
}//for
$r.= "</div>";
}// if ( $a != null ) {
$search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchJrn(\''.$sessid."','rapt','".$content['jr_montant']."')\">";
$search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchJrn(\''.$sessid."',".$gDossier.",'rapt','".$content['jr_montant']."')\">";
$r.= '<H2 class="info">rapprochement </H2>
<INPUT TYPE="TEXT" name="rapt" value="">'.$search;
@ -234,9 +237,9 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
{
echo_debug('jrn.php',__LINE__,"function UpdateJrn");
$gDossier=dossier::id();
$l_array=GetDataJrnJrIdUser($p_cn,$p_jr_id);
$str_dossier=dossier::get();
/* if the operation doesn't exist in the quant_xxx table then we
* show the expert view
*/
@ -562,7 +565,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
//doc
if ( $p_mode ==1 && $content['jr_pj_name'] != "")
$r.='<tr><TD>Effacer Pj <INPUT TYPE="CHECKBOX" name="to_remove" ></TD>';
$r.="<TD>".sprintf('<A class="detail" HREF="show_pj.php?jrn=%s&jr_grpt_id=%s">%s</A>',
$r.="<TD>".sprintf('<A class="detail" HREF="show_pj.php?jrn=%s&jr_grpt_id=%s&'.$str_dossier.'">%s</A>',
$content['jr_id'],
$content['jr_grpt_id'],
$content['jr_pj_name'])."</TD>";
@ -586,17 +589,18 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
$r.= '<div style="margin-left:30px;">';
foreach ($a as $key => $element) {
$r.=sprintf ('%s <INPUT TYPE="BUTTON" VALUE="Détail" onClick="modifyOperation(\'%s\',\'%s\')">',
$r.=sprintf ('%s <INPUT TYPE="BUTTON" VALUE="Détail" onClick="modifyOperation(\'%s\',\'%s\',%d)">',
GetInternal($p_cn,$element),
$element,
$sessid);
$r.=sprintf('<INPUT TYPE="button" value="Efface" onClick="dropLink(\'%s\',\'%s\',\'%s\')"><BR>',
$content['jr_id'],$element,$sessid);
$sessid,
$gDossier);
$r.=sprintf('<INPUT TYPE="button" value="Efface" onClick="dropLink(\'%s\',\'%s\',\'%s\',%d)"><BR>',
$content['jr_id'],$element,$sessid,$gDossier);
}//for
$r.= "</div>";
}// if ( $a != null ) {
$search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchJrn(\''.$sessid."','rapt','".$content['jr_montant']."')\">";
$search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchJrn(\''.$sessid."',".$gDossier.",'rapt','".$content['jr_montant']."')\">";
$r.= '<H2 class="info">rapprochement </H2>
<INPUT TYPE="TEXT" name="rapt" value="">'.$search;
@ -1025,9 +1029,9 @@ function SetInternalCode($p_cn,$p_grpt,$p_jrn)
//$num=CountSql($p_cn,"select * from jrn where jr_def_id=$p_jrn and jr_internal != 'ANNULE'")+1;
$num = NextSequence($p_cn,'s_internal');
$num=strtoupper(hexdec($num));
$atype=GetJrnProp($_SESSION['g_dossier'],$p_jrn);
$atype=GetJrnProp(dossier::id(),$p_jrn);
$type=$atype['jrn_def_code'];
$internal_code=sprintf("%d%s-%s",$_SESSION['g_dossier'],$type,$num);
$internal_code=sprintf("%d%s-%s",dossier::id(),$type,$num);
echo_debug ("jrn.php",__LINE__,"internal_code = $internal_code");
return $internal_code;
}

View file

@ -24,7 +24,7 @@
*/
require_once("preference.php");
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
//-----------------------------------------------------
// Periode
//-----------------------------------------------------
@ -37,6 +37,7 @@ if ( $action=="change_per") {
${"$key"}=$element;
echo "<TABLE>";
echo '<TR> <FORM ACTION="user_advanced.php?p_action=periode" METHOD="POST">';
echo dossier::hidden();
echo ' <INPUT TYPE="HIDDEN" NAME="p_per" VALUE="'.$p_per.'">';
echo '<TD> <INPUT TYPE="text" NAME="p_date_start" VALUE="'.$p_date_start.'"></TD>';
echo '<TD> <INPUT TYPE="text" NAME="p_date_end" VALUE="'.$p_date_end.'"></TD>';
@ -109,4 +110,4 @@ if ( $action== "delete_per" ) {
ShowPeriode($cn);
?>
?>

View file

@ -43,7 +43,7 @@ if ( isset ($_POST['spass']) ) {
}
}
$url=$_SERVER['REQUEST_URI'];
if ( ! isset ($_SESSION['g_dossier']) )
if ( ! isset ($_REQUEST['gDossier']) )
{
echo '<A class="mtitle" href="user_login.php"><input type="button" value="Retour"></a>';
}
@ -95,7 +95,7 @@ $disp_style.="</SELECT>";
// Si utilise un dossier alors propose de changer
// la periode par defaut
if ( ! isset ($_SESSION['g_dossier']) )
if ( ! isset ($_REQUEST['gDossier']) )
{
echo '<A href="user_login.php"><input type="button" value="Retour"></a>';
}
@ -104,7 +104,7 @@ else
include_once("preference.php");
$msg="";
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($_REQUEST['gDossier']);
if ( isset ($_POST["sub_periode"] ) )
{
$periode=$_POST["periode"];

View file

@ -223,6 +223,7 @@ echo '<TD> <INPUT TYPE="text" NAME="p_devise"></TD>';
*/
function ShowPeriode($p_cn)
{
$str_dossier=dossier::get();
// echo "<h2 class=\"info\"> Période </H2>";
$Res=ExecSql($p_cn,"select p_id,to_char(p_start,'DD.MM.YYYY') as date_start,to_char(p_end,'DD.MM.YYYY') as date_end,p_central,p_closed,p_exercice
from parm_periode order by p_start,p_end");
@ -247,15 +248,15 @@ function ShowPeriode($p_cn)
$remove='<TD></TD>';
} else {
$closed='<TD class="mtitle">';
$closed.='<A class="mtitle" HREF="user_advanced.php?p_action=periode&action=closed&p_per='.$l_line['p_id'].'"> Cloturer</A>';
$closed.='<A class="mtitle" HREF="user_advanced.php?p_action=periode&action=closed&p_per='.$l_line['p_id'].'&'.$str_dossier.'"> Cloturer</A>';
$change='<TD class="mtitle">';
$change.='<A class="mtitle" HREF="user_advanced.php?p_action=periode&action=change_per&p_per='.
$l_line['p_id']."&p_date_start=".$l_line['date_start'].
"&p_date_end=".$l_line['date_end']."&p_exercice=".
$l_line['p_exercice']."\"> Changer</A>";
$l_line['p_exercice']."&$str_dossier\"> Changer</A>";
$remove='<TD class="mtitle">';
$remove.='<A class="mtitle" HREF="user_advanced.php?p_action=periode&action=delete_per&p_per='.
$l_line['p_id']."\"> Efface</A>";
$l_line['p_id']."&$str_dossier\"> Efface</A>";
}
echo "$closed";
@ -267,6 +268,7 @@ function ShowPeriode($p_cn)
}
echo '<TR> <FORM ACTION="user_advanced.php?p_action=periode" METHOD="POST">';
echo dossier::hidden();
echo '<TD> <INPUT TYPE="text" NAME="p_date_start" SIZE="10"></TD>';
echo '<TD> <INPUT TYPE="text" NAME="p_date_end" SIZE="10"></TD>';
echo '<TD> <INPUT TYPE="text" NAME="p_exercice" SIZE="10"></TD>';

View file

@ -24,29 +24,28 @@
/*!\file
* \brief Manage the stock by year
*/
require_once('class_dossier.php');
include_once("preference.php");
include_once ("ac_common.php");
include_once("postgres.php");
include_once("stock_inc.php");
include_once("check_priv.php");
require_once('class_dossier.php');
$gDossier=dossier::id();
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 */
$gDossier=dossier::id();
$cn=DbConnect($_SESSION['g_dossier']);
$cn=DbConnect($gDossier);
include_once ("class_user.php");
$User=new cl_user($cn);
$User->Check();
// Synchronize rights
SyncRight($_SESSION['g_dossier'],$_SESSION['g_user']);
SyncRight($gDossier,$_SESSION['g_user']);
$href=basename($_SERVER['PHP_SELF']);
@ -55,10 +54,8 @@ if ($href=='compta.php')
//Show the top menu
include_once ("user_menu.php");
// echo ShowMenuCompta($_SESSION['g_dossier'],"user_advanced.php");
// Show Menu Left
$left_menu=ShowMenuAdvanced("stock.php");
$left_menu=ShowMenuAdvanced(5);
//echo '<div class="lmenu">';
echo $left_menu;
}
@ -72,7 +69,7 @@ include_once("stock_inc.php");
// Adjust the stock
if ( isset ($_POST['sub_change']))
{
if ( CheckAction($_SESSION['g_dossier'],$_SESSION['g_user'],STOCK_WRITE) == 0 )
if ( CheckAction($gDossier,$_SESSION['g_user'],STOCK_WRITE) == 0 )
{
/* Cannot Access */
NoAccess();
@ -94,7 +91,7 @@ if ( isset ($_POST['sub_change']))
} else
{
// Check if User Can change the stock
if ( CheckAction($_SESSION['g_dossier'],$_SESSION['g_user'],STOCK_WRITE) == 0 ) {
if ( CheckAction($gDossier,$_SESSION['g_user'],STOCK_WRITE) == 0 ) {
NoAccess();
exit (-1);
}
@ -147,14 +144,14 @@ if ( ! isset ($_GET['year']) ) {
// View details
if ( $action == 'detail' ) {
// Check if User Can see the stock
if ( CheckAction($_SESSION['g_dossier'],$_SESSION['g_user'],STOCK_READ) == 0 ) {
if ( CheckAction($gDossier,$_SESSION['g_user'],STOCK_READ) == 0 ) {
NoAccess();
exit (-1);
}
$sg_code=(isset ($_GET['sg_code'] ))?$_GET['sg_code']:$_POST['sg_code'];
$year=(isset($_GET['year']))?$_GET['year']:$_POST['year'];
$a=ViewDetailStock($cn,$sg_code,$year);
$write=CheckAction($_SESSION['g_dossier'],$_SESSION['g_user'],STOCK_WRITE);
$write=CheckAction($gDossier,$_SESSION['g_user'],STOCK_WRITE);
$b="";
@ -167,9 +164,10 @@ if ( $action == 'detail' ) {
echo '<form action="?p_action=stock" method="POST">';
echo ChangeStock($sg_code,$year);
echo '<input type="submit" name="sub_change" value="Ok">';
echo dossier::hidden();
echo '</form>';
}
echo '<A class="mtitle" HREF="?p_action=stock"><INPUT TYPE="BUTTON" value="Retour"</A>';
echo '<A class="mtitle" HREF="?p_action=stock&"'.dossier::get().'><INPUT TYPE="BUTTON" value="Retour"</A>';
echo '</div>';
@ -182,13 +180,13 @@ $Res=ExecSql($cn,$sql);
$r="";
for ( $i = 0; $i < pg_NumRows($Res);$i++) {
$l=pg_fetch_array($Res,$i);
$r.=sprintf('<A class="mtitle" HREF="?p_action=stock&year=%d">%d</a> - ',
$r.=sprintf('<A class="mtitle" HREF="?p_action=stock&year=%d&'.dossier::get().'">%d</a> - ',
$l['exercice'],
$l['exercice']);
}
// Check if User Can see the stock
if ( CheckAction($_SESSION['g_dossier'],$_SESSION['g_user'],STOCK_READ) == 0 ) {
if ( CheckAction($gDossier,$_SESSION['g_user'],STOCK_READ) == 0 ) {
NoAccess();
exit (-1);
}

Some files were not shown because too many files have changed in this diff Show more