From fa2bc964eabf19e7f09f60b3efd1d97221b03fef Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sat, 15 Apr 2006 01:12:57 +0000 Subject: [PATCH] task #5409 debug info task #5405 Quick Code --- html/priv_user.php | 20 ++--- html/sec_pdf.php | 2 +- include/ac_common.php | 2 +- include/class_jrn.php | 18 ++--- include/class_operation.php | 2 +- include/class_user.php | 12 +-- include/class_widget.php | 6 +- include/constant.php | 1 + include/fiche_inc.php | 145 +++++++++++++++++++++++------------- 9 files changed, 126 insertions(+), 82 deletions(-) diff --git a/html/priv_user.php b/html/priv_user.php index d2c9770c2..578fb0fa2 100644 --- a/html/priv_user.php +++ b/html/priv_user.php @@ -22,7 +22,7 @@ include_once("postgres.php"); include_once("debug.php"); include_once("user_menu.php"); html_page_start($_SESSION['g_theme']); -echo_debug(__FILE__,__LINE__,"entering priv_users"); +echo_debug('priv_user.php',__LINE__,"entering priv_users"); $rep=DbConnect(); @@ -37,21 +37,21 @@ if ($User->admin != 1) { if (! isset ($_GET['UID']) && ! isset($_POST['UID']) ) { //Message d'erreur si UID non positionné - echo_debug(__FILE__,__LINE__,"UID NOT DEFINED"); + echo_debug('priv_user.php',__LINE__,"UID NOT DEFINED"); html_page_stop(); return; } $uid=( isset ($_GET['UID']))? $_GET['UID']: $_POST['UID']; -echo_debug(__FILE__,__LINE__,"UID IS DEFINED"); +echo_debug('priv_user.php',__LINE__,"UID IS DEFINED"); $r_UID=GetUid($uid); if ( $r_UID == false ) { - echo_debug(__FILE__,__LINE__,"UID NOT VALID"); + echo_debug('priv_user.php',__LINE__,"UID NOT VALID"); // Message d'erreur html_page_stop(); return; } -echo_debug(__FILE__,__LINE__,"UID IS VALID"); +echo_debug('priv_user.php',__LINE__,"UID IS VALID"); echo '

Administration Globale

