From 2f2e18c6ac5e0d166d5239d7d47006d1597b6a86 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 8 Jul 2010 10:13:05 +0000 Subject: [PATCH] Merged revisions 3433-3443,3446-3452 via svnmerge from file:///home/developper/svn/phpcompta/branches/rel510 ........ r3446 | danydb | 2010-07-06 13:55:00 +0200 (Tue, 06 Jul 2010) | 1 line when an attribute is not found, it returns a string -ERROR- . This string is not a define in constant.php ........ --- include/class_action.php | 4 ++-- include/class_contact.php | 2 +- include/class_fiche.php | 6 +++--- include/constant.php | 1 + include/import_inc.php | 2 +- include/impress_poste.inc.php | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/class_action.php b/include/class_action.php index 32150f9c3..98c5b6948 100644 --- a/include/class_action.php +++ b/include/class_action.php @@ -266,7 +266,7 @@ class Action $str_add_button=$f_add_button->input(); // f_id_dest sender - if ( $this->qcode_dest != '- ERROR -' && strlen(trim($this->qcode_dest)) != 0) + if ( $this->qcode_dest != NOTFOUND && strlen(trim($this->qcode_dest)) != 0) { $tiers=new Fiche($this->db); $tiers->get_by_qcode($this->qcode_dest); @@ -823,7 +823,7 @@ class Action $fexp->id=$row['f_id_dest']; $qcode_dest=$fexp->strAttribut(ATTR_DEF_QUICKCODE); - $qexp=($qcode_dest=="- ERROR -")?"Interne":$qcode_dest; + $qexp=($qcode_dest==NOTFOUND)?"Interne":$qcode_dest; $jsexp=sprintf("javascript:showfiche('%s')", $qexp); if ( $qexp != 'Interne' ) diff --git a/include/class_contact.php b/include/class_contact.php index eb544f455..d38175d27 100644 --- a/include/class_contact.php +++ b/include/class_contact.php @@ -110,7 +110,7 @@ $back_url=urlencode($_SERVER['REQUEST_URI']); $l_company=new Fiche($this->cn); $l_company->get_by_qcode($contact->strAttribut(ATTR_DEF_COMPANY),false); $l_company_name=$l_company->strAttribut(ATTR_DEF_NAME); - if ( $l_company_name == '- ERROR -' ) $l_company_name=""; + if ( $l_company_name == NOTFOUND ) $l_company_name=""; // add popup for detail if ( $l_company_name !="") { diff --git a/include/class_fiche.php b/include/class_fiche.php index 15ba627ef..91816d0f3 100644 --- a/include/class_fiche.php +++ b/include/class_fiche.php @@ -287,7 +287,7 @@ class Fiche { if ( sizeof ($this->attribut) == 0 ) { - if ($this->id==0) return '- ERROR -'; + if ($this->id==0) return NOTFOUND; // object is not in memory we need to look into the database $sql="select av_text from attr_value join jnt_fic_att_value using(jft_id) where f_id=".FormatString($this->id)." and ad_id=".$p_ad_id; @@ -295,7 +295,7 @@ class Fiche { $row=Database::fetch_all($Res); // if not found return error if ( $row == false ) - return ' - ERROR -'; + return NOTFOUND; return $row[0]['av_text']; } @@ -305,7 +305,7 @@ class Fiche { if ( $e->ad_id == $p_ad_id ) return $e->av_text; } - return '- ERROR -'; + return NOTFOUND; } /*!\brief make an array of attributes of the category of card (FICHE_DEF.FD_ID) *The array can be used with the function insert, it will return a struct like this : diff --git a/include/constant.php b/include/constant.php index e0e601931..50d9f945d 100644 --- a/include/constant.php +++ b/include/constant.php @@ -31,6 +31,7 @@ $version_phpcompta=9000; define ("DBVERSION",85); define ("DBVERSIONREPO",12); +define ('NOTFOUND','--not found--'); define ("MAX_COMPTE",4); define ('MAX_ARTICLE',9); diff --git a/include/import_inc.php b/include/import_inc.php index 2498062d5..beb891fd4 100644 --- a/include/import_inc.php +++ b/include/import_inc.php @@ -304,7 +304,7 @@ function TransferCSV($p_cn, $periode){ $f->get_by_qcode($bq_account); $bq_poste=$f->strAttribut(ATTR_DEF_ACCOUNT); // Vérification que le poste comptable trouvé existe - if ( $poste_comptable == '- ERROR -' || strlen(trim($poste_comptable))==0) + if ( $poste_comptable == NOTFOUND || strlen(trim($poste_comptable))==0) $test=0; else { diff --git a/include/impress_poste.inc.php b/include/impress_poste.inc.php index 916f8be1d..026c6f630 100644 --- a/include/impress_poste.inc.php +++ b/include/impress_poste.inc.php @@ -153,7 +153,7 @@ if ( isset( $_REQUEST['bt_html'] ) ) { $fiche=new Fiche($cn); $qcode=$fiche->get_by_qcode($_GET['f_id']); $p=$fiche->strAttribut(ATTR_DEF_ACCOUNT); - if ( $p != "- ERROR -") { + if ( $p != NOTFOUND) { $go=2; } }