diff --git a/doc/mod_function b/doc/mod_function new file mode 100644 index 000000000..3e2c303a0 --- /dev/null +++ b/doc/mod_function @@ -0,0 +1,10 @@ +/* function + * Purpose : + * + * parm : + * - + * gen : + * - + * return: + */ + diff --git a/html/enc_jrn.php b/html/enc_jrn.php index fa675f820..e3157c809 100644 --- a/html/enc_jrn.php +++ b/html/enc_jrn.php @@ -23,6 +23,7 @@ include_once ("ac_common.php"); include_once("jrn.php"); include_once("preference.php"); include_once("poste.php"); +include_once("error.php"); html_page_start(0,"onLoad=\"CheckTotal();\""); if ( ! isset ( $g_dossier ) ) { echo "You must choose a Dossier "; @@ -146,37 +147,10 @@ if ( isset($_POST['add_record']) ) { $result=VerifData($cn,$HTTP_POST_VARS,$g_user); - - switch( $result) { - case NOERROR: - break; - case BADPARM: - break; - case BADDATE: - echo ""; - break; - case NOTPERIODE: - echo ""; - break; - case PERIODCLOSED: - echo ""; - break; - case INVALID_ECH: - echo ""; - break; - case RAPPT_ALREADY_USED: - echo '"; - break; - case RAPPT_NOT_EXIST: - echo '"; - break; - case DIFF_AMOUNT: - echo ""; - break; - case RAPPT_NOMATCH_AMOUNT: - echo '"; - break; - } + + // Parse result + AnalyzeError($result); + if ($result != NOERROR) { echo ""; CorrectRecord($g_dossier,$g_user,$g_jrn,$p_MaxDeb,$p_MaxCred,$HTTP_POST_VARS); @@ -317,37 +291,9 @@ if ( isset($_POST['update_record']) ) { } reset($HTTP_POST_VARS); $result=VerifData($cn,$HTTP_POST_VARS,$g_user); - - switch( $result) { - case NOERROR: - break; - case BADPARM: - break; - case BADDATE: - echo ""; - break; - case NOTPERIODE: - echo ""; - break; - case PERIODCLOSED: - echo ""; - break; - case INVALID_ECH: - echo ""; - break; - case RAPPT_ALREADY_USED: - echo '"; - break; - case RAPPT_NOT_EXIST: - echo '"; - break; - case DIFF_AMOUNT: - echo ""; - break; - case RAPPT_NOMATCH_AMOUNT: - echo '"; - break; - } + + // Parse result + AnalyzeError($result); foreach ( $HTTP_POST_VARS as $name=>$element ) { echo_debug("element $name -> $element "); // Sauve les données dans des variables @@ -363,16 +309,13 @@ if ( isset($_POST['update_record']) ) { $Res=StartSql($cn); - foreach ( $HTTP_POST_VARS as $name=>$element ) { - // Sauve les données dans des variables - ${"p_$name"}=$element; - echo_debug("p_name p_$name = $element"); - } $userPref=GetUserPeriode($cn,$g_user); - + $tot_montant=0; for ( $i = 0; $i < $p_MaxDeb; $i++) { $j_id=${"p_op_deb$i"}; $montant=${"p_mont_deb$i"}; + // Compute the sum (for jrn table) + $tot_montant+=$montant; $l_class=${"p_class_deb$i"}; if ( strlen(trim($montant)) == 0) $montant=0; $p_text=(FormatString(${"p_text_deb$i"})==null)?GetPosteLibelle($g_dossier,$l_class):FormatString(${"p_text_deb$i"}); @@ -431,7 +374,7 @@ if ( isset($_POST['update_record']) ) { $comment, $l_date, $p_rapt, - $p_sum_deb, + $tot_montant, $userPref, $p_jr_id ); @@ -449,7 +392,7 @@ if ( isset($_POST['update_record']) ) { $Sql=sprintf("update jrn set jr_comment='%s', jr_date=%s,jr_rapt=null,jr_montant=%f,jr_tech_per=%d where jr_id=%d", $comment, - $l_date,$p_sum_deb,$userPref, + $l_date,$tot_montant,$userPref, $p_jr_id); $Res=ExecSql($cn,$Sql); diff --git a/html/verif.php b/html/verif.php deleted file mode 100644 index 667c39821..000000000 --- a/html/verif.php +++ /dev/null @@ -1,31 +0,0 @@ - -/* - * This file is part of WCOMPTA. - * - * WCOMPTA 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, - * 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 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -// Auteur Dany De Bontridder ddebontridder@yahoo.fr -include_once ("ac_common.php"); -html_page_start(); -session_unset(); - include_once("postgres.php"); -echo "p_user $p_user p_pass $p_pass"; -$user=$_POST[p_user]; -$pass=$_POST[p_pass]; - - CheckUser(); - - html_page_stop(); -?> diff --git a/include/error.php b/include/error.php new file mode 100644 index 000000000..ab2fb0be4 --- /dev/null +++ b/include/error.php @@ -0,0 +1,66 @@ + +/* + * This file is part of WCOMPTA. + * + * WCOMPTA 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, + * 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 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +// Auteur Dany De Bontridder ddebontridder@yahoo.fr +// $Revision$ +include_once("constant.php"); +/* function AnalyzeError + * Purpose : Following the error code + * show adialog box + * parm : + * - $p_result + * gen : + * - none + * return: none + */ + +function AnalyzeError( $p_result) { + + switch( $p_result) { + case NOERROR: + break; + case BADPARM: + break; + case BADDATE: + echo ""; + break; + case NOTPERIODE: + echo ""; + break; + case PERIODCLOSED: + echo ""; + break; + case INVALID_ECH: + echo ""; + break; + case RAPPT_ALREADY_USED: + echo '"; + break; + case RAPPT_NOT_EXIST: + echo '"; + break; + case DIFF_AMOUNT: + echo ""; + break; + case RAPPT_NOMATCH_AMOUNT: + echo '"; + break; + } +} + +?> \ No newline at end of file diff --git a/include/jrn.php b/include/jrn.php index 7d8e3bfb4..c3cd294aa 100644 --- a/include/jrn.php +++ b/include/jrn.php @@ -743,6 +743,13 @@ function ViewJrn($p_dossier,$p_user,$p_jrn,$p_array=null) { echo '"; echo ""; }else { + + if ( isset ($_GET["PHPSESSID"]) ) { + $sessid=$_GET["PHPSESSID"]; + } else { + $sessid=$_POST["PHPSESSID"]; + } + echo "