diff --git a/html/impress.php b/html/impress.php index 4acd9e887..3ebe10a43 100644 --- a/html/impress.php +++ b/html/impress.php @@ -1,22 +1,22 @@ /* - * This file is part of WCOMPTA. + * This file is part of PhpCompta. * - * WCOMPTA is free software; you can redistribute it and/or modify + * PhpCompta is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * WCOMPTA is distributed in the hope that it will be useful, + * PhpCompta is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with WCOMPTA; if not, write to the Free Software + * along with PhpCompta; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// Auteur Dany De Bontridder ddebontridder@yahoo.fr +// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr /* $Revision$ */ include_once ("ac_common.php"); html_page_start($g_UserProperty['use_theme']); @@ -30,7 +30,11 @@ CheckUser(); include ("check_priv.php"); include_once ("top_menu_compta.php"); ShowMenuCompta($g_dossier,$g_UserProperty); - +if ( isset ($g_jrn) ) { + $p_id=$g_jrn; +} else { + if (isset ($_GET["p_id"]) ) $p_id=$_GET["p_id"]; +} include_once("impress_inc.php"); ShowMenuComptaRight($g_dossier,$g_UserProperty); @@ -40,9 +44,9 @@ if ( $g_UserProperty['use_admin'] == 0 ) { /* Cannot Access */ NoAccess(); } - if (isset ($_GET["p_id"]) && isset ($_GET["type"])) { + if ( isset ($_GET["type"])) { if ( $type="jrn") { - $right=CheckJrn($g_dossier,$g_user,$_GET['p_id']); + $right=CheckJrn($g_dossier,$g_user,$p_id); if ($right == 0 ){ /* Cannot Access */ NoAccess(); diff --git a/html/jrn_add.php b/html/jrn_add.php index d069bfc07..b1b14239c 100644 --- a/html/jrn_add.php +++ b/html/jrn_add.php @@ -80,10 +80,23 @@ echo_debug("nom journal $p_jrn_name"); $p_jrn_class_cred=FormatString($_POST["p_jrn_class_cred"]); // compute the jrn_def.jrn_def_code $p_code=sprintf("%s-%02d",trim($_POST['p_jrn_type']),NextJrn($cn,$_POST['p_jrn_type'])); + $p_jrn_fiche_deb=""; + $p_jrn_fiche_cred=""; + + if ( isset ($_POST["FICHEDEB"])) { + $p_jrn_fiche_deb=join(",",$_POST["FICHEDEB"]); + } + if ( isset ($_POST["FICHECRED"])) { + $p_jrn_fiche_cred=join(",",$_POST["FICHECRED"]); + } + $Sql=sprintf("insert into jrn_def(jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_deb_max_line,jrn_cred_max_line, - jrn_def_type,jrn_def_code) values ('%s','%s','%s',%s,%s,'%s','%s')", + jrn_def_type,jrn_def_fiche_deb,jrn_def_fiche_cred,jrn_def_code) + values ('%s','%s','%s',%s,%s,'%s','%s','%s','%s')", $p_jrn_name,$p_jrn_class_deb,$p_jrn_class_cred, - $l_deb_max_line,$l_cred_max_line,$_POST['p_jrn_type'],$p_code + $l_deb_max_line,$l_cred_max_line,$_POST['p_jrn_type'], + $p_jrn_fiche_deb,$p_jrn_fiche_cred, + $p_code ); echo_debug($Sql); $Res=ExecSql($cn,$Sql); @@ -155,6 +168,28 @@ echo ''; echo ''; echo ''; ?> + +// Get all the fiches +echo '