Fix: replace sizeof() by count()

This commit is contained in:
Regis Houssin 2011-09-17 19:49:50 +00:00
parent 6e98cc26fc
commit 2c1b3722f2
154 changed files with 430 additions and 393 deletions

View File

@ -339,7 +339,7 @@ class Adherent extends CommonObject
// Fin appel triggers // Fin appel triggers
} }
if (sizeof($this->errors)) if (count($this->errors))
{ {
dol_syslog(get_class($this)."::create ".join(',',$this->errors), LOG_ERR); dol_syslog(get_class($this)."::create ".join(',',$this->errors), LOG_ERR);
$this->db->rollback(); $this->db->rollback();

View File

@ -183,7 +183,7 @@ if ($id > 0)
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$member->getLibStatut(4).'</td></tr>'; print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$member->getLibStatut(4).'</td></tr>';
// Nbre fichiers // Nbre fichiers
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
//Total taille //Total taille
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';

View File

@ -283,7 +283,7 @@ if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->adhe
} }
$result=$object->update($user,0,$nosyncuser,$nosyncuserpass); $result=$object->update($user,0,$nosyncuser,$nosyncuserpass);
if ($result >= 0 && ! sizeof($object->errors)) if ($result >= 0 && ! count($object->errors))
{ {
$dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1).'/photos'; $dir= $conf->adherent->dir_output . '/' . get_exdir($object->id,2,0,1).'/photos';
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
@ -514,7 +514,7 @@ if ($user->rights->adherent->creer && $_POST["action"] == 'confirm_valid' && $_P
$adht = new AdherentType($db); $adht = new AdherentType($db);
$adht->fetch($object->typeid); $adht->fetch($object->typeid);
if ($result >= 0 && ! sizeof($object->errors)) if ($result >= 0 && ! count($object->errors))
{ {
// Send confirmation Email (selon param du type adherent sinon generique) // Send confirmation Email (selon param du type adherent sinon generique)
if ($object->email && $_POST["send_mail"]) if ($object->email && $_POST["send_mail"])
@ -548,7 +548,7 @@ if ($user->rights->adherent->supprimer && $_POST["action"] == 'confirm_resign' &
$result=$object->resiliate($user); $result=$object->resiliate($user);
if ($result >= 0 && ! sizeof($object->errors)) if ($result >= 0 && ! count($object->errors))
{ {
if ($object->email && $_POST["send_mail"]) if ($object->email && $_POST["send_mail"])
{ {
@ -576,7 +576,7 @@ if ($user->rights->adherent->supprimer && $_POST["action"] == 'confirm_resign' &
if ($user->rights->adherent->supprimer && $_POST["action"] == 'confirm_del_spip' && $_POST["confirm"] == 'yes') if ($user->rights->adherent->supprimer && $_POST["action"] == 'confirm_del_spip' && $_POST["confirm"] == 'yes')
{ {
if (! sizeof($object->errors)) if (! count($object->errors))
{ {
if(!$object->del_to_spip()){ if(!$object->del_to_spip()){
$errmsg.="Echec de la suppression de l'utilisateur dans spip: ".$object->error."<BR>\n"; $errmsg.="Echec de la suppression de l'utilisateur dans spip: ".$object->error."<BR>\n";
@ -586,7 +586,7 @@ if ($user->rights->adherent->supprimer && $_POST["action"] == 'confirm_del_spip'
if ($user->rights->adherent->creer && $_POST["action"] == 'confirm_add_spip' && $_POST["confirm"] == 'yes') if ($user->rights->adherent->creer && $_POST["action"] == 'confirm_add_spip' && $_POST["confirm"] == 'yes')
{ {
if (! sizeof($object->errors)) if (! count($object->errors))
{ {
if (!$object->add_to_spip()) if (!$object->add_to_spip())
{ {
@ -683,7 +683,7 @@ if ($action == 'create')
// Type // Type
print '<tr><td><span class="fieldrequired">'.$langs->trans("MemberType").'</span></td><td>'; print '<tr><td><span class="fieldrequired">'.$langs->trans("MemberType").'</span></td><td>';
$listetype=$adht->liste_array(); $listetype=$adht->liste_array();
if (sizeof($listetype)) if (count($listetype))
{ {
print $html->selectarray("typeid", $listetype, isset($_POST["typeid"])?$_POST["typeid"]:$typeid, 1); print $html->selectarray("typeid", $listetype, isset($_POST["typeid"])?$_POST["typeid"]:$typeid, 1);
} else { } else {

View File

@ -91,7 +91,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
//print 'datef='.$subscription->datef.' '.$_POST['datesubendday']; //print 'datef='.$subscription->datef.' '.$_POST['datesubendday'];
$result=$subscription->update($user); $result=$subscription->update($user);
if ($result >= 0 && ! sizeof($subscription->errors)) if ($result >= 0 && ! count($subscription->errors))
{ {
$db->commit(); $db->commit();

View File

@ -199,7 +199,7 @@ if ($result > 0)
//print_r($records); //print_r($records);
// Affichage arbre // Affichage arbre
if (sizeof($records) && $records != false && (! isset($records['count']) || $records['count'] > 0)) if (count($records) && $records != false && (! isset($records['count']) || $records['count'] > 0))
{ {
if (! is_array($records)) if (! is_array($records))
{ {

View File

@ -75,7 +75,7 @@ class Auth {
$authmode=explode(',',$dolibarr_main_authentication); $authmode=explode(',',$dolibarr_main_authentication);
// No authentication mode // No authentication mode
if (! sizeof($authmode) && empty($conf->login_method_modules)) if (! count($authmode) && empty($conf->login_method_modules))
{ {
$langs->load('main'); $langs->load('main');
dol_print_error('',$langs->trans("ErrorConfigParameterNotDefined",'dolibarr_main_authentication')); dol_print_error('',$langs->trans("ErrorConfigParameterNotDefined",'dolibarr_main_authentication'));

View File

@ -661,7 +661,7 @@ class ActionComm extends CommonObject
require_once (DOL_DOCUMENT_ROOT ."/lib/xcal.lib.php"); require_once (DOL_DOCUMENT_ROOT ."/lib/xcal.lib.php");
require_once (DOL_DOCUMENT_ROOT ."/lib/date.lib.php"); require_once (DOL_DOCUMENT_ROOT ."/lib/date.lib.php");
dol_syslog("ActionComm::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".sizeof($filters), LOG_DEBUG); dol_syslog("ActionComm::build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG);
// Check parameters // Check parameters
if (empty($format)) return -1; if (empty($format)) return -1;

View File

@ -208,7 +208,7 @@ if ($objectid > 0)
} }
print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>'; print '<tr><td width="30%" nowrap>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>'; print '</table>';

View File

@ -502,7 +502,7 @@ if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0
} }
} }
if (sizeof($listofextcals)) if (count($listofextcals))
{ {
require_once(DOL_DOCUMENT_ROOT."/comm/action/class/ical.class.php"); require_once(DOL_DOCUMENT_ROOT."/comm/action/class/ical.class.php");
foreach($listofextcals as $extcal) foreach($listofextcals as $extcal)
@ -994,7 +994,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print ($status?'&status='.$status:'').($filter?'&filter='.$filter:''); print ($status?'&status='.$status:'').($filter?'&filter='.$filter:'');
print ($filtera?'&filtera='.$filtera:'').($filtert?'&filtert='.$filtert:'').($filterd?'&filterd='.$filterd:''); print ($filtera?'&filtera='.$filtera:'').($filtert?'&filtert='.$filtert:'').($filterd?'&filterd='.$filterd:'');
print '">'.img_picto("all","1downarrow_selected.png").' ...'; print '">'.img_picto("all","1downarrow_selected.png").' ...';
print ' +'.(sizeof($eventarray[$daykey])-$maxPrint); print ' +'.(count($eventarray[$daykey])-$maxPrint);
print '</a>'; print '</a>';
break; break;
//$ok=false; // To avoid to show twice the link //$ok=false; // To avoid to show twice the link

View File

@ -199,7 +199,7 @@ if ($_REQUEST["action"] == 'sendallconfirmed' && $_REQUEST['confirm'] == 'yes')
$arr_css = array(); $arr_css = array();
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0); $listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
if (sizeof($listofpaths)) if (count($listofpaths))
{ {
foreach($listofpaths as $key => $val) foreach($listofpaths as $key => $val)
{ {
@ -333,7 +333,7 @@ if ($_POST["action"] == 'send' && empty($_POST["cancel"]))
// Attached files // Attached files
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0); $listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
if (sizeof($listofpaths)) if (count($listofpaths))
{ {
foreach($listofpaths as $key => $val) foreach($listofpaths as $key => $val)
{ {
@ -909,7 +909,7 @@ else
print '<tr><td>'.$langs->trans("MailFile").' '.$i.'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("MailFile").' '.$i.'</td><td colspan="3">';
// List of files // List of files
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0); $listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
if (sizeof($listofpaths)) if (count($listofpaths))
{ {
foreach($listofpaths as $key => $val) foreach($listofpaths as $key => $val)
{ {
@ -1001,7 +1001,7 @@ else
print '<td colspan="3">'; print '<td colspan="3">';
// List of files // List of files
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0); $listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
if (sizeof($listofpaths)) if (count($listofpaths))
{ {
foreach($listofpaths as $key => $val) foreach($listofpaths as $key => $val)
{ {

View File

@ -1531,7 +1531,7 @@ if ($id > 0 || ! empty($ref))
// Validate // Validate
if ($object->statut == 0 && $user->rights->propale->valider) if ($object->statut == 0 && $user->rights->propale->valider)
{ {
if (sizeof($object->lines) > 0) print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=validate">'.$langs->trans('Validate').'</a>'; if (count($object->lines) > 0) print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=validate">'.$langs->trans('Validate').'</a>';
else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>'; else print '<a class="butActionRefused" href="#">'.$langs->trans('Validate').'</a>';
} }
@ -1574,7 +1574,7 @@ if ($id > 0 || ! empty($ref))
} }
$arraypropal=$object->getInvoiceArrayList(); $arraypropal=$object->getInvoiceArrayList();
if (is_array($arraypropal) && sizeof($arraypropal) > 0) if (is_array($arraypropal) && count($arraypropal) > 0)
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled&amp;socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled&amp;socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>';
} }

View File

@ -692,7 +692,7 @@ class Propal extends CommonObject
if (! $error) if (! $error)
{ {
$fk_parent_line=0; $fk_parent_line=0;
$num=sizeof($this->lines); $num=count($this->lines);
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {
@ -1651,7 +1651,7 @@ class Propal extends CommonObject
$this->fetchObjectLinked($id,$this->element); $this->fetchObjectLinked($id,$this->element);
foreach($this->linkedObjectsIds as $objecttype => $objectid) foreach($this->linkedObjectsIds as $objecttype => $objectid)
{ {
$numi=sizeof($objectid); $numi=count($objectid);
for ($i=0;$i<$numi;$i++) for ($i=0;$i<$numi;$i++)
{ {
// Cas des factures liees directement // Cas des factures liees directement
@ -1665,7 +1665,7 @@ class Propal extends CommonObject
$this->fetchObjectLinked($objectid[$i],$objecttype); $this->fetchObjectLinked($objectid[$i],$objecttype);
foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid) foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid)
{ {
$numj=sizeof($subobjectid); $numj=count($subobjectid);
for ($j=0;$j<$numj;$j++) for ($j=0;$j<$numj;$j++)
{ {
$linkedInvoices[] = $subobjectid[$j]; $linkedInvoices[] = $subobjectid[$j];
@ -1675,7 +1675,7 @@ class Propal extends CommonObject
} }
} }
if (sizeof($linkedInvoices) > 0) if (count($linkedInvoices) > 0)
{ {
$sql= "SELECT rowid as facid, facnumber, total, datef as df, fk_user_author, fk_statut, paye"; $sql= "SELECT rowid as facid, facnumber, total, datef as df, fk_user_author, fk_statut, paye";
$sql.= " FROM ".MAIN_DB_PREFIX."facture"; $sql.= " FROM ".MAIN_DB_PREFIX."facture";
@ -2115,7 +2115,7 @@ class Propal extends CommonObject
} }
} }
// TODO Definir regle des propales a facturer en retard // TODO Definir regle des propales a facturer en retard
// if ($mode == 'signed' && ! sizeof($this->FactureListeArray($obj->rowid))) $this->nbtodolate++; // if ($mode == 'signed' && ! count($this->FactureListeArray($obj->rowid))) $this->nbtodolate++;
} }
return 1; return 1;
} }

View File

@ -285,7 +285,7 @@ if ($id > 0 || ! empty($ref))
foreach(array('internal','external') as $source) foreach(array('internal','external') as $source)
{ {
$tab = $propal->liste_contact(-1,$source); $tab = $propal->liste_contact(-1,$source);
$num=sizeof($tab); $num=count($tab);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)

View File

@ -167,7 +167,7 @@ if ($id > 0 || ! empty($ref))
print "<tr><td>".$langs->trans("Company")."</td>"; print "<tr><td>".$langs->trans("Company")."</td>";
print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>'; print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>'; print '</table>';

View File

@ -241,7 +241,8 @@ class Commande extends CommonObject
$langs->load("agenda"); $langs->load("agenda");
// Loop on each line // Loop on each line
for ($i = 0 ; $i < sizeof($this->lines) ; $i++) $num=count($this->lines);
for ($i = 0; $i < $num; $i++)
{ {
if ($this->lines[$i]->fk_product > 0) if ($this->lines[$i]->fk_product > 0)
{ {
@ -352,7 +353,8 @@ class Commande extends CommonObject
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
$langs->load("agenda"); $langs->load("agenda");
for ($i = 0 ; $i < sizeof($this->lines) ; $i++) $num=count($this->lines);
for ($i = 0; $i < $num; $i++)
{ {
if ($this->lines[$i]->fk_product > 0) if ($this->lines[$i]->fk_product > 0)
{ {
@ -647,7 +649,7 @@ class Commande extends CommonObject
if ($this->id) if ($this->id)
{ {
$fk_parent_line=0; $fk_parent_line=0;
$num=sizeof($this->lines); $num=count($this->lines);
/* /*
* Insertion du detail des produits dans la base * Insertion du detail des produits dans la base
@ -874,7 +876,8 @@ class Commande extends CommonObject
$this->date_commande = dol_now(); $this->date_commande = dol_now();
$this->source = 0; $this->source = 0;
for ($i = 0 ; $i < sizeof($object->lines) ; $i++) $num=count($object->lines);
for ($i = 0; $i < $num; $i++)
{ {
$line = new OrderLine($this->db); $line = new OrderLine($this->db);
@ -1161,7 +1164,7 @@ class Commande extends CommonObject
$prod->fetch($idproduct); $prod->fetch($idproduct);
$prod -> get_sousproduits_arbo (); $prod -> get_sousproduits_arbo ();
$prods_arbo = $prod->get_each_prod(); $prods_arbo = $prod->get_each_prod();
if(sizeof($prods_arbo) > 0) if(count($prods_arbo) > 0)
{ {
foreach($prods_arbo as $key => $value) foreach($prods_arbo as $key => $value)
{ {
@ -1582,7 +1585,7 @@ class Commande extends CommonObject
// Recherche total en stock pour chaque produit // Recherche total en stock pour chaque produit
if (sizeof($array_of_product)) if (count($array_of_product))
{ {
$sql = "SELECT fk_product, sum(ps.reel) as total"; $sql = "SELECT fk_product, sum(ps.reel) as total";
$sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps"; $sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps";

View File

@ -276,7 +276,7 @@ if ($id > 0 || ! empty($ref))
foreach(array('internal','external') as $source) foreach(array('internal','external') as $source)
{ {
$tab = $commande->liste_contact(-1,$source); $tab = $commande->liste_contact(-1,$source);
$num=sizeof($tab); $num=count($tab);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)

View File

@ -154,7 +154,7 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print "</table>\n"; print "</table>\n";
print "</div>\n"; print "</div>\n";

View File

@ -238,7 +238,7 @@ if ($action == 'add' && $user->rights->commande->creer)
if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
$fk_parent_line=0; $fk_parent_line=0;
$num=sizeof($lines); $num=count($lines);
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {

View File

@ -151,7 +151,7 @@ if ($_GET["account"])
$bankaccount->fetch($id); $bankaccount->fetch($id);
$bankaccount->label=$bankaccount->ref; $bankaccount->label=$bankaccount->ref;
print $bankaccount->getNomUrl(1); print $bankaccount->getNomUrl(1);
if ($key < (sizeof($listid)-1)) print ', '; if ($key < (count($listid)-1)) print ', ';
} }
} }
} }

View File

@ -760,7 +760,7 @@ if ($account)
$bankaccount->fetch($id); $bankaccount->fetch($id);
$bankaccount->label=$bankaccount->ref; $bankaccount->label=$bankaccount->ref;
print $bankaccount->getNomUrl(1); print $bankaccount->getNomUrl(1);
if ($key < (sizeof($listid)-1)) print ', '; if ($key < (count($listid)-1)) print ', ';
} }
} }
} }

View File

@ -274,7 +274,7 @@ if ($result)
print '</tr>'; print '</tr>';
// Show links of bank transactions // Show links of bank transactions
if (sizeof($links)) if (count($links))
{ {
print "<tr><td>".$langs->trans("Links")."</td>"; print "<tr><td>".$langs->trans("Links")."</td>";
print '<td colspan="4">'; print '<td colspan="4">';

View File

@ -2130,7 +2130,7 @@ else
} }
$facidavoir=$object->getListIdAvoirFromInvoice(); $facidavoir=$object->getListIdAvoirFromInvoice();
if (sizeof($facidavoir) > 0) if (count($facidavoir) > 0)
{ {
print ' ('.$langs->transnoentities("InvoiceHasAvoir"); print ' ('.$langs->transnoentities("InvoiceHasAvoir");
$i=0; $i=0;
@ -2667,7 +2667,7 @@ else
} }
// Validate // Validate
if ($object->statut == 0 && sizeof($object->lines) > 0 && if ($object->statut == 0 && count($object->lines) > 0 &&
( (
(($object->type == 0 || $object->type == 1 || $object->type == 3 || $object->type == 4) && $object->total_ttc >= 0) (($object->type == 0 || $object->type == 1 || $object->type == 3 || $object->type == 4) && $object->total_ttc >= 0)
|| ($object->type == 2 && $object->total_ttc <= 0)) || ($object->type == 2 && $object->total_ttc <= 0))

View File

@ -109,7 +109,7 @@ if ($id > 0 || ! empty($ref))
} }
$facidavoir=$object->getListIdAvoirFromInvoice(); $facidavoir=$object->getListIdAvoirFromInvoice();
if (sizeof($facidavoir) > 0) if (count($facidavoir) > 0)
{ {
print ' ('.$langs->transnoentities("InvoiceHasAvoir"); print ' ('.$langs->transnoentities("InvoiceHasAvoir");
$i=0; $i=0;

View File

@ -143,7 +143,8 @@ class FactureRec extends Facture
/* /*
* Lines * Lines
*/ */
for ($i = 0 ; $i < sizeof($facsrc->lines) ; $i++) $num=count($facsrc->lines);
for ($i = 0; $i < $num; $i++)
{ {
$result_insert = $this->addline($this->id, $result_insert = $this->addline($this->id,
$facsrc->lines[$i]->desc, $facsrc->lines[$i]->desc,

View File

@ -276,11 +276,11 @@ class Facture extends CommonObject
/* /*
* Insert lines of invoices into database * Insert lines of invoices into database
*/ */
if (sizeof($this->lines) && is_object($this->lines[0])) if (count($this->lines) && is_object($this->lines[0]))
{ {
$fk_parent_line = 0; $fk_parent_line = 0;
dol_syslog("There is ".sizeof($this->lines)." lines that are invoice lines objects"); dol_syslog("There is ".count($this->lines)." lines that are invoice lines objects");
foreach ($this->lines as $i => $val) foreach ($this->lines as $i => $val)
{ {
$newinvoiceline=new FactureLigne($this->db); $newinvoiceline=new FactureLigne($this->db);
@ -313,7 +313,7 @@ class Facture extends CommonObject
{ {
$fk_parent_line = 0; $fk_parent_line = 0;
dol_syslog("There is ".sizeof($this->lines)." lines that are array lines"); dol_syslog("There is ".count($this->lines)." lines that are array lines");
foreach ($this->lines as $i => $val) foreach ($this->lines as $i => $val)
{ {
if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0 if (($this->lines[$i]->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
@ -496,7 +496,7 @@ class Facture extends CommonObject
} }
} }
dol_syslog("Facture::createFromCurrent invertdetail=".$invertdetail." socid=".$this->socid." nboflines=".sizeof($facture->lines)); dol_syslog("Facture::createFromCurrent invertdetail=".$invertdetail." socid=".$this->socid." nboflines=".count($facture->lines));
$facid = $facture->create($user); $facid = $facture->create($user);
if ($facid <= 0) if ($facid <= 0)
@ -615,7 +615,8 @@ class Facture extends CommonObject
$this->date = dol_now(); $this->date = dol_now();
$this->source = 0; $this->source = 0;
for ($i = 0 ; $i < sizeof($object->lines) ; $i++) $num=count($object->lines);
for ($i = 0; $i < $num; $i++)
{ {
$line = new FactureLigne($this->db); $line = new FactureLigne($this->db);
@ -1209,7 +1210,7 @@ class Facture extends CommonObject
} }
// Consumned discounts are freed // Consumned discounts are freed
if (sizeof($list_rowid_det)) if (count($list_rowid_det))
{ {
$sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except';
$sql.= ' SET fk_facture = NULL'; $sql.= ' SET fk_facture = NULL';
@ -1634,7 +1635,8 @@ class Facture extends CommonObject
$langs->load("agenda"); $langs->load("agenda");
// Loop on each line // Loop on each line
for ($i = 0 ; $i < sizeof($this->lines) ; $i++) $num=count($this->lines);
for ($i = 0; $i < $num; $i++)
{ {
if ($this->lines[$i]->fk_product > 0) if ($this->lines[$i]->fk_product > 0)
{ {
@ -1748,7 +1750,8 @@ class Facture extends CommonObject
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
$langs->load("agenda"); $langs->load("agenda");
for ($i = 0 ; $i < sizeof($this->lines) ; $i++) $num=count($this->lines);
for ($i = 0; $i < $num; $i++)
{ {
if ($this->lines[$i]->fk_product > 0) if ($this->lines[$i]->fk_product > 0)
{ {
@ -2743,7 +2746,8 @@ class Facture extends CommonObject
{ {
// On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees
$ventilExportCompta = 0 ; $ventilExportCompta = 0 ;
for ($i = 0 ; $i < sizeof($this->lines) ; $i++) $num=count($this->lines);
for ($i = 0; $i < $num; $i++)
{ {
if ($this->lines[$i]->export_compta <> 0 && $this->lines[$i]->code_ventilation <> 0) if ($this->lines[$i]->export_compta <> 0 && $this->lines[$i]->code_ventilation <> 0)
{ {

View File

@ -271,7 +271,7 @@ if ($id > 0 || ! empty($ref))
foreach(array('internal','external') as $source) foreach(array('internal','external') as $source)
{ {
$tab = $facture->liste_contact(-1,$source); $tab = $facture->liste_contact(-1,$source);
$num=sizeof($tab); $num=count($tab);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)

View File

@ -172,7 +172,7 @@ if ($id > 0 || ! empty($ref))
// Company // Company
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print "</table>\n"; print "</table>\n";
print "</div>\n"; print "</div>\n";

View File

@ -404,7 +404,7 @@ else
print '<td align="center">'.$langs->trans("ReductionShort").'</td>'; print '<td align="center">'.$langs->trans("ReductionShort").'</td>';
print '<td align="center">'.$langs->trans("Qty").'</td></tr>'; print '<td align="center">'.$langs->trans("Qty").'</td></tr>';
$num = sizeof($fac->lines); $num = count($fac->lines);
$i = 0; $i = 0;
$var=True; $var=True;
while ($i < $num) while ($i < $num)

View File

@ -181,7 +181,7 @@ if ($_REQUEST["facid"] > 0 || $_REQUEST["ref"])
} }
$facidavoir=$fac->getListIdAvoirFromInvoice(); $facidavoir=$fac->getListIdAvoirFromInvoice();
if (sizeof($facidavoir) > 0) if (count($facidavoir) > 0)
{ {
print ' ('.$langs->transnoentities("InvoiceHasAvoir"); print ' ('.$langs->transnoentities("InvoiceHasAvoir");
$i=0; $i=0;

View File

@ -586,7 +586,7 @@ else
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($user->societe_id == 0 && sizeof($accounts) == 1 && $action == 'new' && $user->rights->banque->cheque) if ($user->societe_id == 0 && count($accounts) == 1 && $action == 'new' && $user->rights->banque->cheque)
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create&amp;accountid='.$account_id.'">'.$langs->trans('NewCheckReceipt').'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create&amp;accountid='.$account_id.'">'.$langs->trans('NewCheckReceipt').'</a>';
} }

View File

@ -271,7 +271,7 @@ class Paiement extends CommonObject
$billsarray=$this->getBillsArray('fk_statut > 1'); $billsarray=$this->getBillsArray('fk_statut > 1');
if (is_array($billsarray)) if (is_array($billsarray))
{ {
if (sizeof($billsarray)) if (count($billsarray))
{ {
$this->error="ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible"; $this->error="ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible";
$this->db->rollback(); $this->db->rollback();

View File

@ -86,7 +86,7 @@ if ($_POST["action"] == 'add_payment')
} }
} }
if (sizeof($amounts) <= 0) if (count($amounts) <= 0)
{ {
$error++; $error++;
$errmsg='ErrorNoPaymentDefined'; $errmsg='ErrorNoPaymentDefined';

View File

@ -334,8 +334,9 @@ class BonPrelevement extends CommonObject
{ {
$facs = array(); $facs = array();
$facs = $this->_get_list_factures(); $facs = $this->_get_list_factures();
for ($i = 0 ; $i < sizeof($facs) ; $i++) $num=count($facs);
for ($i = 0; $i < $num; $i++)
{ {
/* Tag invoice as payed */ /* Tag invoice as payed */
dol_syslog("BonPrelevement::set_credite set_paid fac ".$facs[$i]); dol_syslog("BonPrelevement::set_credite set_paid fac ".$facs[$i]);
@ -423,7 +424,8 @@ class BonPrelevement extends CommonObject
$facs = $this->_get_list_factures(); $facs = $this->_get_list_factures();
for ($i = 0 ; $i < sizeof($facs) ; $i++) $num=count($facs);
for ($i = 0; $i < $num; $i++)
{ {
$fac = new Facture($this->db); $fac = new Facture($this->db);
$fac->fetch($facs[$i]); $fac->fetch($facs[$i]);
@ -781,7 +783,7 @@ class BonPrelevement extends CommonObject
$i = 0; $i = 0;
dol_syslog("Start RIB check"); dol_syslog("Start RIB check");
if (sizeof($factures) > 0) if (count($factures) > 0)
{ {
foreach ($factures as $fac) foreach ($factures as $fac)
{ {
@ -825,12 +827,12 @@ class BonPrelevement extends CommonObject
$ok=0; $ok=0;
// Withdraw invoices in factures_prev array // Withdraw invoices in factures_prev array
$out=sizeof($factures_prev)." invoices will be withdrawn."; $out=count($factures_prev)." invoices will be withdrawn.";
//print $out."\n"; //print $out."\n";
dol_syslog($out); dol_syslog($out);
if (sizeof($factures_prev) > 0) if (count($factures_prev) > 0)
{ {
if ($mode=='real') if ($mode=='real')
{ {
@ -917,7 +919,7 @@ class BonPrelevement extends CommonObject
*/ */
if (!$error) if (!$error)
{ {
if (sizeof($factures_prev) > 0) if (count($factures_prev) > 0)
{ {
foreach ($factures_prev as $fac) foreach ($factures_prev as $fac)
{ {
@ -977,9 +979,9 @@ class BonPrelevement extends CommonObject
* Withdraw receipt * Withdraw receipt
*/ */
dol_syslog("Debut prelevement - Nombre de factures ".sizeof($factures_prev)); dol_syslog("Debut prelevement - Nombre de factures ".count($factures_prev));
if (sizeof($factures_prev) > 0) if (count($factures_prev) > 0)
{ {
$bonprev->date_echeance = $datetimeprev; $bonprev->date_echeance = $datetimeprev;
$bonprev->reference_remise = $ref; $bonprev->reference_remise = $ref;
@ -1033,7 +1035,7 @@ class BonPrelevement extends CommonObject
dol_syslog("Error",LOG_ERROR); dol_syslog("Error",LOG_ERROR);
} }
return sizeof($factures_prev); return count($factures_prev);
} }
else else
{ {

View File

@ -115,9 +115,9 @@ class RejetPrelevement
dol_syslog("RejetPrelevement::create Erreur 5"); dol_syslog("RejetPrelevement::create Erreur 5");
$error++; $error++;
} }
$num=count($facs);
for ($i = 0 ; $i < sizeof($facs) ; $i++) for ($i = 0; $i < $num; $i++)
{ {
$fac = new Facture($this->db); $fac = new Facture($this->db);
$fac->fetch($facs[$i]); $fac->fetch($facs[$i]);

View File

@ -486,7 +486,7 @@ if ($id > 0 || ! empty($ref))
} }
$arraypropal=$object->getInvoiceArrayList(); $arraypropal=$object->getInvoiceArrayList();
if ($object->statut == 2 && is_array($arraypropal) && sizeof($arraypropal) > 0) if ($object->statut == 2 && is_array($arraypropal) && count($arraypropal) > 0)
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=setstatut&statut=4&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=setstatut&statut=4&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>';
} }

View File

@ -223,7 +223,7 @@ print_liste_field_titre($langs->trans("OtherStatistics"),$_SERVER["PHP_SELF"],""
print "</tr>\n"; print "</tr>\n";
$var=true; $var=true;
if (sizeof($amount)) if (count($amount))
{ {
$arrayforsort=$name; $arrayforsort=$name;

View File

@ -223,7 +223,7 @@ if (empty($reshook))
$_GET["action"] = $_POST["action"] = 'edit'; $_GET["action"] = $_POST["action"] = 'edit';
} }
if (! sizeof($errors)) if (! count($errors))
{ {
$object->fetch($_POST["contactid"]); $object->fetch($_POST["contactid"]);

View File

@ -584,7 +584,7 @@ class Contrat extends CommonObject
return -2; return -2;
} }
$this->nbofservices=sizeof($this->lines); $this->nbofservices=count($this->lines);
$this->total_ttc = price2num($total_ttc); // TODO For the moment value is false as value is not stored in database for line linked to products $this->total_ttc = price2num($total_ttc); // TODO For the moment value is false as value is not stored in database for line linked to products
$this->total_vat = price2num($total_vat); // TODO For the moment value is false as value is not stored in database for line linked to products $this->total_vat = price2num($total_vat); // TODO For the moment value is false as value is not stored in database for line linked to products
$this->total_ht = price2num($total_ht); // TODO For the moment value is false as value is not stored in database for line linked to products $this->total_ht = price2num($total_ht); // TODO For the moment value is false as value is not stored in database for line linked to products

View File

@ -271,7 +271,7 @@ if ($id > 0)
foreach(array('internal','external') as $source) foreach(array('internal','external') as $source)
{ {
$tab = $contrat->liste_contact(-1,$source); $tab = $contrat->liste_contact(-1,$source);
$num=sizeof($tab); $num=count($tab);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)

View File

@ -147,7 +147,7 @@ if ($contrat->id)
print '<tr><td>'.$langs->trans("Customer").'</td>'; print '<tr><td>'.$langs->trans("Customer").'</td>';
print '<td colspan="3">'.$soc->getNomUrl(1).'</td></tr>'; print '<td colspan="3">'.$soc->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>'; print '</table>';

View File

@ -584,7 +584,7 @@ else
dol_htmloutput_errors($mesg,''); dol_htmloutput_errors($mesg,'');
$nbofservices=sizeof($object->lines); $nbofservices=count($object->lines);
$author = new User($db); $author = new User($db);
$author->fetch($object->user_author_id); $author->fetch($object->user_author_id);
@ -793,7 +793,7 @@ else
} }
// Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme) // Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme)
print '<td align="right" nowrap="nowrap">'; print '<td align="right" nowrap="nowrap">';
if ($user->rights->contrat->creer && sizeof($arrayothercontracts) && ($object->statut >= 0)) if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0))
{ {
print '<a href="fiche.php?id='.$object->id.'&amp;action=move&amp;rowid='.$objp->rowid.'">'; print '<a href="fiche.php?id='.$object->id.'&amp;action=move&amp;rowid='.$objp->rowid.'">';
print img_picto($langs->trans("MoveToAnotherContract"),'uparrow'); print img_picto($langs->trans("MoveToAnotherContract"),'uparrow');

View File

@ -699,7 +699,7 @@ abstract class CommonObject
{ {
$contactAlreadySelected = array(); $contactAlreadySelected = array();
$tab = $this->liste_contact(-1,$source); $tab = $this->liste_contact(-1,$source);
$num=sizeof($tab); $num=count($tab);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
@ -1345,7 +1345,7 @@ abstract class CommonObject
{ {
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
$num=sizeof($objectids); $num=count($objectids);
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {
@ -1474,7 +1474,7 @@ abstract class CommonObject
} }
// Request to get complementary values // Request to get complementary values
if (sizeof($optionsArray) > 0) if (count($optionsArray) > 0)
{ {
$sql = "SELECT rowid"; $sql = "SELECT rowid";
foreach ($optionsArray as $name => $label) foreach ($optionsArray as $name => $label)
@ -1516,7 +1516,7 @@ abstract class CommonObject
*/ */
function insertExtraFields() function insertExtraFields()
{ {
if (sizeof($this->array_options) > 0) if (count($this->array_options) > 0)
{ {
$this->db->begin(); $this->db->begin();
@ -1679,7 +1679,7 @@ abstract class CommonObject
$this->fetchObjectLinked(); $this->fetchObjectLinked();
$num = sizeof($this->linkedObjects); $num = count($this->linkedObjects);
foreach($this->linkedObjects as $objecttype => $objects) foreach($this->linkedObjects as $objecttype => $objects)
{ {

View File

@ -311,8 +311,8 @@ class DolGraph
$k = 0; $k = 0;
$vals = array(); $vals = array();
$nblines = sizeof($this->data); $nblines = count($this->data);
$nbvalues = sizeof($this->data[0]) - 1; $nbvalues = count($this->data[0]) - 1;
for ($j = 0 ; $j < $nblines ; $j++) for ($j = 0 ; $j < $nblines ; $j++)
{ {
@ -331,8 +331,8 @@ class DolGraph
$k = 0; $k = 0;
$vals = array(); $vals = array();
$nblines = sizeof($this->data); $nblines = count($this->data);
$nbvalues = sizeof($this->data[0]) - 1; $nbvalues = count($this->data[0]) - 1;
for ($j = 0 ; $j < $nblines ; $j++) for ($j = 0 ; $j < $nblines ; $j++)
{ {
@ -397,7 +397,7 @@ class DolGraph
*/ */
function draw($file) function draw($file)
{ {
if (! is_array($this->data) || sizeof($this->data) < 1) if (! is_array($this->data) || count($this->data) < 1)
{ {
$this->error="Call to draw method was made but SetData was not called or called with an empty dataset for parameters"; $this->error="Call to draw method was made but SetData was not called or called with an empty dataset for parameters";
dol_syslog("DolGraph::draw ".$this->error, LOG_ERR); dol_syslog("DolGraph::draw ".$this->error, LOG_ERR);
@ -471,7 +471,7 @@ class DolGraph
// On boucle sur chaque lot de donnees // On boucle sur chaque lot de donnees
$legends=array(); $legends=array();
$i=0; $i=0;
$nblot=sizeof($this->data[0])-1; $nblot=count($this->data[0])-1;
while ($i < $nblot) while ($i < $nblot)
{ {
@ -558,7 +558,7 @@ class DolGraph
$group->legend->setTextFont(new $artichow_defaultfont(10)); // This is to force Artichow to use awFileFontDriver to $group->legend->setTextFont(new $artichow_defaultfont(10)); // This is to force Artichow to use awFileFontDriver to
// solve a bug in Artichow with UTF8 // solve a bug in Artichow with UTF8
if (sizeof($this->Legend)) if (count($this->Legend))
{ {
if ($this->type == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND); if ($this->type == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND);
if ($this->type == 'lines') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE); if ($this->type == 'lines') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE);

View File

@ -143,7 +143,7 @@ class HookManager
if ($method == 'doActions' && method_exists($actioninstance,$method)) if ($method == 'doActions' && method_exists($actioninstance,$method))
{ {
$resaction+=$actioninstance->doActions($parameters, $object, $action); // action can be changed by method (to go back to other action for example), socid can be changed/set by method (during creation for example) $resaction+=$actioninstance->doActions($parameters, $object, $action); // action can be changed by method (to go back to other action for example), socid can be changed/set by method (during creation for example)
if ($resaction < 0 || ! empty($actioninstance->error) || (! empty($actioninstance->errors) && sizeof($actioninstance->errors) > 0)) if ($resaction < 0 || ! empty($actioninstance->error) || (! empty($actioninstance->errors) && count($actioninstance->errors) > 0))
{ {
$this->error=$actioninstance->error; $this->errors=$actioninstance->errors; $this->error=$actioninstance->error; $this->errors=$actioninstance->errors;
if ($action=='add') $action='create'; // TODO this change must be inside the doActions if ($action=='add') $action='create'; // TODO this change must be inside the doActions
@ -153,7 +153,7 @@ class HookManager
else if ($method == 'showInputFields' && method_exists($actioninstance,$method)) else if ($method == 'showInputFields' && method_exists($actioninstance,$method))
{ {
$resaction+=$actioninstance->showInputFields($parameters, $object, $action); // action can be changed by method (to go back to other action for example), socid can be changed/set by method (during creation for example) $resaction+=$actioninstance->showInputFields($parameters, $object, $action); // action can be changed by method (to go back to other action for example), socid can be changed/set by method (during creation for example)
if ($resaction < 0 || ! empty($actioninstance->error) || (! empty($actioninstance->errors) && sizeof($actioninstance->errors) > 0)) if ($resaction < 0 || ! empty($actioninstance->error) || (! empty($actioninstance->errors) && count($actioninstance->errors) > 0))
{ {
$this->error=$actioninstance->error; $this->errors=$actioninstance->errors; $this->error=$actioninstance->error; $this->errors=$actioninstance->errors;
} }
@ -161,7 +161,7 @@ class HookManager
else if ($method == 'showOutputFields' && method_exists($actioninstance,$method)) else if ($method == 'showOutputFields' && method_exists($actioninstance,$method))
{ {
$resaction+=$actioninstance->showOutputFields($parameters, $object, $action); // action can be changed by method (to go back to other action for example), socid can be changed/set by method (during creation for example) $resaction+=$actioninstance->showOutputFields($parameters, $object, $action); // action can be changed by method (to go back to other action for example), socid can be changed/set by method (during creation for example)
if ($resaction < 0 || ! empty($actioninstance->error) || (! empty($actioninstance->errors) && sizeof($actioninstance->errors) > 0)) if ($resaction < 0 || ! empty($actioninstance->error) || (! empty($actioninstance->errors) && count($actioninstance->errors) > 0))
{ {
$this->error=$actioninstance->error; $this->errors=$actioninstance->errors; $this->error=$actioninstance->error; $this->errors=$actioninstance->errors;
} }

View File

@ -723,8 +723,8 @@ class Form
if ($htmlname != 'none') if ($htmlname != 'none')
{ {
$disabled=0; $disabled=0;
if (is_array($exclude) && sizeof($exclude) && in_array($obj->rowid,$exclude)) $disabled=1; if (is_array($exclude) && count($exclude) && in_array($obj->rowid,$exclude)) $disabled=1;
if (is_array($limitto) && sizeof($limitto) && ! in_array($obj->rowid,$limitto)) $disabled=1; if (is_array($limitto) && count($limitto) && ! in_array($obj->rowid,$limitto)) $disabled=1;
if ($selected && $selected == $obj->rowid) if ($selected && $selected == $obj->rowid)
{ {
print '<option value="'.$obj->rowid.'"'; print '<option value="'.$obj->rowid.'"';
@ -854,7 +854,7 @@ class Form
$userstatic->prenom=$obj->firstname; $userstatic->prenom=$obj->firstname;
$disableline=0; $disableline=0;
if (is_array($enableonly) && sizeof($enableonly) && ! in_array($obj->rowid,$enableonly)) $disableline=1; if (is_array($enableonly) && count($enableonly) && ! in_array($obj->rowid,$enableonly)) $disableline=1;
if ((is_object($selected) && $selected->id == $obj->rowid) || (! is_object($selected) && $selected == $obj->rowid)) if ((is_object($selected) && $selected->id == $obj->rowid) || (! is_object($selected) && $selected == $obj->rowid))
{ {
@ -1769,7 +1769,7 @@ class Form
foreach($this->cache_types_paiements as $id => $arraytypes) foreach($this->cache_types_paiements as $id => $arraytypes)
{ {
// On passe si on a demande de filtrer sur des modes de paiments particuliers // On passe si on a demande de filtrer sur des modes de paiments particuliers
if (sizeof($filterarray) && ! in_array($arraytypes['type'],$filterarray)) continue; if (count($filterarray) && ! in_array($arraytypes['type'],$filterarray)) continue;
// We discard empty line if showempty is on because an empty line has already been output. // We discard empty line if showempty is on because an empty line has already been output.
if ($empty && empty($arraytypes['code'])) continue; if ($empty && empty($arraytypes['code'])) continue;
@ -2917,10 +2917,10 @@ class Form
// Comme ils sont tries par ordre croissant, dernier = plus eleve = taux courant // Comme ils sont tries par ordre croissant, dernier = plus eleve = taux courant
if ($defaulttx < 0 || dol_strlen($defaulttx) == 0) if ($defaulttx < 0 || dol_strlen($defaulttx) == 0)
{ {
$defaulttx = $txtva[sizeof($txtva)-1]; $defaulttx = $txtva[count($txtva)-1];
} }
$nbdetaux = sizeof($txtva); $nbdetaux = count($txtva);
if ($nbdetaux > 0) if ($nbdetaux > 0)
{ {
$return.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; $return.= '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';

View File

@ -511,7 +511,7 @@ class FormCompany
{ {
// For ajax search we limit here. For combo list, we limit later // For ajax search we limit here. For combo list, we limit later
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT
&& is_array($limitto) && sizeof($limitto)) && is_array($limitto) && count($limitto))
{ {
$sql.= " WHERE rowid in (".join(',',$limitto).")"; $sql.= " WHERE rowid in (".join(',',$limitto).")";
} }
@ -571,7 +571,7 @@ class FormCompany
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
if ($i == 0) $firstCompany = $obj->rowid; if ($i == 0) $firstCompany = $obj->rowid;
$disabled=0; $disabled=0;
if (is_array($limitto) && sizeof($limitto) && ! in_array($obj->rowid,$limitto)) $disabled=1; if (is_array($limitto) && count($limitto) && ! in_array($obj->rowid,$limitto)) $disabled=1;
if ($selected > 0 && $selected == $obj->rowid) if ($selected > 0 && $selected == $obj->rowid)
{ {
print '<option value="'.$obj->rowid.'"'; print '<option value="'.$obj->rowid.'"';

View File

@ -389,13 +389,13 @@ class FormFile
{ {
$out.= '<td align="center" class="formdoc">'; $out.= '<td align="center" class="formdoc">';
$out.= $langs->trans('Model').' '; $out.= $langs->trans('Model').' ';
if (is_array($modellist) && sizeof($modellist) == 1) // If there is only one element if (is_array($modellist) && count($modellist) == 1) // If there is only one element
{ {
$arraykeys=array_keys($modellist); $arraykeys=array_keys($modellist);
$modelselected=$arraykeys[0]; $modelselected=$arraykeys[0];
} }
$out.= $html->selectarray('model',$modellist,$modelselected,$showempty,0,0); $out.= $html->selectarray('model',$modellist,$modelselected,$showempty,0,0);
if (sizeof($cgvlist) > 0) if (count($cgvlist) > 0)
{ {
$out.= $html->selectarray('cgv',$cgvlist,"-1",1,0,1); $out.= $html->selectarray('cgv',$cgvlist,"-1",1,0,1);
} }
@ -410,7 +410,7 @@ class FormFile
// Language code (if multilang) // Language code (if multilang)
$out.= '<td align="center" class="formdoc">'; $out.= '<td align="center" class="formdoc">';
if (($allowgenifempty || (is_array($modellist) && sizeof($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang) if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang)
{ {
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'); include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php');
$formadmin=new FormAdmin($this->db); $formadmin=new FormAdmin($this->db);
@ -456,7 +456,7 @@ class FormFile
$file_list=dol_dir_list($filedir,'files',0,$filter,'\.meta$'.($png?'|'.$png:''),'date',SORT_DESC); $file_list=dol_dir_list($filedir,'files',0,$filter,'\.meta$'.($png?'|'.$png:''),'date',SORT_DESC);
// Affiche en-tete tableau si non deja affiche // Affiche en-tete tableau si non deja affiche
if (sizeof($file_list) && ! $headershown && !$iconPDF) if (count($file_list) && ! $headershown && !$iconPDF)
{ {
$headershown=1; $headershown=1;
$out.= '<div class="titre">'.$titletoshow.'</div>'; $out.= '<div class="titre">'.$titletoshow.'</div>';
@ -561,7 +561,7 @@ class FormFile
print_liste_field_titre('','',''); print_liste_field_titre('','','');
print '</tr>'; print '</tr>';
$nboffiles=sizeof($filearray); $nboffiles=count($filearray);
if ($nboffiles > 0) include_once(DOL_DOCUMENT_ROOT.'/lib/images.lib.php'); if ($nboffiles > 0) include_once(DOL_DOCUMENT_ROOT.'/lib/images.lib.php');
@ -719,7 +719,7 @@ class FormFile
print "</td></tr>\n"; print "</td></tr>\n";
} }
} }
if (sizeof($filearray) == 0) if (count($filearray) == 0)
{ {
print '<tr '.$bc[$var].'><td colspan="4">'; print '<tr '.$bc[$var].'><td colspan="4">';
if (empty($textifempty)) print $langs->trans("NoFileFound"); if (empty($textifempty)) print $langs->trans("NoFileFound");

View File

@ -514,7 +514,7 @@ class FormMail
$out.= ' });'; $out.= ' });';
$out.= '})'; $out.= '})';
$out.= '</script>'."\n"; $out.= '</script>'."\n";
if (sizeof($listofpaths)) if (count($listofpaths))
{ {
foreach($listofpaths as $key => $val) foreach($listofpaths as $key => $val)
{ {

View File

@ -370,7 +370,7 @@ class FormOther
function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='')
{ {
global $langs; global $langs;
if (! is_array($arrayofcolors) || sizeof($arrayofcolors) < 1) if (! is_array($arrayofcolors) || count($arrayofcolors) < 1)
{ {
$langs->load("other"); $langs->load("other");
print '<link rel="stylesheet" media="screen" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css" />'; print '<link rel="stylesheet" media="screen" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/jpicker/css/jPicker-1.1.6.css" />';
@ -662,7 +662,7 @@ function PLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selecte
$lastprojectid=0; $lastprojectid=0;
$numlines=sizeof($lines); $numlines=count($lines);
for ($i = 0 ; $i < $numlines ; $i++) for ($i = 0 ; $i < $numlines ; $i++)
{ {
if ($lines[$i]->fk_parent == $parent) if ($lines[$i]->fk_parent == $parent)

View File

@ -195,7 +195,7 @@ function limitChars(textarea, limit, infodiv)
dol_syslog("Warning: The SMS sending method has not been defined into MAIN_SMS_SENDMODE", LOG_WARNING); dol_syslog("Warning: The SMS sending method has not been defined into MAIN_SMS_SENDMODE", LOG_WARNING);
$resultsender[0]->number=$this->fromsms; $resultsender[0]->number=$this->fromsms;
} }
if (sizeof($resultsender) > 0) if (count($resultsender) > 0)
{ {
print '<select name="fromsms" id="valid" class="flat">'; print '<select name="fromsms" id="valid" class="flat">';
foreach($resultsender as $obj) foreach($resultsender as $obj)

View File

@ -57,7 +57,7 @@ class Menu {
*/ */
function add($url, $titre, $level=0, $enabled=1, $target='',$mainmenu='') function add($url, $titre, $level=0, $enabled=1, $target='',$mainmenu='')
{ {
$i = sizeof($this->liste); $i = count($this->liste);
$this->liste[$i]['url'] = $url; $this->liste[$i]['url'] = $url;
$this->liste[$i]['titre'] = $titre; $this->liste[$i]['titre'] = $titre;
$this->liste[$i]['level'] = $level; $this->liste[$i]['level'] = $level;
@ -71,7 +71,7 @@ class Menu {
*/ */
function remove_last() function remove_last()
{ {
if (sizeof($this->liste) > 1) array_pop($this->liste); if (count($this->liste) > 1) array_pop($this->liste);
} }
} }

View File

@ -411,7 +411,7 @@ class Menubase
$leftmenu=$myleftmenu; // To export to dol_eval function $leftmenu=$myleftmenu; // To export to dol_eval function
// Load datas into tabMenu // Load datas into tabMenu
if (sizeof($tabMenu) == 0) if (count($tabMenu) == 0)
{ {
$this->menuLoad($leftmenu, $type_user, $menu_handler, $tabMenu); $this->menuLoad($leftmenu, $type_user, $menu_handler, $tabMenu);
} }
@ -464,7 +464,7 @@ class Menubase
$this->newmenu = $newmenu; $this->newmenu = $newmenu;
// Load datas into tabMenu // Load datas into tabMenu
if (sizeof($tabMenu) == 0) if (count($tabMenu) == 0)
{ {
$this->menuLoad($leftmenu, $type_user, $menu_handler, $tabMenu); $this->menuLoad($leftmenu, $type_user, $menu_handler, $tabMenu);
} }

View File

@ -206,7 +206,7 @@ class Notify
$message, $message,
array($file), array($file),
array($mimefile), array($mimefile),
array($filename[sizeof($filename)-1]), array($filename[count($filename)-1]),
'', '', 0, $msgishtml '', '', 0, $msgishtml
); );

View File

@ -229,7 +229,7 @@ class Translate {
require_once(DOL_DOCUMENT_ROOT ."/lib/memory.lib.php"); require_once(DOL_DOCUMENT_ROOT ."/lib/memory.lib.php");
$tmparray=dol_getcache($usecachekey); $tmparray=dol_getcache($usecachekey);
if (is_array($tmparray) && sizeof($tmparray)) if (is_array($tmparray) && count($tmparray))
{ {
$this->tab_translate=array_merge($tmparray,$this->tab_translate); // Already found values tab_translate overwrites duplicates $this->tab_translate=array_merge($tmparray,$this->tab_translate); // Already found values tab_translate overwrites duplicates
//print $newdomain."\n"; //print $newdomain."\n";
@ -281,7 +281,7 @@ class Translate {
// TODO Move cache write out of loop on dirs // TODO Move cache write out of loop on dirs
// To save lang content for usecachekey into cache // To save lang content for usecachekey into cache
if ($usecachekey && sizeof($tabtranslatedomain)) if ($usecachekey && count($tabtranslatedomain))
{ {
$ressetcache=dol_setcache($usecachekey,$tabtranslatedomain); $ressetcache=dol_setcache($usecachekey,$tabtranslatedomain);
if ($ressetcache < 0) if ($ressetcache < 0)

View File

@ -560,7 +560,7 @@ class EcmDirectory // extends CommonObject
{ {
if (is_array($this->cats[$obj->rowid]['id_children'])) if (is_array($this->cats[$obj->rowid]['id_children']))
{ {
$newelempos=sizeof($this->cats[$obj->rowid]['id_children']); $newelempos=count($this->cats[$obj->rowid]['id_children']);
//print "this->cats[$i]['id_children'] est deja un tableau de $newelem elements<br>"; //print "this->cats[$i]['id_children'] est deja un tableau de $newelem elements<br>";
$this->cats[$obj->rowid]['id_children'][$newelempos]=$obj->rowid_fille; $this->cats[$obj->rowid]['id_children'][$newelempos]=$obj->rowid_fille;
} }
@ -653,7 +653,7 @@ class EcmDirectory // extends CommonObject
// Update request // Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET";
$sql.= " cachenbofdoc = '".sizeof($filelist)."'"; $sql.= " cachenbofdoc = '".count($filelist)."'";
if (empty($all)) // By default if (empty($all)) // By default
{ {
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
@ -667,7 +667,7 @@ class EcmDirectory // extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$this->cachenbofdoc=sizeof($filelist); $this->cachenbofdoc=count($filelist);
return $this->cachenbofdoc; return $this->cachenbofdoc;
} }
else else

View File

@ -63,7 +63,7 @@ class FormEcm
$output = '<select class="flat" name="'.$select_name.'">'; $output = '<select class="flat" name="'.$select_name.'">';
if (is_array($cate_arbo)) if (is_array($cate_arbo))
{ {
if (! sizeof($cate_arbo)) $output.= '<option value="-1" disabled="disabled">'.$langs->trans("NoCategoriesDefined").'</option>'; if (! count($cate_arbo)) $output.= '<option value="-1" disabled="disabled">'.$langs->trans("NoCategoriesDefined").'</option>';
else else
{ {
$output.= '<option value="-1">&nbsp;</option>'; $output.= '<option value="-1">&nbsp;</option>';

View File

@ -224,7 +224,7 @@ print '</td></tr>';
print '/ecm/'.$relativepath; print '/ecm/'.$relativepath;
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("ECMNbOfDocs").'</td><td>'; print '<tr><td>'.$langs->trans("ECMNbOfDocs").'</td><td>';
print sizeof($filearray); print count($filearray);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>';
print dol_print_size($totalsize); print dol_print_size($totalsize);

View File

@ -280,7 +280,7 @@ print '<tr><td>'.$langs->trans("ECMDirectoryForFiles").'</td><td>';
print '/ecm/'.$relativepath; print '/ecm/'.$relativepath;
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("ECMNbOfDocs").'</td><td>'; print '<tr><td>'.$langs->trans("ECMNbOfDocs").'</td><td>';
print sizeof($filearray); print count($filearray);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td>';
print dol_print_size($totalsize); print dol_print_size($totalsize);
@ -321,7 +321,7 @@ if ($_GET["action"] != 'edit' && $_GET['action'] != 'delete')
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('ECMAddSection').'</a>'; print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans('ECMAddSection').'</a>';
} }
if (sizeof($filearray) == 0) if (count($filearray) == 0)
{ {
if ($user->rights->ecm->setup) if ($user->rights->ecm->setup)
{ {

View File

@ -154,7 +154,7 @@ else
print '<table class="border"width="100%">'; print '<table class="border"width="100%">';
// Nbre fichiers // Nbre fichiers
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
//Total taille //Total taille
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';

View File

@ -463,7 +463,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
$showonrightsize=''; $showonrightsize='';
if (sizeof($sectionauto)) if (count($sectionauto))
{ {
// Root title line (Automatic section) // Root title line (Automatic section)
print '<tr>'; print '<tr>';

View File

@ -210,7 +210,8 @@ class Expedition extends CommonObject
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
// Insertion des lignes // Insertion des lignes
for ($i = 0 ; $i < sizeof($this->lines) ; $i++) $num=count($this->lines);
for ($i = 0; $i < $num; $i++)
{ {
if (! $this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty) > 0) if (! $this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty) > 0)
{ {
@ -617,7 +618,7 @@ class Expedition extends CommonObject
*/ */
function addline( $entrepot_id, $id, $qty ) function addline( $entrepot_id, $id, $qty )
{ {
$num = sizeof($this->lines); $num = count($this->lines);
$line = new ExpeditionLigne($this->db); $line = new ExpeditionLigne($this->db);
$line->entrepot_id = $entrepot_id; $line->entrepot_id = $entrepot_id;

View File

@ -99,7 +99,8 @@ if ($action == 'add')
$object->ref_int = $_POST["ref_int"]; $object->ref_int = $_POST["ref_int"];
//var_dump($_POST);exit; //var_dump($_POST);exit;
for ($i = 0 ; $i < sizeof($objectsrc->lines) ; $i++) $num=count($objectsrc->lines);
for ($i = 0; $i < $num; $i++)
{ {
$qty = "qtyl".$i; $qty = "qtyl".$i;
if ($_POST[$qty] > 0) if ($_POST[$qty] > 0)
@ -625,7 +626,7 @@ if ($action == 'create')
print '<br><table class="nobordernopadding" width="100%">'; print '<br><table class="nobordernopadding" width="100%">';
//$lines = $object->fetch_lines(1); //$lines = $object->fetch_lines(1);
$numAsked = sizeof($object->lines); $numAsked = count($object->lines);
/* Lecture des expeditions deja effectuees */ /* Lecture des expeditions deja effectuees */
$object->loadExpeditions(); $object->loadExpeditions();
@ -784,7 +785,7 @@ if ($action == 'create')
{ {
$product->get_sousproduits_arbo (); $product->get_sousproduits_arbo ();
$prods_arbo = $product->get_arbo_each_prod($qtyProdCom); $prods_arbo = $product->get_arbo_each_prod($qtyProdCom);
if(sizeof($prods_arbo) > 0) if(count($prods_arbo) > 0)
{ {
foreach($prods_arbo as $key => $value) foreach($prods_arbo as $key => $value)
{ {
@ -831,7 +832,7 @@ else
exit -1; exit -1;
} }
$lines = $object->lines; $lines = $object->lines;
$num_prod = sizeof($lines); $num_prod = count($lines);
if ($object->id > 0) if ($object->id > 0)
{ {

View File

@ -533,7 +533,7 @@ if ($id > 0 || ! empty($ref))
// Define a new tree with quantiies recalculated // Define a new tree with quantiies recalculated
$prods_arbo = $product->get_arbo_each_prod($qtyProdCom); $prods_arbo = $product->get_arbo_each_prod($qtyProdCom);
//var_dump($prods_arbo); //var_dump($prods_arbo);
if(sizeof($prods_arbo) > 0) if(count($prods_arbo) > 0)
{ {
foreach($prods_arbo as $key => $value) foreach($prods_arbo as $key => $value)
{ {

View File

@ -93,14 +93,14 @@ if ($action=='selectfield')
foreach($fieldsarray as $key=>$val) foreach($fieldsarray as $key=>$val)
{ {
if (! empty($array_selected[$key])) continue; // If already selected, select next if (! empty($array_selected[$key])) continue; // If already selected, select next
$array_selected[$key]=sizeof($array_selected)+1; $array_selected[$key]=count($array_selected)+1;
//print_r($array_selected); //print_r($array_selected);
$_SESSION["export_selected_fields"]=$array_selected; $_SESSION["export_selected_fields"]=$array_selected;
} }
} }
else else
{ {
$array_selected[$_GET["field"]]=sizeof($array_selected)+1; $array_selected[$_GET["field"]]=count($array_selected)+1;
//print_r($array_selected); //print_r($array_selected);
$_SESSION["export_selected_fields"]=$array_selected; $_SESSION["export_selected_fields"]=$array_selected;
} }
@ -281,7 +281,7 @@ if ($step == 1 || ! $datatoexport)
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
$val=true; $val=true;
if (sizeof($objexport->array_export_code)) if (count($objexport->array_export_code))
{ {
foreach ($objexport->array_export_code as $key => $value) foreach ($objexport->array_export_code as $key => $value)
{ {
@ -420,7 +420,7 @@ if ($step == 2 && $datatoexport)
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
// If value of entityicon=entitylang='icon:Label' // If value of entityicon=entitylang='icon:Label'
$tmparray=explode(':',$entityicon); $tmparray=explode(':',$entityicon);
if (sizeof($tmparray) >=2) if (count($tmparray) >=2)
{ {
$entityicon=$tmparray[0]; $entityicon=$tmparray[0];
$entitylang=$tmparray[1]; $entitylang=$tmparray[1];
@ -472,7 +472,7 @@ if ($step == 2 && $datatoexport)
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if (sizeof($array_selected)) if (count($array_selected))
{ {
print '<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.'">'.$langs->trans("NextStep").'</a>'; print '<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.'">'.$langs->trans("NextStep").'</a>';
} }
@ -567,7 +567,7 @@ if ($step == 3 && $datatoexport)
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
// If value of entityicon=entitylang='icon:Label' // If value of entityicon=entitylang='icon:Label'
$tmparray=explode(':',$entityicon); $tmparray=explode(':',$entityicon);
if (sizeof($tmparray) >=2) if (count($tmparray) >=2)
{ {
$entityicon=$tmparray[0]; $entityicon=$tmparray[0];
$entitylang=$tmparray[1]; $entitylang=$tmparray[1];
@ -587,7 +587,7 @@ if ($step == 3 && $datatoexport)
print '<td align="right" width="100">'; print '<td align="right" width="100">';
print $value.' '; print $value.' ';
print '</td><td align="center" width="20">'; print '</td><td align="center" width="20">';
if ($value < sizeof($array_selected)) print '<a href="'.$_SERVER["PHP_SELF"].'?step=3&datatoexport='.$datatoexport.'&action=downfield&field='.$code.'">'.img_down().'</a>'; if ($value < count($array_selected)) print '<a href="'.$_SERVER["PHP_SELF"].'?step=3&datatoexport='.$datatoexport.'&action=downfield&field='.$code.'">'.img_down().'</a>';
if ($value > 1) print '<a href="'.$_SERVER["PHP_SELF"].'?step=3&datatoexport='.$datatoexport.'&action=upfield&field='.$code.'">'.img_up().'</a>'; if ($value > 1) print '<a href="'.$_SERVER["PHP_SELF"].'?step=3&datatoexport='.$datatoexport.'&action=upfield&field='.$code.'">'.img_up().'</a>';
print '</td>'; print '</td>';
@ -610,7 +610,7 @@ if ($step == 3 && $datatoexport)
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if (sizeof($array_selected)) if (count($array_selected))
{ {
print '<a class="butAction" href="export.php?step=4&datatoexport='.$datatoexport.'">'.$langs->trans("NextStep").'</a>'; print '<a class="butAction" href="export.php?step=4&datatoexport='.$datatoexport.'">'.$langs->trans("NextStep").'</a>';
} }
@ -619,7 +619,7 @@ if ($step == 3 && $datatoexport)
// Area for profils export // Area for profils export
if (sizeof($array_selected)) if (count($array_selected))
{ {
print '<br>'; print '<br>';
print $langs->trans("SaveExportModel"); print $langs->trans("SaveExportModel");

View File

@ -95,7 +95,7 @@ print '<td>'.$langs->trans("ExportableDatas").'</td>';
//print '<td>&nbsp;</td>'; //print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
$var=true; $var=true;
if (sizeof($export->array_export_code)) if (count($export->array_export_code))
{ {
foreach ($export->array_export_code as $key => $value) foreach ($export->array_export_code as $key => $value)
{ {
@ -123,7 +123,7 @@ print '</table>';
print '<br>'; print '<br>';
print '<center>'; print '<center>';
if (sizeof($export->array_export_code)) if (count($export->array_export_code))
{ {
if ($user->rights->export->creer) if ($user->rights->export->creer)
{ {

View File

@ -261,7 +261,7 @@ if ($id > 0)
foreach(array('internal','external') as $source) foreach(array('internal','external') as $source)
{ {
$tab = $fichinter->liste_contact(-1,$source); $tab = $fichinter->liste_contact(-1,$source);
$num=sizeof($tab); $num=count($tab);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)

View File

@ -148,7 +148,7 @@ if ($object->id)
// Societe // Societe
print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>"; print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>";
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>'; print '</table>';

View File

@ -1067,7 +1067,7 @@ elseif ($fichinterid)
if ($action != 'editdescription') if ($action != 'editdescription')
{ {
// Validate // Validate
if ($object->statut == 0 && $user->rights->ficheinter->creer && sizeof($object->lines) > 0) if ($object->statut == 0 && $user->rights->ficheinter->creer && count($object->lines) > 0)
{ {
print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=validate"'; print '<a class="butAction" href="fiche.php?id='.$object->id.'&action=validate"';
print '>'.$langs->trans("Valid").'</a>'; print '>'.$langs->trans("Valid").'</a>';

View File

@ -417,7 +417,8 @@ class CommandeFournisseur extends Commande
{ {
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
for ($i = 0 ; $i < sizeof($this->lines) ; $i++) $num=count($this->lines);
for ($i = 0; $i < $num; $i++)
{ {
if ($this->lines[$i]->fk_product > 0) if ($this->lines[$i]->fk_product > 0)
{ {
@ -643,7 +644,8 @@ class CommandeFournisseur extends Commande
{ {
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
for ($i = 0 ; $i < sizeof($this->lines) ; $i++) $num=count($this->lines);
for ($i = 0; $i < $num; $i++)
{ {
// Product with reference // Product with reference
if ($this->lines[$i]->fk_product > 0) if ($this->lines[$i]->fk_product > 0)
@ -1404,7 +1406,8 @@ class CommandeFournisseur extends Commande
$this->lines = array(); $this->lines = array();
for ($i = 0 ; $i < sizeof($comclient->lines) ; $i++) $num=count($comclient->lines);
for ($i = 0; $i < $num; $i++)
{ {
$prod = new Product($this->db); $prod = new Product($this->db);
if ($prod->fetch($comclient->lines[$i]->fk_product) > 0) if ($prod->fetch($comclient->lines[$i]->fk_product) > 0)

View File

@ -792,7 +792,8 @@ class FactureFournisseur extends Facture
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
$langs->load("agenda"); $langs->load("agenda");
for ($i = 0 ; $i < sizeof($this->lines) ; $i++) $num=count($this->lines);
for ($i = 0; $i < $num; $i++)
{ {
if ($this->lines[$i]->fk_product > 0) if ($this->lines[$i]->fk_product > 0)
{ {
@ -867,7 +868,8 @@ class FactureFournisseur extends Facture
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
$langs->load("agenda"); $langs->load("agenda");
for ($i = 0 ; $i < sizeof($this->lines) ; $i++) $num=count($this->lines);
for ($i = 0; $i < $num; $i++)
{ {
if ($this->lines[$i]->fk_product > 0) if ($this->lines[$i]->fk_product > 0)
{ {

View File

@ -251,7 +251,7 @@ class PaiementFourn extends Paiement
$billsarray=$this->getBillsArray('paye=1'); $billsarray=$this->getBillsArray('paye=1');
if (is_array($billsarray)) if (is_array($billsarray))
{ {
if (sizeof($billsarray)) if (count($billsarray))
{ {
$this->error='Impossible de supprimer un paiement portant sur au moins une facture a l\'etat paye'; $this->error='Impossible de supprimer un paiement portant sur au moins une facture a l\'etat paye';
$this->db->rollback(); $this->db->rollback();

View File

@ -268,7 +268,7 @@ if ($id > 0 || ! empty($ref))
foreach(array('internal','external') as $source) foreach(array('internal','external') as $source)
{ {
$tab = $commande->liste_contact(-1,$source); $tab = $commande->liste_contact(-1,$source);
$num=sizeof($tab); $num=count($tab);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)

View File

@ -282,7 +282,7 @@ if ($id > 0 || ! empty($ref))
// Warehouse // Warehouse
print '<td align="right">'; print '<td align="right">';
if (sizeof($listwarehouses)) if (count($listwarehouses))
{ {
print $html->selectarray("entrepot_".$i, $listwarehouses, '', $disabled, 0, 0, '', 0, 0, $disabled); print $html->selectarray("entrepot_".$i, $listwarehouses, '', $disabled, 0, 0, '', 0, 0, $disabled);
} }

View File

@ -190,7 +190,7 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="2">'.$author->getNomUrl(1).'</td>'; print '<td colspan="2">'.$author->getNomUrl(1).'</td>';
print '</tr>'; print '</tr>';
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.sizeof($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>'; print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print "</table>\n"; print "</table>\n";

View File

@ -1033,7 +1033,7 @@ if ($id > 0 || ! empty($ref))
*/ */
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
$num = sizeof($object->lines); $num = count($object->lines);
$i = 0; $total = 0; $i = 0; $total = 0;
if ($num) if ($num)

View File

@ -262,7 +262,7 @@ if ($id > 0)
foreach(array('internal','external') as $source) foreach(array('internal','external') as $source)
{ {
$tab = $facture->liste_contact(-1,$source); $tab = $facture->liste_contact(-1,$source);
$num=sizeof($tab); $num=count($tab);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)

View File

@ -161,7 +161,7 @@ if ($facid > 0)
// Societe // Societe
print '<tr><td>'.$langs->trans('Supplier').'</td><td colspan="3">'.$facture->thirdparty->getNomUrl(1).'</td></tr>'; print '<tr><td>'.$langs->trans('Supplier').'</td><td colspan="3">'.$facture->thirdparty->getNomUrl(1).'</td></tr>';
print '<tr><td>'.$langs->trans('NbOfAttachedFiles').'</td><td colspan="3">'.sizeof($filearray).'</td></tr>'; print '<tr><td>'.$langs->trans('NbOfAttachedFiles').'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans('TotalSizeOfAttachedFiles').'</td><td colspan="3">'.$totalsize.' '.$langs->trans('bytes').'</td></tr>'; print '<tr><td>'.$langs->trans('TotalSizeOfAttachedFiles').'</td><td colspan="3">'.$totalsize.' '.$langs->trans('bytes').'</td></tr>';

View File

@ -266,7 +266,8 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer)
$lines = $srcobject->lines; $lines = $srcobject->lines;
if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines(); if (empty($lines) && method_exists($srcobject,'fetch_lines')) $lines = $srcobject->fetch_lines();
for ($i = 0 ; $i < sizeof($lines) ; $i++) $num=count($lines);
for ($i = 0; $i < $num; $i++)
{ {
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle); $desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0); $product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
@ -1301,7 +1302,7 @@ else
} }
$facidavoir=$fac->getListIdAvoirFromInvoice(); $facidavoir=$fac->getListIdAvoirFromInvoice();
if (sizeof($facidavoir) > 0) if (count($facidavoir) > 0)
{ {
print ' ('.$langs->transnoentities("InvoiceHasAvoir"); print ' ('.$langs->transnoentities("InvoiceHasAvoir");
$i=0; $i=0;
@ -1488,7 +1489,8 @@ else
print '<br>'; print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
$var=1; $var=1;
for ($i = 0 ; $i < sizeof($fac->lines) ; $i++) $num=count($fac->lines);
for ($i = 0; $i < $num; $i++)
{ {
if ($i == 0) if ($i == 0)
{ {
@ -1795,7 +1797,7 @@ else
//Validate //Validate
if ($_GET['action'] != 'edit' && $fac->statut == 0) if ($_GET['action'] != 'edit' && $fac->statut == 0)
{ {
if (sizeof($fac->lines)) if (count($fac->lines))
{ {
if ($user->rights->fournisseur->facture->valider) if ($user->rights->fournisseur->facture->valider)
{ {

View File

@ -283,7 +283,7 @@ else
$companystatic->LoadSupplierCateg(); $companystatic->LoadSupplierCateg();
$categstatic=new Categorie($db); $categstatic=new Categorie($db);
if (sizeof($companystatic->SupplierCategories)) if (count($companystatic->SupplierCategories))
{ {
print '<br>'; print '<br>';

View File

@ -120,7 +120,7 @@ if ($_GET["id"])
$c = new Categorie($db); $c = new Categorie($db);
$cats = $c->containing($_REQUEST['id'],0); $cats = $c->containing($_REQUEST['id'],0);
if (sizeof($cats) > 0) if (count($cats) > 0)
{ {
print "Vous avez stock<63> le produit dans les cat<61>gorie suivantes:<br/><br/>"; print "Vous avez stock<63> le produit dans les cat<61>gorie suivantes:<br/><br/>";
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';

View File

@ -337,7 +337,7 @@ if ($step == 1 || ! $datatoimport)
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
$val=true; $val=true;
if (sizeof($objimport->array_import_code)) if (count($objimport->array_import_code))
{ {
foreach ($objimport->array_import_code as $key => $value) foreach ($objimport->array_import_code as $key => $value)
{ {
@ -635,21 +635,22 @@ if ($step == 4 && $datatoimport)
// Load targets fields in database // Load targets fields in database
$fieldstarget=$objimport->array_import_fields[0]; $fieldstarget=$objimport->array_import_fields[0];
$maxpos=max(sizeof($fieldssource),sizeof($fieldstarget)); $maxpos=max(count($fieldssource),count($fieldstarget));
//var_dump($array_match_file_to_database); //var_dump($array_match_file_to_database);
// Is it a first time in page (if yes, we must initialize array_match_file_to_database) // Is it a first time in page (if yes, we must initialize array_match_file_to_database)
if (sizeof($array_match_file_to_database) == 0) if (count($array_match_file_to_database) == 0)
{ {
// This is first input in screen, we need to define // This is first input in screen, we need to define
// $array_match_file_to_database // $array_match_file_to_database
// $serialized_array_match_file_to_database // $serialized_array_match_file_to_database
// $_SESSION["dol_array_match_file_to_database"] // $_SESSION["dol_array_match_file_to_database"]
$pos=1; $pos=1;
while ($pos <= sizeof($fieldssource)) $num=count($fieldssource);
while ($pos <= $num)
{ {
if (sizeof($fieldssource) >= 1 && $pos <= sizeof($fieldssource)) if ($num >= 1 && $pos <= $num)
{ {
$posbis=1; $posbis=1;
foreach($fieldstarget as $key => $val) foreach($fieldstarget as $key => $val)
@ -800,13 +801,14 @@ if ($step == 4 && $datatoimport)
$valforsourcefieldnb[$lefti]=$key; $valforsourcefieldnb[$lefti]=$key;
$lefti++; $lefti++;
if ($lefti > sizeof($fieldstarget)) break; // Other fields are in the not imported area if ($lefti > count($fieldstarget)) break; // Other fields are in the not imported area
} }
//var_dump($valforsourcefieldnb); //var_dump($valforsourcefieldnb);
// Complete source fields from sizeof($fieldssource)+1 to sizeof($fieldstarget) // Complete source fields from count($fieldssource)+1 to count($fieldstarget)
$more=1; $more=1;
while ($lefti <= sizeof($fieldstarget)) $num=count($fieldssource);
while ($lefti <= $num)
{ {
$var=!$var; $var=!$var;
$newkey=getnewkey($fieldssource,$listofkeys); $newkey=getnewkey($fieldssource,$listofkeys);
@ -849,8 +851,8 @@ if ($step == 4 && $datatoimport)
if (preg_match('/\*$/',$label)) if (preg_match('/\*$/',$label))
{ {
$text='<span class="fieldrequired">'.$text.'</span>'; $text='<span class="fieldrequired">'.$text.'</span>';
$more=((! empty($valforsourcefieldnb[$i]) && $valforsourcefieldnb[$i] <= sizeof($fieldssource)) ? '' : img_warning($langs->trans("FieldNeedSource"))); $more=((! empty($valforsourcefieldnb[$i]) && $valforsourcefieldnb[$i] <= count($fieldssource)) ? '' : img_warning($langs->trans("FieldNeedSource")));
if ($mandatoryfieldshavesource) $mandatoryfieldshavesource=(! empty($valforsourcefieldnb[$i]) && ($valforsourcefieldnb[$i] <= sizeof($fieldssource))); if ($mandatoryfieldshavesource) $mandatoryfieldshavesource=(! empty($valforsourcefieldnb[$i]) && ($valforsourcefieldnb[$i] <= count($fieldssource)));
//print 'xx'.($i).'-'.$valforsourcefieldnb[$i].'-'.$mandatoryfieldshavesource; //print 'xx'.($i).'-'.$valforsourcefieldnb[$i].'-'.$mandatoryfieldshavesource;
} }
print $text; print $text;
@ -860,7 +862,7 @@ if ($step == 4 && $datatoimport)
$filecolumn=$array_match_database_to_file[$code]; $filecolumn=$array_match_database_to_file[$code];
// Source field info // Source field info
$htmltext ='<b><u>'.$langs->trans("FieldSource").'</u></b><br>'; $htmltext ='<b><u>'.$langs->trans("FieldSource").'</u></b><br>';
if ($filecolumn > sizeof($fieldssource)) $htmltext.=$langs->trans("DataComeFromNoWhere").'<br>'; if ($filecolumn > count($fieldssource)) $htmltext.=$langs->trans("DataComeFromNoWhere").'<br>';
else else
{ {
if (empty($objimport->array_import_convertvalue[0][$code])) // If source file does not need convertion if (empty($objimport->array_import_convertvalue[0][$code])) // If source file does not need convertion
@ -991,7 +993,7 @@ if ($step == 4 && $datatoimport)
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if (sizeof($array_match_file_to_database)) if (count($array_match_file_to_database))
{ {
if ($mandatoryfieldshavesource) if ($mandatoryfieldshavesource)
{ {
@ -1007,7 +1009,7 @@ if ($step == 4 && $datatoimport)
// Area for profils import // Area for profils import
if (sizeof($array_match_file_to_database)) if (count($array_match_file_to_database))
{ {
print '<br>'."\n"; print '<br>'."\n";
print '<!-- Area to add new import profile -->'."\n"; print '<!-- Area to add new import profile -->'."\n";
@ -1204,12 +1206,12 @@ if ($step == 5 && $datatoimport)
foreach($array_match_file_to_database as $code=>$label) foreach($array_match_file_to_database as $code=>$label)
{ {
//var_dump($fieldssource); //var_dump($fieldssource);
if ($code > sizeof($fieldssource)) continue; if ($code > count($fieldssource)) continue;
//print $code.'-'.$label; //print $code.'-'.$label;
$alias=preg_replace('/(\..*)$/i','',$label); $alias=preg_replace('/(\..*)$/i','',$label);
$listtables[$alias]=$objimport->array_import_tables[0][$alias]; $listtables[$alias]=$objimport->array_import_tables[0][$alias];
} }
if (sizeof($listtables)) if (count($listtables))
{ {
$newval=''; $newval='';
//ksort($listtables); //ksort($listtables);
@ -1247,12 +1249,12 @@ if ($step == 5 && $datatoimport)
{ {
$i++; $i++;
//var_dump($fieldssource); //var_dump($fieldssource);
if ($code > sizeof($fieldssource)) continue; if ($code > count($fieldssource)) continue;
//print $code.'-'.$label; //print $code.'-'.$label;
$alias=preg_replace('/(\..*)$/i','',$label); $alias=preg_replace('/(\..*)$/i','',$label);
$listfields[$i]=$langs->trans("Field").' '.$code.'->'.$label; $listfields[$i]=$langs->trans("Field").' '.$code.'->'.$label;
} }
print sizeof($listfields)?(join(', ',$listfields)):$langs->trans("Error"); print count($listfields)?(join(', ',$listfields)):$langs->trans("Error");
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
@ -1309,10 +1311,10 @@ if ($step == 5 && $datatoimport)
$arrayrecord=$obj->import_read_record(); $arrayrecord=$obj->import_read_record();
if ($excludefirstline && $sourcelinenb == 1) continue; if ($excludefirstline && $sourcelinenb == 1) continue;
$result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,sizeof($fieldssource),$importid); $result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,count($fieldssource),$importid);
if (sizeof($obj->errors)) $arrayoferrors[$sourcelinenb]=$obj->errors; if (count($obj->errors)) $arrayoferrors[$sourcelinenb]=$obj->errors;
if (sizeof($obj->warnings)) $arrayofwarnings[$sourcelinenb]=$obj->warnings; if (count($obj->warnings)) $arrayofwarnings[$sourcelinenb]=$obj->warnings;
if (! sizeof($obj->errors) && ! sizeof($obj->warnings)) $nbok++; if (! count($obj->errors) && ! count($obj->warnings)) $nbok++;
} }
// Close file // Close file
$obj->import_close_file(); $obj->import_close_file();
@ -1325,21 +1327,21 @@ if ($step == 5 && $datatoimport)
$db->rollback(); // We force rollback because this was just a simulation. $db->rollback(); // We force rollback because this was just a simulation.
// Show OK // Show OK
if (! sizeof($arrayoferrors) && ! sizeof($arrayofwarnings)) print img_picto($langs->trans("OK"),'tick').' <b>'.$langs->trans("NoError").'</b><br><br>'; if (! count($arrayoferrors) && ! count($arrayofwarnings)) print img_picto($langs->trans("OK"),'tick').' <b>'.$langs->trans("NoError").'</b><br><br>';
else print $langs->trans("NbOfLinesOK",$nbok).'</b><br><br>'; else print $langs->trans("NbOfLinesOK",$nbok).'</b><br><br>';
// Show Errors // Show Errors
//var_dump($arrayoferrors); //var_dump($arrayoferrors);
if (sizeof($arrayoferrors)) if (count($arrayoferrors))
{ {
print img_error().' <b>'.$langs->trans("ErrorsOnXLines",sizeof($arrayoferrors)).'</b><br>'; print img_error().' <b>'.$langs->trans("ErrorsOnXLines",count($arrayoferrors)).'</b><br>';
print '<table width="100%" class="border"><tr><td>'; print '<table width="100%" class="border"><tr><td>';
foreach ($arrayoferrors as $key => $val) foreach ($arrayoferrors as $key => $val)
{ {
$nboferrors++; $nboferrors++;
if ($nboferrors > $maxnboferrors) if ($nboferrors > $maxnboferrors)
{ {
print $langs->trans("TooMuchErrors",(sizeof($arrayoferrors)-$nboferrors))."<br>"; print $langs->trans("TooMuchErrors",(count($arrayoferrors)-$nboferrors))."<br>";
break; break;
} }
print '* '.$langs->trans("Line").' '.$key.'<br>'; print '* '.$langs->trans("Line").' '.$key.'<br>';
@ -1354,16 +1356,16 @@ if ($step == 5 && $datatoimport)
// Show Warnings // Show Warnings
//var_dump($arrayoferrors); //var_dump($arrayoferrors);
if (sizeof($arrayofwarnings)) if (count($arrayofwarnings))
{ {
print img_warning().' <b>'.$langs->trans("WarningsOnXLines",sizeof($arrayofwarnings)).'</b><br>'; print img_warning().' <b>'.$langs->trans("WarningsOnXLines",count($arrayofwarnings)).'</b><br>';
print '<table width="100%" class="border"><tr><td>'; print '<table width="100%" class="border"><tr><td>';
foreach ($arrayofwarnings as $key => $val) foreach ($arrayofwarnings as $key => $val)
{ {
$nbofwarnings++; $nbofwarnings++;
if ($nbofwarnings > $maxnbofwarnings) if ($nbofwarnings > $maxnbofwarnings)
{ {
print $langs->trans("TooMuchWarnings",(sizeof($arrayofwarnings)-$nbofwarnings))."<br>"; print $langs->trans("TooMuchWarnings",(count($arrayofwarnings)-$nbofwarnings))."<br>";
break; break;
} }
print ' * '.$langs->trans("Line").' '.$key.'<br>'; print ' * '.$langs->trans("Line").' '.$key.'<br>';
@ -1553,12 +1555,12 @@ if ($step == 6 && $datatoimport)
foreach($array_match_file_to_database as $code=>$label) foreach($array_match_file_to_database as $code=>$label)
{ {
//var_dump($fieldssource); //var_dump($fieldssource);
if ($code > sizeof($fieldssource)) continue; if ($code > count($fieldssource)) continue;
//print $code.'-'.$label; //print $code.'-'.$label;
$alias=preg_replace('/(\..*)$/i','',$label); $alias=preg_replace('/(\..*)$/i','',$label);
$listtables[$alias]=$objimport->array_import_tables[0][$alias]; $listtables[$alias]=$objimport->array_import_tables[0][$alias];
} }
if (sizeof($listtables)) if (count($listtables))
{ {
$newval=''; $newval='';
foreach ($listtables as $val) foreach ($listtables as $val)
@ -1594,12 +1596,12 @@ if ($step == 6 && $datatoimport)
{ {
$i++; $i++;
//var_dump($fieldssource); //var_dump($fieldssource);
if ($code > sizeof($fieldssource)) continue; if ($code > count($fieldssource)) continue;
//print $code.'-'.$label; //print $code.'-'.$label;
$alias=preg_replace('/(\..*)$/i','',$label); $alias=preg_replace('/(\..*)$/i','',$label);
$listfields[$i]=$langs->trans("Field").' '.$code.'->'.$label; $listfields[$i]=$langs->trans("Field").' '.$code.'->'.$label;
} }
print sizeof($listfields)?(join(', ',$listfields)):$langs->trans("Error"); print count($listfields)?(join(', ',$listfields)):$langs->trans("Error");
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';
@ -1631,10 +1633,10 @@ if ($step == 6 && $datatoimport)
$arrayrecord=$obj->import_read_record(); $arrayrecord=$obj->import_read_record();
if ($excludefirstline && $sourcelinenb == 1) continue; if ($excludefirstline && $sourcelinenb == 1) continue;
$result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,sizeof($fieldssource),$importid); $result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,count($fieldssource),$importid);
if (sizeof($obj->errors)) $arrayoferrors[$sourcelinenb]=$obj->errors; if (count($obj->errors)) $arrayoferrors[$sourcelinenb]=$obj->errors;
if (sizeof($obj->warnings)) $arrayofwarnings[$sourcelinenb]=$obj->warnings; if (count($obj->warnings)) $arrayofwarnings[$sourcelinenb]=$obj->warnings;
if (! sizeof($obj->errors) && ! sizeof($obj->warnings)) $nbok++; if (! count($obj->errors) && ! count($obj->warnings)) $nbok++;
} }
// Close file // Close file
$obj->import_close_file(); $obj->import_close_file();
@ -1644,7 +1646,7 @@ if ($step == 6 && $datatoimport)
print $langs->trans("ErrorFailedToOpenFile",$pathfile); print $langs->trans("ErrorFailedToOpenFile",$pathfile);
} }
if (sizeof($arrayoferrors) > 0) $db->rollback(); // We force rollback because this was errors. if (count($arrayoferrors) > 0) $db->rollback(); // We force rollback because this was errors.
else $db->commit(); // We can commit if no errors. else $db->commit(); // We can commit if no errors.
print '</div>'; print '</div>';
@ -1681,7 +1683,7 @@ function show_elem($fieldssource,$i,$pos,$key,$var,$nostyle='')
print '<div class="box" style="padding: 0px 0px 0px 0px;" id="boxto_'.$pos.'">'."\n"; print '<div class="box" style="padding: 0px 0px 0px 0px;" id="boxto_'.$pos.'">'."\n";
print '<table summary="boxtable'.$pos.'" width="100%" class="nobordernopadding">'."\n"; print '<table summary="boxtable'.$pos.'" width="100%" class="nobordernopadding">'."\n";
if ($pos && $pos > sizeof($fieldssource)) // No fields if ($pos && $pos > count($fieldssource)) // No fields
{ {
print '<tr '.($nostyle?'':$bc[$var]).' height="20">'; print '<tr '.($nostyle?'':$bc[$var]).' height="20">';
print '<td class="nocellnopadding" width="16" style="font-weight: normal">'; print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
@ -1732,7 +1734,7 @@ function show_elem($fieldssource,$i,$pos,$key,$var,$nostyle='')
*/ */
function getnewkey(&$fieldssource,&$listofkey) function getnewkey(&$fieldssource,&$listofkey)
{ {
$i=sizeof($fieldssource)+1; $i=count($fieldssource)+1;
// Max number of key // Max number of key
$maxkey=0; $maxkey=0;
foreach($listofkey as $key=>$val) foreach($listofkey as $key=>$val)

View File

@ -91,7 +91,7 @@ print '<td>'.$langs->trans("ImportableDatas").'</td>';
//print '<td>&nbsp;</td>'; //print '<td>&nbsp;</td>';
print '</tr>'; print '</tr>';
$val=true; $val=true;
if (sizeof($import->array_import_code)) if (count($import->array_import_code))
{ {
foreach ($import->array_import_code as $key => $value) foreach ($import->array_import_code as $key => $value)
{ {
@ -118,7 +118,7 @@ print '</table>';
print '<br>'; print '<br>';
print '<center>'; print '<center>';
if (sizeof($import->array_import_code)) if (count($import->array_import_code))
{ {
//if ($user->rights->import->run) //if ($user->rights->import->run)
//{ //{

View File

@ -119,7 +119,7 @@ class box_comptes extends ModeleBoxes {
} }
// Total // Total
if (sizeof($listofcurrencies) <= 1) if (count($listofcurrencies) <= 1)
{ {
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="right" class="liste_total"', $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="right" class="liste_total"',
'text' => $langs->trans('Total') 'text' => $langs->trans('Total')

View File

@ -101,7 +101,7 @@ class box_external_rss extends ModeleBoxes {
// INFO on items // INFO on items
$items=$rssparser->getItems(); $items=$rssparser->getItems();
$nbitems=sizeof($items); $nbitems=count($items);
for($i = 0; $i < $max && $i < $nbitems; $i++) for($i = 0; $i < $max && $i < $nbitems; $i++)
{ {
$item = $items[$i]; $item = $items[$i];

View File

@ -105,8 +105,8 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
// Define nbcol and nblines of the box to show // Define nbcol and nblines of the box to show
$nbcol=0; $nbcol=0;
if (isset($contents[0])) $nbcol=sizeof($contents[0]); if (isset($contents[0])) $nbcol=count($contents[0]);
$nblines=sizeof($contents); $nblines=count($contents);
print "\n\n<!-- Box start -->\n"; print "\n\n<!-- Box start -->\n";
print '<div class="box" id="boxto_'.$this->box_id.'">'."\n"; print '<div class="box" id="boxto_'.$this->box_id.'">'."\n";
@ -167,7 +167,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
else print '<tr valign="top" '.$bcx[$var].'>'; else print '<tr valign="top" '.$bcx[$var].'>';
// Loop on each TD // Loop on each TD
$nbcolthisline=sizeof($contents[$i]); $nbcolthisline=count($contents[$i]);
for ($j=0; $j < $nbcolthisline; $j++) for ($j=0; $j < $nbcolthisline; $j++)
{ {
// Define tdparam // Define tdparam

View File

@ -234,7 +234,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after)
$alt=0; $alt=0;
if (is_array($menu_array)) if (is_array($menu_array))
{ {
for ($i = 0 ; $i < sizeof($menu_array) ; $i++) $num=count($menu_array);
for ($i = 0; $i < $num; $i++)
{ {
$alt++; $alt++;
if (empty($menu_array[$i]['level'])) if (empty($menu_array[$i]['level']))
@ -314,7 +315,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after)
} }
} }
return sizeof($menu_array); return count($menu_array);
} }
?> ?>

View File

@ -1329,7 +1329,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
$alt=0; $alt=0;
if (is_array($menu_array)) if (is_array($menu_array))
{ {
for ($i = 0 ; $i < sizeof($menu_array) ; $i++) $num=count($menu_array);
for ($i = 0; $i < $num; $i++)
{ {
$alt++; $alt++;
if (empty($menu_array[$i]['level'])) if (empty($menu_array[$i]['level']))
@ -1399,7 +1400,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
} }
} }
return sizeof($menu_array); return count($menu_array);
} }

View File

@ -169,7 +169,8 @@ class MenuLeft {
$this->menu_array=$newmenu->liste; $this->menu_array=$newmenu->liste;
$alt=0; $alt=0;
for ($i = 0 ; $i < sizeof($this->menu_array) ; $i++) $num=count($this->menu_array);
for ($i = 0; $i < $num; $i++)
{ {
$alt++; $alt++;
if (empty($this->menu_array[$i]['level'])) if (empty($this->menu_array[$i]['level']))

View File

@ -114,7 +114,8 @@ abstract class DolibarrModules
// Execute les requetes sql complementaires // Execute les requetes sql complementaires
if (! $err) if (! $err)
{ {
for ($i = 0 ; $i < sizeof($array_sql) ; $i++) $num=count($array_sql);
for ($i = 0; $i < $num; $i++)
{ {
if (! $err) if (! $err)
{ {
@ -211,7 +212,8 @@ abstract class DolibarrModules
if (! $err) $err+=$this->delete_dirs(); if (! $err) $err+=$this->delete_dirs();
// Run complementary sql requests // Run complementary sql requests
for ($i = 0 ; $i < sizeof($array_sql) ; $i++) $num=count($array_sql);
for ($i = 0; $i < $num; $i++)
{ {
if (! $err) if (! $err)
{ {
@ -955,7 +957,7 @@ abstract class DolibarrModules
$err=0; $err=0;
//print $this->rights_class." ".sizeof($this->rights)."<br>"; //print $this->rights_class." ".count($this->rights)."<br>";
// Test if module is activated // Test if module is activated
$sql_del = "SELECT ".$this->db->decrypt('value')." as value"; $sql_del = "SELECT ".$this->db->decrypt('value')." as value";

View File

@ -137,7 +137,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0); $pdf->SetAutoPageBreak(1,0);
$nboflines=sizeof($this->lines); $nboflines=count($this->lines);
// Define nb of page // Define nb of page
$pages = intval($nboflines / $this->line_per_page); $pages = intval($nboflines / $this->line_per_page);
if (($nboflines % $this->line_per_page)>0) if (($nboflines % $this->line_per_page)>0)
@ -288,7 +288,8 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$pdf->SetFillColor(220,220,220); $pdf->SetFillColor(220,220,220);
$yp = 0; $yp = 0;
$lineinpage=0; $lineinpage=0;
for ($j = 0 ; $j < sizeof($this->lines) ; $j++) $num=count($this->lines);
for ($j = 0; $j < $num; $j++)
{ {
$lineinpage++; $lineinpage++;
@ -309,7 +310,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$yp = $yp + $this->line_height; $yp = $yp + $this->line_height;
if ($lineinpage >= $this->line_per_page && $j < (sizeof($this->lines)-1)) if ($lineinpage >= $this->line_per_page && $j < (count($this->lines)-1))
{ {
$lineinpage=0; $yp=0; $lineinpage=0; $yp=0;

View File

@ -186,7 +186,7 @@ class pdf_edison extends ModelePDFCommandes
$iniY = $pdf->GetY(); $iniY = $pdf->GetY();
$curY = $pdf->GetY(); $curY = $pdf->GetY();
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$nblignes = sizeof($object->lines); $nblignes = count($object->lines);
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
{ {
@ -569,7 +569,7 @@ class pdf_edison extends ModelePDFCommandes
// If CUSTOMER contact defined on invoice, we use it // If CUSTOMER contact defined on invoice, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER'); $arrayidcontact=$object->getIdContact('external','CUSTOMER');
if (sizeof($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]); $result=$object->fetch_contact($arrayidcontact[0]);

View File

@ -934,7 +934,7 @@ class pdf_einstein extends ModelePDFCommandes
// If CUSTOMER contact defined on order, we use it // If CUSTOMER contact defined on order, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER'); $arrayidcontact=$object->getIdContact('external','CUSTOMER');
if (sizeof($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]); $result=$object->fetch_contact($arrayidcontact[0]);

View File

@ -193,7 +193,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
//Generation du tableau //Generation du tableau
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$nblignes = sizeof($object->lines); $nblignes = count($object->lines);
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
{ {
@ -508,7 +508,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
// If SHIPPING contact defined on order, we use it // If SHIPPING contact defined on order, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->$origin->getIdContact('external','SHIPPING'); $arrayidcontact=$object->$origin->getIdContact('external','SHIPPING');
if (sizeof($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]); $result=$object->fetch_contact($arrayidcontact[0]);

View File

@ -209,7 +209,8 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
$nexY = $tab_top + 7; $nexY = $tab_top + 7;
for ($i = 0 ; $i < sizeof($object->lines) ; $i++) $num=count($object->lines);
for ($i = 0; $i < $num; $i++)
{ {
$curY = $nexY; $curY = $nexY;
@ -439,7 +440,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
$carac_emetteur=''; $carac_emetteur='';
// Add internal contact of proposal if defined // Add internal contact of proposal if defined
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL'); $arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
if (sizeof($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$object->fetch_user($arrayidcontact[0]); $object->fetch_user($arrayidcontact[0]);
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
@ -477,7 +478,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
// If CUSTOMER contact defined, we use it // If CUSTOMER contact defined, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER'); $arrayidcontact=$object->getIdContact('external','CUSTOMER');
if (sizeof($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]); $result=$object->fetch_contact($arrayidcontact[0]);

View File

@ -189,7 +189,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
else else
{ {
$tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt'); $tmpfiles=dol_dir_list($tmpdir,'files',0,'\.odt');
if (sizeof($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles); if (count($tmpfiles)) $listoffiles=array_merge($listoffiles,$tmpfiles);
} }
} }
$texthelp=$langs->trans("ListOfDirectoriesForModelGenODT"); $texthelp=$langs->trans("ListOfDirectoriesForModelGenODT");
@ -210,7 +210,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$texte.= '</table>'; $texte.= '</table>';
// Scan directories // Scan directories
if (sizeof($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.sizeof($listoffiles).'</b>'; if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
$texte.= '</td>'; $texte.= '</td>';
@ -306,7 +306,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// If BILLING contact defined on invoice, we use it // If BILLING contact defined on invoice, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING'); $arrayidcontact=$object->getIdContact('external','BILLING');
if (sizeof($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]); $result=$object->fetch_contact($arrayidcontact[0]);

View File

@ -176,7 +176,7 @@ class pdf_crabe extends ModelePDFFactures
if (file_exists($dir)) if (file_exists($dir))
{ {
$nblignes = sizeof($object->lines); $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format); $pdf=pdf_getInstance($this->format);
@ -1104,7 +1104,7 @@ class pdf_crabe extends ModelePDFFactures
if ($objecttype == 'propal') if ($objecttype == 'propal')
{ {
$outputlangs->load('propal'); $outputlangs->load('propal');
$num=sizeof($objects); $num=count($objects);
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {
$posy+=4; $posy+=4;
@ -1116,7 +1116,7 @@ class pdf_crabe extends ModelePDFFactures
else if ($objecttype == 'commande') else if ($objecttype == 'commande')
{ {
$outputlangs->load('orders'); $outputlangs->load('orders');
$num=sizeof($objects); $num=count($objects);
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {
$posy+=4; $posy+=4;
@ -1165,7 +1165,7 @@ class pdf_crabe extends ModelePDFFactures
// If BILLING contact defined on invoice, we use it // If BILLING contact defined on invoice, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING'); $arrayidcontact=$object->getIdContact('external','BILLING');
if (sizeof($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]); $result=$object->fetch_contact($arrayidcontact[0]);

View File

@ -205,7 +205,7 @@ class pdf_oursin extends ModelePDFFactures
$iniY = $pdf->GetY(); $iniY = $pdf->GetY();
$curY = $pdf->GetY(); $curY = $pdf->GetY();
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$nblignes = sizeof($object->lines); $nblignes = count($object->lines);
// Loop on each lines // Loop on each lines
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
@ -742,7 +742,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetXY($this->marges['g']+153,$tab_top + 1); $pdf->SetXY($this->marges['g']+153,$tab_top + 1);
$pdf->MultiCell(0, 4, $outputlangs->transnoentities("Qty"), 0, 'L'); $pdf->MultiCell(0, 4, $outputlangs->transnoentities("Qty"), 0, 'L');
$nblignes = sizeof($object->lines); $nblignes = count($object->lines);
$rem=0; $rem=0;
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
{ {
@ -849,7 +849,7 @@ class pdf_oursin extends ModelePDFFactures
// If BILLING contact defined on invoice, we use it // If BILLING contact defined on invoice, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING'); $arrayidcontact=$object->getIdContact('external','BILLING');
if (sizeof($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]); $result=$object->fetch_contact($arrayidcontact[0]);
@ -971,7 +971,7 @@ class pdf_oursin extends ModelePDFFactures
if ($objecttype == 'propal') if ($objecttype == 'propal')
{ {
$outputlangs->load('propal'); $outputlangs->load('propal');
$num=sizeof($objects); $num=count($objects);
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {
$posy+=4; $posy+=4;
@ -982,7 +982,7 @@ class pdf_oursin extends ModelePDFFactures
} }
else if ($objecttype == 'commande') else if ($objecttype == 'commande')
{ {
$num=sizeof($objects); $num=count($objects);
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {
$posy+=4; $posy+=4;

View File

@ -271,7 +271,7 @@ function facture_meta_create($db, $facid, $message="")
if (is_dir($dir)) if (is_dir($dir))
{ {
$nblignes = sizeof($fac->lines); $nblignes = count($fac->lines);
$client = $fac->client->nom . " " . $fac->client->address . " " . $fac->client->cp . " " . $fac->client->ville; $client = $fac->client->nom . " " . $fac->client->address . " " . $fac->client->cp . " " . $fac->client->ville;
$meta = "REFERENCE=\"" . $fac->ref . "\" $meta = "REFERENCE=\"" . $fac->ref . "\"
DATE=\"" . dol_print_date($fac->date,'') . "\" DATE=\"" . dol_print_date($fac->date,'') . "\"

View File

@ -246,7 +246,7 @@ class ImportCsv extends ModeleImports
} }
} }
$this->col=sizeof($newarrayres); $this->col=count($newarrayres);
} }
return $newarrayres; return $newarrayres;
@ -289,8 +289,8 @@ class ImportCsv extends ModeleImports
//var_dump($sort_array_match_file_to_database); //var_dump($sort_array_match_file_to_database);
if (sizeof($arrayrecord) == 0 || if (count($arrayrecord) == 0 ||
(sizeof($arrayrecord) == 1 && empty($arrayrecord[0]['val']))) (count($arrayrecord) == 1 && empty($arrayrecord[0]['val'])))
{ {
//print 'W'; //print 'W';
$this->warnings[$warning]['lib']=$langs->trans('EmptyLine'); $this->warnings[$warning]['lib']=$langs->trans('EmptyLine');

View File

@ -100,7 +100,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
{ {
$object->fetch_thirdparty(); $object->fetch_thirdparty();
$nblines = sizeof($object->lines); $nblines = count($object->lines);
$objectref = dol_sanitizeFileName($object->ref); $objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->expedition->dir_output."/receipt"; $dir = $conf->expedition->dir_output."/receipt";
@ -359,7 +359,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
// If SHIPPING contact defined on invoice, we use it // If SHIPPING contact defined on invoice, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->commande->getIdContact('external','SHIPPING'); $arrayidcontact=$object->commande->getIdContact('external','SHIPPING');
if (sizeof($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]); $result=$object->fetch_contact($arrayidcontact[0]);
@ -422,7 +422,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
foreach($object->linkedObjects as $elementtype => $objects) foreach($object->linkedObjects as $elementtype => $objects)
{ {
$num=sizeof($objects); $num=count($objects);
for ($i=0;$i<$num;$i++) for ($i=0;$i<$num;$i++)
{ {
$order=new Commande($this->db); $order=new Commande($this->db);

Some files were not shown because too many files have changed in this diff Show More