diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 944d7772e85..47d59d198f0 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -339,7 +339,7 @@ class Adherent extends CommonObject
// Fin appel triggers
}
- if (sizeof($this->errors))
+ if (count($this->errors))
{
dol_syslog(get_class($this)."::create ".join(',',$this->errors), LOG_ERR);
$this->db->rollback();
diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php
index 0723291c647..91f8be836a3 100644
--- a/htdocs/adherents/document.php
+++ b/htdocs/adherents/document.php
@@ -183,7 +183,7 @@ if ($id > 0)
print '
'.$langs->trans("MailFile").' '.$i.' ';
// List of files
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
- if (sizeof($listofpaths))
+ if (count($listofpaths))
{
foreach($listofpaths as $key => $val)
{
@@ -1001,7 +1001,7 @@ else
print ' ';
// List of files
$listofpaths=dol_dir_list($upload_dir,'all',0,'','','name',SORT_ASC,0);
- if (sizeof($listofpaths))
+ if (count($listofpaths))
{
foreach($listofpaths as $key => $val)
{
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 5b2d1522d62..a76f151447c 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -1531,7 +1531,7 @@ if ($id > 0 || ! empty($ref))
// Validate
if ($object->statut == 0 && $user->rights->propale->valider)
{
- if (sizeof($object->lines) > 0) print 'id.'&action=validate">'.$langs->trans('Validate').' ';
+ if (count($object->lines) > 0) print 'id.'&action=validate">'.$langs->trans('Validate').' ';
else print ''.$langs->trans('Validate').' ';
}
@@ -1574,7 +1574,7 @@ if ($id > 0 || ! empty($ref))
}
$arraypropal=$object->getInvoiceArrayList();
- if (is_array($arraypropal) && sizeof($arraypropal) > 0)
+ if (is_array($arraypropal) && count($arraypropal) > 0)
{
print 'id.'&action=classifybilled&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").' ';
}
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 1ab5857648b..31c7ac3d7f4 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -692,7 +692,7 @@ class Propal extends CommonObject
if (! $error)
{
$fk_parent_line=0;
- $num=sizeof($this->lines);
+ $num=count($this->lines);
for ($i=0;$i<$num;$i++)
{
@@ -1651,7 +1651,7 @@ class Propal extends CommonObject
$this->fetchObjectLinked($id,$this->element);
foreach($this->linkedObjectsIds as $objecttype => $objectid)
{
- $numi=sizeof($objectid);
+ $numi=count($objectid);
for ($i=0;$i<$numi;$i++)
{
// Cas des factures liees directement
@@ -1665,7 +1665,7 @@ class Propal extends CommonObject
$this->fetchObjectLinked($objectid[$i],$objecttype);
foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid)
{
- $numj=sizeof($subobjectid);
+ $numj=count($subobjectid);
for ($j=0;$j<$numj;$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.= " FROM ".MAIN_DB_PREFIX."facture";
@@ -2115,7 +2115,7 @@ class Propal extends CommonObject
}
}
// 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;
}
diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php
index a6e818a07ac..e4dfe3299a7 100644
--- a/htdocs/comm/propal/contact.php
+++ b/htdocs/comm/propal/contact.php
@@ -285,7 +285,7 @@ if ($id > 0 || ! empty($ref))
foreach(array('internal','external') as $source)
{
$tab = $propal->liste_contact(-1,$source);
- $num=sizeof($tab);
+ $num=count($tab);
$i = 0;
while ($i < $num)
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index dcd41b3b8d5..3a3d41b2fcb 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -167,7 +167,7 @@ if ($id > 0 || ! empty($ref))
print " ';
-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 '
'.$langs->trans('NewCheckReceipt').' ';
}
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index f629e650549..5f300710892 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -271,7 +271,7 @@ class Paiement extends CommonObject
$billsarray=$this->getBillsArray('fk_statut > 1');
if (is_array($billsarray))
{
- if (sizeof($billsarray))
+ if (count($billsarray))
{
$this->error="ErrorDeletePaymentLinkedToAClosedInvoiceNotPossible";
$this->db->rollback();
diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php
index 9c2106a6dfb..e3a57ea88be 100755
--- a/htdocs/compta/paiement_charge.php
+++ b/htdocs/compta/paiement_charge.php
@@ -86,7 +86,7 @@ if ($_POST["action"] == 'add_payment')
}
}
- if (sizeof($amounts) <= 0)
+ if (count($amounts) <= 0)
{
$error++;
$errmsg='ErrorNoPaymentDefined';
diff --git a/htdocs/compta/prelevement/class/bon-prelevement.class.php b/htdocs/compta/prelevement/class/bon-prelevement.class.php
index c29a0d77d36..4e6d37969ba 100644
--- a/htdocs/compta/prelevement/class/bon-prelevement.class.php
+++ b/htdocs/compta/prelevement/class/bon-prelevement.class.php
@@ -334,8 +334,9 @@ class BonPrelevement extends CommonObject
{
$facs = array();
$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 */
dol_syslog("BonPrelevement::set_credite set_paid fac ".$facs[$i]);
@@ -423,7 +424,8 @@ class BonPrelevement extends CommonObject
$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->fetch($facs[$i]);
@@ -781,7 +783,7 @@ class BonPrelevement extends CommonObject
$i = 0;
dol_syslog("Start RIB check");
- if (sizeof($factures) > 0)
+ if (count($factures) > 0)
{
foreach ($factures as $fac)
{
@@ -825,12 +827,12 @@ class BonPrelevement extends CommonObject
$ok=0;
// 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";
dol_syslog($out);
- if (sizeof($factures_prev) > 0)
+ if (count($factures_prev) > 0)
{
if ($mode=='real')
{
@@ -917,7 +919,7 @@ class BonPrelevement extends CommonObject
*/
if (!$error)
{
- if (sizeof($factures_prev) > 0)
+ if (count($factures_prev) > 0)
{
foreach ($factures_prev as $fac)
{
@@ -977,9 +979,9 @@ class BonPrelevement extends CommonObject
* 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->reference_remise = $ref;
@@ -1033,7 +1035,7 @@ class BonPrelevement extends CommonObject
dol_syslog("Error",LOG_ERROR);
}
- return sizeof($factures_prev);
+ return count($factures_prev);
}
else
{
diff --git a/htdocs/compta/prelevement/class/rejet-prelevement.class.php b/htdocs/compta/prelevement/class/rejet-prelevement.class.php
index dbb1328f4a5..90dd3bf8016 100644
--- a/htdocs/compta/prelevement/class/rejet-prelevement.class.php
+++ b/htdocs/compta/prelevement/class/rejet-prelevement.class.php
@@ -115,9 +115,9 @@ class RejetPrelevement
dol_syslog("RejetPrelevement::create Erreur 5");
$error++;
}
-
-
- for ($i = 0 ; $i < sizeof($facs) ; $i++)
+
+ $num=count($facs);
+ for ($i = 0; $i < $num; $i++)
{
$fac = new Facture($this->db);
$fac->fetch($facs[$i]);
diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php
index 09f03b47c9b..7660cf99a1e 100644
--- a/htdocs/compta/propal.php
+++ b/htdocs/compta/propal.php
@@ -486,7 +486,7 @@ if ($id > 0 || ! empty($ref))
}
$arraypropal=$object->getInvoiceArrayList();
- if ($object->statut == 2 && is_array($arraypropal) && sizeof($arraypropal) > 0)
+ if ($object->statut == 2 && is_array($arraypropal) && count($arraypropal) > 0)
{
print '
id.'&action=setstatut&statut=4&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").' ';
}
diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php
index b1e55ae8e21..7ad351bb118 100644
--- a/htdocs/compta/stats/cabyuser.php
+++ b/htdocs/compta/stats/cabyuser.php
@@ -223,7 +223,7 @@ print_liste_field_titre($langs->trans("OtherStatistics"),$_SERVER["PHP_SELF"],""
print "\n";
$var=true;
-if (sizeof($amount))
+if (count($amount))
{
$arrayforsort=$name;
diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php
index 4441909554d..7e01644b08d 100644
--- a/htdocs/contact/fiche.php
+++ b/htdocs/contact/fiche.php
@@ -223,7 +223,7 @@ if (empty($reshook))
$_GET["action"] = $_POST["action"] = 'edit';
}
- if (! sizeof($errors))
+ if (! count($errors))
{
$object->fetch($_POST["contactid"]);
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index efc8faabf60..0d07b69853c 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -584,7 +584,7 @@ class Contrat extends CommonObject
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_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
diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php
index c095cfca195..858d531cbf6 100644
--- a/htdocs/contrat/contact.php
+++ b/htdocs/contrat/contact.php
@@ -271,7 +271,7 @@ if ($id > 0)
foreach(array('internal','external') as $source)
{
$tab = $contrat->liste_contact(-1,$source);
- $num=sizeof($tab);
+ $num=count($tab);
$i = 0;
while ($i < $num)
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index 89a29e67c4c..b9e7686a0ec 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -147,7 +147,7 @@ if ($contrat->id)
print '
'.$langs->trans("Customer").' ';
print ''.$soc->getNomUrl(1).' ';
- print '
'.$langs->trans("NbOfAttachedFiles").' '.sizeof($filearray).' ';
+ print '
'.$langs->trans("NbOfAttachedFiles").' '.count($filearray).' ';
print '
'.$langs->trans("TotalSizeOfAttachedFiles").' '.$totalsize.' '.$langs->trans("bytes").' ';
print '';
diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php
index f25b6b08bb1..58034043f59 100644
--- a/htdocs/contrat/fiche.php
+++ b/htdocs/contrat/fiche.php
@@ -584,7 +584,7 @@ else
dol_htmloutput_errors($mesg,'');
- $nbofservices=sizeof($object->lines);
+ $nbofservices=count($object->lines);
$author = new User($db);
$author->fetch($object->user_author_id);
@@ -793,7 +793,7 @@ else
}
// Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme)
print '
';
- if ($user->rights->contrat->creer && sizeof($arrayothercontracts) && ($object->statut >= 0))
+ if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0))
{
print '';
print img_picto($langs->trans("MoveToAnotherContract"),'uparrow');
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index cf17e5dc564..276a9bc8d90 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -699,7 +699,7 @@ abstract class CommonObject
{
$contactAlreadySelected = array();
$tab = $this->liste_contact(-1,$source);
- $num=sizeof($tab);
+ $num=count($tab);
$i = 0;
while ($i < $num)
{
@@ -1345,7 +1345,7 @@ abstract class CommonObject
{
dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
- $num=sizeof($objectids);
+ $num=count($objectids);
for ($i=0;$i<$num;$i++)
{
@@ -1474,7 +1474,7 @@ abstract class CommonObject
}
// Request to get complementary values
- if (sizeof($optionsArray) > 0)
+ if (count($optionsArray) > 0)
{
$sql = "SELECT rowid";
foreach ($optionsArray as $name => $label)
@@ -1516,7 +1516,7 @@ abstract class CommonObject
*/
function insertExtraFields()
{
- if (sizeof($this->array_options) > 0)
+ if (count($this->array_options) > 0)
{
$this->db->begin();
@@ -1679,7 +1679,7 @@ abstract class CommonObject
$this->fetchObjectLinked();
- $num = sizeof($this->linkedObjects);
+ $num = count($this->linkedObjects);
foreach($this->linkedObjects as $objecttype => $objects)
{
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index c904bbc1411..8b9d9431ac3 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -311,8 +311,8 @@ class DolGraph
$k = 0;
$vals = array();
- $nblines = sizeof($this->data);
- $nbvalues = sizeof($this->data[0]) - 1;
+ $nblines = count($this->data);
+ $nbvalues = count($this->data[0]) - 1;
for ($j = 0 ; $j < $nblines ; $j++)
{
@@ -331,8 +331,8 @@ class DolGraph
$k = 0;
$vals = array();
- $nblines = sizeof($this->data);
- $nbvalues = sizeof($this->data[0]) - 1;
+ $nblines = count($this->data);
+ $nbvalues = count($this->data[0]) - 1;
for ($j = 0 ; $j < $nblines ; $j++)
{
@@ -397,7 +397,7 @@ class DolGraph
*/
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";
dol_syslog("DolGraph::draw ".$this->error, LOG_ERR);
@@ -471,7 +471,7 @@ class DolGraph
// On boucle sur chaque lot de donnees
$legends=array();
$i=0;
- $nblot=sizeof($this->data[0])-1;
+ $nblot=count($this->data[0])-1;
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
// 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 == 'lines') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE);
diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php
index 61f9ba290b2..b59cddc5764 100755
--- a/htdocs/core/class/hookmanager.class.php
+++ b/htdocs/core/class/hookmanager.class.php
@@ -143,7 +143,7 @@ class HookManager
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)
- 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;
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))
{
$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;
}
@@ -161,7 +161,7 @@ class HookManager
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)
- 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;
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 6a38310fde1..918b1d51a64 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -723,8 +723,8 @@ class Form
if ($htmlname != 'none')
{
$disabled=0;
- if (is_array($exclude) && sizeof($exclude) && in_array($obj->rowid,$exclude)) $disabled=1;
- if (is_array($limitto) && sizeof($limitto) && ! in_array($obj->rowid,$limitto)) $disabled=1;
+ if (is_array($exclude) && count($exclude) && in_array($obj->rowid,$exclude)) $disabled=1;
+ if (is_array($limitto) && count($limitto) && ! in_array($obj->rowid,$limitto)) $disabled=1;
if ($selected && $selected == $obj->rowid)
{
print 'prenom=$obj->firstname;
$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))
{
@@ -1769,7 +1769,7 @@ class Form
foreach($this->cache_types_paiements as $id => $arraytypes)
{
// 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.
if ($empty && empty($arraytypes['code'])) continue;
@@ -2917,10 +2917,10 @@ class Form
// Comme ils sont tries par ordre croissant, dernier = plus eleve = taux courant
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)
{
$return.= '';
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index 1b1b8c2a0e2..34fe0035a5a 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -511,7 +511,7 @@ class FormCompany
{
// For ajax search we limit here. For combo list, we limit later
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).")";
}
@@ -571,7 +571,7 @@ class FormCompany
$obj = $this->db->fetch_object($resql);
if ($i == 0) $firstCompany = $obj->rowid;
$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)
{
print '';
$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);
$modelselected=$arraykeys[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);
}
@@ -410,7 +410,7 @@ class FormFile
// Language code (if multilang)
$out.= '';
- 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');
$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);
// Affiche en-tete tableau si non deja affiche
- if (sizeof($file_list) && ! $headershown && !$iconPDF)
+ if (count($file_list) && ! $headershown && !$iconPDF)
{
$headershown=1;
$out.= ''.$titletoshow.'
';
@@ -561,7 +561,7 @@ class FormFile
print_liste_field_titre('','','');
print '';
- $nboffiles=sizeof($filearray);
+ $nboffiles=count($filearray);
if ($nboffiles > 0) include_once(DOL_DOCUMENT_ROOT.'/lib/images.lib.php');
@@ -719,7 +719,7 @@ class FormFile
print " \n";
}
}
- if (sizeof($filearray) == 0)
+ if (count($filearray) == 0)
{
print '';
if (empty($textifempty)) print $langs->trans("NoFileFound");
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index d917a240685..46641be1128 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -514,7 +514,7 @@ class FormMail
$out.= ' });';
$out.= '})';
$out.= ''."\n";
- if (sizeof($listofpaths))
+ if (count($listofpaths))
{
foreach($listofpaths as $key => $val)
{
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index 7d0357c2d68..4689ff37c2b 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -370,7 +370,7 @@ class FormOther
function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='')
{
global $langs;
- if (! is_array($arrayofcolors) || sizeof($arrayofcolors) < 1)
+ if (! is_array($arrayofcolors) || count($arrayofcolors) < 1)
{
$langs->load("other");
print ' ';
@@ -662,7 +662,7 @@ function PLineSelect(&$inc, $parent, $lines, $level=0, $selectedtask=0, $selecte
$lastprojectid=0;
- $numlines=sizeof($lines);
+ $numlines=count($lines);
for ($i = 0 ; $i < $numlines ; $i++)
{
if ($lines[$i]->fk_parent == $parent)
diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php
index 7334b3682e6..adb27154155 100755
--- a/htdocs/core/class/html.formsms.class.php
+++ b/htdocs/core/class/html.formsms.class.php
@@ -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);
$resultsender[0]->number=$this->fromsms;
}
- if (sizeof($resultsender) > 0)
+ if (count($resultsender) > 0)
{
print '';
foreach($resultsender as $obj)
diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php
index 2705ac28999..ae3d140858d 100644
--- a/htdocs/core/class/menu.class.php
+++ b/htdocs/core/class/menu.class.php
@@ -57,7 +57,7 @@ class Menu {
*/
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]['titre'] = $titre;
$this->liste[$i]['level'] = $level;
@@ -71,7 +71,7 @@ class Menu {
*/
function remove_last()
{
- if (sizeof($this->liste) > 1) array_pop($this->liste);
+ if (count($this->liste) > 1) array_pop($this->liste);
}
}
diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php
index a1e604c8a25..1fbdddff610 100644
--- a/htdocs/core/class/menubase.class.php
+++ b/htdocs/core/class/menubase.class.php
@@ -411,7 +411,7 @@ class Menubase
$leftmenu=$myleftmenu; // To export to dol_eval function
// Load datas into tabMenu
- if (sizeof($tabMenu) == 0)
+ if (count($tabMenu) == 0)
{
$this->menuLoad($leftmenu, $type_user, $menu_handler, $tabMenu);
}
@@ -464,7 +464,7 @@ class Menubase
$this->newmenu = $newmenu;
// Load datas into tabMenu
- if (sizeof($tabMenu) == 0)
+ if (count($tabMenu) == 0)
{
$this->menuLoad($leftmenu, $type_user, $menu_handler, $tabMenu);
}
diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index a998f3ecf30..c2f86856bd0 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -206,7 +206,7 @@ class Notify
$message,
array($file),
array($mimefile),
- array($filename[sizeof($filename)-1]),
+ array($filename[count($filename)-1]),
'', '', 0, $msgishtml
);
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index ca4e526c877..75ac238aa12 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -229,7 +229,7 @@ class Translate {
require_once(DOL_DOCUMENT_ROOT ."/lib/memory.lib.php");
$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
//print $newdomain."\n";
@@ -281,7 +281,7 @@ class Translate {
// TODO Move cache write out of loop on dirs
// To save lang content for usecachekey into cache
- if ($usecachekey && sizeof($tabtranslatedomain))
+ if ($usecachekey && count($tabtranslatedomain))
{
$ressetcache=dol_setcache($usecachekey,$tabtranslatedomain);
if ($ressetcache < 0)
diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php
index 9d45c5f7017..c34f7122317 100644
--- a/htdocs/ecm/class/ecmdirectory.class.php
+++ b/htdocs/ecm/class/ecmdirectory.class.php
@@ -560,7 +560,7 @@ class EcmDirectory // extends CommonObject
{
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 ";
$this->cats[$obj->rowid]['id_children'][$newelempos]=$obj->rowid_fille;
}
@@ -653,7 +653,7 @@ class EcmDirectory // extends CommonObject
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."ecm_directories SET";
- $sql.= " cachenbofdoc = '".sizeof($filelist)."'";
+ $sql.= " cachenbofdoc = '".count($filelist)."'";
if (empty($all)) // By default
{
$sql.= " WHERE rowid = ".$this->id;
@@ -667,7 +667,7 @@ class EcmDirectory // extends CommonObject
$resql = $this->db->query($sql);
if ($resql)
{
- $this->cachenbofdoc=sizeof($filelist);
+ $this->cachenbofdoc=count($filelist);
return $this->cachenbofdoc;
}
else
diff --git a/htdocs/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php
index cf4fdb75133..efc6358c732 100644
--- a/htdocs/ecm/class/htmlecm.form.class.php
+++ b/htdocs/ecm/class/htmlecm.form.class.php
@@ -63,7 +63,7 @@ class FormEcm
$output = '';
if (is_array($cate_arbo))
{
- if (! sizeof($cate_arbo)) $output.= ''.$langs->trans("NoCategoriesDefined").' ';
+ if (! count($cate_arbo)) $output.= ''.$langs->trans("NoCategoriesDefined").' ';
else
{
$output.= ' ';
diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/docfile.php
index 0911fbb9d97..feb37ef27f7 100644
--- a/htdocs/ecm/docfile.php
+++ b/htdocs/ecm/docfile.php
@@ -224,7 +224,7 @@ print ' ';
print '/ecm/'.$relativepath;
print ' ';
print '
'.$langs->trans("ECMNbOfDocs").' ';
-print sizeof($filearray);
+print count($filearray);
print ' ';
print '
'.$langs->trans("TotalSizeOfAttachedFiles").' ';
print dol_print_size($totalsize);
diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php
index eb9badd499f..2fd20a9ed26 100644
--- a/htdocs/ecm/docmine.php
+++ b/htdocs/ecm/docmine.php
@@ -280,7 +280,7 @@ print ' '.$langs->trans("ECMDirectoryForFiles").' ';
print '/ecm/'.$relativepath;
print ' ';
print '
'.$langs->trans("ECMNbOfDocs").' ';
-print sizeof($filearray);
+print count($filearray);
print ' ';
print '
'.$langs->trans("TotalSizeOfAttachedFiles").' ';
print dol_print_size($totalsize);
@@ -321,7 +321,7 @@ if ($_GET["action"] != 'edit' && $_GET['action'] != 'delete')
print ''.$langs->trans('ECMAddSection').' ';
}
- if (sizeof($filearray) == 0)
+ if (count($filearray) == 0)
{
if ($user->rights->ecm->setup)
{
diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php
index 72e27432a68..1d98e484af1 100644
--- a/htdocs/ecm/docother.php
+++ b/htdocs/ecm/docother.php
@@ -154,7 +154,7 @@ else
print '';
// Nbre fichiers
-print ''.$langs->trans("NbOfAttachedFiles").' '.sizeof($filearray).' ';
+print ''.$langs->trans("NbOfAttachedFiles").' '.count($filearray).' ';
//Total taille
print ''.$langs->trans("TotalSizeOfAttachedFiles").' '.$totalsize.' '.$langs->trans("bytes").' ';
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index a1817c0eb95..a2adc93b229 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -463,7 +463,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
$showonrightsize='';
- if (sizeof($sectionauto))
+ if (count($sectionauto))
{
// Root title line (Automatic section)
print '';
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 2bf5209fed6..d4532806f61 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -210,7 +210,8 @@ class Expedition extends CommonObject
if ($this->db->query($sql))
{
// 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)
{
@@ -617,7 +618,7 @@ class Expedition extends CommonObject
*/
function addline( $entrepot_id, $id, $qty )
{
- $num = sizeof($this->lines);
+ $num = count($this->lines);
$line = new ExpeditionLigne($this->db);
$line->entrepot_id = $entrepot_id;
diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index 980a6235c9a..216a0e3abe4 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -99,7 +99,8 @@ if ($action == 'add')
$object->ref_int = $_POST["ref_int"];
//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;
if ($_POST[$qty] > 0)
@@ -625,7 +626,7 @@ if ($action == 'create')
print '';
//$lines = $object->fetch_lines(1);
- $numAsked = sizeof($object->lines);
+ $numAsked = count($object->lines);
/* Lecture des expeditions deja effectuees */
$object->loadExpeditions();
@@ -784,7 +785,7 @@ if ($action == 'create')
{
$product->get_sousproduits_arbo ();
$prods_arbo = $product->get_arbo_each_prod($qtyProdCom);
- if(sizeof($prods_arbo) > 0)
+ if(count($prods_arbo) > 0)
{
foreach($prods_arbo as $key => $value)
{
@@ -831,7 +832,7 @@ else
exit -1;
}
$lines = $object->lines;
- $num_prod = sizeof($lines);
+ $num_prod = count($lines);
if ($object->id > 0)
{
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index f45c7cbb49f..1e0050ba792 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -533,7 +533,7 @@ if ($id > 0 || ! empty($ref))
// Define a new tree with quantiies recalculated
$prods_arbo = $product->get_arbo_each_prod($qtyProdCom);
//var_dump($prods_arbo);
- if(sizeof($prods_arbo) > 0)
+ if(count($prods_arbo) > 0)
{
foreach($prods_arbo as $key => $value)
{
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index 6e1e267e268..5758ca1eb09 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -93,14 +93,14 @@ if ($action=='selectfield')
foreach($fieldsarray as $key=>$val)
{
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);
$_SESSION["export_selected_fields"]=$array_selected;
}
}
else
{
- $array_selected[$_GET["field"]]=sizeof($array_selected)+1;
+ $array_selected[$_GET["field"]]=count($array_selected)+1;
//print_r($array_selected);
$_SESSION["export_selected_fields"]=$array_selected;
}
@@ -281,7 +281,7 @@ if ($step == 1 || ! $datatoexport)
print ' ';
print '';
$val=true;
- if (sizeof($objexport->array_export_code))
+ if (count($objexport->array_export_code))
{
foreach ($objexport->array_export_code as $key => $value)
{
@@ -420,7 +420,7 @@ if ($step == 2 && $datatoexport)
print '';
// If value of entityicon=entitylang='icon:Label'
$tmparray=explode(':',$entityicon);
- if (sizeof($tmparray) >=2)
+ if (count($tmparray) >=2)
{
$entityicon=$tmparray[0];
$entitylang=$tmparray[1];
@@ -472,7 +472,7 @@ if ($step == 2 && $datatoexport)
*/
print '';
- if (sizeof($array_selected))
+ if (count($array_selected))
{
print '
'.$langs->trans("NextStep").' ';
}
@@ -567,7 +567,7 @@ if ($step == 3 && $datatoexport)
print '
';
// If value of entityicon=entitylang='icon:Label'
$tmparray=explode(':',$entityicon);
- if (sizeof($tmparray) >=2)
+ if (count($tmparray) >=2)
{
$entityicon=$tmparray[0];
$entitylang=$tmparray[1];
@@ -587,7 +587,7 @@ if ($step == 3 && $datatoexport)
print ' ';
print $value.' ';
print ' ';
- if ($value < sizeof($array_selected)) print ''.img_down().' ';
+ if ($value < count($array_selected)) print ''.img_down().' ';
if ($value > 1) print ''.img_up().' ';
print ' ';
@@ -610,7 +610,7 @@ if ($step == 3 && $datatoexport)
*/
print '
';
- if (sizeof($array_selected))
+ if (count($array_selected))
{
print '
'.$langs->trans("NextStep").' ';
}
@@ -619,7 +619,7 @@ if ($step == 3 && $datatoexport)
// Area for profils export
- if (sizeof($array_selected))
+ if (count($array_selected))
{
print '
';
print $langs->trans("SaveExportModel");
diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php
index 628936f8059..de92fbcdb11 100644
--- a/htdocs/exports/index.php
+++ b/htdocs/exports/index.php
@@ -95,7 +95,7 @@ print '
'.$langs->trans("ExportableDatas").' ';
//print '
';
print '';
$var=true;
-if (sizeof($export->array_export_code))
+if (count($export->array_export_code))
{
foreach ($export->array_export_code as $key => $value)
{
@@ -123,7 +123,7 @@ print '
';
print ' ';
print '';
-if (sizeof($export->array_export_code))
+if (count($export->array_export_code))
{
if ($user->rights->export->creer)
{
diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php
index efcb52e1d28..77c2aa75d98 100644
--- a/htdocs/fichinter/contact.php
+++ b/htdocs/fichinter/contact.php
@@ -261,7 +261,7 @@ if ($id > 0)
foreach(array('internal','external') as $source)
{
$tab = $fichinter->liste_contact(-1,$source);
- $num=sizeof($tab);
+ $num=count($tab);
$i = 0;
while ($i < $num)
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index 9522f726256..d55461e5fc2 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -148,7 +148,7 @@ if ($object->id)
// Societe
print "".$langs->trans("Company")." ".$object->client->getNomUrl(1)." ";
- print ''.$langs->trans("NbOfAttachedFiles").' '.sizeof($filearray).' ';
+ print ''.$langs->trans("NbOfAttachedFiles").' '.count($filearray).' ';
print ''.$langs->trans("TotalSizeOfAttachedFiles").' '.$totalsize.' '.$langs->trans("bytes").' ';
print '
';
diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php
index a892246ef75..0f8abd8966d 100644
--- a/htdocs/fichinter/fiche.php
+++ b/htdocs/fichinter/fiche.php
@@ -1067,7 +1067,7 @@ elseif ($fichinterid)
if ($action != 'editdescription')
{
// 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 ''.$langs->trans("Valid").' ';
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 96cc54be32d..1035be97179 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -417,7 +417,8 @@ class CommandeFournisseur extends Commande
{
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)
{
@@ -643,7 +644,8 @@ class CommandeFournisseur extends Commande
{
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
if ($this->lines[$i]->fk_product > 0)
@@ -1404,7 +1406,8 @@ class CommandeFournisseur extends Commande
$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);
if ($prod->fetch($comclient->lines[$i]->fk_product) > 0)
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index cb9a77b15b9..daf2e07364b 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -792,7 +792,8 @@ class FactureFournisseur extends Facture
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
$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)
{
@@ -867,7 +868,8 @@ class FactureFournisseur extends Facture
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php");
$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)
{
diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index 60940370e22..066073f953a 100644
--- a/htdocs/fourn/class/paiementfourn.class.php
+++ b/htdocs/fourn/class/paiementfourn.class.php
@@ -251,7 +251,7 @@ class PaiementFourn extends Paiement
$billsarray=$this->getBillsArray('paye=1');
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->db->rollback();
diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php
index d51ced68c18..8a7cc08aa50 100644
--- a/htdocs/fourn/commande/contact.php
+++ b/htdocs/fourn/commande/contact.php
@@ -268,7 +268,7 @@ if ($id > 0 || ! empty($ref))
foreach(array('internal','external') as $source)
{
$tab = $commande->liste_contact(-1,$source);
- $num=sizeof($tab);
+ $num=count($tab);
$i = 0;
while ($i < $num)
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 68b01ef2310..0bb534d89e2 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -282,7 +282,7 @@ if ($id > 0 || ! empty($ref))
// Warehouse
print ' ';
- if (sizeof($listwarehouses))
+ if (count($listwarehouses))
{
print $html->selectarray("entrepot_".$i, $listwarehouses, '', $disabled, 0, 0, '', 0, 0, $disabled);
}
diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php
index b80a45346df..d28530f1348 100644
--- a/htdocs/fourn/commande/document.php
+++ b/htdocs/fourn/commande/document.php
@@ -190,7 +190,7 @@ if ($id > 0 || ! empty($ref))
print ' '.$author->getNomUrl(1).' ';
print '';
- print '
'.$langs->trans("NbOfAttachedFiles").' '.sizeof($filearray).' ';
+ print '
'.$langs->trans("NbOfAttachedFiles").' '.count($filearray).' ';
print '
'.$langs->trans("TotalSizeOfAttachedFiles").' '.$totalsize.' '.$langs->trans("bytes").' ';
print "\n";
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 41a39c7c8b5..15283b93d90 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -1033,7 +1033,7 @@ if ($id > 0 || ! empty($ref))
*/
print '
';
- $num = sizeof($object->lines);
+ $num = count($object->lines);
$i = 0; $total = 0;
if ($num)
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index ffbf5966e73..d05b29d7888 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -262,7 +262,7 @@ if ($id > 0)
foreach(array('internal','external') as $source)
{
$tab = $facture->liste_contact(-1,$source);
- $num=sizeof($tab);
+ $num=count($tab);
$i = 0;
while ($i < $num)
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index ac1907055bf..fd7b4de18c5 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -161,7 +161,7 @@ if ($facid > 0)
// Societe
print ''.$langs->trans('Supplier').' '.$facture->thirdparty->getNomUrl(1).' ';
- print ''.$langs->trans('NbOfAttachedFiles').' '.sizeof($filearray).' ';
+ print ''.$langs->trans('NbOfAttachedFiles').' '.count($filearray).' ';
print ''.$langs->trans('TotalSizeOfAttachedFiles').' '.$totalsize.' '.$langs->trans('bytes').' ';
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index acac34251f2..a9cbcfe917d 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -266,7 +266,8 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer)
$lines = $srcobject->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);
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
@@ -1301,7 +1302,7 @@ else
}
$facidavoir=$fac->getListIdAvoirFromInvoice();
- if (sizeof($facidavoir) > 0)
+ if (count($facidavoir) > 0)
{
print ' ('.$langs->transnoentities("InvoiceHasAvoir");
$i=0;
@@ -1488,7 +1489,8 @@ else
print ' ';
print '';
$var=1;
- for ($i = 0 ; $i < sizeof($fac->lines) ; $i++)
+ $num=count($fac->lines);
+ for ($i = 0; $i < $num; $i++)
{
if ($i == 0)
{
@@ -1795,7 +1797,7 @@ else
//Validate
if ($_GET['action'] != 'edit' && $fac->statut == 0)
{
- if (sizeof($fac->lines))
+ if (count($fac->lines))
{
if ($user->rights->fournisseur->facture->valider)
{
diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php
index eba232ebcef..e8b8ab122a9 100644
--- a/htdocs/fourn/index.php
+++ b/htdocs/fourn/index.php
@@ -283,7 +283,7 @@ else
$companystatic->LoadSupplierCateg();
$categstatic=new Categorie($db);
-if (sizeof($companystatic->SupplierCategories))
+if (count($companystatic->SupplierCategories))
{
print ' ';
diff --git a/htdocs/fourn/product/categorie.php b/htdocs/fourn/product/categorie.php
index c6e8956202b..4517d668176 100644
--- a/htdocs/fourn/product/categorie.php
+++ b/htdocs/fourn/product/categorie.php
@@ -120,7 +120,7 @@ if ($_GET["id"])
$c = new Categorie($db);
$cats = $c->containing($_REQUEST['id'],0);
- if (sizeof($cats) > 0)
+ if (count($cats) > 0)
{
print "Vous avez stock� le produit dans les cat�gorie suivantes: ";
print '';
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index a1fe048009b..99b956c401e 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -337,7 +337,7 @@ if ($step == 1 || ! $datatoimport)
print ' ';
print '';
$val=true;
- if (sizeof($objimport->array_import_code))
+ if (count($objimport->array_import_code))
{
foreach ($objimport->array_import_code as $key => $value)
{
@@ -635,21 +635,22 @@ if ($step == 4 && $datatoimport)
// Load targets fields in database
$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);
// 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
// $array_match_file_to_database
// $serialized_array_match_file_to_database
// $_SESSION["dol_array_match_file_to_database"]
$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;
foreach($fieldstarget as $key => $val)
@@ -800,13 +801,14 @@ if ($step == 4 && $datatoimport)
$valforsourcefieldnb[$lefti]=$key;
$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);
- // Complete source fields from sizeof($fieldssource)+1 to sizeof($fieldstarget)
+ // Complete source fields from count($fieldssource)+1 to count($fieldstarget)
$more=1;
- while ($lefti <= sizeof($fieldstarget))
+ $num=count($fieldssource);
+ while ($lefti <= $num)
{
$var=!$var;
$newkey=getnewkey($fieldssource,$listofkeys);
@@ -849,8 +851,8 @@ if ($step == 4 && $datatoimport)
if (preg_match('/\*$/',$label))
{
$text=''.$text.' ';
- $more=((! empty($valforsourcefieldnb[$i]) && $valforsourcefieldnb[$i] <= sizeof($fieldssource)) ? '' : img_warning($langs->trans("FieldNeedSource")));
- if ($mandatoryfieldshavesource) $mandatoryfieldshavesource=(! empty($valforsourcefieldnb[$i]) && ($valforsourcefieldnb[$i] <= sizeof($fieldssource)));
+ $more=((! empty($valforsourcefieldnb[$i]) && $valforsourcefieldnb[$i] <= count($fieldssource)) ? '' : img_warning($langs->trans("FieldNeedSource")));
+ if ($mandatoryfieldshavesource) $mandatoryfieldshavesource=(! empty($valforsourcefieldnb[$i]) && ($valforsourcefieldnb[$i] <= count($fieldssource)));
//print 'xx'.($i).'-'.$valforsourcefieldnb[$i].'-'.$mandatoryfieldshavesource;
}
print $text;
@@ -860,7 +862,7 @@ if ($step == 4 && $datatoimport)
$filecolumn=$array_match_database_to_file[$code];
// Source field info
$htmltext =''.$langs->trans("FieldSource").' ';
- if ($filecolumn > sizeof($fieldssource)) $htmltext.=$langs->trans("DataComeFromNoWhere").' ';
+ if ($filecolumn > count($fieldssource)) $htmltext.=$langs->trans("DataComeFromNoWhere").' ';
else
{
if (empty($objimport->array_import_convertvalue[0][$code])) // If source file does not need convertion
@@ -991,7 +993,7 @@ if ($step == 4 && $datatoimport)
*/
print '';
- if (sizeof($array_match_file_to_database))
+ if (count($array_match_file_to_database))
{
if ($mandatoryfieldshavesource)
{
@@ -1007,7 +1009,7 @@ if ($step == 4 && $datatoimport)
// Area for profils import
- if (sizeof($array_match_file_to_database))
+ if (count($array_match_file_to_database))
{
print ' '."\n";
print ''."\n";
@@ -1204,12 +1206,12 @@ if ($step == 5 && $datatoimport)
foreach($array_match_file_to_database as $code=>$label)
{
//var_dump($fieldssource);
- if ($code > sizeof($fieldssource)) continue;
+ if ($code > count($fieldssource)) continue;
//print $code.'-'.$label;
$alias=preg_replace('/(\..*)$/i','',$label);
$listtables[$alias]=$objimport->array_import_tables[0][$alias];
}
- if (sizeof($listtables))
+ if (count($listtables))
{
$newval='';
//ksort($listtables);
@@ -1247,12 +1249,12 @@ if ($step == 5 && $datatoimport)
{
$i++;
//var_dump($fieldssource);
- if ($code > sizeof($fieldssource)) continue;
+ if ($code > count($fieldssource)) continue;
//print $code.'-'.$label;
$alias=preg_replace('/(\..*)$/i','',$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 '';
print '
';
@@ -1309,10 +1311,10 @@ if ($step == 5 && $datatoimport)
$arrayrecord=$obj->import_read_record();
if ($excludefirstline && $sourcelinenb == 1) continue;
- $result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,sizeof($fieldssource),$importid);
- if (sizeof($obj->errors)) $arrayoferrors[$sourcelinenb]=$obj->errors;
- if (sizeof($obj->warnings)) $arrayofwarnings[$sourcelinenb]=$obj->warnings;
- if (! sizeof($obj->errors) && ! sizeof($obj->warnings)) $nbok++;
+ $result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,count($fieldssource),$importid);
+ if (count($obj->errors)) $arrayoferrors[$sourcelinenb]=$obj->errors;
+ if (count($obj->warnings)) $arrayofwarnings[$sourcelinenb]=$obj->warnings;
+ if (! count($obj->errors) && ! count($obj->warnings)) $nbok++;
}
// 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.
// Show OK
- if (! sizeof($arrayoferrors) && ! sizeof($arrayofwarnings)) print img_picto($langs->trans("OK"),'tick').' '.$langs->trans("NoError").' ';
+ if (! count($arrayoferrors) && ! count($arrayofwarnings)) print img_picto($langs->trans("OK"),'tick').' '.$langs->trans("NoError").' ';
else print $langs->trans("NbOfLinesOK",$nbok).' ';
// Show Errors
//var_dump($arrayoferrors);
- if (sizeof($arrayoferrors))
+ if (count($arrayoferrors))
{
- print img_error().' '.$langs->trans("ErrorsOnXLines",sizeof($arrayoferrors)).' ';
+ print img_error().' '.$langs->trans("ErrorsOnXLines",count($arrayoferrors)).' ';
print '';
foreach ($arrayoferrors as $key => $val)
{
$nboferrors++;
if ($nboferrors > $maxnboferrors)
{
- print $langs->trans("TooMuchErrors",(sizeof($arrayoferrors)-$nboferrors))." ";
+ print $langs->trans("TooMuchErrors",(count($arrayoferrors)-$nboferrors))." ";
break;
}
print '* '.$langs->trans("Line").' '.$key.' ';
@@ -1354,16 +1356,16 @@ if ($step == 5 && $datatoimport)
// Show Warnings
//var_dump($arrayoferrors);
- if (sizeof($arrayofwarnings))
+ if (count($arrayofwarnings))
{
- print img_warning().' '.$langs->trans("WarningsOnXLines",sizeof($arrayofwarnings)).' ';
+ print img_warning().' '.$langs->trans("WarningsOnXLines",count($arrayofwarnings)).' ';
print '';
foreach ($arrayofwarnings as $key => $val)
{
$nbofwarnings++;
if ($nbofwarnings > $maxnbofwarnings)
{
- print $langs->trans("TooMuchWarnings",(sizeof($arrayofwarnings)-$nbofwarnings))." ";
+ print $langs->trans("TooMuchWarnings",(count($arrayofwarnings)-$nbofwarnings))." ";
break;
}
print ' * '.$langs->trans("Line").' '.$key.' ';
@@ -1553,12 +1555,12 @@ if ($step == 6 && $datatoimport)
foreach($array_match_file_to_database as $code=>$label)
{
//var_dump($fieldssource);
- if ($code > sizeof($fieldssource)) continue;
+ if ($code > count($fieldssource)) continue;
//print $code.'-'.$label;
$alias=preg_replace('/(\..*)$/i','',$label);
$listtables[$alias]=$objimport->array_import_tables[0][$alias];
}
- if (sizeof($listtables))
+ if (count($listtables))
{
$newval='';
foreach ($listtables as $val)
@@ -1594,12 +1596,12 @@ if ($step == 6 && $datatoimport)
{
$i++;
//var_dump($fieldssource);
- if ($code > sizeof($fieldssource)) continue;
+ if ($code > count($fieldssource)) continue;
//print $code.'-'.$label;
$alias=preg_replace('/(\..*)$/i','',$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 ' ';
print '
';
@@ -1631,10 +1633,10 @@ if ($step == 6 && $datatoimport)
$arrayrecord=$obj->import_read_record();
if ($excludefirstline && $sourcelinenb == 1) continue;
- $result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,sizeof($fieldssource),$importid);
- if (sizeof($obj->errors)) $arrayoferrors[$sourcelinenb]=$obj->errors;
- if (sizeof($obj->warnings)) $arrayofwarnings[$sourcelinenb]=$obj->warnings;
- if (! sizeof($obj->errors) && ! sizeof($obj->warnings)) $nbok++;
+ $result=$obj->import_insert($arrayrecord,$array_match_file_to_database,$objimport,count($fieldssource),$importid);
+ if (count($obj->errors)) $arrayoferrors[$sourcelinenb]=$obj->errors;
+ if (count($obj->warnings)) $arrayofwarnings[$sourcelinenb]=$obj->warnings;
+ if (! count($obj->errors) && ! count($obj->warnings)) $nbok++;
}
// Close file
$obj->import_close_file();
@@ -1644,7 +1646,7 @@ if ($step == 6 && $datatoimport)
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.
print '';
@@ -1681,7 +1683,7 @@ function show_elem($fieldssource,$i,$pos,$key,$var,$nostyle='')
print ''."\n";
print '
'."\n";
- if ($pos && $pos > sizeof($fieldssource)) // No fields
+ if ($pos && $pos > count($fieldssource)) // No fields
{
print '';
print '';
@@ -1732,7 +1734,7 @@ function show_elem($fieldssource,$i,$pos,$key,$var,$nostyle='')
*/
function getnewkey(&$fieldssource,&$listofkey)
{
- $i=sizeof($fieldssource)+1;
+ $i=count($fieldssource)+1;
// Max number of key
$maxkey=0;
foreach($listofkey as $key=>$val)
diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php
index 58f83a95cee..d5f2396b4e4 100644
--- a/htdocs/imports/index.php
+++ b/htdocs/imports/index.php
@@ -91,7 +91,7 @@ print ' '.$langs->trans("ImportableDatas").' ';
//print ' ';
print ' ';
$val=true;
-if (sizeof($import->array_import_code))
+if (count($import->array_import_code))
{
foreach ($import->array_import_code as $key => $value)
{
@@ -118,7 +118,7 @@ print '
';
print '
';
print '
';
-if (sizeof($import->array_import_code))
+if (count($import->array_import_code))
{
//if ($user->rights->import->run)
//{
diff --git a/htdocs/includes/boxes/box_comptes.php b/htdocs/includes/boxes/box_comptes.php
index 86648746411..be8e3abd56e 100644
--- a/htdocs/includes/boxes/box_comptes.php
+++ b/htdocs/includes/boxes/box_comptes.php
@@ -119,7 +119,7 @@ class box_comptes extends ModeleBoxes {
}
// 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"',
'text' => $langs->trans('Total')
diff --git a/htdocs/includes/boxes/box_external_rss.php b/htdocs/includes/boxes/box_external_rss.php
index b57c5fa99e4..cf159c41599 100644
--- a/htdocs/includes/boxes/box_external_rss.php
+++ b/htdocs/includes/boxes/box_external_rss.php
@@ -101,7 +101,7 @@ class box_external_rss extends ModeleBoxes {
// INFO on items
$items=$rssparser->getItems();
- $nbitems=sizeof($items);
+ $nbitems=count($items);
for($i = 0; $i < $max && $i < $nbitems; $i++)
{
$item = $items[$i];
diff --git a/htdocs/includes/boxes/modules_boxes.php b/htdocs/includes/boxes/modules_boxes.php
index bd482efc50f..d899f0e0ce3 100644
--- a/htdocs/includes/boxes/modules_boxes.php
+++ b/htdocs/includes/boxes/modules_boxes.php
@@ -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
$nbcol=0;
- if (isset($contents[0])) $nbcol=sizeof($contents[0]);
- $nblines=sizeof($contents);
+ if (isset($contents[0])) $nbcol=count($contents[0]);
+ $nblines=count($contents);
print "\n\n\n";
print ''."\n";
@@ -167,7 +167,7 @@ class ModeleBoxes // Can't be abtract as it is instanciated to build "empty"
else print '
';
// Loop on each TD
- $nbcolthisline=sizeof($contents[$i]);
+ $nbcolthisline=count($contents[$i]);
for ($j=0; $j < $nbcolthisline; $j++)
{
// Define tdparam
diff --git a/htdocs/includes/menus/standard/auguria.lib.php b/htdocs/includes/menus/standard/auguria.lib.php
index e93897a6825..9899d121c1a 100644
--- a/htdocs/includes/menus/standard/auguria.lib.php
+++ b/htdocs/includes/menus/standard/auguria.lib.php
@@ -234,7 +234,8 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after)
$alt=0;
if (is_array($menu_array))
{
- for ($i = 0 ; $i < sizeof($menu_array) ; $i++)
+ $num=count($menu_array);
+ for ($i = 0; $i < $num; $i++)
{
$alt++;
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);
}
?>
diff --git a/htdocs/includes/menus/standard/eldy.lib.php b/htdocs/includes/menus/standard/eldy.lib.php
index 4bceaaac353..62f74b065dc 100644
--- a/htdocs/includes/menus/standard/eldy.lib.php
+++ b/htdocs/includes/menus/standard/eldy.lib.php
@@ -1329,7 +1329,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
$alt=0;
if (is_array($menu_array))
{
- for ($i = 0 ; $i < sizeof($menu_array) ; $i++)
+ $num=count($menu_array);
+ for ($i = 0; $i < $num; $i++)
{
$alt++;
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);
}
diff --git a/htdocs/includes/menus/standard/empty.php b/htdocs/includes/menus/standard/empty.php
index c25699f7625..66a93c6ce73 100644
--- a/htdocs/includes/menus/standard/empty.php
+++ b/htdocs/includes/menus/standard/empty.php
@@ -169,7 +169,8 @@ class MenuLeft {
$this->menu_array=$newmenu->liste;
$alt=0;
- for ($i = 0 ; $i < sizeof($this->menu_array) ; $i++)
+ $num=count($this->menu_array);
+ for ($i = 0; $i < $num; $i++)
{
$alt++;
if (empty($this->menu_array[$i]['level']))
diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php
index 10e9770a23f..d3eecdc5668 100644
--- a/htdocs/includes/modules/DolibarrModules.class.php
+++ b/htdocs/includes/modules/DolibarrModules.class.php
@@ -114,7 +114,8 @@ abstract class DolibarrModules
// Execute les requetes sql complementaires
if (! $err)
{
- for ($i = 0 ; $i < sizeof($array_sql) ; $i++)
+ $num=count($array_sql);
+ for ($i = 0; $i < $num; $i++)
{
if (! $err)
{
@@ -211,7 +212,8 @@ abstract class DolibarrModules
if (! $err) $err+=$this->delete_dirs();
// Run complementary sql requests
- for ($i = 0 ; $i < sizeof($array_sql) ; $i++)
+ $num=count($array_sql);
+ for ($i = 0; $i < $num; $i++)
{
if (! $err)
{
@@ -955,7 +957,7 @@ abstract class DolibarrModules
$err=0;
- //print $this->rights_class." ".sizeof($this->rights)." ";
+ //print $this->rights_class." ".count($this->rights)." ";
// Test if module is activated
$sql_del = "SELECT ".$this->db->decrypt('value')." as value";
diff --git a/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php
index 77f1f65b041..ca445a0bae9 100644
--- a/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php
+++ b/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php
@@ -137,7 +137,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
$pdf->SetAutoPageBreak(1,0);
- $nboflines=sizeof($this->lines);
+ $nboflines=count($this->lines);
// Define nb of page
$pages = intval($nboflines / $this->line_per_page);
if (($nboflines % $this->line_per_page)>0)
@@ -288,7 +288,8 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$pdf->SetFillColor(220,220,220);
$yp = 0;
$lineinpage=0;
- for ($j = 0 ; $j < sizeof($this->lines) ; $j++)
+ $num=count($this->lines);
+ for ($j = 0; $j < $num; $j++)
{
$lineinpage++;
@@ -309,7 +310,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$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;
diff --git a/htdocs/includes/modules/commande/pdf_edison.modules.php b/htdocs/includes/modules/commande/pdf_edison.modules.php
index 76529829853..3de200186ba 100644
--- a/htdocs/includes/modules/commande/pdf_edison.modules.php
+++ b/htdocs/includes/modules/commande/pdf_edison.modules.php
@@ -186,7 +186,7 @@ class pdf_edison extends ModelePDFCommandes
$iniY = $pdf->GetY();
$curY = $pdf->GetY();
$nexY = $pdf->GetY();
- $nblignes = sizeof($object->lines);
+ $nblignes = count($object->lines);
for ($i = 0 ; $i < $nblignes ; $i++)
{
@@ -569,7 +569,7 @@ class pdf_edison extends ModelePDFCommandes
// If CUSTOMER contact defined on invoice, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php
index fa268dd4da8..e577b427148 100644
--- a/htdocs/includes/modules/commande/pdf_einstein.modules.php
+++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php
@@ -934,7 +934,7 @@ class pdf_einstein extends ModelePDFCommandes
// If CUSTOMER contact defined on order, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php b/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php
index 7c412c0f900..4a552dcf5db 100644
--- a/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php
+++ b/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php
@@ -193,7 +193,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
//Generation du tableau
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
- $nblignes = sizeof($object->lines);
+ $nblignes = count($object->lines);
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
$usecontact=false;
$arrayidcontact=$object->$origin->getIdContact('external','SHIPPING');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php b/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php
index 4abdd943df8..c494ce76b8f 100644
--- a/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php
+++ b/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php
@@ -209,7 +209,8 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
$nexY = $tab_top + 7;
- for ($i = 0 ; $i < sizeof($object->lines) ; $i++)
+ $num=count($object->lines);
+ for ($i = 0; $i < $num; $i++)
{
$curY = $nexY;
@@ -439,7 +440,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
$carac_emetteur='';
// Add internal contact of proposal if defined
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$object->fetch_user($arrayidcontact[0]);
$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
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/includes/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 04f72a5e824..26c189a2456 100644
--- a/htdocs/includes/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/includes/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -189,7 +189,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
else
{
$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");
@@ -210,7 +210,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$texte.= '
';
// Scan directories
- if (sizeof($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.sizeof($listoffiles).' ';
+ if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).' ';
$texte.= '';
@@ -306,7 +306,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// If BILLING contact defined on invoice, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php b/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php
index 16331c1c0a3..ae7ac6bb0a6 100755
--- a/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/includes/modules/facture/doc/pdf_crabe.modules.php
@@ -176,7 +176,7 @@ class pdf_crabe extends ModelePDFFactures
if (file_exists($dir))
{
- $nblignes = sizeof($object->lines);
+ $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
@@ -1104,7 +1104,7 @@ class pdf_crabe extends ModelePDFFactures
if ($objecttype == 'propal')
{
$outputlangs->load('propal');
- $num=sizeof($objects);
+ $num=count($objects);
for ($i=0;$i<$num;$i++)
{
$posy+=4;
@@ -1116,7 +1116,7 @@ class pdf_crabe extends ModelePDFFactures
else if ($objecttype == 'commande')
{
$outputlangs->load('orders');
- $num=sizeof($objects);
+ $num=count($objects);
for ($i=0;$i<$num;$i++)
{
$posy+=4;
@@ -1165,7 +1165,7 @@ class pdf_crabe extends ModelePDFFactures
// If BILLING contact defined on invoice, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php b/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php
index d398bda4ee6..3f2f8e5b851 100755
--- a/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php
+++ b/htdocs/includes/modules/facture/doc/pdf_oursin.modules.php
@@ -205,7 +205,7 @@ class pdf_oursin extends ModelePDFFactures
$iniY = $pdf->GetY();
$curY = $pdf->GetY();
$nexY = $pdf->GetY();
- $nblignes = sizeof($object->lines);
+ $nblignes = count($object->lines);
// Loop on each lines
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->MultiCell(0, 4, $outputlangs->transnoentities("Qty"), 0, 'L');
- $nblignes = sizeof($object->lines);
+ $nblignes = count($object->lines);
$rem=0;
for ($i = 0 ; $i < $nblignes ; $i++)
{
@@ -849,7 +849,7 @@ class pdf_oursin extends ModelePDFFactures
// If BILLING contact defined on invoice, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
@@ -971,7 +971,7 @@ class pdf_oursin extends ModelePDFFactures
if ($objecttype == 'propal')
{
$outputlangs->load('propal');
- $num=sizeof($objects);
+ $num=count($objects);
for ($i=0;$i<$num;$i++)
{
$posy+=4;
@@ -982,7 +982,7 @@ class pdf_oursin extends ModelePDFFactures
}
else if ($objecttype == 'commande')
{
- $num=sizeof($objects);
+ $num=count($objects);
for ($i=0;$i<$num;$i++)
{
$posy+=4;
diff --git a/htdocs/includes/modules/facture/modules_facture.php b/htdocs/includes/modules/facture/modules_facture.php
index 99e265d3d9c..bbaaf2c5eb9 100644
--- a/htdocs/includes/modules/facture/modules_facture.php
+++ b/htdocs/includes/modules/facture/modules_facture.php
@@ -271,7 +271,7 @@ function facture_meta_create($db, $facid, $message="")
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;
$meta = "REFERENCE=\"" . $fac->ref . "\"
DATE=\"" . dol_print_date($fac->date,'') . "\"
diff --git a/htdocs/includes/modules/import/import_csv.modules.php b/htdocs/includes/modules/import/import_csv.modules.php
index 1145ec30c28..43ee7c98262 100644
--- a/htdocs/includes/modules/import/import_csv.modules.php
+++ b/htdocs/includes/modules/import/import_csv.modules.php
@@ -246,7 +246,7 @@ class ImportCsv extends ModeleImports
}
}
- $this->col=sizeof($newarrayres);
+ $this->col=count($newarrayres);
}
return $newarrayres;
@@ -289,8 +289,8 @@ class ImportCsv extends ModeleImports
//var_dump($sort_array_match_file_to_database);
- if (sizeof($arrayrecord) == 0 ||
- (sizeof($arrayrecord) == 1 && empty($arrayrecord[0]['val'])))
+ if (count($arrayrecord) == 0 ||
+ (count($arrayrecord) == 1 && empty($arrayrecord[0]['val'])))
{
//print 'W';
$this->warnings[$warning]['lib']=$langs->trans('EmptyLine');
diff --git a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php
index 78e85a430b8..1e6737c5f9f 100644
--- a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php
+++ b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php
@@ -100,7 +100,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
{
$object->fetch_thirdparty();
- $nblines = sizeof($object->lines);
+ $nblines = count($object->lines);
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->expedition->dir_output."/receipt";
@@ -359,7 +359,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
// If SHIPPING contact defined on invoice, we use it
$usecontact=false;
$arrayidcontact=$object->commande->getIdContact('external','SHIPPING');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
@@ -422,7 +422,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
foreach($object->linkedObjects as $elementtype => $objects)
{
- $num=sizeof($objects);
+ $num=count($objects);
for ($i=0;$i<$num;$i++)
{
$order=new Commande($this->db);
diff --git a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php
index 0086417abe5..a03e297a6a7 100644
--- a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php
+++ b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php
@@ -122,7 +122,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
{
$object->fetch_thirdparty();
- $nblines = sizeof($object->lines);
+ $nblines = count($object->lines);
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->expedition->dir_output."/receipt";
@@ -550,7 +550,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
foreach($object->linkedObjects as $elementtype => $objects)
{
- $num=sizeof($objects);
+ $num=count($objects);
for ($i=0;$i<$num;$i++)
{
$order=new Commande($this->db);
@@ -612,7 +612,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// If SHIPPING contact defined on invoice, we use it
$usecontact=false;
$arrayidcontact=$object->commande->getIdContact('external','SHIPPING');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/modules/mailings/modules_mailings.php b/htdocs/includes/modules/mailings/modules_mailings.php
index c3cf5a77900..786999c6760 100644
--- a/htdocs/includes/modules/mailings/modules_mailings.php
+++ b/htdocs/includes/modules/mailings/modules_mailings.php
@@ -133,7 +133,7 @@ abstract class MailingTargets
// Insert emailing targest from array into database
$j = 0;
- $num = sizeof($cibles);
+ $num = count($cibles);
for ($i = 0 ; $i < $num ; $i++)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_cibles";
diff --git a/htdocs/includes/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/includes/modules/mailings/thirdparties_services_expired.modules.php
index 4e28e85f6b6..478cfca9dd0 100755
--- a/htdocs/includes/modules/mailings/thirdparties_services_expired.modules.php
+++ b/htdocs/includes/modules/mailings/thirdparties_services_expired.modules.php
@@ -204,7 +204,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
$s='';
$s.='';
- if (sizeof($this->arrayofproducts)) $s.=' ';
+ if (count($this->arrayofproducts)) $s.=' ';
else $s.=''.$langs->trans("ContactsAllShort").' ';
foreach($this->arrayofproducts as $key => $val)
{
diff --git a/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php b/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php
index 73c9f7031cd..07303b6ef38 100644
--- a/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php
+++ b/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php
@@ -105,7 +105,7 @@ class pdf_baleine extends ModelePDFProjects
if ($conf->projet->dir_output)
{
- $nblignes = sizeof($object->lines);
+ $nblignes = count($object->lines);
$default_font_size = pdf_getPDFFontsize($outputlangs);
@@ -139,7 +139,7 @@ class pdf_baleine extends ModelePDFProjects
$tasksarray = $task->getTasksArray(0,0,$object->id);
$object->lines=$tasksarray;
- $nblignes=sizeof($object->lines);
+ $nblignes=count($object->lines);
$pdf->Open();
$pagenb=0;
@@ -382,7 +382,7 @@ class pdf_baleine extends ModelePDFProjects
if ($objecttype == 'commande')
{
$outputlangs->load('orders');
- $num=sizeof($objects);
+ $num=count($objects);
for ($i=0;$i<$num;$i++)
{
$posy+=4;
diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
index 32c2ef1b9ef..853119a43fb 100644
--- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
+++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php
@@ -953,7 +953,7 @@ class pdf_propale_azur extends ModelePDFPropales
$carac_emetteur='';
// Add internal contact of proposal if defined
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$object->fetch_user($arrayidcontact[0]);
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
@@ -991,7 +991,7 @@ class pdf_propale_azur extends ModelePDFPropales
// If CUSTOMER contact defined, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php
index 97c3078f8c2..b9ff4420a80 100644
--- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php
+++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php
@@ -953,7 +953,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$carac_emetteur='';
// Add internal contact of proposal if defined
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$object->fetch_user($arrayidcontact[0]);
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n";
@@ -991,7 +991,7 @@ class pdf_propale_jaune extends ModelePDFPropales
// If CUSTOMER contact defined, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/modules/rapport/pdf_paiement.class.php b/htdocs/includes/modules/rapport/pdf_paiement.class.php
index ede63b64be5..7f9e90b7624 100644
--- a/htdocs/includes/modules/rapport/pdf_paiement.class.php
+++ b/htdocs/includes/modules/rapport/pdf_paiement.class.php
@@ -269,7 +269,7 @@ class pdf_paiement
$oldprowid = 0;
$pdf->SetFillColor(220,220,220);
$yp = 0;
- $numlines=sizeof($lines);
+ $numlines=count($lines);
for ($j = 0 ; $j < $numlines ; $j++)
{
$i = $j;
diff --git a/htdocs/includes/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/includes/modules/societe/doc/doc_generic_odt.modules.php
index e14aed7ff5d..db81b13b1f8 100644
--- a/htdocs/includes/modules/societe/doc/doc_generic_odt.modules.php
+++ b/htdocs/includes/modules/societe/doc/doc_generic_odt.modules.php
@@ -108,7 +108,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
else
{
$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");
@@ -129,7 +129,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$texte.= '
';
// Scan directories
- if (sizeof($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.sizeof($listoffiles).' ';
+ if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).' ';
$texte.= '';
diff --git a/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php
index 747f3c50a36..b4c6d068c4b 100755
--- a/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php
+++ b/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php
@@ -167,7 +167,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
if (file_exists($dir))
{
- $nblignes = sizeof($object->lines);
+ $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
@@ -821,7 +821,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
// If BILLING contact defined on invoice, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php
index 606a1bf264a..28c35c0293e 100644
--- a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php
+++ b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php
@@ -170,7 +170,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
if (file_exists($dir))
{
- $nblignes = sizeof($object->lines);
+ $nblignes = count($object->lines);
$pdf=pdf_getInstance($this->format);
@@ -752,7 +752,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
// If BILLING contact defined on invoice, we use it
$usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING');
- if (sizeof($arrayidcontact) > 0)
+ if (count($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
diff --git a/htdocs/includes/triggers/interface_modLdap_Ldapsynchro.class.php b/htdocs/includes/triggers/interface_modLdap_Ldapsynchro.class.php
index 5ca41b94c65..d1bd3e3fffc 100644
--- a/htdocs/includes/triggers/interface_modLdap_Ldapsynchro.class.php
+++ b/htdocs/includes/triggers/interface_modLdap_Ldapsynchro.class.php
@@ -136,7 +136,7 @@ class InterfaceLdapsynchro
$container=$object->oldcopy->_load_ldap_dn($oldinfo,1);
$search = "(".$object->oldcopy->_load_ldap_dn($oldinfo,2).")";
$records=$ldap->search($container,$search);
- if (sizeof($records) && $records['count'] == 0)
+ if (count($records) && $records['count'] == 0)
{
$olddn = '';
}
@@ -167,7 +167,7 @@ class InterfaceLdapsynchro
$container=$object->oldcopy->_load_ldap_dn($oldinfo,1);
$search = "(".$object->oldcopy->_load_ldap_dn($oldinfo,2).")";
$records=$ldap->search($container,$search);
- if (sizeof($records) && $records['count'] == 0)
+ if (count($records) && $records['count'] == 0)
{
$olddn = '';
}
@@ -240,7 +240,7 @@ class InterfaceLdapsynchro
$container=$object->oldcopy->_load_ldap_dn($oldinfo,1);
$search = "(".$object->oldcopy->_load_ldap_dn($oldinfo,2).")";
$records=$ldap->search($container,$search);
- if (sizeof($records) && $records['count'] == 0)
+ if (count($records) && $records['count'] == 0)
{
$olddn = '';
}
@@ -310,7 +310,7 @@ class InterfaceLdapsynchro
$container=$object->oldcopy->_load_ldap_dn($oldinfo,1);
$search = "(".$object->oldcopy->_load_ldap_dn($oldinfo,2).")";
$records=$ldap->search($container,$search);
- if (sizeof($records) && $records['count'] == 0)
+ if (count($records) && $records['count'] == 0)
{
$olddn = '';
}
@@ -433,7 +433,7 @@ class InterfaceLdapsynchro
$container=$object->oldcopy->_load_ldap_dn($oldinfo,1);
$search = "(".$object->oldcopy->_load_ldap_dn($oldinfo,2).")";
$records=$ldap->search($container,$search);
- if (sizeof($records) && $records['count'] == 0)
+ if (count($records) && $records['count'] == 0)
{
$olddn = '';
}
diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index 44369ab7634..edb3208656d 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -400,7 +400,7 @@ else
print $langs->trans("UpgradeDesc");
if ($ok)
{
- if (sizeof($dolibarrlastupgradeversionarray) >= 2) // If a database access is available and a version x.y already available
+ if (count($dolibarrlastupgradeversionarray) >= 2) // If a database access is available and a version x.y already available
{
// Now we check if this is the first qualified choice
if ($allowupgrade && empty($foundrecommandedchoice) && versioncompare($dolibarrversiontoarray,$dolibarrlastupgradeversionarray) > 0)
@@ -408,7 +408,7 @@ else
print ' ';
//print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE);
print ''.$langs->trans("InstallChoiceSuggested").'
';
- if ($count < sizeof($migarray)) // There is other choices after
+ if ($count < count($migarray)) // There is other choices after
{
print $langs->trans("MigrateIsDoneStepByStep",DOL_VERSION);
}
@@ -427,7 +427,7 @@ else
if ($allowupgrade)
{
// If it's not last updagre script, action = upgrade_tmp, if last action = upgrade
- print ''.$langs->trans("Start").' ';
+ print ''.$langs->trans("Start").' ';
}
else
{
diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php
index 74255c7c1f8..b613f3546af 100644
--- a/htdocs/install/etape1.php
+++ b/htdocs/install/etape1.php
@@ -331,7 +331,8 @@ if (! $error && $db->connected && $action == "set")
$dir[6] = $main_data_dir."/produit";
// Boucle sur chaque repertoire de dir[] pour les creer s'ils nexistent pas
- for ($i = 0 ; $i < sizeof($dir) ; $i++)
+ $num=count($dir);
+ for ($i = 0; $i < $num; $i++)
{
if (is_dir($dir[$i]))
{
diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php
index 2f25a2fc261..df3e82658b9 100644
--- a/htdocs/install/etape2.php
+++ b/htdocs/install/etape2.php
@@ -296,7 +296,7 @@ if ($action == "set")
$versioncommande=explode('.',$reg[1]);
//print var_dump($versioncommande);
//print var_dump($versionarray);
- if (sizeof($versioncommande) && sizeof($versionarray)
+ if (count($versioncommande) && count($versionarray)
&& versioncompare($versioncommande,$versionarray) <= 0)
{
// Version qualified, delete SQL comments
@@ -309,7 +309,7 @@ if ($action == "set")
$versioncommande=explode('.',$reg[1]);
//print var_dump($versioncommande);
//print var_dump($versionarray);
- if (sizeof($versioncommande) && sizeof($versionarray)
+ if (count($versioncommande) && count($versionarray)
&& versioncompare($versioncommande,$versionarray) <= 0)
{
// Version qualified, delete SQL comments
@@ -533,7 +533,7 @@ if ($action == "set")
}
fclose($fp);
- dolibarr_install_syslog("Found ".$linefound." records, defined ".sizeof($arrayofrequests)." groups.",LOG_DEBUG);
+ dolibarr_install_syslog("Found ".$linefound." records, defined ".count($arrayofrequests)." groups.",LOG_DEBUG);
// We loop on each requests
foreach($arrayofrequests as $buffer)
diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php
index 794e2d8ca39..94d37eab946 100644
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -385,7 +385,7 @@ function pFooter($nonext=0,$setuplang='',$jscheckfunction='')
print ''."\n";
// If there is some logs in buffer to show
- if (isset($conf->logbuffer) && sizeof($conf->logbuffer))
+ if (isset($conf->logbuffer) && count($conf->logbuffer))
{
print "\n";
print "