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
........
This commit is contained in:
Dany De Bontridder 2010-07-08 10:13:05 +00:00
parent 4f17b3d525
commit 2f2e18c6ac
6 changed files with 9 additions and 8 deletions

View file

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

View file

@ -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 !="")
{

View file

@ -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 :

View file

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

View file

@ -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
{

View file

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