'; echo "
".MenuAdmin()."
"; @@ -77,7 +77,7 @@ if ( isset ( $_GET['reset_passwd']) ){ } if ( isset ($_POST['SAVE']) ){ $uid = $_POST['UID']; - echo_debug(__FILE__,__LINE__,"SAVE is set"); + echo_debug('priv_user.php',__LINE__,"SAVE is set"); // Update User $cn=DbConnect(); $Sql="update ac_users set use_first_name='".$_POST['fname']."', use_name='".$_POST['lname']."' @@ -87,10 +87,10 @@ if ( isset ($_POST['SAVE']) ){ // Update Priv on Folder foreach ($HTTP_POST_VARS as $name=>$elem) { - echo_debug(__FILE__,__LINE__,"HTTP_POST_VARS $name $elem"); + echo_debug('priv_user.php',__LINE__,"HTTP_POST_VARS $name $elem"); if ( substr_count($name,'PRIV')!=0 ) { - echo_debug(__FILE__,__LINE__,"Found a priv"); + echo_debug('priv_user.php',__LINE__,"Found a priv"); $db_id=substr($name,4); $cn=DbConnect(); if ( ExisteJnt($db_id,$uid) != 1 ) @@ -181,7 +181,7 @@ echo ""; $Dossier=ShowDossier('all',1,0); foreach ( $Dossier as $rDossier) { $NORIGHT="";$Write="";$Read=""; - echo_debug(__FILE__,__LINE__,"Dossier : ".$rDossier['dos_id']); + echo_debug('priv_user.php',__LINE__,"Dossier : ".$rDossier['dos_id']); $login_name=GetLogin($uid); $priv=GetPriv($rDossier['dos_id'],$login_name); printf(" Dossier : %s ",$rDossier['dos_name']); @@ -189,7 +189,7 @@ foreach ( $Dossier as $rDossier) { { $NORIGHT="CHECKED";} else { $A=$priv[0]['priv_priv']; - echo_debug(__FILE__,__LINE__,"Priv = $A"); + echo_debug('priv_user.php',__LINE__,"Priv = $A"); if ( $priv[0]['priv_priv']=='W' ) {$Write="CHECKED";} else { diff --git a/html/sec_pdf.php b/html/sec_pdf.php index f7b4beb18..1aea2e6a2 100755 --- a/html/sec_pdf.php +++ b/html/sec_pdf.php @@ -30,7 +30,7 @@ include_once("ac_common.php"); include_once("postgres.php"); include_once("class.ezpdf.php"); require_once("check_priv.php"); -echo_debug(__FILE__,__LINE__,"imp pdf securité"); +echo_debug('sec_pdf.php',__LINE__,"imp pdf securité"); $cn=DbConnect($_SESSION['g_dossier']); ////////////////////////////////////////////////////////////////////// // Security diff --git a/include/ac_common.php b/include/ac_common.php index 6a770913a..a38d3cbf9 100644 --- a/include/ac_common.php +++ b/include/ac_common.php @@ -329,7 +329,7 @@ function make_array($p_cn,$p_sql,$p_null=0) { function getPeriodeName($p_cn,$p_id,$pos='p_start') { if ( $pos != 'p_start' and $pos != 'p_end') - echo_error(__FILE__."-".__LINE__.' UNDEFINED PERIODE'); + echo_error('ac_common.php'."-".__LINE__.' UNDEFINED PERIODE'); $ret=execSql($p_cn,"select to_char($pos,'Mon YYYY') as t from parm_periode where p_id=$p_id"); if (pg_NumRows($ret) == 0) return null; $a=pg_fetch_array($ret,0); diff --git a/include/class_jrn.php b/include/class_jrn.php index 101e9c2ea..6419e8084 100644 --- a/include/class_jrn.php +++ b/include/class_jrn.php @@ -62,7 +62,7 @@ class jrn { */ function GetRow($p_from,$p_to,$cent='off',$p_limit=-1,$p_offset=-1) { - echo_debug(__FILE__,__LINE__,"GetRow ( $p_from,$p_to,$cent,$p_limit,$p_offset)"); + echo_debug('class_jrn.php',__LINE__,"GetRow ( $p_from,$p_to,$cent,$p_limit,$p_offset)"); if ( $p_from == $p_to ) $periode=" jr_tech_per = $p_from "; @@ -74,7 +74,7 @@ class jrn { if ( $this->id != 0 ) { if ( $cent=='off' ) { - echo_debug(__FILE__,__LINE__,"journaux non centralisé"); + echo_debug('class_jrn.php',__LINE__,"journaux non centralisé"); // Journaux non centralisés $Res=ExecSql($this->db,"select j_id,j_id as int_j_id,to_char(j_date,'DD.MM.YYYY') as j_date, jr_internal, @@ -90,7 +90,7 @@ class jrn { $cond_limite); }else { // Journaux centralisés - echo_debug(__FILE__,__LINE__,"journaux centralisé"); + echo_debug('class_jrn.php',__LINE__,"journaux centralisé"); $Sql="select jr_opid as j_id, c_order as int_j_id, to_char (c_date,'DD.MM.YYYY') as j_date , @@ -116,7 +116,7 @@ class jrn { } else { // Grand Livre if ( $cent == 'off') { - echo_debug(__FILE__,__LINE__,"Grand livre non centralisé"); + echo_debug('class_jrn.php',__LINE__,"Grand livre non centralisé"); // Non centralisé $Res=ExecSql($this->db,"select j_id,j_id as int_j_id,to_char(j_date,'DD.MM.YYYY') as j_date, jr_internal, @@ -132,7 +132,7 @@ class jrn { $cond_limite); } else { - echo_debug(__FILE__,__LINE__,"Grand livre centralisé"); + echo_debug('class_jrn.php',__LINE__,"Grand livre centralisé"); // Centralisé $Sql="select jr_c_opid as j_id, c_order as int_j_id, @@ -172,8 +172,8 @@ class jrn { $jr_montant=($line['jr_montant']!=0)?sprintf("% 8.2f",$line['jr_montant']):""; $tot_deb+=$line['deb_montant']; $tot_cred+=$line['cred_montant']; - echo_debug(__FILE__,__LINE__," GetRow : mont_Deb ".$mont_deb); - echo_debug(__FILE__,__LINE__," GetRow : mont_cred ".$mont_cred); + echo_debug('class_jrn.php',__LINE__," GetRow : mont_Deb ".$mont_deb); + echo_debug('class_jrn.php',__LINE__," GetRow : mont_cred ".$mont_cred); if ( $case != $line['grp'] ) { $case=$line['grp']; @@ -216,7 +216,7 @@ class jrn { } - echo_debug(__FILE__,__LINE__,"Total debit $tot_deb,credit $tot_cred"); + echo_debug('class_jrn.php',__LINE__,"Total debit $tot_deb,credit $tot_cred"); $this->row=$array; $a=array($array,$tot_deb,$tot_cred); return $a; @@ -241,7 +241,7 @@ class jrn { function GetRowSimple($p_from,$p_to,$cent='off',$p_limit=-1,$p_offset=-1) { - echo_debug(__FILE__,__LINE__,"GetRowSimple ( $p_from,$p_to,$cent,$p_limit,$p_offset)"); + echo_debug('class_jrn.php',__LINE__,"GetRowSimple ( $p_from,$p_to,$cent,$p_limit,$p_offset)"); // Periode check //--- if ( $p_from == $p_to ) diff --git a/include/class_operation.php b/include/class_operation.php index 3104f5c4d..0a5ec9bc7 100644 --- a/include/class_operation.php +++ b/include/class_operation.php @@ -28,7 +28,7 @@ if ( isset( $_POST['bt_html'] ) ) { include("jrn.php"); $p_cent=( isset ( $_POST['cent']) )?'on':'off'; // $POST=from_periode, to_periode, jrn_id, cent - echo_debug(__FILE__,__LINE__," jrn sql = $sql"); + echo_debug('class_operation.php',__LINE__," jrn sql = $sql"); $Jrn=new jrn($cn,$_POST['jrn_id']); $Jrn->GetName(); $Jrn->GetRow( $_POST['from_periode'], diff --git a/include/class_user.php b/include/class_user.php index 80f3caf6d..94f93f0bc 100644 --- a/include/class_user.php +++ b/include/class_user.php @@ -35,7 +35,7 @@ class cl_user { function cl_user ($p_cn,$p_id=-1){ // if p_id is not set then check the connected user if ( $p_id == -1 ) { - echo_debug(__FILE__,__LINE__," g_user = ".$_SESSION['g_user']); + echo_debug('class_user.php',__LINE__," g_user = ".$_SESSION['g_user']); $this->id=$_SESSION['g_user']; $this->pass=$_SESSION['g_pass']; $this->valid=(isset ($_SESSION['isValid']))?1:0; @@ -96,10 +96,10 @@ class cl_user { where ac_users.use_login='$this->id' and ac_users.use_active=1 and ac_users.use_pass='$pass5'"; - echo_debug(__FILE__,__LINE__,"Sql = $sql"); + echo_debug('class_user.php',__LINE__,"Sql = $sql"); $ret=pg_exec($cn,$sql); $res=pg_NumRows($ret); - echo_debug(__FILE__,__LINE__,"Number of found rows : $res"); + echo_debug('class_user.php',__LINE__,"Number of found rows : $res"); if ( $res >0 ) { $r=pg_fetch_array($ret,0); $_SESSION['use_admin']=$r['use_admin']; @@ -280,7 +280,7 @@ function GetPreferences () function GetGlobalPref() { - echo_debug(__FILE__,__LINE__,"function GetGlobalPref"); + echo_debug('class_user.php',__LINE__,"function GetGlobalPref"); $cn=Dbconnect(); // Load everything in an array $Res=ExecSql ($cn,"select parameter_type,parameter_value from @@ -324,8 +324,8 @@ function GetGlobalPref() * return: nothing */ function insert_default_global_pref($p_type="",$p_value="") { - echo_debug(__FILE__,__LINE__,"function insert_default_global_pref"); - echo_debug(__FILE__,__LINE__,"parameter p_type $p_type p_value $p_value"); + echo_debug('class_user.php',__LINE__,"function insert_default_global_pref"); + echo_debug('class_user.php',__LINE__,"parameter p_type $p_type p_value $p_value"); $default_parameter= array("THEME"=>"Light", "PAGESIZE"=>"50"); diff --git a/include/class_widget.php b/include/class_widget.php index 20975f4a2..fec7d2ff3 100644 --- a/include/class_widget.php +++ b/include/class_widget.php @@ -75,7 +75,7 @@ class widget { $disabled = $this->disabled ? "DISABLED" : ""; if (strtoupper($this->type)=="TEXT") { if ( $this->readonly==false) { - $r="value\" TABINDEX=\"$this->tabindex\" SIZE=\"$this->size\" ".$disabled.">";} else { + $r="name\" VALUE=\"$this->value\" TABINDEX=\"$this->tabindex\" SIZE=\"$this->size\" ".$disabled.">";} else { $r=sprintf('%s', $this->value,$this->name,$this->value); } @@ -106,9 +106,9 @@ class widget { } $r.=""; } else { - echo_debug(__FILE__,__LINE__,"this->selected = ".$this->selected); + echo_debug('class_widget.php',__LINE__,"this->selected = ".$this->selected); for ( $i=0;$ivalue);$i++) { - echo_debug(__FILE__,__LINE__,"check for ".$this->value[$i]['value']); + echo_debug('class_widget.php',__LINE__,"check for ".$this->value[$i]['value']); if ($this->selected==$this->value[$i]['value'] ) { $r=$this->value[$i]['label']; diff --git a/include/constant.php b/include/constant.php index bfcaf9610..772f838a2 100644 --- a/include/constant.php +++ b/include/constant.php @@ -112,6 +112,7 @@ define ("FICHE_TYPE_ADM_TAX",14); define ("ATTR_DEF_DEPENSE_NON_DEDUCTIBLE",20); define ("ATTR_DEF_TVA_NON_DEDUCTIBLE",21); define ("ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP",22); +define ("ATTR_DEF_QUICKCODE",23); define ("JS_SEARCH_POSTE","