diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php
index cb70e9541dc..569bcc9dfd4 100644
--- a/dev/translation/autotranslator.class.php
+++ b/dev/translation/autotranslator.class.php
@@ -221,8 +221,8 @@ class autoTranslator
}
if ($key == 'CHARSET') $val=$this->_outputpagecode;
- else if (preg_match('/^Format/',$key)) $val=$value;
- else if ($value=='-') $val=$value;
+ elseif (preg_match('/^Format/',$key)) $val=$value;
+ elseif ($value=='-') $val=$value;
else
{
// If not translated then translate
diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php
index 0e3b2c7513f..cfc51e210f4 100755
--- a/dev/translation/sanity_check_en_langfiles.php
+++ b/dev/translation/sanity_check_en_langfiles.php
@@ -215,8 +215,8 @@ foreach ($dups as $string => $pages)
$s.="\n";
if ($duplicateinsamefile) $sduplicateinsamefile .= $s;
- else if ($inmain) $sinmainandother .= $s;
- else if ($inadmin) $sininstallandadmin .= $s;
+ elseif ($inmain) $sinmainandother .= $s;
+ elseif ($inadmin) $sininstallandadmin .= $s;
else $sother .= $s;
}
diff --git a/dev/translation/strip_language_file.php b/dev/translation/strip_language_file.php
index 92233d71b98..685626d6c11 100755
--- a/dev/translation/strip_language_file.php
+++ b/dev/translation/strip_language_file.php
@@ -310,7 +310,7 @@ foreach($filesToProcess as $fileToProcess)
{
//print "Key $key is a key we always want to see into secondary file (line: $cnt).\n";
}
- else if ( ! array_key_exists($key, $aSecondary))
+ elseif ( ! array_key_exists($key, $aSecondary))
{
//print "Key $key does NOT exist in secondary language (line: $cnt).\n";
continue;
diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index c9b72d9cc4c..45ecb5cd6e6 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -162,7 +162,7 @@ if (empty($reshook))
if ($result < 0) {
setEventMessages($accounting->error, $accounting->errors, 'errors');
}
- } else if ($action == 'enable') {
+ } elseif ($action == 'enable') {
if ($accounting->fetch($id)) {
$result = $accounting->account_activate($id);
}
diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php
index a5b39744e06..0d1d5625958 100644
--- a/htdocs/accountancy/admin/accountmodel.php
+++ b/htdocs/accountancy/admin/accountmodel.php
@@ -270,7 +270,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') {
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
}
- else if ($value == 'entity') {
+ elseif ($value == 'entity') {
$_POST[$listfieldvalue[$i]] = $conf->entity;
}
if ($i) $sql.=",";
@@ -318,7 +318,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
}
- else if ($field == 'entity') {
+ elseif ($field == 'entity') {
$_POST[$listfieldvalue[$i]] = $conf->entity;
}
if ($i) $sql.=",";
@@ -535,7 +535,7 @@ if ($id)
{
print '';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).' ';
- else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
+ elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
else print $valuetoshow;
print ' ';
}
@@ -729,14 +729,14 @@ if ($id)
{
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
}
- else if ($value == 'source')
+ elseif ($value == 'source')
{
$valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
}
- else if ($valuetoshow=='all') {
+ elseif ($valuetoshow=='all') {
$valuetoshow=$langs->trans('All');
}
- else if ($fieldlist[$field]=='country') {
+ elseif ($fieldlist[$field]=='country') {
if (empty($obj->country_code))
{
$valuetoshow='-';
@@ -747,7 +747,7 @@ if ($id)
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
}
}
- else if ($fieldlist[$field]=='country_id') {
+ elseif ($fieldlist[$field]=='country_id') {
$showfield=0;
}
diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php
index a2ec757b212..b8e6945b632 100644
--- a/htdocs/accountancy/admin/card.php
+++ b/htdocs/accountancy/admin/card.php
@@ -124,7 +124,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
exit;
}
}
-} else if ($action == 'edit' && $user->rights->accounting->chartofaccount) {
+} elseif ($action == 'edit' && $user->rights->accounting->chartofaccount) {
if (! $cancel) {
$result = $object->fetch($id);
@@ -177,7 +177,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
header("Location: " . $urltogo);
exit();
}
-} else if ($action == 'delete' && $user->rights->accounting->chartofaccount) {
+} elseif ($action == 'delete' && $user->rights->accounting->chartofaccount) {
$result = $object->fetch($id);
if (! empty($object->id)) {
@@ -272,7 +272,7 @@ if ($action == 'create') {
print '';
}
-else if ($id > 0 || $ref) {
+elseif ($id > 0 || $ref) {
$result = $object->fetch($id, $ref, 1);
diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php
index 80880c7bbb3..ebd8011469e 100644
--- a/htdocs/accountancy/admin/categories_list.php
+++ b/htdocs/accountancy/admin/categories_list.php
@@ -268,7 +268,7 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha'))
if ($field == 'fk_country' && $_POST['country'] > 0) {
$_POST[$listfieldvalue[$i]] = $_POST['country'];
}
- else if ($field == 'entity') {
+ elseif ($field == 'entity') {
$_POST[$listfieldvalue[$i]] = $conf->entity;
}
if ($i) $sql.=",";
@@ -492,7 +492,7 @@ if ($id)
{
print '';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).' ';
- else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
+ elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
else print $valuetoshow;
print ' ';
}
@@ -699,10 +699,10 @@ if ($id)
{
$valuetoshow = yn($valuetoshow);
}
- else if ($valuetoshow=='all') {
+ elseif ($valuetoshow=='all') {
$valuetoshow=$langs->trans('All');
}
- else if ($fieldlist[$field]=='country') {
+ elseif ($fieldlist[$field]=='country') {
if (empty($obj->country_code))
{
$valuetoshow='-';
@@ -713,20 +713,20 @@ if ($id)
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
}
}
- else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
+ elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
$key=$langs->trans("Country".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
+ elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
$langs->loadLangs(array("propal"));
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
+ elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
$key=$langs->trans("Action".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
+ elseif ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
$showfield=0;
}
diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php
index 297a3026b02..42a6710c3c1 100644
--- a/htdocs/accountancy/admin/fiscalyear_card.php
+++ b/htdocs/accountancy/admin/fiscalyear_card.php
@@ -73,7 +73,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
}
}
-else if ($action == 'add') {
+elseif ($action == 'add') {
if (! GETPOST('cancel', 'alpha')) {
$error = 0;
@@ -118,7 +118,7 @@ else if ($action == 'add') {
}
// Update record
-else if ($action == 'update') {
+elseif ($action == 'update') {
if (! GETPOST('cancel', 'alpha')) {
$result = $object->fetch($id);
@@ -198,7 +198,7 @@ if ($action == 'create')
print '';
print '';
-} else if ($id) {
+} elseif ($id) {
$result = $object->fetch($id);
if ($result > 0) {
$head = fiscalyear_prepare_head($object);
diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php
index 4611a0ba906..f26aba437e5 100644
--- a/htdocs/accountancy/admin/journals_list.php
+++ b/htdocs/accountancy/admin/journals_list.php
@@ -270,7 +270,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
}
- else if ($field == 'entity') {
+ elseif ($field == 'entity') {
$_POST[$listfieldvalue[$i]] = $conf->entity;
}
if ($i) $sql.=",";
@@ -441,7 +441,7 @@ if ($id)
{
print '';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).' ';
- else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
+ elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
else print $valuetoshow;
print ' ';
}
@@ -611,11 +611,11 @@ if ($id)
if ($valuetoshow=='all') {
$valuetoshow=$langs->trans('All');
}
- else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
+ elseif ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
$key=$langs->trans("AccountingJournalType".strtoupper($obj->nature));
$valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature))?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
+ elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
$valuetoshow=$langs->trans($obj->label);
}
@@ -630,8 +630,8 @@ if ($id)
if (isset($obj->code) && $id != 10)
{
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
- else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
- else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
+ elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
+ elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
}
$canbemodified=$iserasable;
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index 36ed261f20f..4cc03f7a529 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -140,7 +140,7 @@ if ($action == "confirm_update") {
}
}
-else if ($action == "add") {
+elseif ($action == "add") {
$error = 0;
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0))
@@ -201,7 +201,7 @@ else if ($action == "add") {
}
}
-else if ($action == "confirm_delete") {
+elseif ($action == "confirm_delete") {
$object = new BookKeeping($db);
$result = $object->fetch($id, null, $mode);
@@ -218,7 +218,7 @@ else if ($action == "confirm_delete") {
$action = '';
}
-else if ($action == "confirm_create") {
+elseif ($action == "confirm_create") {
$error = 0;
$object = new BookKeeping($db);
diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php
index 46ebb8b4bc8..4a4cfa928ac 100644
--- a/htdocs/accountancy/customer/lines.php
+++ b/htdocs/accountancy/customer/lines.php
@@ -219,12 +219,12 @@ if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
- else if ($search_year > 0 && ! empty($search_day))
+ elseif ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
}
-else if ($search_year > 0)
+elseif ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index c6c12a26f31..79ff0d07ae6 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -257,12 +257,12 @@ if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
- else if ($search_year > 0 && ! empty($search_day))
+ elseif ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
}
-else if ($search_year > 0)
+elseif ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php
index c617f984af3..c6fa1202171 100644
--- a/htdocs/accountancy/expensereport/lines.php
+++ b/htdocs/accountancy/expensereport/lines.php
@@ -190,12 +190,12 @@ if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
- else if ($search_year > 0 && ! empty($search_day))
+ elseif ($search_year > 0 && ! empty($search_day))
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
}
-else if ($search_year > 0)
+elseif ($search_year > 0)
{
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php
index 6977d76845d..078a91bc96e 100644
--- a/htdocs/accountancy/expensereport/list.php
+++ b/htdocs/accountancy/expensereport/list.php
@@ -219,12 +219,12 @@ if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
- else if ($search_year > 0 && ! empty($search_day))
+ elseif ($search_year > 0 && ! empty($search_day))
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
}
-else if ($search_year > 0)
+elseif ($search_year > 0)
{
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 24bf2097b67..b6b5137fe34 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -290,18 +290,18 @@ if ($result) {
$paymentstatic->ref = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this
$tabpay[$obj->rowid]["paymentid"] = $paymentstatic->id;
- } else if ($links[$key]['type'] == 'payment_supplier') {
+ } elseif ($links[$key]['type'] == 'payment_supplier') {
$paymentsupplierstatic->id = $links[$key]['url_id'];
$paymentsupplierstatic->ref = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentsupplierid"] = $paymentsupplierstatic->id;
- } else if ($links[$key]['type'] == 'company') {
+ } elseif ($links[$key]['type'] == 'company') {
$societestatic->id = $links[$key]['url_id'];
$societestatic->name = $links[$key]['label'];
$societestatic->email = $tabcompany[$obj->rowid]['email'];
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
if ($compta_soc) $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
- } else if ($links[$key]['type'] == 'user') {
+ } elseif ($links[$key]['type'] == 'user') {
$userstatic->id = $links[$key]['url_id'];
$userstatic->name = $links[$key]['label'];
$userstatic->email = $tabuser[$obj->rowid]['email'];
@@ -310,7 +310,7 @@ if ($result) {
if ($userstatic->id > 0) $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
else $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
if ($compta_user) $tabtp[$obj->rowid][$compta_user] += $obj->amount;
- } else if ($links[$key]['type'] == 'sc') {
+ } elseif ($links[$key]['type'] == 'sc') {
$chargestatic->id = $links[$key]['url_id'];
$chargestatic->ref = $links[$key]['url_id'];
@@ -339,14 +339,14 @@ if ($result) {
$objmid = $db->fetch_object($resultmid);
$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
}
- } else if ($links[$key]['type'] == 'payment_donation') {
+ } elseif ($links[$key]['type'] == 'payment_donation') {
$paymentdonstatic->id = $links[$key]['url_id'];
$paymentdonstatic->ref = $links[$key]['url_id'];
$paymentdonstatic->fk_donation = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentdonstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id;
$tabtp[$obj->rowid][$account_pay_donation] += $obj->amount;
- } else if ($links[$key]['type'] == 'member') {
+ } elseif ($links[$key]['type'] == 'member') {
$paymentsubscriptionstatic->id = $links[$key]['url_id'];
$paymentsubscriptionstatic->ref = $links[$key]['url_id'];
$paymentsubscriptionstatic->label = $links[$key]['label'];
@@ -354,24 +354,24 @@ if ($result) {
$tabpay[$obj->rowid]["paymentsubscriptionid"] = $paymentsubscriptionstatic->id;
$paymentsubscriptionstatic->fetch($paymentsubscriptionstatic->id);
$tabtp[$obj->rowid][$account_pay_subscription] += $obj->amount;
- } else if ($links[$key]['type'] == 'payment_vat') { // Payment VAT
+ } elseif ($links[$key]['type'] == 'payment_vat') { // Payment VAT
$paymentvatstatic->id = $links[$key]['url_id'];
$paymentvatstatic->ref = $links[$key]['url_id'];
$paymentvatstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id;
$tabtp[$obj->rowid][$account_pay_vat] += $obj->amount;
- } else if ($links[$key]['type'] == 'payment_salary') {
+ } elseif ($links[$key]['type'] == 'payment_salary') {
$paymentsalstatic->id = $links[$key]['url_id'];
$paymentsalstatic->ref = $links[$key]['url_id'];
$paymentsalstatic->label = $links[$key]['label'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
- } else if ($links[$key]['type'] == 'payment_expensereport') {
+ } elseif ($links[$key]['type'] == 'payment_expensereport') {
$paymentexpensereportstatic->id = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentexpensereport"] = $paymentexpensereportstatic->id;
- } else if ($links[$key]['type'] == 'payment_various') {
+ } elseif ($links[$key]['type'] == 'payment_various') {
$paymentvariousstatic->id = $links[$key]['url_id'];
$paymentvariousstatic->ref = $links[$key]['url_id'];
$paymentvariousstatic->label = $links[$key]['label'];
@@ -380,7 +380,7 @@ if ($result) {
$paymentvariousstatic->fetch($paymentvariousstatic->id);
$account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word
$tabtp[$obj->rowid][$account_various] += $obj->amount;
- } else if ($links[$key]['type'] == 'payment_loan') {
+ } elseif ($links[$key]['type'] == 'payment_loan') {
$paymentloanstatic->id = $links[$key]['url_id'];
$paymentloanstatic->ref = $links[$key]['url_id'];
$paymentloanstatic->fk_loan = $links[$key]['url_id'];
@@ -399,7 +399,7 @@ if ($result) {
$tabtp[$obj->rowid][$objmid->accountancy_account_insurance] -= $objmid->amount_insurance;
$tabtp[$obj->rowid][$objmid->accountancy_account_interest] -= $objmid->amount_interest;
}
- } else if ($links[$key]['type'] == 'banktransfert') {
+ } elseif ($links[$key]['type'] == 'banktransfert') {
$accountLinestatic->fetch($links[$key]['url_id']);
$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- ' .$accountLinestatic ->getNomUrl(1);
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
@@ -567,68 +567,68 @@ if (! $error && $action == 'writebookkeeping') {
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
$bookkeeping->label_compte = $accountingaccount->label;
- } else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
+ } elseif ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
$bookkeeping->label_compte = $accountingaccount->label;
- } else if ($tabtype[$key] == 'payment_expensereport') {
+ } elseif ($tabtype[$key] == 'payment_expensereport') {
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
$bookkeeping->subledger_label = $tabuser[$key]['name'];
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
$bookkeeping->label_compte = $accountingaccount->label;
- } else if ($tabtype[$key] == 'payment_salary') {
+ } elseif ($tabtype[$key] == 'payment_salary') {
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
$bookkeeping->subledger_label = $tabuser[$key]['name'];
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
$bookkeeping->label_compte = $accountingaccount->label;
- } else if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
+ } elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
$bookkeeping->subledger_account = '';
$bookkeeping->subledger_label = '';
$bookkeeping->numero_compte = $k;
$bookkeeping->label_compte = $objmid->labelc;
- } else if ($tabtype[$key] == 'payment_vat') {
+ } elseif ($tabtype[$key] == 'payment_vat') {
$bookkeeping->subledger_account = '';
$bookkeeping->subledger_label = '';
$bookkeeping->numero_compte = $k;
$accountingaccount->fetch(null, $k, true);
$bookkeeping->label_compte = $accountingaccount->label;
- } else if ($tabtype[$key] == 'payment_donation') {
+ } elseif ($tabtype[$key] == 'payment_donation') {
$bookkeeping->subledger_account = '';
$bookkeeping->subledger_label = '';
$bookkeeping->numero_compte = $k;
$accountingaccount->fetch(null, $k, true);
$bookkeeping->label_compte = $accountingaccount->label;
- } else if ($tabtype[$key] == 'member') {
+ } elseif ($tabtype[$key] == 'member') {
$bookkeeping->subledger_account = '';
$bookkeeping->subledger_label = '';
$bookkeeping->numero_compte = $k;
$accountingaccount->fetch(null, $k, true);
$bookkeeping->label_compte = $accountingaccount->label;
- } else if ($tabtype[$key] == 'payment_loan') {
+ } elseif ($tabtype[$key] == 'payment_loan') {
$bookkeeping->subledger_account = '';
$bookkeeping->subledger_label = '';
$bookkeeping->numero_compte = $k;
$accountingaccount->fetch(null, $k, true);
$bookkeeping->label_compte = $accountingaccount->label;
- } else if ($tabtype[$key] == 'payment_various') {
+ } elseif ($tabtype[$key] == 'payment_various') {
$bookkeeping->subledger_account = '';
$bookkeeping->subledger_label = '';
$bookkeeping->numero_compte = $k;
$accountingaccount->fetch(null, $k, true);
$bookkeeping->label_compte = $accountingaccount->label;
- } else if ($tabtype[$key] == 'banktransfert') {
+ } elseif ($tabtype[$key] == 'banktransfert') {
$bookkeeping->subledger_account = '';
$bookkeeping->subledger_label = '';
$bookkeeping->numero_compte = $k;
@@ -845,11 +845,11 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
if ($tabtype[$key] == 'payment_supplier') {
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
- } else if($tabtype[$key] == 'payment') {
+ } elseif($tabtype[$key] == 'payment') {
print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep;
- } else if($tabtype[$key] == 'payment_expensereport') {
+ } elseif($tabtype[$key] == 'payment_expensereport') {
print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
- } else if($tabtype[$key] == 'payment_salary') {
+ } elseif($tabtype[$key] == 'payment_salary') {
print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
} else {
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php
index 051562c656e..585c8400680 100644
--- a/htdocs/accountancy/supplier/lines.php
+++ b/htdocs/accountancy/supplier/lines.php
@@ -214,12 +214,12 @@ if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
- else if ($search_year > 0 && ! empty($search_day))
+ elseif ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
}
-else if ($search_year > 0)
+elseif ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index 4ca53d4bcab..1a315897f02 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -256,12 +256,12 @@ if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
- else if ($search_year > 0 && ! empty($search_day))
+ elseif ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
}
-else if ($search_year > 0)
+elseif ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index ab8fbe8ca06..d12d4b31aa2 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -2487,7 +2487,7 @@ class Adherent extends CommonObject
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // Create OpenLDAP MD5 password (TODO add type of encryption)
}
// Set LDAP password if possible
- else if ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
+ elseif ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
{
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
{
@@ -2502,7 +2502,7 @@ class Adherent extends CommonObject
}
}
// Use $this->pass_indatabase value if exists
- else if (! empty($this->pass_indatabase))
+ elseif (! empty($this->pass_indatabase))
{
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass_indatabase; // $this->pass_indatabase = mot de passe non crypte
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase, 4); // md5 for OpenLdap TODO add type of encryption
diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php
index a728ffe78d3..9ced878a68e 100644
--- a/htdocs/adherents/class/api_members.class.php
+++ b/htdocs/adherents/class/api_members.class.php
@@ -213,7 +213,7 @@ class Members extends DolibarrApi
if ($result < 0) {
throw new RestException(500, 'Error when resiliating member: '.$member->error);
}
- } else if ($value == '1') {
+ } elseif ($value == '1') {
$result = $member->validate(DolibarrApiAccess::$user);
if ($result < 0) {
throw new RestException(500, 'Error when validating member: '.$member->error);
diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php
index 8da764179a4..1a52c9226f5 100644
--- a/htdocs/adherents/stats/geo.php
+++ b/htdocs/adherents/stats/geo.php
@@ -210,9 +210,9 @@ if ($mode && ! count($data))
else
{
if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").' ';
- else if ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").' ';
- else if ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").' ';
- else if ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").' ';//+
+ elseif ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").' ';
+ elseif ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").' ';
+ elseif ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").' ';//+
else
{
print $langs->trans("MembersStatisticsDesc").' ';
diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index e476492fdfa..86c31e6cd04 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -793,8 +793,8 @@ if ($rowid > 0)
else
{
if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $bankviainvoice=1;
- else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
- else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $invoiceonly=1;
+ elseif (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
+ elseif (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $invoiceonly=1;
}
print "\n\n\n";
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index c1ce5c2c294..86b149fe2b9 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -538,11 +538,11 @@ if ($rowid > 0)
if ($status != '')
{
if ($status == '-1,1') { $titre=$langs->trans("MembersListQualified"); }
- else if ($status == '-1') { $titre=$langs->trans("MembersListToValid"); }
- else if ($status == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); }
- else if ($status == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); }
- else if ($status == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
- else if ($status == '0') { $titre=$langs->trans("MembersListResiliated"); }
+ elseif ($status == '-1') { $titre=$langs->trans("MembersListToValid"); }
+ elseif ($status == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); }
+ elseif ($status == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); }
+ elseif ($status == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
+ elseif ($status == '0') { $titre=$langs->trans("MembersListResiliated"); }
}
elseif ($action == 'search')
{
diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php
index 72097057149..f16226c812b 100644
--- a/htdocs/admin/agenda_other.php
+++ b/htdocs/admin/agenda_other.php
@@ -86,7 +86,7 @@ if ($action == 'set')
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
}
-else if ($action == 'specimen') // For orders
+elseif ($action == 'specimen') // For orders
{
$modele=GETPOST('module','alpha');
@@ -133,13 +133,13 @@ else if ($action == 'specimen') // For orders
}
// Activate a model
-else if ($action == 'setmodel')
+elseif ($action == 'setmodel')
{
//print "sssd".$value;
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -149,7 +149,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php
index 856d6f19668..10d716a1af6 100644
--- a/htdocs/admin/agenda_reminder.php
+++ b/htdocs/admin/agenda_reminder.php
@@ -81,7 +81,7 @@ if ($action == 'set')
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
}
-else if ($action == 'specimen') // For orders
+elseif ($action == 'specimen') // For orders
{
$modele=GETPOST('module','alpha');
@@ -128,13 +128,13 @@ else if ($action == 'specimen') // For orders
}
// Activate a model
-else if ($action == 'setmodel')
+elseif ($action == 'setmodel')
{
//print "sssd".$value;
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -144,7 +144,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php
index 031e4200268..34becb49ada 100644
--- a/htdocs/admin/bank.php
+++ b/htdocs/admin/bank.php
@@ -133,7 +133,7 @@ if ($action == 'specimen') {
if ($action == 'set') {
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del') {
+elseif ($action == 'del') {
$ret = delDocumentModel($value, $type);
if ($ret > 0) {
if ($conf->global->BANKADDON_PDF == "$value")
@@ -141,7 +141,7 @@ else if ($action == 'del') {
}
}
// Set default model
-else if ($action == 'setdoc') {
+elseif ($action == 'setdoc') {
if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '',
$conf->entity)) {
// The constant that was read before the new set
diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php
index c0480bb7e50..c5bc3f596b4 100644
--- a/htdocs/admin/boxes.php
+++ b/htdocs/admin/boxes.php
@@ -289,14 +289,14 @@ if ($resql)
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
$resql = $db->query($sql);
}
- else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
+ elseif (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
{
$box_order = "B0".$record['box_order'];
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
$resql = $db->query($sql);
}
}
- else if (dol_strlen($record['box_order']) == 2)
+ elseif (dol_strlen($record['box_order']) == 2)
{
if (preg_match("/[13579]{1}/",substr($record['box_order'],-1)))
{
@@ -304,7 +304,7 @@ if ($resql)
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
$resql = $db->query($sql);
}
- else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
+ elseif (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
{
$box_order = "B".$record['box_order'];
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index 2360c1f7b6e..42ea60d0f9f 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -73,7 +73,7 @@ if ($action == 'updateMask')
}
}
-else if ($action == 'specimen')
+elseif ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
@@ -119,12 +119,12 @@ else if ($action == 'specimen')
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -134,7 +134,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -151,7 +151,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
{
// TODO Check if numbering module chosen can be activated
// by calling method canBeActivated
@@ -159,7 +159,7 @@ else if ($action == 'setmod')
dolibarr_set_const($db, "COMMANDE_ADDON",$value,'chaine',0,'',$conf->entity);
}
-else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
+elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK')
{
$draft = GETPOST("COMMANDE_DRAFT_WATERMARK");
$res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
@@ -176,7 +176,7 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
}
}
-else if ($action == 'set_ORDER_FREE_TEXT')
+elseif ($action == 'set_ORDER_FREE_TEXT')
{
$freetext = GETPOST("ORDER_FREE_TEXT",'none'); // No alpha here, we want exact string
@@ -195,7 +195,7 @@ else if ($action == 'set_ORDER_FREE_TEXT')
}
// Activate Set Shippable Icon In List
-else if ($action=="setshippableiconinlist") {
+elseif ($action=="setshippableiconinlist") {
$setshippableiconinlist = GETPOST('value','int');
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity);
if (! $res > 0) $error++;
@@ -207,7 +207,7 @@ else if ($action=="setshippableiconinlist") {
}
// Activate ask for payment bank
-else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
+elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
{
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
@@ -224,7 +224,7 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
}
// Activate ask for warehouse
-else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
+elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
{
$res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index f0a0cde4c92..41786c2c55b 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -137,7 +137,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
}
else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING);
}
- else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
+ elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
{
$error++;
$langs->load("errors");
@@ -821,7 +821,7 @@ else
{
print 'logo).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').' ';
}
- else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
+ elseif ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
{
print ' ';
}
@@ -1097,11 +1097,11 @@ else
{
print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
}
- else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==1)
+ elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==1)
{
print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
}
- else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){
+ elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){
print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
}
@@ -1151,11 +1151,11 @@ else
{
print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
}
- else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==1)
+ elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==1)
{
print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
}
- else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==2)
+ elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==2)
{
print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
}
diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php
index 660f7c7c500..a54e1eb7aeb 100644
--- a/htdocs/admin/confexped.php
+++ b/htdocs/admin/confexped.php
@@ -71,7 +71,7 @@ if ($action == 'activate_delivery')
header("Location: confexped.php");
exit;
}
-else if ($action == 'disable_delivery')
+elseif ($action == 'disable_delivery')
{
dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON",$conf->entity);
header("Location: confexped.php");
diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php
index cfda870e9da..fedccb49642 100644
--- a/htdocs/admin/const.php
+++ b/htdocs/admin/const.php
@@ -233,7 +233,7 @@ $sql.= ", entity";
$sql.= " FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug
-else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
+elseif (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name'));
$sql.= " ORDER BY entity, name ASC";
diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index 60be9e062ba..0a704ce5ee8 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -69,7 +69,7 @@ if ($action == 'updateMask')
}
}
-else if ($action == 'specimen') // For contract
+elseif ($action == 'specimen') // For contract
{
$modele= GETPOST('module','alpha');
@@ -115,12 +115,12 @@ else if ($action == 'specimen') // For contract
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -130,7 +130,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -147,7 +147,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@@ -155,7 +155,7 @@ else if ($action == 'setmod')
dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity);
}
-else if ($action == 'set_other')
+elseif ($action == 'set_other')
{
$freetext= GETPOST('CONTRACT_FREE_TEXT','none'); // No alpha here, we want exact string
$res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index df61d33092a..c57a511b3c9 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -728,7 +728,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') {
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
}
- else if ($value == 'entity') {
+ elseif ($value == 'entity') {
$_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]);
}
if ($i) $sql.=",";
@@ -780,7 +780,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
}
- else if ($field == 'entity') {
+ elseif ($field == 'entity') {
$_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]);
}
if ($i) $sql.=",";
@@ -1125,7 +1125,7 @@ if ($id)
{
print '';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).' ';
- else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
+ elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
else print $valuetoshow;
print ' ';
}
@@ -1409,14 +1409,14 @@ if ($id)
{
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
}
- else if ($value == 'source')
+ elseif ($value == 'source')
{
$valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
}
- else if ($valuetoshow=='all') {
+ elseif ($valuetoshow=='all') {
$valuetoshow=$langs->trans('All');
}
- else if ($fieldlist[$field]=='country') {
+ elseif ($fieldlist[$field]=='country') {
if (empty($obj->country_code))
{
$valuetoshow='-';
@@ -1427,143 +1427,143 @@ if ($id)
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
}
}
- else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
+ elseif ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
$valuetoshow=yn($valuetoshow);
$align="center";
}
- else if ($fieldlist[$field]=='type_cdr') {
+ elseif ($fieldlist[$field]=='type_cdr') {
if(empty($valuetoshow)) $valuetoshow = $langs->trans('None');
elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
$align="center";
}
- else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
+ elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
$valuetoshow=price($valuetoshow);
}
if ($value == 'private')
{
$valuetoshow = yn($elementList[$valuetoshow]);
}
- else if ($fieldlist[$field]=='libelle_facture') {
+ elseif ($fieldlist[$field]=='libelle_facture') {
$langs->load("bills");
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
$valuetoshow=nl2br($valuetoshow);
}
- else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
+ elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
$key=$langs->trans("Country".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
+ elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
$langs->load("propal");
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
+ elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
$key=$langs->trans("Action".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
+ elseif (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
$key=$langs->trans("Currency".strtoupper($obj->code_iso));
$valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') {
+ elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') {
$key=$langs->trans(strtoupper($obj->code));
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') {
+ elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') {
$key=$langs->trans(strtoupper($obj->code));
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') {
+ elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') {
$key=$langs->trans("Civility".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
+ elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
$langs->load('agenda');
$key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') {
+ elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') {
$langs->load("bills");
$key=$langs->trans("PaymentConditionShort".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
+ elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
$langs->load("bills");
$key=$langs->trans("PaymentType".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
+ elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
$key=$langs->trans("DemandReasonType".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') {
+ elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') {
$langs->load("orders");
$key=$langs->trans($obj->code);
$valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]};
}
- else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') {
+ elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') {
$langs->load("sendings");
$key=$langs->trans("SendingMethod".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format')
+ elseif ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format')
{
$key = $langs->trans('PaperFormat'.strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
+ elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
{
$langs->load('trips');
$key = $langs->trans(strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
+ elseif ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
$showfield=0;
}
- else if ($fieldlist[$field]=='unicode') {
+ elseif ($fieldlist[$field]=='unicode') {
$valuetoshow = $langs->getCurrencySymbol($obj->code,1);
}
- else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
+ elseif ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
$langs->load("products");
$valuetoshow=$langs->trans($obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
+ elseif ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
$langs->load("products");
$valuetoshow = $langs->trans($obj->{$fieldlist[$field]});
}
- else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
+ elseif (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
{
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
}
- else if ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') {
+ elseif ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') {
$align="center";
}
- else if ($fieldlist[$field]=='localtax1_type') {
+ elseif ($fieldlist[$field]=='localtax1_type') {
if ($obj->localtax1 != 0)
$valuetoshow=$localtax_typeList[$valuetoshow];
else
$valuetoshow = '';
$align="center";
}
- else if ($fieldlist[$field]=='localtax2_type') {
+ elseif ($fieldlist[$field]=='localtax2_type') {
if ($obj->localtax2 != 0)
$valuetoshow=$localtax_typeList[$valuetoshow];
else
$valuetoshow = '';
$align="center";
}
- else if ($fieldlist[$field]=='taux') {
+ elseif ($fieldlist[$field]=='taux') {
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
$align="center";
}
- else if (in_array($fieldlist[$field],array('recuperableonly')))
+ elseif (in_array($fieldlist[$field],array('recuperableonly')))
{
$align="center";
}
- else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
+ elseif ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
$valuetoshow = length_accountg($valuetoshow);
}
elseif ($fieldlist[$field] == 'fk_tva')
@@ -1604,8 +1604,8 @@ if ($id)
if (isset($obj->code) && $id != 10)
{
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
- else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
- else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
+ elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
+ elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
}
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
@@ -1639,8 +1639,8 @@ if ($id)
else
{
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");
- else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
- else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
+ elseif (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
+ elseif (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
else print $langs->trans("AlwaysActive");
}
print "";
diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php
index c1bb4e997dc..1fac509705c 100644
--- a/htdocs/admin/dolistore/ajax/image.php
+++ b/htdocs/admin/dolistore/ajax/image.php
@@ -53,6 +53,6 @@ try {
// Here we are dealing with errors
$trace = $e->getTrace();
if ($trace[0]['args'][0] == 404) die('Bad ID');
- else if ($trace[0]['args'][0] == 401) die('Bad auth key');
+ elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
}
diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php
index e676423e6b0..a21eb56cb2c 100644
--- a/htdocs/admin/dolistore/class/dolistore.class.php
+++ b/htdocs/admin/dolistore/class/dolistore.class.php
@@ -154,7 +154,7 @@ class Dolistore
// Here we are dealing with errors
$trace = $e->getTrace();
if ($trace[0]['args'][0] == 404) die('Bad ID');
- else if ($trace[0]['args'][0] == 401) die('Bad auth key');
+ elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
else
{
print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.' ';
diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php
index 3126f432938..e058778155a 100644
--- a/htdocs/admin/ecm.php
+++ b/htdocs/admin/ecm.php
@@ -100,7 +100,7 @@ else
{
print ''.img_picto($langs->trans("Disabled"),'off').' ';
}
- else if(! empty($conf->global->USER_MAIL_REQUIRED))
+ elseif(! empty($conf->global->USER_MAIL_REQUIRED))
{
print ''.img_picto($langs->trans("Enabled"),'on').' ';
}
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index 2ae3a7cad99..2dec14f0a24 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -74,7 +74,7 @@ if ($action == 'updateMask')
}
}
-else if ($action == 'set_param')
+elseif ($action == 'set_param')
{
$freetext=GETPOST('SHIPPING_FREE_TEXT','none'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
@@ -98,7 +98,7 @@ else if ($action == 'set_param')
}
}
-else if ($action == 'specimen')
+elseif ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
@@ -144,12 +144,12 @@ else if ($action == 'specimen')
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -159,7 +159,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -176,7 +176,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmodel')
+elseif ($action == 'setmodel')
{
dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
}
diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php
index f8429069611..23d2571b256 100644
--- a/htdocs/admin/expensereport.php
+++ b/htdocs/admin/expensereport.php
@@ -70,7 +70,7 @@ if ($action == 'updateMask')
}
}
-else if ($action == 'specimen') // For fiche inter
+elseif ($action == 'specimen') // For fiche inter
{
$modele= GETPOST('module','alpha');
@@ -118,7 +118,7 @@ else if ($action == 'specimen') // For fiche inter
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
if ($ret > 0 && empty($conf->global->EXPENSEREPORT_ADDON_PDF))
@@ -127,7 +127,7 @@ else if ($action == 'set')
}
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -137,7 +137,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -154,7 +154,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@@ -162,7 +162,7 @@ else if ($action == 'setmod')
dolibarr_set_const($db, "EXPENSEREPORT_ADDON",$value,'chaine',0,'',$conf->entity);
}
-else if ($action == 'setoptions')
+elseif ($action == 'setoptions')
{
$db->begin();
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index fe78e5aa5b6..6e9ccf792b0 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -124,12 +124,12 @@ if ($action == 'specimen')
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -139,7 +139,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -156,7 +156,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php
index 8751d906918..e975a2f0ff8 100644
--- a/htdocs/admin/fckeditor.php
+++ b/htdocs/admin/fckeditor.php
@@ -167,7 +167,7 @@ else
{
print ''.img_picto($langs->trans("Disabled"),'switch_off').' ';
}
- else if ($value == 1)
+ elseif ($value == 1)
{
print ''.img_picto($langs->trans("Enabled"),'switch_on').' ';
}
diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index 9a259fd3c0d..7e263a5e285 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -70,7 +70,7 @@ if ($action == 'updateMask')
}
}
-else if ($action == 'specimen') // For fiche inter
+elseif ($action == 'specimen') // For fiche inter
{
$modele= GETPOST('module','alpha');
@@ -116,12 +116,12 @@ else if ($action == 'specimen') // For fiche inter
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -131,7 +131,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -148,7 +148,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@@ -156,7 +156,7 @@ else if ($action == 'setmod')
dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity);
}
-else if ($action == 'set_FICHINTER_FREE_TEXT')
+elseif ($action == 'set_FICHINTER_FREE_TEXT')
{
$freetext= GETPOST('FICHINTER_FREE_TEXT','none'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
@@ -173,7 +173,7 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
}
}
-else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
+elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK')
{
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php
index c687a6fbc2d..62fe6631a60 100644
--- a/htdocs/admin/holiday.php
+++ b/htdocs/admin/holiday.php
@@ -71,7 +71,7 @@ if ($action == 'updateMask')
}
}
-else if ($action == 'specimen') // For contract
+elseif ($action == 'specimen') // For contract
{
$modele= GETPOST('module','alpha');
@@ -117,12 +117,12 @@ else if ($action == 'specimen') // For contract
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -132,7 +132,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "HOLIDAY_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -149,7 +149,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@@ -157,7 +157,7 @@ else if ($action == 'setmod')
dolibarr_set_const($db, "HOLIDAY_ADDON",$value,'chaine',0,'',$conf->entity);
}
-else if ($action == 'set_other')
+elseif ($action == 'set_other')
{
$freetext= GETPOST('HOLIDAY_FREE_TEXT','none'); // No alpha here, we want exact string
$res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index e2168ec2d76..84ce38f9757 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -173,7 +173,7 @@ if ($action == 'update')
{
dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND",$original_file,'chaine',0,'',$conf->entity);
}
- else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
+ elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result))
{
$error++;
$langs->load("errors");
diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index 33b6d83e0da..d7eb804fa4d 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -673,11 +673,11 @@ else
{
print $langs->trans('RobotEmail');
}
- else if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user')
+ elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user')
{
print $langs->trans('UserEmail');
}
- else if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company')
+ elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company')
{
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
}
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index a6b2e89cc1a..35f5e5d6e72 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -479,7 +479,7 @@ foreach ($fieldlist as $field => $value)
{
print '';
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).' ';
- else if (! empty($tabhelp[$id][$value]))
+ elseif (! empty($tabhelp[$id][$value]))
{
if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click
else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2); // Tooltip on hover
@@ -552,7 +552,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
if ($tmpfieldlist == 'topic') {
print ' ';
}
- else if ($tmpfieldlist == 'joinfiles') {
+ elseif ($tmpfieldlist == 'joinfiles') {
print ' ';
}
else
diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php
index 6e5f0d77b4b..d85218dbd5a 100644
--- a/htdocs/admin/menus/other.php
+++ b/htdocs/admin/menus/other.php
@@ -42,7 +42,7 @@ if ($action == 'activate_hidemenu')
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
-else if ($action == 'disable_hidemenu')
+elseif ($action == 'disable_hidemenu')
{
dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]);
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index 4694021c233..4f24862e34c 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -244,7 +244,7 @@ if ($action == 'set' && $user->admin)
header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
exit;
}
-else if ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes')
+elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes')
{
$result=unActivateModule($value);
if ($result) setEventMessages($result, null, 'errors');
@@ -698,7 +698,7 @@ if ($mode == 'common')
{
print $langs->trans("Disabled");
}
- else if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
+ elseif (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
{
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
else {
@@ -761,7 +761,7 @@ if ($mode == 'common')
}
print " \n";
}
- else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
+ elseif (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
{
print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').' ';
}
@@ -783,7 +783,7 @@ if ($mode == 'common')
{
// Should never happened
}
- else if (! empty($objMod->disabled))
+ elseif (! empty($objMod->disabled))
{
print $langs->trans("Disabled");
}
diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php
index af2aed5a744..4a4e07d35f9 100644
--- a/htdocs/admin/notification.php
+++ b/htdocs/admin/notification.php
@@ -71,7 +71,7 @@ if ($action == 'setvalue' && $user->admin)
$newval=GETPOST($shortkey.'_key');
//print $newkey.' - '.$newval.' ';
}
- else if (preg_match('/^NOTIF_(.*)_new_key/',$key,$reg))
+ elseif (preg_match('/^NOTIF_(.*)_new_key/',$key,$reg))
{
// Add a new entry
$newkey='NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index 37c836043a0..3d9a6984f88 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -86,7 +86,7 @@ if ($action == 'activate_pdfsecurity')
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
exit;
}
-else if ($action == 'disable_pdfsecurity')
+elseif ($action == 'disable_pdfsecurity')
{
dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php
index e0caadc9677..a6c5c54a40f 100644
--- a/htdocs/admin/prelevement.php
+++ b/htdocs/admin/prelevement.php
@@ -96,9 +96,7 @@ if ($action == "set")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
- } else
-
- if (! $error)
+ } elseif (! $error)
{
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index beb63b8eb0c..b9fe6bca9d0 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -188,7 +188,7 @@ if ($action == 'set')
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -197,7 +197,7 @@ else if ($action == 'del')
}
}
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -212,7 +212,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php
index 4aa362932af..07781551eb6 100644
--- a/htdocs/admin/reception_setup.php
+++ b/htdocs/admin/reception_setup.php
@@ -80,7 +80,7 @@ if ($action == 'updateMask')
}
}
-else if ($action == 'set_param')
+elseif ($action == 'set_param')
{
$freetext=GETPOST('RECEPTION_FREE_TEXT','none'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "RECEPTION_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
@@ -104,7 +104,7 @@ else if ($action == 'set_param')
}
}
-else if ($action == 'specimen')
+elseif ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
@@ -150,12 +150,12 @@ else if ($action == 'specimen')
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -165,7 +165,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "RECEPTION_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -182,7 +182,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmodel')
+elseif ($action == 'setmodel')
{
dolibarr_set_const($db, "RECEPTION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
}
diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php
index 26dcdc85b8d..7a4581ac8ec 100644
--- a/htdocs/admin/security.php
+++ b/htdocs/admin/security.php
@@ -108,7 +108,7 @@ if ($action == 'activate_encrypt')
dol_print_error($db,'');
}
}
-else if ($action == 'disable_encrypt')
+elseif ($action == 'disable_encrypt')
{
//On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes
//Do not allow "disable encryption" as passwords cannot be decrypted
@@ -137,7 +137,7 @@ if ($action == 'activate_encryptdbpassconf')
setEventMessages($langs->trans('InstrucToEncodePass',dol_encode($dolibarr_main_db_pass)), null, 'warnings');
}
}
-else if ($action == 'disable_encryptdbpassconf')
+elseif ($action == 'disable_encryptdbpassconf')
{
$result = encodedecode_dbpassconf(0);
if ($result > 0)
@@ -161,7 +161,7 @@ if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK')
header("Location: security.php");
exit;
}
-else if ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
+elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
{
dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK",$conf->entity);
header("Location: security.php");
diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php
index f551aafaaff..f3449e12885 100644
--- a/htdocs/admin/security_file.php
+++ b/htdocs/admin/security_file.php
@@ -67,7 +67,7 @@ if ($action == 'updateform')
// Delete file
-else if ($action == 'delete')
+elseif ($action == 'delete')
{
$langs->load("other");
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile','alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php
index e26fcf900be..99684305cec 100644
--- a/htdocs/admin/security_other.php
+++ b/htdocs/admin/security_other.php
@@ -57,7 +57,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
}
}
-else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
+elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
@@ -71,7 +71,7 @@ else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
}
}
-else if ($action == 'updateform')
+elseif ($action == 'updateform')
{
$res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"],'chaine',0,'',$conf->entity);
$res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"],'chaine',0,'',$conf->entity);
diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index c3c25c9e4e6..a4446f1f8fb 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -122,12 +122,12 @@ if ($action == 'specimen') // For invoices
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -137,7 +137,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -153,7 +153,7 @@ else if ($action == 'setdoc')
$ret = addDocumentModel($value, $type, $label, $scandir);
}
}
-else if ($action == 'unsetdoc')
+elseif ($action == 'unsetdoc')
{
dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
}
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index b23e821b31e..69d582ff90a 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -73,7 +73,7 @@ if ($action == 'updateMask')
}
}
-else if ($action == 'specimen') // For orders
+elseif ($action == 'specimen') // For orders
{
$modele=GETPOST('module','alpha');
@@ -120,12 +120,12 @@ else if ($action == 'specimen') // For orders
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -135,7 +135,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -152,7 +152,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@@ -160,13 +160,13 @@ else if ($action == 'setmod')
dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity);
}
-else if ($action == 'addcat')
+elseif ($action == 'addcat')
{
$fourn = new Fournisseur($db);
$fourn->CreateCategory($user,$_POST["cat"]);
}
-else if ($action == 'set_SUPPLIER_ORDER_OTHER')
+elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
{
$freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT','none'); // No alpha here, we want exact string
$doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED','alpha');
@@ -206,7 +206,7 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
}
// Activate ask for payment bank
-else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
+elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
{
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER",$value,'chaine',0,'',$conf->entity);
diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php
index 77f2a95070e..ecb7b455657 100644
--- a/htdocs/admin/supplier_payment.php
+++ b/htdocs/admin/supplier_payment.php
@@ -61,18 +61,18 @@ if ($action == 'updateMask')
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
-}else if ($action == 'setmod')
+}elseif ($action == 'setmod')
{
dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON", $value, 'chaine', 0, '', $conf->entity);
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -82,7 +82,7 @@ else if ($action == 'del')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -99,7 +99,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'specimen')
+elseif ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php
index 1756974379c..7c18a1b8e19 100644
--- a/htdocs/admin/supplier_proposal.php
+++ b/htdocs/admin/supplier_proposal.php
@@ -169,7 +169,7 @@ if ($action == 'set')
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -178,7 +178,7 @@ else if ($action == 'del')
}
}
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -193,7 +193,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php
index 0eaa7161d5e..9c857964a3c 100644
--- a/htdocs/admin/syslog.php
+++ b/htdocs/admin/syslog.php
@@ -230,7 +230,7 @@ foreach ($syslogModules as $moduleName)
if (! empty($tmpoption))
{
if (isset($_POST[$tmpoption])) $value=$_POST[$tmpoption];
- else if (! empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
+ elseif (! empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
}
else $value = (isset($option['default']) ? $option['default'] : '');
diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php
index fef49bd5c12..645abf36ce8 100644
--- a/htdocs/admin/system/constall.php
+++ b/htdocs/admin/system/constall.php
@@ -183,7 +183,7 @@ foreach($configfileparameters as $key)
// Value
print "";
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
- else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
+ elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
else print ${$newkey};
if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
print " ";
diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php
index c19c7075784..2436807b584 100644
--- a/htdocs/admin/system/database-tables.php
+++ b/htdocs/admin/system/database-tables.php
@@ -56,17 +56,17 @@ if (preg_match('/mysql/i',$conf->db->type))
$sql = "SHOW TABLE STATUS";
$base=1;
}
-else if ($conf->db->type == 'pgsql')
+elseif ($conf->db->type == 'pgsql')
{
$sql = "SELECT conname, contype FROM pg_constraint;";
$base=2;
}
-else if ($conf->db->type == 'mssql')
+elseif ($conf->db->type == 'mssql')
{
//$sqls[0] = "";
//$base=3;
}
-else if ($conf->db->type == 'sqlite' || $conf->db->type == 'sqlite3')
+elseif ($conf->db->type == 'sqlite' || $conf->db->type == 'sqlite3')
{
//$sql = "SELECT name, type FROM sqlite_master";
$base = 4;
diff --git a/htdocs/admin/system/dbtable.php b/htdocs/admin/system/dbtable.php
index 2cf249c0f74..9f9cc63505d 100644
--- a/htdocs/admin/system/dbtable.php
+++ b/htdocs/admin/system/dbtable.php
@@ -50,7 +50,7 @@ if (preg_match('/mysql/i',$conf->db->type))
$sql = "SHOW TABLE STATUS LIKE '".$db->escape($table)."'";
$base=1;
}
-else if ($conf->db->type == 'pgsql')
+elseif ($conf->db->type == 'pgsql')
{
$sql = "SELECT conname,contype FROM pg_constraint";
$base=2;
diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php
index f81053e1631..a8b5b2da401 100644
--- a/htdocs/admin/system/dolibarr.php
+++ b/htdocs/admin/system/dolibarr.php
@@ -374,8 +374,8 @@ foreach($configfileparameters as $key => $value)
// Value
print "";
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
- else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
- else if ($newkey == 'dolibarr_main_document_root_alt')
+ elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
+ elseif ($newkey == 'dolibarr_main_document_root_alt')
{
$tmparray=explode(',',${$newkey});
$i=0;
diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php
index 55be556afb9..d74afcc90bc 100644
--- a/htdocs/admin/tools/dolibarr_export.php
+++ b/htdocs/admin/tools/dolibarr_export.php
@@ -166,7 +166,7 @@ print ' ';
diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php
index 90220f1bb23..e1357a39fb5 100644
--- a/htdocs/admin/tools/dolibarr_import.php
+++ b/htdocs/admin/tools/dolibarr_import.php
@@ -106,7 +106,7 @@ print $langs->trans("RestoreDesc3",$dolibarr_main_db_name).' ';
';
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 949639341da..8ae44951ca5 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -293,7 +293,7 @@ class ActionComm extends CommonObject
$this->type_id=$cactioncomm->id;
$this->type_code=$cactioncomm->code;
}
- else if ($result == 0)
+ elseif ($result == 0)
{
$this->error='Failed to get record with id '.$this->type_id.' code '.$this->type_code.' from dictionary "type of events"';
return -1;
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 3d062298f53..4448fee5366 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -779,7 +779,7 @@ if (count($listofextcals))
$datecurstart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
$datecurend=dol_stringtotime($icalevent['DTEND;VALUE=DATE'],1)-1; // We remove one second to get last second of day
}
- else if (is_array($icalevent['DTSTART']) && ! empty($icalevent['DTSTART']['unixtime']))
+ elseif (is_array($icalevent['DTSTART']) && ! empty($icalevent['DTSTART']['unixtime']))
{
$datecurstart=$icalevent['DTSTART']['unixtime'];
$datecurend=$icalevent['DTEND']['unixtime'];
@@ -1365,7 +1365,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
// We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
}
- else if ($event->type_code == 'ICALEVENT') // Event come from external ical file
+ elseif ($event->type_code == 'ICALEVENT') // Event come from external ical file
{
$numical++;
if (! empty($event->icalname)) {
@@ -1378,7 +1378,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$color=($event->icalcolor?$event->icalcolor:-1);
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other');
}
- else if ($event->type_code == 'BIRTHDAY')
+ elseif ($event->type_code == 'BIRTHDAY')
{
$numbirthday++; $colorindex=2; $cssclass='family_birthday unmovable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
}
@@ -1425,11 +1425,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
$cssclass.= " unmovable";
}
- else if ($event->type_code == 'ICALEVENT')
+ elseif ($event->type_code == 'ICALEVENT')
{
$cssclass.= " unmovable";
}
- else if ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
+ elseif ($event->date_end_in_calendar && date('Ymd',$event->date_start_in_calendar) != date('Ymd',$event->date_end_in_calendar))
{
$tmpyearend = date('Y',$event->date_end_in_calendar);
$tmpmonthend = date('m',$event->date_end_in_calendar);
diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php
index 0c2f3f95c4f..2a5691279a1 100644
--- a/htdocs/comm/action/pertype.php
+++ b/htdocs/comm/action/pertype.php
@@ -809,7 +809,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
$nummytasks++; $cssclass='family_mytasks';
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $color=$event->type_color;
}
- else if ($event->type_code == 'ICALEVENT')
+ elseif ($event->type_code == 'ICALEVENT')
{
$numical++;
if (! empty($event->icalname))
@@ -823,7 +823,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
$color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
}
- else if ($event->type_code == 'BIRTHDAY')
+ elseif ($event->type_code == 'BIRTHDAY')
{
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
}
@@ -1026,7 +1026,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
if ($output[0]['color']) $color1 = $output[0]['color'];
}
- else if (count($cases1[$h]) > 1)
+ elseif (count($cases1[$h]) > 1)
{
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
$color1='222222';
@@ -1039,7 +1039,7 @@ function show_day_events_pertype($username, $day, $month, $year, $monthshown, $s
if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
if ($output[0]['color']) $color2 = $output[0]['color'];
}
- else if (count($cases2[$h]) > 1)
+ elseif (count($cases2[$h]) > 1)
{
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
$color2='222222';
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index 6271a9a3880..f208c25a058 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -970,7 +970,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
if (! empty($conf->global->AGENDA_USE_COLOR_PER_EVENT_TYPE)) $color=$event->type_color;
}
- else if ($event->type_code == 'ICALEVENT')
+ elseif ($event->type_code == 'ICALEVENT')
{
$numical++;
if (! empty($event->icalname))
@@ -984,7 +984,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_ext'.md5($event->icalname):'family_other unsortable');
}
- else if ($event->type_code == 'BIRTHDAY')
+ elseif ($event->type_code == 'BIRTHDAY')
{
$numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
}
@@ -1201,7 +1201,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
if ($output[0]['color']) $color1 = $output[0]['color'];
}
- else if (count($cases1[$h]) > 1)
+ elseif (count($cases1[$h]) > 1)
{
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
$color1='222222';
@@ -1214,7 +1214,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
if ($output[0]['color']) $color2 = $output[0]['color'];
}
- else if (count($cases2[$h]) > 1)
+ elseif (count($cases2[$h]) > 1)
{
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
$color2='222222';
diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php
index f9cf7dc5bf1..04b7cd3ad63 100644
--- a/htdocs/comm/address.php
+++ b/htdocs/comm/address.php
@@ -83,7 +83,7 @@ if ($action == 'add' || $action == 'update')
header("Location: ".$backtopage);
exit;
}
- else if ($origin == 'commande')
+ elseif ($origin == 'commande')
{
header("Location: ../commande/contact.php?action=editdelivery_adress&socid=".$socid."&id=".$originid);
exit;
@@ -112,7 +112,7 @@ if ($action == 'add' || $action == 'update')
}
// Update address
- else if ($action == 'update')
+ elseif ($action == 'update')
{
$result = $object->update($id, $socid, $user);
@@ -123,7 +123,7 @@ if ($action == 'add' || $action == 'update')
header("Location: ".$backtopage);
exit;
}
- else if ($origin == 'commande')
+ elseif ($origin == 'commande')
{
header("Location: ../commande/contact.php?id=".$originid);
exit;
@@ -153,7 +153,7 @@ if ($action == 'add' || $action == 'update')
}
}
-else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer)
+elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer)
{
$result = $object->delete($id, $socid);
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index e0b60a87753..bee64fb41d1 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -496,7 +496,7 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
print '';
print '';
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastCustomersOrProspects",$max);
- else if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max);
+ elseif (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) print $langs->trans("BoxTitleLastModifiedProspects",$max);
else print $langs->trans("BoxTitleLastModifiedCustomers",$max);
print ' ';
print ''.$langs->trans("FullList").' ';
@@ -759,7 +759,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
print ' '.$langs->trans("XMoreLines", ($num - $nbofloop))." ";
}
- else if ($total>0)
+ elseif ($total>0)
{
print ''.$langs->trans("Total")." ".price($total)." ";
}
@@ -863,7 +863,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{
print ''.$langs->trans("XMoreLines", ($num - $nbofloop))." ";
}
- else if ($total>0)
+ elseif ($total>0)
{
print ''.$langs->trans("Total")." ".price($total)." ";
}
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 233f32d26be..5ce2b5c2f61 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -122,7 +122,7 @@ if (empty($reshook))
setEventMessages($langs->trans("MailingNeedCommand2"), null, 'warnings');
$action='';
}
- else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
+ elseif ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
{
setEventMessages($langs->trans("NotEnoughPermissions"), null, 'warnings');
$action='';
@@ -525,13 +525,13 @@ if (empty($reshook))
$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1,$object,'mailing');
if ($action == 'settitre') $object->titre = trim(GETPOST('titre','alpha'));
- else if ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from','alpha'));
- else if ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto','alpha'));
- else if ($action == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto','alpha'));
- else if ($action == 'settitre' && empty($object->titre)) {
+ elseif ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from','alpha'));
+ elseif ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto','alpha'));
+ elseif ($action == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto','alpha'));
+ elseif ($action == 'settitre' && empty($object->titre)) {
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
}
- else if ($action == 'setfrom' && empty($object->email_from)) {
+ elseif ($action == 'setfrom' && empty($object->email_from)) {
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom"));
}
@@ -803,12 +803,12 @@ else
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valid",'','',1);
}
// Confirm reset
- else if ($action == 'reset')
+ elseif ($action == 'reset')
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$object->ref),"confirm_reset",'','',2);
}
// Confirm delete
- else if ($action == 'delete')
+ elseif ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(! empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''),$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete",'','',1);
}
@@ -842,7 +842,7 @@ else
if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings');
$_GET["action"]='';
}
- else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
+ elseif ($conf->global->MAILING_LIMIT_SENDBYWEB < 0)
{
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings');
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings');
@@ -1008,7 +1008,7 @@ else
{
print ''.$langs->trans("ValidMailing").' ';
}
- else if (empty($user->rights->mailing->valider))
+ elseif (empty($user->rights->mailing->valider))
{
print ''.$langs->trans("ValidMailing").' ';
}
@@ -1024,7 +1024,7 @@ else
{
print ''.$langs->trans("SendMailing").' ';
}
- else if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send)
+ elseif (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send)
{
print ''.$langs->trans("SendMailing").' ';
}
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index ac23177652f..0cb414be421 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -557,7 +557,7 @@ if ($object->fetch($id) >= 0)
$objectstatic->fetch($obj->source_id);
print $objectstatic->getNomUrl(1);
}
- else if ($obj->source_type == 'user')
+ elseif ($obj->source_type == 'user')
{
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
$objectstatic=new User($db);
@@ -565,14 +565,14 @@ if ($object->fetch($id) >= 0)
$objectstatic->id=$obj->source_id;
print $objectstatic->getNomUrl(1);
}
- else if ($obj->source_type == 'thirdparty')
+ elseif ($obj->source_type == 'thirdparty')
{
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$objectstatic=new Societe($db);
$objectstatic->fetch($obj->source_id);
print $objectstatic->getNomUrl(1);
}
- else if ($obj->source_type == 'contact')
+ elseif ($obj->source_type == 'contact')
{
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$objectstatic=new Contact($db);
diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php
index 2f88cb2dd9c..0de2efbd9cf 100644
--- a/htdocs/comm/mailing/class/advtargetemailing.class.php
+++ b/htdocs/comm/mailing/class/advtargetemailing.class.php
@@ -785,12 +785,12 @@ class AdvanceTargetingMailing extends CommonObject
if (!empty($arrayquery['options_'.$key.'_max'.'_cnct'])) {
$sqlwhere[]= " (te.".$key." >= ".$arrayquery['options_'.$key.'_max'.'_cnct']." AND te.".$key." <= ".$arrayquery['options_'.$key.'_min'.'_cnct'].")";
}
- } else if (($extrafields->attribute_type[$key] == 'date') ||
+ } elseif (($extrafields->attribute_type[$key] == 'date') ||
($extrafields->attribute_type[$key] == 'datetime')) {
if (!empty($arrayquery['options_'.$key.'_end_dt'.'_cnct'])){
$sqlwhere[]= " (te.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'.'_cnct'])."' AND te.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'.'_cnct'])."')";
}
- }else if ($extrafields->attribute_type[$key] == 'boolean') {
+ }elseif ($extrafields->attribute_type[$key] == 'boolean') {
if ($arrayquery['options_'.$key.'_cnct']!=''){
if ($arrayquery['options_'.$key.'_cnct']==0) {
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key.'_cnct']." OR ((te.".$key." IS NULL) AND (te.fk_object IS NOT NULL)))";
@@ -885,12 +885,12 @@ class AdvanceTargetingMailing extends CommonObject
if (!empty($arrayquery['options_'.$key.'_max'])) {
$sqlwhere[]= " (tse.".$key." >= ".$arrayquery['options_'.$key.'_max']." AND tse.".$key." <= ".$arrayquery['options_'.$key.'_min'].")";
}
- } else if (($extrafields->attribute_type[$key] == 'date') ||
+ } elseif (($extrafields->attribute_type[$key] == 'date') ||
($extrafields->attribute_type[$key] == 'datetime')) {
if (!empty($arrayquery['options_'.$key.'_end_dt'])){
$sqlwhere[]= " (tse.".$key." >= '".$this->db->idate($arrayquery['options_'.$key.'_st_dt'])."' AND tse.".$key." <= '".$this->db->idate($arrayquery['options_'.$key.'_end_dt'])."')";
}
- }else if ($extrafields->attribute_type[$key] == 'boolean') {
+ }elseif ($extrafields->attribute_type[$key] == 'boolean') {
if ($arrayquery['options_'.$key]!=''){
$sqlwhere[]= " (tse.".$key." = ".$arrayquery['options_'.$key].")";
}
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index c6ba6781423..93511ce0513 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -205,7 +205,7 @@ if (empty($reshook))
}
// Delete proposal
- else if ($action == 'confirm_delete' && $confirm == 'yes' && $usercandelete)
+ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $usercandelete)
{
$result = $object->delete($user);
if ($result > 0) {
@@ -218,7 +218,7 @@ if (empty($reshook))
}
// Remove line
- else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate)
+ elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate)
{
$result = $object->deleteline($lineid);
// reorder lines
@@ -242,7 +242,7 @@ if (empty($reshook))
}
// Validation
- else if ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate)
+ elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate)
{
$result = $object->valid($user);
if ($result >= 0)
@@ -269,7 +269,7 @@ if (empty($reshook))
}
}
- else if ($action == 'setdate' && $usercancreate)
+ elseif ($action == 'setdate' && $usercancreate)
{
$datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
@@ -284,13 +284,13 @@ if (empty($reshook))
dol_print_error($db, $object->error);
}
}
- else if ($action == 'setecheance' && $usercancreate)
+ elseif ($action == 'setecheance' && $usercancreate)
{
$result = $object->set_echeance($user, dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']));
if ($result < 0)
dol_print_error($db, $object->error);
}
- else if ($action == 'setdate_livraison' && $usercancreate)
+ elseif ($action == 'setdate_livraison' && $usercancreate)
{
$result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST['date_livraisonmonth'], $_POST['date_livraisonday'], $_POST['date_livraisonyear']));
if ($result < 0)
@@ -298,7 +298,7 @@ if (empty($reshook))
}
// Positionne ref client
- else if ($action == 'setref_client' && $usercancreate)
+ elseif ($action == 'setref_client' && $usercancreate)
{
$result = $object->set_ref_client($user, GETPOST('ref_client'));
if ($result < 0)
@@ -314,7 +314,7 @@ if (empty($reshook))
}
// Create proposal
- else if ($action == 'add' && $usercancreate)
+ elseif ($action == 'add' && $usercancreate)
{
$object->socid = $socid;
$object->fetch_thirdparty();
@@ -619,7 +619,7 @@ if (empty($reshook))
}
// Classify billed
- else if ($action == 'classifybilled' && $usercanclose)
+ elseif ($action == 'classifybilled' && $usercanclose)
{
$db->begin();
@@ -641,7 +641,7 @@ if (empty($reshook))
}
// Close proposal
- else if ($action == 'setstatut' && $usercanclose && ! GETPOST('cancel','alpha'))
+ elseif ($action == 'setstatut' && $usercanclose && ! GETPOST('cancel','alpha'))
{
if (! (GETPOST('statut','int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors');
@@ -672,7 +672,7 @@ if (empty($reshook))
}
// Reopen proposal
- else if ($action == 'confirm_reopen' && $usercanclose && ! GETPOST('cancel','alpha'))
+ elseif ($action == 'confirm_reopen' && $usercanclose && ! GETPOST('cancel','alpha'))
{
// prevent browser refresh from reopening proposal several times
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED)
@@ -808,7 +808,7 @@ if (empty($reshook))
}
}
- else if ($action == "setabsolutediscount" && $usercancreate) {
+ elseif ($action == "setabsolutediscount" && $usercancreate) {
if ($_POST["remise_id"]) {
if ($object->id > 0) {
$result = $object->insert_discount($_POST["remise_id"]);
@@ -820,7 +820,7 @@ if (empty($reshook))
}
// Add line
- else if ($action == 'addline' && $usercancreate) {
+ elseif ($action == 'addline' && $usercancreate) {
// Set if we used free entry or predefined product
$predef='';
@@ -1184,7 +1184,7 @@ if (empty($reshook))
}
// Update a line within proposal
- else if ($action == 'updateline' && $usercancreate && GETPOST('save'))
+ elseif ($action == 'updateline' && $usercancreate && GETPOST('save'))
{
// Define info_bits
$info_bits = 0;
@@ -1320,66 +1320,66 @@ if (empty($reshook))
}
}
- else if ($action == 'updateline' && $usercancreate && GETPOST('cancel','alpha'))
+ elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel','alpha'))
{
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}
// Set project
- else if ($action == 'classin' && $usercancreate) {
+ elseif ($action == 'classin' && $usercancreate) {
$object->setProject(GETPOST('projectid','int'));
}
// Delai de livraison
- else if ($action == 'setavailability' && $usercancreate) {
+ elseif ($action == 'setavailability' && $usercancreate) {
$result = $object->set_availability($user, GETPOST('availability_id','int'));
}
// Origine de la propale
- else if ($action == 'setdemandreason' && $usercancreate) {
+ elseif ($action == 'setdemandreason' && $usercancreate) {
$result = $object->set_demand_reason($user, GETPOST('demand_reason_id','int'));
}
// Conditions de reglement
- else if ($action == 'setconditions' && $usercancreate) {
+ elseif ($action == 'setconditions' && $usercancreate) {
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
}
- else if ($action == 'setremisepercent' && $usercancreate) {
+ elseif ($action == 'setremisepercent' && $usercancreate) {
$result = $object->set_remise_percent($user, $_POST['remise_percent']);
}
- else if ($action == 'setremiseabsolue' && $usercancreate) {
+ elseif ($action == 'setremiseabsolue' && $usercancreate) {
$result = $object->set_remise_absolue($user, $_POST['remise_absolue']);
}
// Mode de reglement
- else if ($action == 'setmode' && $usercancreate) {
+ elseif ($action == 'setmode' && $usercancreate) {
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
}
// Multicurrency Code
- else if ($action == 'setmulticurrencycode' && $usercancreate) {
+ elseif ($action == 'setmulticurrencycode' && $usercancreate) {
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
}
// Multicurrency rate
- else if ($action == 'setmulticurrencyrate' && $usercancreate) {
+ elseif ($action == 'setmulticurrencyrate' && $usercancreate) {
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')));
}
// bank account
- else if ($action == 'setbankaccount' && $usercancreate) {
+ elseif ($action == 'setbankaccount' && $usercancreate) {
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
}
// shipping method
- else if ($action == 'setshippingmethod' && $usercancreate) {
+ elseif ($action == 'setshippingmethod' && $usercancreate) {
$result=$object->setShippingMethod(GETPOST('shipping_method_id', 'int'));
}
- else if ($action == 'update_extras') {
+ elseif ($action == 'update_extras') {
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from update form
@@ -1421,7 +1421,7 @@ if (empty($reshook))
}
// Bascule du statut d'un contact
- else if ($action == 'swapstatut') {
+ elseif ($action == 'swapstatut') {
if ($object->fetch($id) > 0) {
$result = $object->swapContactStatus(GETPOST('ligne'));
} else {
@@ -1430,7 +1430,7 @@ if (empty($reshook))
}
// Efface un contact
- else if ($action == 'deletecontact') {
+ elseif ($action == 'deletecontact') {
$object->fetch($id);
$result = $object->delete_contact($lineid);
@@ -1909,22 +1909,22 @@ if ($action == 'create')
}
// Confirm delete
- else if ($action == 'delete') {
+ elseif ($action == 'delete') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
}
// Confirm reopen
- else if ($action == 'reopen') {
+ elseif ($action == 'reopen') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
}
// Confirmation delete product/service line
- else if ($action == 'ask_deleteline') {
+ elseif ($action == 'ask_deleteline') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
}
// Confirm validate proposal
- else if ($action == 'validate') {
+ elseif ($action == 'validate') {
$error = 0;
// We verifie whether the object is provisionally numbering
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index d1d3fb086bd..b3da0634aee 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -2706,7 +2706,7 @@ class Propal extends CommonObject
{
$ga[$obj->propalid] = $obj->ref;
}
- else if ($shortlist == 2)
+ elseif ($shortlist == 2)
{
$ga[$obj->propalid] = $obj->ref.' ('.$obj->name.')';
}
diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php
index 7fc556a3b12..dc14324c293 100644
--- a/htdocs/comm/propal/contact.php
+++ b/htdocs/comm/propal/contact.php
@@ -56,7 +56,7 @@ if ($id > 0 || ! empty($ref))
setEventMessages($langs->trans('ErrorRecordNotFound'), null, 'errors');
$error++;
}
- else if ($ret < 0)
+ elseif ($ret < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
$error++;
@@ -105,7 +105,7 @@ if ($action == 'addcontact' && $user->rights->propale->creer)
}
// Toggle the status of a contact
-else if ($action == 'swapstatut' && $user->rights->propale->creer)
+elseif ($action == 'swapstatut' && $user->rights->propale->creer)
{
if ($object->id > 0)
{
@@ -114,7 +114,7 @@ else if ($action == 'swapstatut' && $user->rights->propale->creer)
}
// Deletes a contact
-else if ($action == 'deletecontact' && $user->rights->propale->creer)
+elseif ($action == 'deletecontact' && $user->rights->propale->creer)
{
$result = $object->delete_contact($lineid);
diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php
index b96a95d8e64..e708e0dac15 100644
--- a/htdocs/comm/propal/index.php
+++ b/htdocs/comm/propal/index.php
@@ -367,7 +367,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
{
print ''.$langs->trans("XMoreLines", ($num - $nbofloop))." ";
}
- else if ($total>0)
+ elseif ($total>0)
{
print ''.$langs->trans("Total")." ".price($total)." ";
}
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 61fa1d548d7..193859cdd70 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -940,7 +940,7 @@ if ($resql)
print $nbofsalesrepresentative;
print '';
}
- else if ($nbofsalesrepresentative > 0)
+ elseif ($nbofsalesrepresentative > 0)
{
$userstatic=new User($db);
$j=0;
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 36dac7431af..08da5786589 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -159,7 +159,7 @@ if (empty($reshook))
}
// Reopen a closed order
- else if ($action == 'reopen' && $user->rights->commande->creer)
+ elseif ($action == 'reopen' && $user->rights->commande->creer)
{
if ($object->statut == Commande::STATUS_CANCELED || $object->statut == Commande::STATUS_CLOSED)
{
@@ -176,7 +176,7 @@ if (empty($reshook))
}
// Remove order
- else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->commande->supprimer)
+ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->commande->supprimer)
{
$result = $object->delete($user);
if ($result > 0)
@@ -191,7 +191,7 @@ if (empty($reshook))
}
// Remove a product line
- else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->commande->creer)
+ elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->commande->creer)
{
$result = $object->deleteline($user, $lineid);
if ($result > 0)
@@ -222,13 +222,13 @@ if (empty($reshook))
}
// Link to a project
- else if ($action == 'classin' && $user->rights->commande->creer)
+ elseif ($action == 'classin' && $user->rights->commande->creer)
{
$object->setProject(GETPOST('projectid','int'));
}
// Add order
- else if ($action == 'add' && $user->rights->commande->creer)
+ elseif ($action == 'add' && $user->rights->commande->creer)
{
$datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year'));
@@ -481,7 +481,7 @@ if (empty($reshook))
}
}
- else if ($action == 'classifybilled' && $user->rights->commande->creer)
+ elseif ($action == 'classifybilled' && $user->rights->commande->creer)
{
$ret=$object->classifyBilled($user);
@@ -489,7 +489,7 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors');
}
}
- else if ($action == 'classifyunbilled' && $user->rights->commande->creer)
+ elseif ($action == 'classifyunbilled' && $user->rights->commande->creer)
{
$ret=$object->classifyUnBilled();
if ($ret < 0) {
@@ -498,7 +498,7 @@ if (empty($reshook))
}
// Positionne ref commande client
- else if ($action == 'setref_client' && $user->rights->commande->creer) {
+ elseif ($action == 'setref_client' && $user->rights->commande->creer) {
$result = $object->set_ref_client($user, GETPOST('ref_client'));
if ($result < 0)
{
@@ -506,7 +506,7 @@ if (empty($reshook))
}
}
- else if ($action == 'setremise' && $user->rights->commande->creer) {
+ elseif ($action == 'setremise' && $user->rights->commande->creer) {
$result = $object->set_remise($user, GETPOST('remise'));
if ($result < 0)
{
@@ -514,7 +514,7 @@ if (empty($reshook))
}
}
- else if ($action == 'setabsolutediscount' && $user->rights->commande->creer) {
+ elseif ($action == 'setabsolutediscount' && $user->rights->commande->creer) {
if (GETPOST('remise_id')) {
if ($object->id > 0) {
$object->insert_discount(GETPOST('remise_id'));
@@ -524,7 +524,7 @@ if (empty($reshook))
}
}
- else if ($action == 'setdate' && $user->rights->commande->creer) {
+ elseif ($action == 'setdate' && $user->rights->commande->creer) {
// print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$date = dol_mktime(0, 0, 0, GETPOST('order_month'), GETPOST('order_day'), GETPOST('order_year'));
@@ -534,7 +534,7 @@ if (empty($reshook))
}
}
- else if ($action == 'setdate_livraison' && $user->rights->commande->creer) {
+ elseif ($action == 'setdate_livraison' && $user->rights->commande->creer) {
// print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year'));
@@ -544,35 +544,35 @@ if (empty($reshook))
}
}
- else if ($action == 'setmode' && $user->rights->commande->creer) {
+ elseif ($action == 'setmode' && $user->rights->commande->creer) {
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
}
// Multicurrency Code
- else if ($action == 'setmulticurrencycode' && $user->rights->commande->creer) {
+ elseif ($action == 'setmulticurrencycode' && $user->rights->commande->creer) {
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
}
// Multicurrency rate
- else if ($action == 'setmulticurrencyrate' && $user->rights->commande->creer) {
+ elseif ($action == 'setmulticurrencyrate' && $user->rights->commande->creer) {
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')));
}
- else if ($action == 'setavailability' && $user->rights->commande->creer) {
+ elseif ($action == 'setavailability' && $user->rights->commande->creer) {
$result = $object->availability(GETPOST('availability_id'));
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
}
- else if ($action == 'setdemandreason' && $user->rights->commande->creer) {
+ elseif ($action == 'setdemandreason' && $user->rights->commande->creer) {
$result = $object->demand_reason(GETPOST('demand_reason_id'));
if ($result < 0)
setEventMessages($object->error, $object->errors, 'errors');
}
- else if ($action == 'setconditions' && $user->rights->commande->creer) {
+ elseif ($action == 'setconditions' && $user->rights->commande->creer) {
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
if ($result < 0) {
dol_print_error($db, $object->error);
@@ -604,7 +604,7 @@ if (empty($reshook))
}
// bank account
- else if ($action == 'setbankaccount' && $user->rights->commande->creer) {
+ elseif ($action == 'setbankaccount' && $user->rights->commande->creer) {
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -612,7 +612,7 @@ if (empty($reshook))
}
// shipping method
- else if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
+ elseif ($action == 'setshippingmethod' && $user->rights->commande->creer) {
$result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -620,23 +620,23 @@ if (empty($reshook))
}
// warehouse
- else if ($action == 'setwarehouse' && $user->rights->commande->creer) {
+ elseif ($action == 'setwarehouse' && $user->rights->commande->creer) {
$result = $object->setWarehouse(GETPOST('warehouse_id', 'int'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
- else if ($action == 'setremisepercent' && $user->rights->commande->creer) {
+ elseif ($action == 'setremisepercent' && $user->rights->commande->creer) {
$result = $object->set_remise($user, GETPOST('remise_percent'));
}
- else if ($action == 'setremiseabsolue' && $user->rights->commande->creer) {
+ elseif ($action == 'setremiseabsolue' && $user->rights->commande->creer) {
$result = $object->set_remise_absolue($user, GETPOST('remise_absolue'));
}
// Add a new line
- else if ($action == 'addline' && $user->rights->commande->creer)
+ elseif ($action == 'addline' && $user->rights->commande->creer)
{
$langs->load('errors');
$error = 0;
@@ -998,7 +998,7 @@ if (empty($reshook))
/*
* Update a line
*/
- else if ($action == 'updateline' && $user->rights->commande->creer && GETPOST('save'))
+ elseif ($action == 'updateline' && $user->rights->commande->creer && GETPOST('save'))
{
// Clean parameters
$date_start='';
@@ -1134,12 +1134,12 @@ if (empty($reshook))
}
}
- else if ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
+ elseif ($action == 'updateline' && $user->rights->commande->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}
- else if ($action == 'confirm_validate' && $confirm == 'yes' &&
+ elseif ($action == 'confirm_validate' && $confirm == 'yes' &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))
)
@@ -1196,7 +1196,7 @@ if (empty($reshook))
}
// Go back to draft status
- else if ($action == 'confirm_modif' && $user->rights->commande->creer) {
+ elseif ($action == 'confirm_modif' && $user->rights->commande->creer) {
$idwarehouse = GETPOST('idwarehouse');
$qualified_for_stock_change=0;
@@ -1244,14 +1244,14 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer) {
+ elseif ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer) {
$result = $object->cloture($user);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
- else if ($action == 'confirm_cancel' && $confirm == 'yes' &&
+ elseif ($action == 'confirm_cancel' && $confirm == 'yes' &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->commande->order_advance->validate)))
)
@@ -1441,7 +1441,7 @@ if (empty($reshook))
}
// bascule du statut d'un contact
- else if ($action == 'swapstatut')
+ elseif ($action == 'swapstatut')
{
if ($object->id > 0) {
$result = $object->swapContactStatus(GETPOST('ligne'));
@@ -1451,7 +1451,7 @@ if (empty($reshook))
}
// Efface un contact
- else if ($action == 'deletecontact')
+ elseif ($action == 'deletecontact')
{
$result = $object->delete_contact($lineid);
diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php
index c531948f4cd..2c91990332b 100644
--- a/htdocs/commande/class/api_orders.class.php
+++ b/htdocs/commande/class/api_orders.class.php
@@ -565,7 +565,7 @@ class Orders extends DolibarrApi
$result = $this->commande->set_reopen(DolibarrApiAccess::$user);
if( $result < 0) {
throw new RestException(405, $this->commande->error);
- }else if( $result == 0) {
+ }elseif( $result == 0) {
throw new RestException(304);
}
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 894f9c5c687..5c000ce6d2d 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -2533,7 +2533,7 @@ class Commande extends CommonOrder
{
$ga[$obj->cid] = $obj->ref;
}
- else if ($shortlist == 2)
+ elseif ($shortlist == 2)
{
$ga[$obj->cid] = $obj->ref.' ('.$obj->name.')';
}
diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php
index b40a284e728..9c5c1c183b0 100644
--- a/htdocs/commande/contact.php
+++ b/htdocs/commande/contact.php
@@ -79,7 +79,7 @@ if ($action == 'addcontact' && $user->rights->commande->creer)
}
// bascule du statut d'un contact
-else if ($action == 'swapstatut' && $user->rights->commande->creer)
+elseif ($action == 'swapstatut' && $user->rights->commande->creer)
{
if ($object->fetch($id))
{
@@ -92,7 +92,7 @@ else if ($action == 'swapstatut' && $user->rights->commande->creer)
}
// Efface un contact
-else if ($action == 'deletecontact' && $user->rights->commande->creer)
+elseif ($action == 'deletecontact' && $user->rights->commande->creer)
{
$object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]);
diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index 4e33a8c0aae..b63136c8581 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -364,7 +364,7 @@ if ($action == 'create')
{
$selectedcode=$_POST["account_country_id"]?$_POST["account_country_id"]:$object->country_code;
}
- else if (empty($selectedcode)) $selectedcode=$mysoc->country_code;
+ elseif (empty($selectedcode)) $selectedcode=$mysoc->country_code;
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
print ''.$langs->trans("BankAccountCountry").' ';
@@ -610,7 +610,7 @@ else
print '';
$conciliate=$object->canBeConciliated();
if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
- else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
+ elseif ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
else print ($object->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')'));
print ' ';
@@ -846,7 +846,7 @@ else
$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id;
$selectedcode=$object->country_code;
if (isset($_POST["account_country_id"])) $selectedcode=$_POST["account_country_id"];
- else if (empty($selectedcode)) $selectedcode=$mysoc->country_code;
+ elseif (empty($selectedcode)) $selectedcode=$mysoc->country_code;
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
print ''.$langs->trans("Country").' ';
@@ -872,7 +872,7 @@ else
print '';
$conciliate=$object->canBeConciliated();
if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
- else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
+ elseif ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
else print ' 0)?'':' checked="checked"').'"> '.$langs->trans("DisableConciliation");
print ' ';
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index cb00e201bc6..9e94d262c18 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -1358,7 +1358,7 @@ class Account extends CommonObject
{
$url = DOL_URL_ROOT.'/compta/bank/bankentries_list.php?id='.$this->id;
}
- else if ($mode == 'receipts')
+ elseif ($mode == 'receipts')
{
$url = DOL_URL_ROOT.'/compta/bank/releve.php?account='.$this->id;
}
@@ -1783,7 +1783,7 @@ class AccountLine extends CommonObject
$sql.= " WHERE b.fk_account = ba.rowid";
$sql.= " AND ba.entity IN (".getEntity('bank_account').")";
if ($num) $sql.= " AND b.num_chq='".$this->db->escape($num)."'";
- else if ($ref) $sql.= " AND b.rowid='".$this->db->escape($ref)."'";
+ elseif ($ref) $sql.= " AND b.rowid='".$this->db->escape($ref)."'";
else $sql.= " AND b.rowid=".$rowid;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php
index d98db0ea998..d359a5c814f 100644
--- a/htdocs/compta/bank/ligne.php
+++ b/htdocs/compta/bank/ligne.php
@@ -351,7 +351,7 @@ if ($result)
print '';*/
print $paymenttmp->getNomUrl(1);
}
- else if ($links[$key]['type']=='payment_supplier') {
+ elseif ($links[$key]['type']=='payment_supplier') {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
$paymenttmp=new PaiementFourn($db);
$paymenttmp->fetch($links[$key]['url_id']);
@@ -362,72 +362,72 @@ if ($result)
print '';*/
print $paymenttmp->getNomUrl(1);
}
- else if ($links[$key]['type']=='company') {
+ elseif ($links[$key]['type']=='company') {
$societe=new Societe($db);
$societe->fetch($links[$key]['url_id']);
print $societe->getNomUrl(1);
}
- else if ($links[$key]['type']=='sc') {
+ elseif ($links[$key]['type']=='sc') {
print '';
print img_object($langs->trans('ShowSocialContribution'),'bill').' ';
print $langs->trans("SocialContribution").($links[$key]['label']?' - '.$links[$key]['label']:'');
print ' ';
}
- else if ($links[$key]['type']=='payment_sc') {
+ elseif ($links[$key]['type']=='payment_sc') {
print '';
print img_object($langs->trans('ShowPayment'),'payment').' ';
print $langs->trans("SocialContributionPayment");
print ' ';
}
- else if ($links[$key]['type']=='payment_vat') {
+ elseif ($links[$key]['type']=='payment_vat') {
print '';
print img_object($langs->trans('ShowVAT'),'payment').' ';
print $langs->trans("VATPayment");
print ' ';
}
- else if ($links[$key]['type']=='payment_salary') {
+ elseif ($links[$key]['type']=='payment_salary') {
print '';
print img_object($langs->trans('ShowPaymentSalary'),'payment').' ';
print $langs->trans("SalaryPayment");
print ' ';
}
- else if ($links[$key]['type']=='payment_loan') {
+ elseif ($links[$key]['type']=='payment_loan') {
print '';
print img_object($langs->trans('ShowLoanPayment'),'payment').' ';
print $langs->trans("PaymentLoan");
print ' ';
}
- else if ($links[$key]['type']=='loan') {
+ elseif ($links[$key]['type']=='loan') {
print '';
print img_object($langs->trans('ShowLoan'),'bill').' ';
print $langs->trans("Loan");
print ' ';
}
- else if ($links[$key]['type']=='member') {
+ elseif ($links[$key]['type']=='member') {
print '';
print img_object($langs->trans('ShowMember'),'user').' ';
print $links[$key]['label'];
print ' ';
}
- else if ($links[$key]['type']=='payment_donation') {
+ elseif ($links[$key]['type']=='payment_donation') {
print '';
print img_object($langs->trans('ShowDonation'),'payment').' ';
print $langs->trans("DonationPayment");
print ' ';
}
- else if ($links[$key]['type']=='banktransfert') {
+ elseif ($links[$key]['type']=='banktransfert') {
print '';
print img_object($langs->trans('ShowTransaction'),'payment').' ';
print $langs->trans("TransactionOnTheOtherAccount");
print ' ';
}
- else if ($links[$key]['type']=='user') {
+ elseif ($links[$key]['type']=='user') {
print '';
print img_object($langs->trans('ShowUser'),'user').' ';
print $langs->trans("User");
print ' ';
}
- else if ($links[$key]['type']=='payment_various') {
+ elseif ($links[$key]['type']=='payment_various') {
print '';
print img_object($langs->trans('ShowVariousPayment'),'payment').' ';
print $langs->trans("VariousPayment");
diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php
index 922df54c147..94f66f2552e 100644
--- a/htdocs/compta/deplacement/card.php
+++ b/htdocs/compta/deplacement/card.php
@@ -78,7 +78,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer)
}
}
-else if ($action == 'classifyrefunded' && $user->rights->deplacement->creer)
+elseif ($action == 'classifyrefunded' && $user->rights->deplacement->creer)
{
$object->fetch($id);
if ($object->statut == 1)
@@ -96,7 +96,7 @@ else if ($action == 'classifyrefunded' && $user->rights->deplacement->creer)
}
}
-else if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->deplacement->supprimer)
+elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->deplacement->supprimer)
{
$result=$object->delete($id);
if ($result >= 0)
@@ -110,7 +110,7 @@ else if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->depl
}
}
-else if ($action == 'add' && $user->rights->deplacement->creer)
+elseif ($action == 'add' && $user->rights->deplacement->creer)
{
if (! GETPOST('cancel','alpha'))
{
@@ -169,7 +169,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer)
}
// Update record
-else if ($action == 'update' && $user->rights->deplacement->creer)
+elseif ($action == 'update' && $user->rights->deplacement->creer)
{
if (! GETPOST('cancel','alpha'))
{
@@ -203,7 +203,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer)
}
// Set into a project
-else if ($action == 'classin' && $user->rights->deplacement->creer)
+elseif ($action == 'classin' && $user->rights->deplacement->creer)
{
$object->fetch($id);
$result=$object->setProject(GETPOST('projectid','int'));
@@ -211,14 +211,14 @@ else if ($action == 'classin' && $user->rights->deplacement->creer)
}
// Set fields
-else if ($action == 'setdated' && $user->rights->deplacement->creer)
+elseif ($action == 'setdated' && $user->rights->deplacement->creer)
{
$dated=dol_mktime(GETPOST('datedhour','int'), GETPOST('datedmin','int'), GETPOST('datedsec','int'), GETPOST('datedmonth','int'), GETPOST('datedday','int'), GETPOST('datedyear','int'));
$object->fetch($id);
$result=$object->setValueFrom('dated', $dated, '', '', 'date', '', $user, 'DEPLACEMENT_MODIFY');
if ($result < 0) dol_print_error($db, $object->error);
}
-else if ($action == 'setkm' && $user->rights->deplacement->creer)
+elseif ($action == 'setkm' && $user->rights->deplacement->creer)
{
$object->fetch($id);
$result=$object->setValueFrom('km', GETPOST('km','int'), '', null, 'text', '', $user, 'DEPLACEMENT_MODIFY');
@@ -314,7 +314,7 @@ if ($action == 'create')
print '';
}
-else if ($id)
+elseif ($id)
{
$result = $object->fetch($id);
if ($result > 0)
diff --git a/htdocs/compta/deplacement/class/deplacementstats.class.php b/htdocs/compta/deplacement/class/deplacementstats.class.php
index 542fe49e503..e7277b0ca58 100644
--- a/htdocs/compta/deplacement/class/deplacementstats.class.php
+++ b/htdocs/compta/deplacement/class/deplacementstats.class.php
@@ -69,7 +69,7 @@ class DeplacementStats extends Stats
$this->where.=" AND fk_soc = ".$this->socid;
}
if (is_array($this->userid) && count($this->userid) > 0) $this->where.=' AND fk_user IN ('.join(',',$this->userid).')';
- else if ($this->userid > 0) $this->where.=' AND fk_user = '.$this->userid;
+ elseif ($this->userid > 0) $this->where.=' AND fk_user = '.$this->userid;
}
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 1fd2906c26f..92d8cf629c7 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -178,7 +178,7 @@ if (empty($reshook))
}
// Change status of invoice
- else if ($action == 'reopen' && $usercancreate) {
+ elseif ($action == 'reopen' && $usercancreate) {
$result = $object->fetch($id);
if ($object->statut == 2 || ($object->statut == 3 && $object->close_code != 'replaced') || ($object->statut == 1 && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted
$result = $object->set_unpaid($user);
@@ -192,7 +192,7 @@ if (empty($reshook))
}
// Delete invoice
- else if ($action == 'confirm_delete' && $confirm == 'yes') {
+ elseif ($action == 'confirm_delete' && $confirm == 'yes') {
$result = $object->fetch($id);
$object->fetch_thirdparty();
@@ -222,7 +222,7 @@ if (empty($reshook))
}
// Delete line
- else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate)
+ elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate)
{
$object->fetch($id);
$object->fetch_thirdparty();
@@ -256,7 +256,7 @@ if (empty($reshook))
}
// Delete link of credit note to invoice
- else if ($action == 'unlinkdiscount' && $usercancreate)
+ elseif ($action == 'unlinkdiscount' && $usercancreate)
{
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(GETPOST("discountid"));
@@ -264,7 +264,7 @@ if (empty($reshook))
}
// Validation
- else if ($action == 'valid' && $usercancreate)
+ elseif ($action == 'valid' && $usercancreate)
{
$object->fetch($id);
@@ -284,7 +284,7 @@ if (empty($reshook))
}
}
- else if ($action == 'set_thirdparty' && $usercancreate)
+ elseif ($action == 'set_thirdparty' && $usercancreate)
{
$object->fetch($id);
$object->setValueFrom('fk_soc', $socid, '', null, 'int', '', $user, 'BILL_MODIFY');
@@ -293,13 +293,13 @@ if (empty($reshook))
exit();
}
- else if ($action == 'classin' && $usercancreate)
+ elseif ($action == 'classin' && $usercancreate)
{
$object->fetch($id);
$object->setProject($_POST['projectid']);
}
- else if ($action == 'setmode' && $usercancreate)
+ elseif ($action == 'setmode' && $usercancreate)
{
$object->fetch($id);
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
@@ -308,16 +308,16 @@ if (empty($reshook))
}
// Multicurrency Code
- else if ($action == 'setmulticurrencycode' && $usercancreate) {
+ elseif ($action == 'setmulticurrencycode' && $usercancreate) {
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
}
// Multicurrency rate
- else if ($action == 'setmulticurrencyrate' && $usercancreate) {
+ elseif ($action == 'setmulticurrencyrate' && $usercancreate) {
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int'));
}
- else if ($action == 'setinvoicedate' && $usercancreate)
+ elseif ($action == 'setinvoicedate' && $usercancreate)
{
$object->fetch($id);
$old_date_lim_reglement = $object->date_lim_reglement;
@@ -336,7 +336,7 @@ if (empty($reshook))
if ($result < 0) dol_print_error($db, $object->error);
}
- else if ($action == 'setdate_pointoftax' && $usercancreate)
+ elseif ($action == 'setdate_pointoftax' && $usercancreate)
{
$object->fetch($id);
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
@@ -345,7 +345,7 @@ if (empty($reshook))
if ($result < 0) dol_print_error($db, $object->error);
}
- else if ($action == 'setconditions' && $usercancreate)
+ elseif ($action == 'setconditions' && $usercancreate)
{
$object->fetch($id);
$object->cond_reglement_code = 0; // To clean property
@@ -361,7 +361,7 @@ if (empty($reshook))
if ($result < 0) dol_print_error($db, $object->error);
}
- else if ($action == 'setpaymentterm' && $usercancreate)
+ elseif ($action == 'setpaymentterm' && $usercancreate)
{
$object->fetch($id);
$object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']);
@@ -374,7 +374,7 @@ if (empty($reshook))
dol_print_error($db, $object->error);
}
- else if ($action == 'setrevenuestamp' && $usercancreate)
+ elseif ($action == 'setrevenuestamp' && $usercancreate)
{
$object->fetch($id);
$object->revenuestamp = GETPOST('revenuestamp');
@@ -391,18 +391,18 @@ if (empty($reshook))
}
// bank account
- else if ($action == 'setbankaccount' && $usercancreate)
+ elseif ($action == 'setbankaccount' && $usercancreate)
{
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
}
- else if ($action == 'setremisepercent' && $usercancreate)
+ elseif ($action == 'setremisepercent' && $usercancreate)
{
$object->fetch($id);
$result = $object->set_remise($user, $_POST['remise_percent']);
}
- else if ($action == "setabsolutediscount" && $usercancreate)
+ elseif ($action == "setabsolutediscount" && $usercancreate)
{
// POST[remise_id] or POST[remise_id_for_payment]
@@ -460,14 +460,14 @@ if (empty($reshook))
}
}
- else if ($action == 'setref_client' && $usercancreate)
+ elseif ($action == 'setref_client' && $usercancreate)
{
$object->fetch($id);
$object->set_ref_client(GETPOST('ref_client'));
}
// Classify to validated
- else if ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate)
+ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate)
{
$idwarehouse = GETPOST('idwarehouse','int');
@@ -567,7 +567,7 @@ if (empty($reshook))
}
// Go back to draft status (unvalidate)
- else if ($action == 'confirm_modif' && $usercanunvalidate)
+ elseif ($action == 'confirm_modif' && $usercanunvalidate)
{
$idwarehouse = GETPOST('idwarehouse','int');
@@ -647,13 +647,13 @@ if (empty($reshook))
}
// Classify "paid"
- else if ($action == 'confirm_paid' && $confirm == 'yes' && $usercanissuepayment)
+ elseif ($action == 'confirm_paid' && $confirm == 'yes' && $usercanissuepayment)
{
$object->fetch($id);
$result = $object->set_paid($user);
if ($result<0) setEventMessages($object->error, $object->errors, 'errors');
} // Classif "paid partialy"
- else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $usercanissuepayment)
+ elseif ($action == 'confirm_paid_partially' && $confirm == 'yes' && $usercanissuepayment)
{
$object->fetch($id);
$close_code = GETPOST("close_code",'none');
@@ -665,7 +665,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
}
} // Classify "abandoned"
- else if ($action == 'confirm_canceled' && $confirm == 'yes') {
+ elseif ($action == 'confirm_canceled' && $confirm == 'yes') {
$object->fetch($id);
$close_code = GETPOST("close_code",'none');
$close_note = GETPOST("close_note",'none');
@@ -678,7 +678,7 @@ if (empty($reshook))
}
// Convertir en reduc
- else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $usercancreate)
+ elseif ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $usercancreate)
{
$object->fetch($id);
$object->fetch_thirdparty();
@@ -824,7 +824,7 @@ if (empty($reshook))
/*
* Insert new invoice in database
*/
- else if ($action == 'add' && $usercancreate)
+ elseif ($action == 'add' && $usercancreate)
{
if ($socid > 0) $object->socid = GETPOST('socid', 'int');
@@ -1648,7 +1648,7 @@ if (empty($reshook))
}
// Add a new line
- else if ($action == 'addline' && $usercancreate)
+ elseif ($action == 'addline' && $usercancreate)
{
$langs->load('errors');
$error = 0;
@@ -2172,7 +2172,7 @@ if (empty($reshook))
}
}
- else if ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier'))
+ elseif ($action == 'updatealllines' && $usercancreate && $_POST['all_percent'] == $langs->trans('Modifier'))
{
if (!$object->fetch($id) > 0) dol_print_error($db);
if (!is_null(GETPOST('all_progress')) && GETPOST('all_progress') != "")
@@ -2189,7 +2189,7 @@ if (empty($reshook))
}
}
- else if ($action == 'updateline' && $usercancreate && $_POST['cancel'] == $langs->trans('Cancel')) {
+ elseif ($action == 'updateline' && $usercancreate && $_POST['cancel'] == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id); // Pour reaffichage de la fiche en cours d'edition
exit();
}
@@ -3283,7 +3283,7 @@ if ($action == 'create')
print ' ';
}
-else if ($id > 0 || ! empty($ref))
+elseif ($id > 0 || ! empty($ref))
{
/*
* Show object in view mode
@@ -4540,7 +4540,7 @@ else if ($id > 0 || ! empty($ref))
} else {
print '' . $langs->trans('Modify') . '
';
}
- } else if (!$object->is_last_in_cycle()) {
+ } elseif (!$object->is_last_in_cycle()) {
print '' . $langs->trans('Modify') . '
';
} else {
print '' . $langs->trans('Modify') . '
';
@@ -4758,7 +4758,7 @@ else if ($id > 0 || ! empty($ref))
if ($usercancreate && ($object->type == 5) && ($object->statut == 1 || $object->statut == 2)) {
if ($object->is_last_in_cycle() && $object->situation_final != 1) {
print '';
- } else if (!$object->is_last_in_cycle()) {
+ } elseif (!$object->is_last_in_cycle()) {
print '';
} else {
print '';
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index 39df40cc260..35a8a45bd20 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -1398,7 +1398,7 @@ class FactureRec extends CommonInvoice
$line->total_ttc=-119.6;
$line->total_tva=-19.6;
}
- else if ($xnbp == 2) // UP is negative (free line)
+ elseif ($xnbp == 2) // UP is negative (free line)
{
$line->subprice=-100;
$line->total_ht=-100;
@@ -1406,7 +1406,7 @@ class FactureRec extends CommonInvoice
$line->total_tva=-19.6;
$line->remise_percent=0;
}
- else if ($xnbp == 3) // Discount is 50% (product line)
+ elseif ($xnbp == 3) // Discount is 50% (product line)
{
$prodid = mt_rand(1, $num_prods);
$line->fk_product=$prodids[$prodid];
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index bc689118426..14d01419037 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -2313,7 +2313,7 @@ class Facture extends CommonInvoice
{
$num = $force_number;
}
- else if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life
+ elseif (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life
{
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION)) // If option enabled, we force invoice date
{
@@ -3337,8 +3337,8 @@ class Facture extends CommonInvoice
// Clean parameters (if not defined or using deprecated value)
if (empty($conf->global->FACTURE_ADDON)) $conf->global->FACTURE_ADDON='mod_facture_terre';
- else if ($conf->global->FACTURE_ADDON=='terre') $conf->global->FACTURE_ADDON='mod_facture_terre';
- else if ($conf->global->FACTURE_ADDON=='mercure') $conf->global->FACTURE_ADDON='mod_facture_mercure';
+ elseif ($conf->global->FACTURE_ADDON=='terre') $conf->global->FACTURE_ADDON='mod_facture_terre';
+ elseif ($conf->global->FACTURE_ADDON=='mercure') $conf->global->FACTURE_ADDON='mod_facture_mercure';
if (! empty($conf->global->FACTURE_ADDON))
{
@@ -3511,7 +3511,7 @@ class Facture extends CommonInvoice
{
$ga[$obj->fid] = $obj->ref;
}
- else if ($shortlist == 2)
+ elseif ($shortlist == 2)
{
$ga[$obj->fid] = $obj->ref.' ('.$obj->name.')';
}
@@ -3971,7 +3971,7 @@ class Facture extends CommonInvoice
$line->multicurrency_total_ttc=-239.2;
$line->multicurrency_total_tva=-39.2;
}
- else if ($xnbp == 2) // UP is negative (free line)
+ elseif ($xnbp == 2) // UP is negative (free line)
{
$line->subprice=-100;
$line->total_ht=-100;
@@ -3982,7 +3982,7 @@ class Facture extends CommonInvoice
$line->multicurrency_total_ttc=-239.2;
$line->multicurrency_total_tva=-39.2;
}
- else if ($xnbp == 3) // Discount is 50% (product line)
+ elseif ($xnbp == 3) // Discount is 50% (product line)
{
$prodid = mt_rand(1, $num_prods);
$line->fk_product=$prodids[$prodid];
diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php
index 80277e14741..4e0c52589de 100644
--- a/htdocs/compta/facture/contact.php
+++ b/htdocs/compta/facture/contact.php
@@ -85,7 +85,7 @@ if ($action == 'addcontact' && $user->rights->facture->creer)
}
// Toggle the status of a contact
-else if ($action == 'swapstatut' && $user->rights->facture->creer)
+elseif ($action == 'swapstatut' && $user->rights->facture->creer)
{
if ($object->fetch($id))
{
@@ -98,7 +98,7 @@ else if ($action == 'swapstatut' && $user->rights->facture->creer)
}
// Deletes a contact
-else if ($action == 'deletecontact' && $user->rights->facture->creer)
+elseif ($action == 'deletecontact' && $user->rights->facture->creer)
{
$object->fetch($id);
$result = $object->delete_contact($lineid);
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index c048737b156..7cc63b10e72 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -405,7 +405,7 @@ if (empty($reshook))
setEventMessages($line->error, $line->errors, 'errors');
}
}
- else if ($action == 'update_extras')
+ elseif ($action == 'update_extras')
{
$object->oldcopy = dol_clone($object);
@@ -1145,7 +1145,7 @@ if ($action == 'create')
$title = $langs->trans("ProductsAndServices");
if (empty($conf->service->enabled))
$title = $langs->trans("Products");
- else if (empty($conf->product->enabled))
+ elseif (empty($conf->product->enabled))
$title = $langs->trans("Services");
print load_fiche_titre($title, '', '');
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index be372e8a570..1b70c50c8f4 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -247,12 +247,12 @@ if ($search_month > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.date_last_gen BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
- else if ($search_year > 0 && ! empty($search_day))
+ elseif ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.date_last_gen BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.date_last_gen, '%m') = '".$db->escape($search_month)."'";
}
-else if ($search_year > 0)
+elseif ($search_year > 0)
{
$sql.= " AND f.date_last_gen BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
@@ -260,12 +260,12 @@ if ($search_month_date_when > 0)
{
if ($search_year_date_when > 0 && empty($search_day_date_when))
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when,$search_month_date_when,false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when,$search_month_date_when,false))."'";
- else if ($search_year_date_when > 0 && ! empty($search_day_date_when))
+ elseif ($search_year_date_when > 0 && ! empty($search_day_date_when))
$sql.= " AND f.date_date_when_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
else
$sql.= " AND date_format(f.date_when, '%m') = '".$db->escape($search_month_date_when)."'";
}
-else if ($search_year_date_when > 0)
+elseif ($search_year_date_when > 0)
{
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when,1,false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when,12,false))."'";
}
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 7a06e6f66df..c3aeb8f6608 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -273,7 +273,7 @@ if ($massaction == 'withdrawrequest')
if($objecttmp->paye || $objecttmp->resteapayer==0){
$error++;
setEventMessages($objecttmp->ref.' '.$langs->trans("AlreadyPaid"), $objecttmp->errors, 'errors');
- } else if($objecttmp->resteapayer<0){
+ } elseif($objecttmp->resteapayer<0){
$error++;
setEventMessages($objecttmp->ref.' '.$langs->trans("AmountMustBePositive"), $objecttmp->errors, 'errors');
}
@@ -303,7 +303,7 @@ if ($massaction == 'withdrawrequest')
$error++;
setEventMessages($objecttmp->ref.' '.$langs->trans("RequestAlreadyDone"), $objecttmp->errors, 'warnings');
}
- else if (!empty($objecttmp->mode_reglement_code ) && $objecttmp->mode_reglement_code != 'PRE'){
+ elseif (!empty($objecttmp->mode_reglement_code ) && $objecttmp->mode_reglement_code != 'PRE'){
$error++;
setEventMessages($objecttmp->ref.' '.$langs->trans("BadPaymentMethod"), $objecttmp->errors, 'errors');
}
diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php
index 574c7103c61..924c6bf3a09 100644
--- a/htdocs/compta/localtax/clients.php
+++ b/htdocs/compta/localtax/clients.php
@@ -58,8 +58,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
{
$date_start=dol_get_first_day($year_start,empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START,false);
if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1;
- else if ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1;
- else if ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1;
+ elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1;
+ elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1;
}
}
else
@@ -229,7 +229,7 @@ if($calc ==0 || $calc == 2)
$langs->load("errors");
if ($coll_list == -1)
print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").' ';
- else if ($coll_list == -2)
+ elseif ($coll_list == -2)
print ''.$langs->trans("FeatureNotYetAvailable").' ';
else
print ''.$langs->trans("Error").' ';
@@ -305,7 +305,7 @@ if($calc ==0 || $calc == 1){
$langs->load("errors");
if ($coll_list == -1)
print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").' ';
- else if ($coll_list == -2)
+ elseif ($coll_list == -2)
print ''.$langs->trans("FeatureNotYetAvailable").' ';
else
print ''.$langs->trans("Error").' ';
diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php
index 73a9f77341a..6875083901b 100644
--- a/htdocs/compta/localtax/quadri_detail.php
+++ b/htdocs/compta/localtax/quadri_detail.php
@@ -68,8 +68,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
{
$date_start=dol_get_first_day($year_start,empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START,false);
if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1;
- else if ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1;
- else if ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1;
+ elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1;
+ elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1;
}
}
else
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index c19d51b5891..e186dfce4cd 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -270,7 +270,7 @@ if ($action == 'builddoc' && $user->rights->banque->cheque)
}
// Remove file in doc form
-else if ($action == 'remove_file' && $user->rights->banque->cheque)
+elseif ($action == 'remove_file' && $user->rights->banque->cheque)
{
if ($object->fetch($id) > 0)
{
diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
index 34dd599f35a..ccb42343907 100644
--- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
@@ -423,8 +423,8 @@ class RemiseCheque extends CommonObject
// Clean parameters (if not defined or using deprecated value)
if (empty($conf->global->CHEQUERECEIPTS_ADDON)) $conf->global->CHEQUERECEIPTS_ADDON='mod_chequereceipt_mint';
- else if ($conf->global->CHEQUERECEIPTS_ADDON=='thyme') $conf->global->CHEQUERECEIPTS_ADDON='mod_chequereceipt_thyme';
- else if ($conf->global->CHEQUERECEIPTS_ADDON=='mint') $conf->global->CHEQUERECEIPTS_ADDON='mod_chequereceipt_mint';
+ elseif ($conf->global->CHEQUERECEIPTS_ADDON=='thyme') $conf->global->CHEQUERECEIPTS_ADDON='mod_chequereceipt_thyme';
+ elseif ($conf->global->CHEQUERECEIPTS_ADDON=='mint') $conf->global->CHEQUERECEIPTS_ADDON='mod_chequereceipt_mint';
if (! empty($conf->global->CHEQUERECEIPTS_ADDON))
{
diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php
index d9ac1ab11eb..d84b26f78b2 100644
--- a/htdocs/compta/paiement/cheque/list.php
+++ b/htdocs/compta/paiement/cheque/list.php
@@ -100,12 +100,12 @@ if ($month > 0)
{
if ($year > 0 && empty($day))
$sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
- else if ($year > 0 && ! empty($day))
+ elseif ($year > 0 && ! empty($day))
$sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
else
$sql.= " AND date_format(bc.date_bordereau, '%m') = '".$month."'";
}
-else if ($year > 0)
+elseif ($year > 0)
{
$sql.= " AND bc.date_bordereau BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 4e729e9c37b..0003043fef4 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -168,9 +168,9 @@ class Paiement extends CommonObject
$sql.= ' WHERE p.entity IN (' . getEntity('invoice').')';
if ($id > 0)
$sql.= ' AND p.rowid = '.$id;
- else if ($ref)
+ elseif ($ref)
$sql.= " AND p.ref = '".$ref."'";
- else if ($fk_bank)
+ elseif ($fk_bank)
$sql.= ' AND p.fk_bank = '.$fk_bank;
$resql = $this->db->query($sql);
@@ -357,7 +357,7 @@ class Paiement extends CommonObject
);
if (!in_array($invoice->type, $affected_types)) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note, nor deposit invoice, nor situation invoice. We do nothing more.");
- else if ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more.");
+ elseif ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more.");
//else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more.");
else
{
@@ -1034,8 +1034,8 @@ class Paiement extends CommonObject
// Clean parameters (if not defined or using deprecated value)
if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON='mod_payment_cicada';
- else if ($conf->global->PAYMENT_ADDON=='ant') $conf->global->PAYMENT_ADDON='mod_payment_ant';
- else if ($conf->global->PAYMENT_ADDON=='cicada') $conf->global->PAYMENT_ADDON='mod_payment_cicada';
+ elseif ($conf->global->PAYMENT_ADDON=='ant') $conf->global->PAYMENT_ADDON='mod_payment_ant';
+ elseif ($conf->global->PAYMENT_ADDON=='cicada') $conf->global->PAYMENT_ADDON='mod_payment_cicada';
if (! empty($conf->global->PAYMENT_ADDON))
{
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index 3a3ba57cb18..38888110d79 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -134,7 +134,7 @@ if ($modecompta == 'CREANCES-DETTES')
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
-else if ($modecompta=="RECETTES-DEPENSES") {
+elseif ($modecompta=="RECETTES-DEPENSES") {
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode=$langs->trans("CalcModeEngagement");
$calcmode.=' ('.$langs->trans("SeeReportInDueDebtMode",' ',' ').')';
@@ -146,7 +146,7 @@ else if ($modecompta=="RECETTES-DEPENSES") {
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
$name = $langs->trans("ReportInOut").', '.$langs->trans("ByYear");
$calcmode=$langs->trans("CalcModeBookkeeping");
@@ -191,7 +191,7 @@ if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
}
- else if ($modecompta=="RECETTES-DEPENSES")
+ elseif ($modecompta=="RECETTES-DEPENSES")
{
/*
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
@@ -232,7 +232,7 @@ if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo
dol_print_error($db);
}
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
// Nothing from this table
}
@@ -278,12 +278,12 @@ if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo
dol_print_error($db);
}
}
- else if ($modecompta=="RECETTES-DEPENSES")
+ elseif ($modecompta=="RECETTES-DEPENSES")
{
// Nothing from this table
}
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
// Nothing from this table
}
@@ -307,7 +307,7 @@ if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
}
- else if ($modecompta=="RECETTES-DEPENSES")
+ elseif ($modecompta=="RECETTES-DEPENSES")
{
$sql = "SELECT sum(pf.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm";
$sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p";
@@ -347,7 +347,7 @@ if (! empty($conf->facture->enabled) && ($modecompta == 'CREANCES-DETTES' || $mo
dol_print_error($db);
}
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
// Nothing from this table
}
@@ -429,7 +429,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
dol_print_error($db);
}
}
- else if ($modecompta=="RECETTES-DEPENSES")
+ elseif ($modecompta=="RECETTES-DEPENSES")
{
// TVA reellement deja payee
$sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm";
@@ -493,7 +493,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
}
}
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
// Nothing from this table
}
@@ -516,7 +516,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'";
}
- else if ($modecompta=="RECETTES-DEPENSES")
+ elseif ($modecompta=="RECETTES-DEPENSES")
{
$sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
@@ -554,7 +554,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
dol_print_error($db);
}
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
// Nothing from this table
}
@@ -578,7 +578,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND cs.date_ech >= '".$db->idate($date_start)."' AND cs.date_ech <= '".$db->idate($date_end)."'";
}
- else if ($modecompta=="RECETTES-DEPENSES")
+ elseif ($modecompta=="RECETTES-DEPENSES")
{
$sql = "SELECT c.libelle as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
@@ -616,7 +616,7 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
dol_print_error($db);
}
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
// Nothing from this table
}
diff --git a/htdocs/compta/salaries/class/salariesstats.class.php b/htdocs/compta/salaries/class/salariesstats.class.php
index 0c91ee29309..1a96fbc56aa 100644
--- a/htdocs/compta/salaries/class/salariesstats.class.php
+++ b/htdocs/compta/salaries/class/salariesstats.class.php
@@ -67,7 +67,7 @@ class SalariesStats extends Stats
$this->where.=" AND fk_soc = ".$this->socid;
}
if (is_array($this->userid) && count($this->userid) > 0) $this->where.=' AND fk_user IN ('.join(',',$this->userid).')';
- else if ($this->userid > 0) $this->where.=' AND fk_user = '.$this->userid;
+ elseif ($this->userid > 0) $this->where.=' AND fk_user = '.$this->userid;
}
diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php
index df199d2e23e..4e1e429f0e5 100644
--- a/htdocs/compta/stats/byratecountry.php
+++ b/htdocs/compta/stats/byratecountry.php
@@ -210,7 +210,7 @@ if ($modecompta=="CREANCES-DETTES") {
$builddate=dol_now();
}
-else if ($modecompta=="RECETTES-DEPENSES")
+elseif ($modecompta=="RECETTES-DEPENSES")
{
$name=$langs->trans("TurnoverCollected").', '.$langs->trans("ByVatRate");
$calcmode=$langs->trans("CalcModeEngagement");
@@ -221,12 +221,12 @@ else if ($modecompta=="RECETTES-DEPENSES")
$builddate=dol_now();
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
}
-else if ($modecompta=="BOOKKEEPINGCOLLECTED")
+elseif ($modecompta=="BOOKKEEPINGCOLLECTED")
{
diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php
index 701fe86f10e..388ae43eb1e 100644
--- a/htdocs/compta/stats/cabyprodserv.php
+++ b/htdocs/compta/stats/cabyprodserv.php
@@ -178,7 +178,7 @@ if ($modecompta=="CREANCES-DETTES") {
$builddate=dol_now();
}
-else if ($modecompta=="RECETTES-DEPENSES")
+elseif ($modecompta=="RECETTES-DEPENSES")
{
$name=$langs->trans("TurnoverCollected").', '.$langs->trans("ByProductsAndServices");
$calcmode=$langs->trans("CalcModeEngagement");
@@ -189,12 +189,12 @@ else if ($modecompta=="RECETTES-DEPENSES")
$builddate=dol_now();
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
}
-else if ($modecompta=="BOOKKEEPINGCOLLECTED")
+elseif ($modecompta=="BOOKKEEPINGCOLLECTED")
{
@@ -231,7 +231,7 @@ if ($modecompta == 'CREANCES-DETTES')
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
}
- else if ($selected_cat) // Into a specific category
+ elseif ($selected_cat) // Into a specific category
{
$sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp";
}
@@ -253,7 +253,7 @@ if ($modecompta == 'CREANCES-DETTES')
{
$sql.=" AND cp.fk_product is null";
}
- else if ($selected_cat) { // Into a specific category
+ elseif ($selected_cat) { // Into a specific category
$sql.= " AND (c.rowid = ".$selected_cat;
if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat;
$sql.= ")";
diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php
index ba9556dd2ac..397538d2ac1 100644
--- a/htdocs/compta/stats/cabyuser.php
+++ b/htdocs/compta/stats/cabyuser.php
@@ -158,7 +158,7 @@ if ($modecompta=="CREANCES-DETTES") {
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
-else if ($modecompta=="RECETTES-DEPENSES")
+elseif ($modecompta=="RECETTES-DEPENSES")
{
$name=$langs->trans("TurnoverCollected").', '.$langs->trans("ByUserAuthorOfInvoice");
$calcmode=$langs->trans("CalcModeEngagement");
@@ -168,12 +168,12 @@ else if ($modecompta=="RECETTES-DEPENSES")
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
}
-else if ($modecompta=="BOOKKEEPINGCOLLECTED")
+elseif ($modecompta=="BOOKKEEPINGCOLLECTED")
{
diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php
index eec3bbcfbac..727f65a8b68 100644
--- a/htdocs/compta/stats/casoc.php
+++ b/htdocs/compta/stats/casoc.php
@@ -184,7 +184,7 @@ if ($modecompta=="CREANCES-DETTES")
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
-else if ($modecompta=="RECETTES-DEPENSES")
+elseif ($modecompta=="RECETTES-DEPENSES")
{
$name=$langs->trans("TurnoverCollected").', '.$langs->trans("ByThirdParties");
$calcmode=$langs->trans("CalcModeEngagement");
@@ -194,12 +194,12 @@ else if ($modecompta=="RECETTES-DEPENSES")
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
}
-else if ($modecompta=="BOOKKEEPINGCOLLECTED")
+elseif ($modecompta=="BOOKKEEPINGCOLLECTED")
{
@@ -228,7 +228,7 @@ if ($modecompta == 'CREANCES-DETTES') {
{
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc";
}
- else if ($selected_cat) // Into a specific category
+ elseif ($selected_cat) // Into a specific category
{
$sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs";
}
@@ -246,7 +246,7 @@ if ($modecompta == 'CREANCES-DETTES') {
{
$sql.=" AND cs.fk_soc is null";
}
- else if ($selected_cat) { // Into a specific category
+ elseif ($selected_cat) { // Into a specific category
$sql.= " AND (c.rowid = ".$db->escape($selected_cat);
if ($subcat) $sql.=" OR c.fk_parent = " . $db->escape($selected_cat);
$sql.= ")";
@@ -266,7 +266,7 @@ if ($modecompta == 'CREANCES-DETTES') {
{
$sql.= " LEFT OUTER JOIN ".MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc";
}
- else if ($selected_cat) // Into a specific category
+ elseif ($selected_cat) // Into a specific category
{
$sql.= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_societe as cs";
}
@@ -280,7 +280,7 @@ if ($modecompta == 'CREANCES-DETTES') {
{
$sql.=" AND cs.fk_soc is null";
}
- else if ($selected_cat) { // Into a specific category
+ elseif ($selected_cat) { // Into a specific category
$sql.= " AND (c.rowid = ".$selected_cat;
if ($subcat) $sql.=" OR c.fk_parent = " . $selected_cat;
$sql.= ")";
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index 79ff8ff5df5..b700905183c 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -128,7 +128,7 @@ if ($modecompta=="CREANCES-DETTES")
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
-else if ($modecompta=="RECETTES-DEPENSES")
+elseif ($modecompta=="RECETTES-DEPENSES")
{
$name=$langs->trans("TurnoverCollected");
$calcmode=$langs->trans("CalcModeEngagement");
@@ -141,7 +141,7 @@ else if ($modecompta=="RECETTES-DEPENSES")
$builddate=dol_now();
//$exportlink=$langs->trans("NotYetAvailable");
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
$name=$langs->trans("Turnover");
$calcmode=$langs->trans("CalcModeBookkeeping");
@@ -174,7 +174,7 @@ if ($modecompta == 'CREANCES-DETTES')
$sql.= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
}
-else if ($modecompta=="RECETTES-DEPENSES")
+elseif ($modecompta=="RECETTES-DEPENSES")
{
/*
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
@@ -189,7 +189,7 @@ else if ($modecompta=="RECETTES-DEPENSES")
$sql.= " AND f.entity IN (".getEntity('invoice').")";
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
}
-else if ($modecompta=="BOOKKEEPING")
+elseif ($modecompta=="BOOKKEEPING")
{
$sql = "SELECT date_format(b.doc_date,'%Y-%m') as dm, sum(b.credit) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_journal as aj";
diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php
index 45b93692e3a..172b66c170c 100644
--- a/htdocs/compta/tva/clients.php
+++ b/htdocs/compta/tva/clients.php
@@ -66,8 +66,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
{
$date_start=dol_get_first_day($year_start,empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START,false);
if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1;
- else if ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1;
- else if ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1;
+ elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1;
+ elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1;
}
}
else
@@ -217,7 +217,7 @@ if (! is_array($x_coll) || ! is_array($x_paye))
$langs->load("errors");
if ($x_coll == -1) {
print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ' ';
- } else if ($x_coll == -2) {
+ } elseif ($x_coll == -2) {
print '' . $langs->trans("FeatureNotYetAvailable") . ' ';
} else {
print '' . $langs->trans("Error") . ' ';
diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php
index f0bb433c65c..0d3b7ec135d 100644
--- a/htdocs/compta/tva/list.php
+++ b/htdocs/compta/tva/list.php
@@ -115,7 +115,7 @@ if ($month > 0)
else
$sql.= " AND date_format(t.datev, '%m') = '$month'";
}
-else if ($year > 0)
+elseif ($year > 0)
{
$sql.= " AND t.datev BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php
index a8e22815ea4..b98b3791c8b 100644
--- a/htdocs/compta/tva/quadri_detail.php
+++ b/htdocs/compta/tva/quadri_detail.php
@@ -66,8 +66,8 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
{
$date_start=dol_get_first_day($year_start,empty($conf->global->SOCIETE_FISCAL_MONTH_START)?1:$conf->global->SOCIETE_FISCAL_MONTH_START,false);
if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end=dol_time_plus_duree($date_start, 3, 'm') - 1;
- else if ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1;
- else if ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1;
+ elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end=dol_time_plus_duree($date_start, 1, 'y') - 1;
+ elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end=dol_time_plus_duree($date_start, 1, 'm') - 1;
}
}
else
@@ -209,7 +209,7 @@ if (! is_array($x_coll) || ! is_array($x_paye))
$langs->load("errors");
if ($x_coll == -1) {
print '' . $langs->trans("ErrorNoAccountancyModuleLoaded") . ' ';
- } else if ($x_coll == -2) {
+ } elseif ($x_coll == -2) {
print '' . $langs->trans("FeatureNotYetAvailable") . ' ';
} else {
print '' . $langs->trans("Error") . ' ';
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index d5b5afa4433..4dbd78f5085 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -344,7 +344,7 @@ class Contact extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET ";
if ($this->socid > 0) $sql .= " fk_soc='".$this->db->escape($this->socid)."',";
- else if ($this->socid == -1) $sql .= " fk_soc=null,";
+ elseif ($this->socid == -1) $sql .= " fk_soc=null,";
$sql .= " civility='".$this->db->escape($this->civility_id)."'";
$sql .= ", lastname='".$this->db->escape($this->lastname)."'";
$sql .= ", firstname='".$this->db->escape($this->firstname)."'";
@@ -874,7 +874,7 @@ class Contact extends CommonObject
unset($this->gender);
if (in_array($this->civility_id, array('MR'))) {
$this->gender = 'man';
- } else if(in_array($this->civility_id, array('MME','MLE'))) {
+ } elseif(in_array($this->civility_id, array('MME','MLE'))) {
$this->gender = 'woman';
}
}
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index af15d873acb..087db5ddea6 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -113,13 +113,13 @@ if ($type == "c")
$titre.=' ('.$langs->trans("ThirdPartyCustomers").')';
$urlfiche="card.php";
}
-else if ($type == "f")
+elseif ($type == "f")
{
if (empty($contextpage) || $contextpage == 'contactlist') $contextpage='contactsupplierlist';
$titre.=' ('.$langs->trans("ThirdPartySuppliers").')';
$urlfiche="card.php";
}
-else if ($type == "o")
+elseif ($type == "o")
{
if (empty($contextpage) || $contextpage == 'contactlist') $contextpage='contactotherlist';
$titre.=' ('.$langs->trans("OthersNotLinkedToThirdParty").')';
@@ -330,15 +330,15 @@ if ($type == "o") // filtre sur type
{
$sql .= " AND p.fk_soc IS NULL";
}
-else if ($type == "f") // filtre sur type
+elseif ($type == "f") // filtre sur type
{
$sql .= " AND s.fournisseur = 1";
}
-else if ($type == "c") // filtre sur type
+elseif ($type == "c") // filtre sur type
{
$sql .= " AND s.client IN (1, 3)";
}
-else if ($type == "p") // filtre sur type
+elseif ($type == "p") // filtre sur type
{
$sql .= " AND s.client IN (2, 3)";
}
@@ -487,7 +487,7 @@ if (! empty($conf->categorie->enabled))
{
$moreforfilter.='';
if ($type == 'c') $moreforfilter.=$langs->trans('CustomersCategoriesShort'). ': ';
- else if ($type == 'p') $moreforfilter.=$langs->trans('ProspectsCategoriesShort'). ': ';
+ elseif ($type == 'p') $moreforfilter.=$langs->trans('ProspectsCategoriesShort'). ': ';
else $moreforfilter.=$langs->trans('CustomersProspectsCategoriesShort'). ': ';
$moreforfilter.=$formother->select_categories(Categorie::TYPE_CUSTOMER,$search_categ_thirdparty,'search_categ_thirdparty',1);
$moreforfilter.='
';
diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php
index 8e74c33cd14..da5a8d4eaa8 100644
--- a/htdocs/contact/perso.php
+++ b/htdocs/contact/perso.php
@@ -293,7 +293,7 @@ else
$ageyear=convertSecondToTime($now-$object->birthday,'year')-1970;
$agemonth=convertSecondToTime($now-$object->birthday,'month')-1;
if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')';
- else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')';
+ elseif ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')';
else print '('.$agemonth.' '.$langs->trans("DurationMonth").')';
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 844cd4321a4..d0e928ff7cd 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -119,7 +119,7 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer)
+ elseif ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer)
{
if (! GETPOST('dateend'))
{
@@ -408,13 +408,13 @@ if (empty($reshook))
}
}
- else if ($action == 'classin' && $user->rights->contrat->creer)
+ elseif ($action == 'classin' && $user->rights->contrat->creer)
{
$object->setProject(GETPOST('projectid'));
}
// Add a new line
- else if ($action == 'addline' && $user->rights->contrat->creer)
+ elseif ($action == 'addline' && $user->rights->contrat->creer)
{
// Set if we used free entry or predefined product
$predef='';
@@ -653,7 +653,7 @@ if (empty($reshook))
}
}
- else if ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel','alpha'))
+ elseif ($action == 'updateline' && $user->rights->contrat->creer && ! GETPOST('cancel','alpha'))
{
$error = 0;
@@ -761,7 +761,7 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer)
+ elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->contrat->creer)
{
$result = $object->deleteline(GETPOST('lineid'),$user);
@@ -776,7 +776,7 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer)
+ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer)
{
$result = $object->validate($user);
@@ -805,7 +805,7 @@ if (empty($reshook))
}
}
- else if ($action == 'reopen' && $user->rights->contrat->creer)
+ elseif ($action == 'reopen' && $user->rights->contrat->creer)
{
$result = $object->reopen($user);
if ($result < 0)
@@ -815,7 +815,7 @@ if (empty($reshook))
}
// Close all lines
- else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer)
+ elseif ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer)
{
$result = $object->closeAll($user);
if ($result < 0)
@@ -825,7 +825,7 @@ if (empty($reshook))
}
// Close all lines
- else if ($action == 'confirm_activate' && $confirm == 'yes' && $user->rights->contrat->creer)
+ elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->rights->contrat->creer)
{
$result = $object->activateAll($user);
if ($result < 0)
@@ -834,7 +834,7 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer)
+ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->contrat->supprimer)
{
$result=$object->delete($user);
if ($result >= 0)
@@ -848,7 +848,7 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer)
+ elseif ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contrat->creer)
{
if (GETPOST('newcid') > 0)
{
@@ -871,7 +871,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefNewContract")), null, 'errors');
}
}
- else if ($action == 'update_extras')
+ elseif ($action == 'update_extras')
{
$object->oldcopy = dol_clone($object);
@@ -1042,13 +1042,13 @@ if (empty($reshook))
}
// bascule du statut d'un contact
- else if ($action == 'swapstatut')
+ elseif ($action == 'swapstatut')
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
// Efface un contact
- else if ($action == 'deletecontact')
+ elseif ($action == 'deletecontact')
{
$result = $object->delete_contact(GETPOST('lineid'));
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 5dce6cb4bd4..81a8ddba115 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -445,7 +445,7 @@ class Contrat extends CommonObject
{
$num = $force_number;
}
- else if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
+ elseif (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
{
$num = $this->getNextNumRef($this->thirdparty);
}
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index c1d21426f83..3272d7ed908 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -241,12 +241,12 @@ if ($month > 0)
{
if ($year > 0 && empty($day))
$sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
- else if ($year > 0 && ! empty($day))
+ elseif ($year > 0 && ! empty($day))
$sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
else
$sql.= " AND date_format(c.date_contrat, '%m') = '".$month."'";
}
-else if ($year > 0)
+elseif ($year > 0)
{
$sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
@@ -711,7 +711,7 @@ while ($i < min($num,$limit))
print $nbofsalesrepresentative;
print '';
}
- else if ($nbofsalesrepresentative > 0)
+ elseif ($nbofsalesrepresentative > 0)
{
$userstatic=new User($db);
$j=0;
diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php
index 9d33def496c..d585ace7cd2 100644
--- a/htdocs/core/actions_builddoc.inc.php
+++ b/htdocs/core/actions_builddoc.inc.php
@@ -60,7 +60,7 @@ if ($action == 'builddoc' && $permissioncreate)
//{
if (GETPOST('fk_bank','int')) { // this field may come from an external module
$object->fk_bank = GETPOST('fk_bank','int');
- } else if (! empty($object->fk_account)) {
+ } elseif (! empty($object->fk_account)) {
$object->fk_bank = $object->fk_account;
}
//}
diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php
index 183585d986b..655c3e62efd 100644
--- a/htdocs/core/actions_sendmails.inc.php
+++ b/htdocs/core/actions_sendmails.inc.php
@@ -121,17 +121,17 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$thirdparty=$object->thirdparty;
$sendtosocid=$thirdparty->id;
}
- else if ($object->element == 'member' || $object->element == 'user')
+ elseif ($object->element == 'member' || $object->element == 'user')
{
$thirdparty=$object;
if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id;
}
- else if ($object->element == 'societe')
+ elseif ($object->element == 'societe')
{
$thirdparty=$object;
if ($thirdparty->id > 0) $sendtosocid=$thirdparty->id;
}
- else if ($object->element == 'contact')
+ elseif ($object->element == 'contact')
{
$contact=$object;
if ($contact->id > 0) $sendtosocid=$contact->fetch_thirdparty()->id;
diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php
index ec253d5ef4a..511adbf9e3e 100644
--- a/htdocs/core/actions_setnotes.inc.php
+++ b/htdocs/core/actions_setnotes.inc.php
@@ -61,7 +61,7 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel
}
}
// Set public note
-else if ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel','alpha'))
+elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel','alpha'))
{
if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('','Include of actions_setnotes.inc.php was done but required variable was not set before');
if (empty($object->id)) $object->fetch($id); // Fetch may not be already done
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index bfbf35b019c..4164b2e41de 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -185,33 +185,33 @@ if ($type == 'directory')
// Auto area for suppliers invoices
if ($module == 'company') $upload_dir = $conf->societe->dir_output;
// Auto area for suppliers invoices
- else if ($module == 'invoice') $upload_dir = $conf->facture->dir_output;
+ elseif ($module == 'invoice') $upload_dir = $conf->facture->dir_output;
// Auto area for suppliers invoices
- else if ($module == 'invoice_supplier') $upload_dir = $conf->fournisseur->facture->dir_output;
+ elseif ($module == 'invoice_supplier') $upload_dir = $conf->fournisseur->facture->dir_output;
// Auto area for customers proposal
- else if ($module == 'propal') $upload_dir = $conf->propal->dir_output;
+ elseif ($module == 'propal') $upload_dir = $conf->propal->dir_output;
// Auto area for suppliers proposal
- else if ($module == 'supplier_proposal') $upload_dir = $conf->supplier_proposal->dir_output;
+ elseif ($module == 'supplier_proposal') $upload_dir = $conf->supplier_proposal->dir_output;
// Auto area for customers orders
- else if ($module == 'order') $upload_dir = $conf->commande->dir_output;
+ elseif ($module == 'order') $upload_dir = $conf->commande->dir_output;
// Auto area for suppliers orders
- else if ($module == 'order_supplier') $upload_dir = $conf->fournisseur->commande->dir_output;
+ elseif ($module == 'order_supplier') $upload_dir = $conf->fournisseur->commande->dir_output;
// Auto area for suppliers invoices
- else if ($module == 'contract') $upload_dir = $conf->contrat->dir_output;
+ elseif ($module == 'contract') $upload_dir = $conf->contrat->dir_output;
// Auto area for products
- else if ($module == 'product') $upload_dir = $conf->product->dir_output;
+ elseif ($module == 'product') $upload_dir = $conf->product->dir_output;
// Auto area for suppliers invoices
- else if ($module == 'tax') $upload_dir = $conf->tax->dir_output;
+ elseif ($module == 'tax') $upload_dir = $conf->tax->dir_output;
// Auto area for projects
- else if ($module == 'project') $upload_dir = $conf->projet->dir_output;
+ elseif ($module == 'project') $upload_dir = $conf->projet->dir_output;
// Auto area for interventions
- else if ($module == 'fichinter') $upload_dir = $conf->ficheinter->dir_output;
+ elseif ($module == 'fichinter') $upload_dir = $conf->ficheinter->dir_output;
// Auto area for users
- else if ($module == 'user') $upload_dir = $conf->user->dir_output;
+ elseif ($module == 'user') $upload_dir = $conf->user->dir_output;
// Auto area for expense report
- else if ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output;
+ elseif ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output;
// Auto area for holiday
- else if ($module == 'holiday') $upload_dir = $conf->holiday->dir_output;
+ elseif ($module == 'holiday') $upload_dir = $conf->holiday->dir_output;
// Automatic list
if (in_array($module, $automodules))
@@ -280,7 +280,7 @@ if ($type == 'directory')
$textifempty = $langs->trans('NoFileFound');
}
- else if ($section === '0')
+ elseif ($section === '0')
{
if ($module == 'ecm') $textifempty=''.$langs->trans("DirNotSynchronizedSyncFirst").'
';
else $textifempty = $langs->trans('NoFileFound');
diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php
index 0f733f4df5c..4977b526cc2 100644
--- a/htdocs/core/ajax/constantonoff.php
+++ b/htdocs/core/ajax/constantonoff.php
@@ -58,7 +58,7 @@ if (! empty($action) && ! empty($name))
{
dolibarr_set_const($db, $name, $value, 'chaine', 0, '', $entity);
}
- else if ($action == 'del')
+ elseif ($action == 'del')
{
dolibarr_del_const($db, $name, $entity);
}
diff --git a/htdocs/core/ajax/extraparams.php b/htdocs/core/ajax/extraparams.php
index e5972d29d70..5d06bb338ef 100644
--- a/htdocs/core/ajax/extraparams.php
+++ b/htdocs/core/ajax/extraparams.php
@@ -52,18 +52,18 @@ if(! empty($id) && ! empty($element) && ! empty($htmlelement) && ! empty($type))
// For compatibility
if ($element == 'order' || $element == 'commande') { $classpath = $subelement = 'commande'; }
- else if ($element == 'propal') { $classpath = 'comm/propal'; $subelement = 'propal'; }
- else if ($element == 'facture') { $classpath = 'compta/facture'; $subelement = 'facture'; }
- else if ($element == 'contract') { $classpath = $subelement = 'contrat'; }
- else if ($element == 'shipping') { $classpath = $subelement = 'expedition'; }
- else if ($element == 'deplacement') { $classpath = 'compta/deplacement'; $subelement = 'deplacement'; }
- else if ($element == 'order_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.commande'; }
- else if ($element == 'invoice_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.facture'; }
+ elseif ($element == 'propal') { $classpath = 'comm/propal'; $subelement = 'propal'; }
+ elseif ($element == 'facture') { $classpath = 'compta/facture'; $subelement = 'facture'; }
+ elseif ($element == 'contract') { $classpath = $subelement = 'contrat'; }
+ elseif ($element == 'shipping') { $classpath = $subelement = 'expedition'; }
+ elseif ($element == 'deplacement') { $classpath = 'compta/deplacement'; $subelement = 'deplacement'; }
+ elseif ($element == 'order_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.commande'; }
+ elseif ($element == 'invoice_supplier') { $classpath = 'fourn'; $subelement = 'fournisseur.facture'; }
dol_include_once('/'.$classpath.'/class/'.$subelement.'.class.php');
if ($element == 'order_supplier') { $classname = 'CommandeFournisseur'; }
- else if ($element == 'invoice_supplier') { $classname = 'FactureFournisseur'; }
+ elseif ($element == 'invoice_supplier') { $classname = 'FactureFournisseur'; }
else $classname = ucfirst($subelement);
$object = new $classname($db);
diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php
index abf3efba7db..918d1920759 100644
--- a/htdocs/core/ajax/loadinplace.php
+++ b/htdocs/core/ajax/loadinplace.php
@@ -56,14 +56,14 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
}
if ($element == 'propal') $element = 'propale';
- else if ($element == 'fichinter') $element = 'ficheinter';
- else if ($element == 'product') $element = 'produit';
- else if ($element == 'member') $element = 'adherent';
- else if ($element == 'order_supplier') {
+ elseif ($element == 'fichinter') $element = 'ficheinter';
+ elseif ($element == 'product') $element = 'produit';
+ elseif ($element == 'member') $element = 'adherent';
+ elseif ($element == 'order_supplier') {
$element = 'fournisseur';
$subelement = 'commande';
}
- else if ($element == 'invoice_supplier') {
+ elseif ($element == 'invoice_supplier') {
$element = 'fournisseur';
$subelement = 'facture';
}
@@ -84,7 +84,7 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
$ret = $form->$methodname();
if ($ret > 0) echo json_encode($form->$cachename);
}
- else if (! empty($ext_element))
+ elseif (! empty($ext_element))
{
$module = $subelement = $ext_element;
if (preg_match('/^([^_]+)_([^_]+)/i',$ext_element,$regs))
diff --git a/htdocs/core/ajax/price.php b/htdocs/core/ajax/price.php
index 3eab18216d1..3b5585837d6 100644
--- a/htdocs/core/ajax/price.php
+++ b/htdocs/core/ajax/price.php
@@ -53,7 +53,7 @@ if (! empty($output) && isset($amount) && isset($tva_tx))
$return['price_ht'] = $amount;
$return['price_ttc'] = (isset($price) && $price != '' ? price($price) : '');
}
- else if ($output == 'price_ht') {
+ elseif ($output == 'price_ht') {
$price = price2num($amount / (1 + ($tva_tx/100)), 'MU');
$return['price_ht'] = (isset($price) && $price != '' ? price($price) : '');
diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php
index 188dcbb29da..8715997d778 100644
--- a/htdocs/core/ajax/saveinplace.php
+++ b/htdocs/core/ajax/saveinplace.php
@@ -79,14 +79,14 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
}
if ($element == 'propal') $newelement = 'propale';
- else if ($element == 'fichinter') $newelement = 'ficheinter';
- else if ($element == 'product') $newelement = 'produit';
- else if ($element == 'member') $newelement = 'adherent';
- else if ($element == 'order_supplier') {
+ elseif ($element == 'fichinter') $newelement = 'ficheinter';
+ elseif ($element == 'product') $newelement = 'produit';
+ elseif ($element == 'member') $newelement = 'adherent';
+ elseif ($element == 'order_supplier') {
$newelement = 'fournisseur';
$subelement = 'commande';
}
- else if ($element == 'invoice_supplier') {
+ elseif ($element == 'invoice_supplier') {
$newelement = 'fournisseur';
$subelement = 'facture';
}
@@ -131,13 +131,13 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
$return['error'] = $langs->trans('ErrorBadValue');
}
}
- else if ($type == 'datepicker')
+ elseif ($type == 'datepicker')
{
$timestamp = GETPOST('timestamp','int',2);
$format = 'date';
$newvalue = ($timestamp / 1000);
}
- else if ($type == 'select')
+ elseif ($type == 'select')
{
$loadmethodname = 'load_cache_'.$loadmethod;
$loadcachename = 'cache_'.$loadmethod;
@@ -211,7 +211,7 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
if ($ret > 0)
{
if ($type == 'numeric') $value = price($newvalue);
- else if ($type == 'textarea') $value = dol_nl2br($newvalue);
+ elseif ($type == 'textarea') $value = dol_nl2br($newvalue);
$return['value'] = $value;
$return['view'] = (! empty($view) ? $view : $value);
diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php
index bc4a3130151..704a0922472 100644
--- a/htdocs/core/boxes/box_graph_product_distribution.php
+++ b/htdocs/core/boxes/box_graph_product_distribution.php
@@ -368,17 +368,17 @@ class box_graph_product_distribution extends ModeleBoxes
if ($nbofgraph == 1)
{
if ($showinvoicenb) $stringtoshow.=$px1->show();
- else if ($showpropalnb) $stringtoshow.=$px2->show();
+ elseif ($showpropalnb) $stringtoshow.=$px2->show();
else $stringtoshow.=$px3->show();
}
if ($nbofgraph == 2)
{
$stringtoshow.='';
if ($showinvoicenb) $stringtoshow.=$px1->show();
- else if ($showpropalnb) $stringtoshow.=$px2->show();
+ elseif ($showpropalnb) $stringtoshow.=$px2->show();
$stringtoshow.='
';
if ($showordernb) $stringtoshow.=$px3->show();
- else if ($showpropalnb) $stringtoshow.=$px2->show();
+ elseif ($showpropalnb) $stringtoshow.=$px2->show();
$stringtoshow.='
';
}
if ($nbofgraph == 3)
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 499bd8deb29..9b0ee84ceed 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -294,7 +294,7 @@ class CMailFile
$this->message.= $text_body . $files_encoded;
$this->message.= "--" . $this->mixed_boundary . "--" . $this->eol;
}
- else if ($this->sendmode == 'smtps')
+ elseif ($this->sendmode == 'smtps')
{
// Use SMTPS library
// ------------------------------------------
@@ -349,7 +349,7 @@ class CMailFile
$this->smtps=$smtps;
}
- else if ($this->sendmode == 'swiftmailer')
+ elseif ($this->sendmode == 'swiftmailer')
{
// Use Swift Mailer library
// ------------------------------------------
@@ -670,7 +670,7 @@ class CMailFile
if (! empty($conf->global->$keyforsmtpserver)) ini_restore('SMTP');
if (! empty($conf->global->$keyforsmtpport)) ini_restore('smtp_port');
}
- else if ($this->sendmode == 'smtps')
+ elseif ($this->sendmode == 'smtps')
{
if (! is_object($this->smtps))
{
@@ -750,7 +750,7 @@ class CMailFile
}
}
}
- else if ($this->sendmode == 'swiftmailer')
+ elseif ($this->sendmode == 'swiftmailer')
{
// Use Swift Mailer library
// ------------------------------------------
diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php
index 893c08b9257..ebdcad5ccf8 100644
--- a/htdocs/core/class/CSMSFile.class.php
+++ b/htdocs/core/class/CSMSFile.class.php
@@ -139,7 +139,7 @@ class CSMSFile
if (! empty($conf->global->MAIN_SMS_DEBUG)) $this->dump_sms_result($res);
}
}
- else if (! empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module'
+ elseif (! empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module'
{
$tmp=explode('@',$conf->global->MAIN_SMS_SENDMODE);
$classfile=$tmp[0]; $module=(empty($tmp[1])?$tmp[0]:$tmp[1]);
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index d4007235295..79f266ed8a2 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -230,7 +230,7 @@ abstract class CommonDocGenerator
{
$object->array_options['options_'.$key] = price($object->array_options['options_'.$key],0,$outputlangs,0,0,-1,$conf->currency);
}
- else if($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox')
+ elseif($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox')
{
$object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]];
}
@@ -760,11 +760,11 @@ abstract class CommonDocGenerator
//Add value to store price with currency
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency']));
}
- else if($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox')
+ elseif($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox')
{
$object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]];
}
- else if($extrafields->attribute_type[$key] == 'date')
+ elseif($extrafields->attribute_type[$key] == 'date')
{
if (strlen($object->array_options['options_'.$key])>0)
{
@@ -782,7 +782,7 @@ abstract class CommonDocGenerator
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_locale' => $object->array_options['options_'.$key.'_locale']));
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_rfc' => $object->array_options['options_'.$key.'_rfc']));
}
- else if($extrafields->attribute_type[$key] == 'datetime')
+ elseif($extrafields->attribute_type[$key] == 'datetime')
{
$datetime = $object->array_options['options_'.$key];
$object->array_options['options_'.$key] = ($datetime!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhour'):''); // using company output language
@@ -791,7 +791,7 @@ abstract class CommonDocGenerator
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_locale' => $object->array_options['options_'.$key.'_locale']));
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_rfc' => $object->array_options['options_'.$key.'_rfc']));
}
- else if($extrafields->attribute_type[$key] == 'link')
+ elseif($extrafields->attribute_type[$key] == 'link')
{
$id = $object->array_options['options_'.$key];
if ($id != "")
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index d262bf87ac4..649b9d317b7 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -426,8 +426,8 @@ abstract class CommonObject
$sql.= " WHERE entity IN (".getEntity($element).")" ;
if ($id > 0) $sql.= " AND rowid = ".$db->escape($id);
- else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";
- else if ($ref_ext) $sql.= " AND ref_ext = '".$db->escape($ref_ext)."'";
+ elseif ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";
+ elseif ($ref_ext) $sql.= " AND ref_ext = '".$db->escape($ref_ext)."'";
else {
$error='ErrorWrongParameters';
dol_print_error(get_class()."::isExistingObject ".$error, LOG_ERR);
@@ -1207,7 +1207,7 @@ abstract class CommonObject
if($this->element=='shipping' && $this->origin_id != 0) {
$id=$this->origin_id;
$element='commande';
- } else if($this->element=='reception' && $this->origin_id != 0) {
+ } elseif($this->element=='reception' && $this->origin_id != 0) {
$id=$this->origin_id;
$element='order_supplier';
} else {
@@ -1353,7 +1353,7 @@ abstract class CommonObject
if (empty($idtype) && $idtype != '0') // If type of barcode no set, we try to guess. If set to '0' it means we forced to have type remain not defined
{
if ($this->element == 'product') $idtype = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;
- else if ($this->element == 'societe') $idtype = $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY;
+ elseif ($this->element == 'societe') $idtype = $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY;
else dol_syslog('Call fetch_barcode with barcode_type not defined and cant be guessed', LOG_WARNING);
}
@@ -1562,8 +1562,8 @@ abstract class CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
if ($format == 'text') $sql.= $field." = '".$this->db->escape($value)."'";
- else if ($format == 'int') $sql.= $field." = ".$this->db->escape($value);
- else if ($format == 'date') $sql.= $field." = ".($value ? "'".$this->db->idate($value)."'" : "null");
+ elseif ($format == 'int') $sql.= $field." = ".$this->db->escape($value);
+ elseif ($format == 'date') $sql.= $field." = ".($value ? "'".$this->db->idate($value)."'" : "null");
if ($fk_user_field)
{
@@ -1648,8 +1648,8 @@ abstract class CommonObject
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
}
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity
- else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid
- else if ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid
+ elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid
+ elseif ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid
if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$alias.".rowid = sc.fk_soc";
$sql.= " WHERE te.".$fieldid." < '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists)
if ($this->restrictiononfksoc == 1 && !$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id;
@@ -1660,7 +1660,7 @@ abstract class CommonObject
$sql.=$filter;
}
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
- else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
+ elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
if ($this->element == 'user' && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
@@ -1694,8 +1694,8 @@ abstract class CommonObject
$sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug";
}
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity
- else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid
- else if ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid
+ elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to socid
+ elseif ($this->restrictiononfksoc == 2 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON te.fk_soc = s.rowid"; // If we need to link to societe to limit select to socid
if ($this->restrictiononfksoc && !$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$alias.".rowid = sc.fk_soc";
$sql.= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists)
if ($this->restrictiononfksoc == 1 && !$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id;
@@ -1706,7 +1706,7 @@ abstract class CommonObject
$sql.=$filter;
}
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
- else if ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
+ elseif ($this->restrictiononfksoc == 1 && $this->element != 'societe' && !$user->rights->societe->client->voir && !$socid) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to socid
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
if ($this->element == 'user' && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
@@ -2675,7 +2675,7 @@ abstract class CommonObject
if ($this->db->query($sql))
{
if ($suffix == '_public') $this->note_public = $note;
- else if ($suffix == '_private') $this->note_private = $note;
+ elseif ($suffix == '_private') $this->note_private = $note;
else
{
$this->note = $note; // deprecated
@@ -3059,7 +3059,7 @@ abstract class CommonObject
$sql.= "fk_source = ".$sourceid." AND sourcetype = '".$sourcetype."'";
if ($withtargettype) $sql.= " AND targettype = '".$targettype."'";
}
- else if ($justtarget)
+ elseif ($justtarget)
{
$sql.= "fk_target = ".$targetid." AND targettype = '".$targettype."'";
if ($withsourcetype) $sql.= " AND sourcetype = '".$sourcetype."'";
@@ -3087,7 +3087,7 @@ abstract class CommonObject
{
$this->linkedObjectsIds[$obj->targettype][$obj->rowid]=$obj->fk_target;
}
- else if ($justtarget)
+ elseif ($justtarget)
{
$this->linkedObjectsIds[$obj->sourcetype][$obj->rowid]=$obj->fk_source;
}
@@ -3125,28 +3125,28 @@ abstract class CommonObject
if ($objecttype == 'facture') {
$classpath = 'compta/facture/class';
}
- else if ($objecttype == 'facturerec') {
+ elseif ($objecttype == 'facturerec') {
$classpath = 'compta/facture/class'; $module = 'facture';
}
- else if ($objecttype == 'propal') {
+ elseif ($objecttype == 'propal') {
$classpath = 'comm/propal/class';
}
- else if ($objecttype == 'supplier_proposal') {
+ elseif ($objecttype == 'supplier_proposal') {
$classpath = 'supplier_proposal/class';
}
- else if ($objecttype == 'shipping') {
+ elseif ($objecttype == 'shipping') {
$classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
}
- else if ($objecttype == 'delivery') {
+ elseif ($objecttype == 'delivery') {
$classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon';
}
- else if ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') {
+ elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') {
$classpath = 'fourn/class'; $module = 'fournisseur';
}
- else if ($objecttype == 'fichinter') {
+ elseif ($objecttype == 'fichinter') {
$classpath = 'fichinter/class'; $subelement = 'fichinter'; $module = 'ficheinter';
}
- else if ($objecttype == 'subscription') {
+ elseif ($objecttype == 'subscription') {
$classpath = 'adherents/class'; $module = 'adherent';
}
@@ -3156,19 +3156,19 @@ abstract class CommonObject
if ($objecttype == 'order') {
$classfile = 'commande'; $classname = 'Commande';
}
- else if ($objecttype == 'invoice_supplier') {
+ elseif ($objecttype == 'invoice_supplier') {
$classfile = 'fournisseur.facture'; $classname = 'FactureFournisseur';
}
- else if ($objecttype == 'order_supplier') {
+ elseif ($objecttype == 'order_supplier') {
$classfile = 'fournisseur.commande'; $classname = 'CommandeFournisseur';
}
- else if ($objecttype == 'supplier_proposal') {
+ elseif ($objecttype == 'supplier_proposal') {
$classfile = 'supplier_proposal'; $classname = 'SupplierProposal';
}
- else if ($objecttype == 'facturerec') {
+ elseif ($objecttype == 'facturerec') {
$classfile = 'facture-rec'; $classname = 'FactureRec';
}
- else if ($objecttype == 'subscription') {
+ elseif ($objecttype == 'subscription') {
$classfile = 'subscription'; $classname = 'Subscription';
}
@@ -3224,7 +3224,7 @@ abstract class CommonObject
$updatetarget=false;
if (! empty($sourceid) && ! empty($sourcetype) && empty($targetid) && empty($targettype)) $updatesource=true;
- else if (empty($sourceid) && empty($sourcetype) && ! empty($targetid) && ! empty($targettype)) $updatetarget=true;
+ elseif (empty($sourceid) && empty($sourcetype) && ! empty($targetid) && ! empty($targettype)) $updatetarget=true;
$sql = "UPDATE ".MAIN_DB_PREFIX."element_element SET ";
if ($updatesource)
@@ -3234,7 +3234,7 @@ abstract class CommonObject
$sql.= " WHERE fk_target = ".$this->id;
$sql.= " AND targettype = '".$this->db->escape($this->element)."'";
}
- else if ($updatetarget)
+ elseif ($updatetarget)
{
$sql.= "fk_target = ".$targetid;
$sql.= ", targettype = '".$this->db->escape($targettype)."'";
@@ -3271,7 +3271,7 @@ abstract class CommonObject
$deletetarget=false;
if (! empty($sourceid) && ! empty($sourcetype) && empty($targetid) && empty($targettype)) $deletesource=true;
- else if (empty($sourceid) && empty($sourcetype) && ! empty($targetid) && ! empty($targettype)) $deletetarget=true;
+ elseif (empty($sourceid) && empty($sourcetype) && ! empty($targetid) && ! empty($targettype)) $deletetarget=true;
$sourceid = (! empty($sourceid) ? $sourceid : $this->id);
$sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element);
@@ -3291,7 +3291,7 @@ abstract class CommonObject
$sql.= " fk_source = ".$sourceid." AND sourcetype = '".$this->db->escape($sourcetype)."'";
$sql.= " AND fk_target = ".$this->id." AND targettype = '".$this->db->escape($this->element)."'";
}
- else if ($deletetarget)
+ elseif ($deletetarget)
{
$sql.= " fk_target = ".$targetid." AND targettype = '".$this->db->escape($targettype)."'";
$sql.= " AND fk_source = ".$this->id." AND sourcetype = '".$this->db->escape($this->element)."'";
@@ -3626,7 +3626,7 @@ abstract class CommonObject
{
if (empty($totalToShip)) $totalToShip=0; // Avoid warning because $totalToShip is ''
$totalToShip+=$line->qty_shipped; // defined for shipment only
- }else if ($line->element == 'commandefournisseurdispatch' && isset($line->qty))
+ }elseif ($line->element == 'commandefournisseurdispatch' && isset($line->qty))
{
if (empty($totalToShip)) $totalToShip=0;
$totalToShip+=$line->qty; // defined for reception only
@@ -4240,7 +4240,7 @@ abstract class CommonObject
$discount->fk_soc = $this->socid;
$this->tpl['label'].= $discount->getNomUrl(0,'discount');
}
- else if (! empty($line->fk_product))
+ elseif (! empty($line->fk_product))
{
$productstatic = new Product($this->db);
$productstatic->id = $line->fk_product;
@@ -5437,7 +5437,7 @@ abstract class CommonObject
{
$morecss = 'minwidth100';
}
- else if (round($size) <= 48)
+ elseif (round($size) <= 48)
{
$morecss = 'minwidth200';
}
@@ -6035,7 +6035,7 @@ abstract class CommonObject
{
$showsize = 'minwidth100';
}
- else if (round($size) <= 48)
+ elseif (round($size) <= 48)
{
$showsize = 'minwidth200';
}
@@ -6589,12 +6589,12 @@ abstract class CommonObject
{
$buyPrice = $product->cost_price;
}
- else if ($product->pmp > 0)
+ elseif ($product->pmp > 0)
{
$buyPrice = $product->pmp;
}
}
- else if (isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == 'pmp')
+ elseif (isset($conf->global->MARGIN_TYPE) && $conf->global->MARGIN_TYPE == 'pmp')
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$product = new Product($this->db);
@@ -6618,7 +6618,7 @@ abstract class CommonObject
{
$buyPrice = $productFournisseur->fourn_unitprice;
}
- else if ($result < 0)
+ elseif ($result < 0)
{
$this->errors[] = $productFournisseur->error;
return -2;
@@ -6740,7 +6740,7 @@ abstract class CommonObject
if ($nbphoto % $nbbyrow == 1) $return.= '';
$return.= '';
}
- else if ($nbbyrow < 0) $return .= '';
+ elseif ($nbbyrow < 0) $return .= '
';
$return.= "\n";
@@ -6821,7 +6821,7 @@ abstract class CommonObject
$return.= '
';
if (($nbphoto % $nbbyrow) == 0) $return.= ' ';
}
- else if ($nbbyrow < 0) $return.='';
+ elseif ($nbbyrow < 0) $return.='';
}
if (empty($size)) { // Format origine
@@ -7003,7 +7003,7 @@ abstract class CommonObject
$queryarray[$field] = $this->db->idate($this->{$field});
}
}
- else if($this->isArray($info))
+ elseif($this->isArray($info))
{
if(! empty($this->{$field})) {
if(! is_array($this->{$field})) {
@@ -7014,7 +7014,7 @@ abstract class CommonObject
$queryarray[$field] = null;
}
}
- else if($this->isInt($info))
+ elseif($this->isInt($info))
{
if ($field == 'entity' && is_null($this->{$field})) $queryarray[$field]=$conf->entity;
else
@@ -7023,7 +7023,7 @@ abstract class CommonObject
if (empty($queryarray[$field])) $queryarray[$field]=0; // May be reset to null later if property 'notnull' is -1 for this field.
}
}
- else if($this->isFloat($info))
+ elseif($this->isFloat($info))
{
$queryarray[$field] = (double) price2num($this->{$field});
if (empty($queryarray[$field])) $queryarray[$field]=0;
@@ -7111,7 +7111,7 @@ abstract class CommonObject
protected function quote($value, $fieldsentry)
{
if (is_null($value)) return 'NULL';
- else if (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value");
+ elseif (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value");
else return "'".$this->db->escape($value)."'";
}
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index de39260e007..d25d3b13f36 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -180,10 +180,10 @@ class Conf
if (! isset($this->modules_parts[$partname]) || ! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); }
$arrValue = json_decode($value,true);
if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue;
- else if (in_array($partname,array('login','menus','substitutions','triggers','tpl'))) $value = '/'.$modulename.'/core/'.$partname.'/';
- else if (in_array($partname,array('models','theme'))) $value = '/'.$modulename.'/';
- else if (in_array($partname,array('sms'))) $value = '/'.$modulename.'/';
- else if ($value == 1) $value = '/'.$modulename.'/core/modules/'.$partname.'/'; // ex: partname = societe
+ elseif (in_array($partname,array('login','menus','substitutions','triggers','tpl'))) $value = '/'.$modulename.'/core/'.$partname.'/';
+ elseif (in_array($partname,array('models','theme'))) $value = '/'.$modulename.'/';
+ elseif (in_array($partname,array('sms'))) $value = '/'.$modulename.'/';
+ elseif ($value == 1) $value = '/'.$modulename.'/core/modules/'.$partname.'/'; // ex: partname = societe
$this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); // $value may be a string or an array
}
// If this is a module constant (must be at end)
@@ -252,7 +252,7 @@ class Conf
if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) $this->global->MAIN_MENUFRONT_SMARTPHONE="eldy_menu.php"; // Use eldy by default because smartphone does not work on all phones
// Clean var use vat for company
if (! isset($this->global->FACTURE_TVAOPTION)) $this->global->FACTURE_TVAOPTION=1;
- else if (! empty($this->global->FACTURE_TVAOPTION) && ! is_numeric($this->global->FACTURE_TVAOPTION))
+ elseif (! empty($this->global->FACTURE_TVAOPTION) && ! is_numeric($this->global->FACTURE_TVAOPTION))
{
// Old value of option, we clean to use new value (0 or 1)
if ($this->global->FACTURE_TVAOPTION != "franchise") $this->global->FACTURE_TVAOPTION=1;
diff --git a/htdocs/core/class/coreobject.class.php b/htdocs/core/class/coreobject.class.php
index b6cff34b0f3..a3a8a0dd5ff 100644
--- a/htdocs/core/class/coreobject.class.php
+++ b/htdocs/core/class/coreobject.class.php
@@ -416,15 +416,15 @@ class CoreObject extends CommonObject
{
$this->setDate($key, $value);
}
- else if( $this->checkFieldType($key, 'array'))
+ elseif( $this->checkFieldType($key, 'array'))
{
$this->{$key} = $value;
}
- else if( $this->checkFieldType($key, 'float') )
+ elseif( $this->checkFieldType($key, 'float') )
{
$this->{$key} = (double) price2num($value);
}
- else if( $this->checkFieldType($key, 'int') ) {
+ elseif( $this->checkFieldType($key, 'int') ) {
$this->{$key} = (int) price2num($value);
}
else
diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php
index b47a324838a..eb44fac13ea 100644
--- a/htdocs/core/class/discount.class.php
+++ b/htdocs/core/class/discount.class.php
@@ -538,7 +538,7 @@ class DiscountAbsolute
$sql.= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id;
$sql.= ' AND f.type = 3';
}
- else if ($invoice->element == 'invoice_supplier')
+ elseif ($invoice->element == 'invoice_supplier')
{
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f';
@@ -584,7 +584,7 @@ class DiscountAbsolute
$sql.= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id;
$sql.= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess received
}
- else if ($invoice->element == 'invoice_supplier')
+ elseif ($invoice->element == 'invoice_supplier')
{
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f';
diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php
index d5b486f3430..035fe1a1486 100644
--- a/htdocs/core/class/dolgeoip.class.php
+++ b/htdocs/core/class/dolgeoip.class.php
@@ -48,7 +48,7 @@ class DolGeoIP
// geoip may have been already included with PEAR
if (! function_exists('geoip_country_code_by_name')) $res=include_once GEOIP_PATH.'geoip.inc';
}
- else if ($type == 'city')
+ elseif ($type == 'city')
{
// geoip may have been already included with PEAR
if (! function_exists('geoip_country_code_by_name')) $res=include_once GEOIP_PATH.'geoipcity.inc';
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index c7dc7991a4a..01ed83bf176 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -704,7 +704,7 @@ class DolGraph
// Create graph
$classname='';
if (! isset($this->type[0]) || $this->type[0] == 'bars') $classname='BarPlot'; // Only one type (first one) is supported by artichow
- else if ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') $classname='LinePlot';
+ elseif ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') $classname='LinePlot';
else $classname='TypeUnknown';
include_once ARTICHOW_PATH.$classname.'.class.php';
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 6d26522bb97..77ee805295d 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -979,7 +979,7 @@ class ExtraFields
{
$morecss = 'minwidth100';
}
- else if (round($size) <= 48)
+ elseif (round($size) <= 48)
{
$morecss = 'minwidth200';
}
@@ -1333,7 +1333,7 @@ class ExtraFields
// current object id can be use into filter
if (strpos($InfoFieldList[4], '$ID$')!==false && !empty($objectid)) {
$InfoFieldList[4]=str_replace('$ID$',$objectid,$InfoFieldList[4]);
- } else if (preg_match("#^.*list.php$#",$_SERVER["DOCUMENT_URI"])) {
+ } elseif (preg_match("#^.*list.php$#",$_SERVER["DOCUMENT_URI"])) {
// Pattern for word=$ID$
$word = '\b[a-zA-Z0-9-\.-_]+\b=\$ID\$';
@@ -1371,7 +1371,7 @@ class ExtraFields
$boolCond =(( $matchCondition[1] == "AND" )?' AND 1 ':' OR 0 ');
$InfoFieldList[4]=str_replace($matchCondition[0],$boolCond.$matchCondition[3],$InfoFieldList[4]);
}
- else if (! empty($matchCondition[3])) {
+ elseif (! empty($matchCondition[3])) {
$boolCond =(( $matchCondition[3] == "AND" )?' 1 AND ':' 0 OR');
$InfoFieldList[4]=str_replace($matchCondition[0],$boolCond,$InfoFieldList[4]);
}
@@ -1945,7 +1945,7 @@ class ExtraFields
// TODO GMT date in memory must be GMT so we should add gm=true in parameters
$value_key=dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]);
}
- else if (in_array($key_type,array('checkbox','chkbxlst')))
+ elseif (in_array($key_type,array('checkbox','chkbxlst')))
{
$value_arr=GETPOST("options_".$key, 'array'); // check if an array
if (!empty($value_arr)) {
@@ -1954,7 +1954,7 @@ class ExtraFields
$value_key='';
}
}
- else if (in_array($key_type,array('price','double')))
+ elseif (in_array($key_type,array('price','double')))
{
$value_arr=GETPOST("options_".$key, 'alpha');
$value_key=price2num($value_arr);
@@ -2020,14 +2020,14 @@ class ExtraFields
// Clean parameters
$value_key=dol_mktime($_POST[$keysuffix."options_".$key.$keyprefix."hour"], $_POST[$keysuffix."options_".$key.$keyprefix."min"], 0, $_POST[$keysuffix."options_".$key.$keyprefix."month"], $_POST[$keysuffix."options_".$key.$keyprefix."day"], $_POST[$keysuffix."options_".$key.$keyprefix."year"]);
}
- else if (in_array($key_type,array('checkbox', 'chkbxlst')))
+ elseif (in_array($key_type,array('checkbox', 'chkbxlst')))
{
$value_arr=GETPOST($keysuffix."options_".$key.$keyprefix);
// Make sure we get an array even if there's only one checkbox
$value_arr=(array) $value_arr;
$value_key=implode(',', $value_arr);
}
- else if (in_array($key_type,array('price','double')))
+ elseif (in_array($key_type,array('price','double')))
{
$value_arr=GETPOST($keysuffix."options_".$key.$keyprefix);
$value_key=price2num($value_arr);
diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php
index 66f6e19102c..3a085821694 100644
--- a/htdocs/core/class/fileupload.class.php
+++ b/htdocs/core/class/fileupload.class.php
@@ -136,7 +136,7 @@ class FileUpload
$object_ref = dol_sanitizeFileName($object->ref);
if ($element == 'invoice_supplier') {
$object_ref = get_exdir($object->id,2,0,0,$object,'invoice_supplier') . $object_ref;
- } else if ($element == 'project_task') {
+ } elseif ($element == 'project_task') {
$object_ref = $object->project->ref . '/' . $object_ref;
}
@@ -456,7 +456,7 @@ class FileUpload
}
}
}
- else if ($this->options['discard_aborted_uploads'])
+ elseif ($this->options['discard_aborted_uploads'])
{
unlink($file_path);
$file->error = 'abort';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c737c7b791e..bb710c5e29f 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -194,13 +194,13 @@ class Form
$tmp=explode(':',$typeofdata);
$ret.=' ';
}
- else if (preg_match('/^(numeric|amount)/',$typeofdata))
+ elseif (preg_match('/^(numeric|amount)/',$typeofdata))
{
$tmp=explode(':',$typeofdata);
$valuetoshow=price2num($editvalue?$editvalue:$value);
$ret.=' ';
}
- else if (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata))
+ elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata))
{
$tmp=explode(':',$typeofdata);
$cols=$tmp[2];
@@ -217,15 +217,15 @@ class Form
$ret.=dol_string_neverthesehtmltags($valuetoshow, array('textarea'));
$ret.='';
}
- else if ($typeofdata == 'day' || $typeofdata == 'datepicker')
+ elseif ($typeofdata == 'day' || $typeofdata == 'datepicker')
{
$ret.=$this->selectDate($value,$htmlname,0,0,1,'form'.$htmlname,1,0);
}
- else if ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker')
+ elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker')
{
$ret.=$this->selectDate($value,$htmlname,1,1,1,'form'.$htmlname,1,0);
}
- else if (preg_match('/^select;/',$typeofdata))
+ elseif (preg_match('/^select;/',$typeofdata))
{
$arraydata=explode(',',preg_replace('/^select;/','',$typeofdata));
foreach($arraydata as $val)
@@ -235,7 +235,7 @@ class Form
}
$ret.=$this->selectarray($htmlname,$arraylist,$value);
}
- else if (preg_match('/^ckeditor/',$typeofdata))
+ elseif (preg_match('/^ckeditor/',$typeofdata))
{
$tmp=explode(':',$typeofdata); // Example: ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -261,7 +261,7 @@ class Form
elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value);
elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day');
elseif ($typeofdata == 'dayhour' || $typeofdata == 'datehourpicker') $ret.=dol_print_date($value,'dayhour');
- else if (preg_match('/^select;/',$typeofdata))
+ elseif (preg_match('/^select;/',$typeofdata))
{
$arraydata=explode(',',preg_replace('/^select;/','',$typeofdata));
foreach($arraydata as $val)
@@ -271,7 +271,7 @@ class Form
}
$ret.=$arraylist[$value];
}
- else if (preg_match('/^ckeditor/',$typeofdata))
+ elseif (preg_match('/^ckeditor/',$typeofdata))
{
$tmpcontent=dol_htmlentitiesbr($value);
if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB))
@@ -314,8 +314,8 @@ class Form
// Check parameters
if (preg_match('/^text/',$inputType)) $value = dol_nl2br($value);
- else if (preg_match('/^numeric/',$inputType)) $value = price($value);
- else if ($inputType == 'day' || $inputType == 'datepicker') $value = dol_print_date($value, 'day');
+ elseif (preg_match('/^numeric/',$inputType)) $value = price($value);
+ elseif ($inputType == 'day' || $inputType == 'datepicker') $value = dol_print_date($value, 'day');
if ($condition)
{
@@ -348,7 +348,7 @@ class Form
if (! empty($tmp[2])) $savemethod=$tmp[2];
$out.= ' '."\n";
}
- else if ((preg_match('/^day$/',$inputType)) || (preg_match('/^datepicker/',$inputType)) || (preg_match('/^datehourpicker/',$inputType)))
+ elseif ((preg_match('/^day$/',$inputType)) || (preg_match('/^datepicker/',$inputType)) || (preg_match('/^datehourpicker/',$inputType)))
{
$tmp=explode(':',$inputType);
$inputType=$tmp[0];
@@ -357,21 +357,21 @@ class Form
$out.= ' '."\n"; // Use for timestamp format
}
- else if (preg_match('/^(select|autocomplete)/',$inputType))
+ elseif (preg_match('/^(select|autocomplete)/',$inputType))
{
$tmp=explode(':',$inputType);
$inputType=$tmp[0]; $loadmethod=$tmp[1];
if (! empty($tmp[2])) $savemethod=$tmp[2];
if (! empty($tmp[3])) $button_only=true;
}
- else if (preg_match('/^textarea/',$inputType))
+ elseif (preg_match('/^textarea/',$inputType))
{
$tmp=explode(':',$inputType);
$inputType=$tmp[0];
$rows=(empty($tmp[1])?'8':$tmp[1]);
$cols=(empty($tmp[2])?'80':$tmp[2]);
}
- else if (preg_match('/^ckeditor/',$inputType))
+ elseif (preg_match('/^ckeditor/',$inputType))
{
$tmp=explode(':',$inputType);
$inputType=$tmp[0]; $toolbar=$tmp[1];
@@ -1081,7 +1081,7 @@ class Form
$out.= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
$out.='';
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
- else if ($hidelabel > 1) {
+ elseif ($hidelabel > 1) {
$placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"';
if ($hidelabel == 2) {
$out.= img_picto($langs->trans("Search"), 'search');
@@ -1131,7 +1131,7 @@ class Form
$outarray=array();
if ($selected === '') $selected = array();
- else if (!is_array($selected)) $selected = array($selected);
+ elseif (!is_array($selected)) $selected = array($selected);
// Clean $filter that may contains sql conditions so sql code
if (function_exists('testSqlAndScriptInject')) {
@@ -1421,7 +1421,7 @@ class Form
if (empty($htmlid)) $htmlid = $htmlname;
if ($selected === '') $selected = array();
- else if (!is_array($selected)) $selected = array($selected);
+ elseif (!is_array($selected)) $selected = array($selected);
$out='';
if (! is_object($hookmanager))
@@ -1598,7 +1598,7 @@ class Form
if ((is_numeric($selected) && ($selected < -2 || empty($selected))) && empty($conf->global->SOCIETE_DISABLE_DEFAULT_SALESREPRESENTATIVE)) $selected=$user->id;
if ($selected === '') $selected = array();
- else if (!is_array($selected)) $selected = array($selected);
+ elseif (!is_array($selected)) $selected = array($selected);
$excludeUsers=null;
$includeUsers=null;
@@ -1607,12 +1607,12 @@ class Form
if (is_array($exclude)) $excludeUsers = implode(",",$exclude);
// Permettre l'inclusion d'utilisateurs
if (is_array($include)) $includeUsers = implode(",",$include);
- else if ($include == 'hierarchy')
+ elseif ($include == 'hierarchy')
{
// Build list includeUsers to have only hierarchy
$includeUsers = implode(",",$user->getAllChildIds(0));
}
- else if ($include == 'hierarchyme')
+ elseif ($include == 'hierarchyme')
{
// Build list includeUsers to have only hierarchy and current user
$includeUsers = implode(",",$user->getAllChildIds(1));
@@ -1991,7 +1991,7 @@ class Form
trans("RefOrLabel").' : ';
- else if ($hidelabel > 1) {
+ elseif ($hidelabel > 1) {
$placeholder=' placeholder="'.$langs->trans("RefOrLabel").'"';
if ($hidelabel == 2) {
print img_picto($langs->trans("Search"), 'search');
@@ -2367,7 +2367,7 @@ class Form
if (! empty($conf->stock->enabled) && $objp->fk_product_type == 0 && isset($objp->stock))
{
if ($objp->stock > 0) $opt.= ' class="product_line_stock_ok"';
- else if ($objp->stock <= 0) $opt.= ' class="product_line_stock_too_low"';
+ elseif ($objp->stock <= 0) $opt.= ' class="product_line_stock_too_low"';
}
$opt.= '>';
$opt.= $objp->ref;
@@ -4906,7 +4906,7 @@ class Form
$code_country.=",'".$societe_acheteuse->country_code."'";
}
}
- else if (! $idprod) // We don't know type of product
+ elseif (! $idprod) // We don't know type of product
{
$code_country.=",'".$societe_acheteuse->country_code."'";
}
@@ -6370,40 +6370,40 @@ class Form
$tplpath = 'compta/'.$element;
if (empty($conf->facture->enabled)) continue; // Do not show if module disabled
}
- else if ($objecttype == 'facturerec') {
+ elseif ($objecttype == 'facturerec') {
$tplpath = 'compta/facture';
$tplname = 'linkedobjectblockForRec';
if (empty($conf->facture->enabled)) continue; // Do not show if module disabled
}
- else if ($objecttype == 'propal') {
+ elseif ($objecttype == 'propal') {
$tplpath = 'comm/'.$element;
if (empty($conf->propal->enabled)) continue; // Do not show if module disabled
}
- else if ($objecttype == 'supplier_proposal') {
+ elseif ($objecttype == 'supplier_proposal') {
if (empty($conf->supplier_proposal->enabled)) continue; // Do not show if module disabled
}
- else if ($objecttype == 'shipping' || $objecttype == 'shipment') {
+ elseif ($objecttype == 'shipping' || $objecttype == 'shipment') {
$tplpath = 'expedition';
if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled
}
- else if ($objecttype == 'reception') {
+ elseif ($objecttype == 'reception') {
$tplpath = 'reception';
if (empty($conf->reception->enabled)) continue; // Do not show if module disabled
}
- else if ($objecttype == 'delivery') {
+ elseif ($objecttype == 'delivery') {
$tplpath = 'livraison';
if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled
}
- else if ($objecttype == 'invoice_supplier') {
+ elseif ($objecttype == 'invoice_supplier') {
$tplpath = 'fourn/facture';
}
- else if ($objecttype == 'order_supplier') {
+ elseif ($objecttype == 'order_supplier') {
$tplpath = 'fourn/commande';
}
- else if ($objecttype == 'expensereport') {
+ elseif ($objecttype == 'expensereport') {
$tplpath = 'expensereport';
}
- else if ($objecttype == 'subscription') {
+ elseif ($objecttype == 'subscription') {
$tplpath = 'adherents';
}
@@ -6509,7 +6509,7 @@ class Form
$possiblelinks=array_merge($possiblelinks, $hookmanager->resArray);
}
}
- else if ($reshook > 0)
+ elseif ($reshook > 0)
{
if (is_array($hookmanager->resArray) && count($hookmanager->resArray))
{
@@ -6832,7 +6832,7 @@ class Form
{
$ret.=dol_htmlentities($object->name);
}
- else if ($object->element == 'member')
+ elseif ($object->element == 'member')
{
$ret.=$object->ref.' ';
$fullname=$object->getFullName($langs);
@@ -6842,23 +6842,23 @@ class Form
$ret.= dol_htmlentities($fullname) . ((! empty($object->societe) && $object->societe != $fullname)?' ('.dol_htmlentities($object->societe).')':'');
}
}
- else if (in_array($object->element, array('contact', 'user', 'usergroup')))
+ elseif (in_array($object->element, array('contact', 'user', 'usergroup')))
{
$ret.=dol_htmlentities($object->getFullName($langs));
}
- else if (in_array($object->element, array('action', 'agenda')))
+ elseif (in_array($object->element, array('action', 'agenda')))
{
$ret.=$object->ref.' '.$object->label;
}
- else if (in_array($object->element, array('adherent_type')))
+ elseif (in_array($object->element, array('adherent_type')))
{
$ret.=$object->label;
}
- else if ($object->element == 'ecm_directories')
+ elseif ($object->element == 'ecm_directories')
{
$ret.='';
}
- else if ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref);
+ elseif ($fieldref != 'none') $ret.=dol_htmlentities($object->$fieldref);
if ($morehtmlref)
@@ -6931,32 +6931,32 @@ class Form
if (! empty($object->logo))
{
if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
- else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small');
+ elseif ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.getImageFileNameForSize($object->logo, '_small');
else $file=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
$originalfile=get_exdir(0, 0, 0, 0, $object, 'thirdparty').'/logos/'.$object->logo;
}
$email=$object->email;
}
- else if ($modulepart=='contact')
+ elseif ($modulepart=='contact')
{
$dir=$conf->societe->multidir_output[$entity].'/contact';
if (! empty($object->photo))
{
if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_mini');
- else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_small');
+ elseif ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
$originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo;
}
$email=$object->email;
$capture='user';
}
- else if ($modulepart=='userphoto')
+ elseif ($modulepart=='userphoto')
{
$dir=$conf->user->dir_output;
if (! empty($object->photo))
{
if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_mini');
- else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_small');
+ elseif ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo;
$originalfile=get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo;
}
@@ -6964,13 +6964,13 @@ class Form
$email=$object->email;
$capture='user';
}
- else if ($modulepart=='memberphoto')
+ elseif ($modulepart=='memberphoto')
{
$dir=$conf->adherent->dir_output;
if (! empty($object->photo))
{
if ((string) $imagesize == 'mini') $file=get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
- else if ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
+ elseif ((string) $imagesize == 'small') $file=get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
$originalfile=get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
}
@@ -6985,7 +6985,7 @@ class Form
if (! empty($object->photo))
{
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
- else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
+ elseif ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
else $file=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
$originalfile=get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
}
@@ -7008,7 +7008,7 @@ class Form
$ret.=' ';
if ($addlinktofullsize) $ret.='';
}
- else if ($altfile && file_exists($dir."/".$altfile))
+ elseif ($altfile && file_exists($dir."/".$altfile))
{
if ($addlinktofullsize)
{
diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php
index e96ec257c93..ddfe8682081 100644
--- a/htdocs/core/class/html.formadmin.class.php
+++ b/htdocs/core/class/html.formadmin.class.php
@@ -100,7 +100,7 @@ class FormAdmin
$out.= ''.$valuetoshow.' ';
}
}
- else if ($selected == $key)
+ elseif ($selected == $key)
{
$out.= ''.$valuetoshow.' ';
}
@@ -167,7 +167,7 @@ class FormAdmin
$prefix='';
// 0=Recommanded, 1=Experimental, 2=Developpement, 3=Other
if (preg_match('/^eldy/i',$file)) $prefix='0';
- else if (preg_match('/^smartphone/i',$file)) $prefix='2';
+ elseif (preg_match('/^smartphone/i',$file)) $prefix='2';
else $prefix='3';
if ($file == $selected)
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index 065b241095a..e1315a9b244 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -816,12 +816,12 @@ class FormCompany
{
if (isset($idprof)) {
if ($idprof==1) $formlength=9;
- else if ($idprof==2) $formlength=14;
- else if ($idprof==3) $formlength=5; // 4 chiffres et 1 lettre depuis janvier
- else if ($idprof==4) $formlength=32; // No maximum as we need to include a town name in this id
+ elseif ($idprof==2) $formlength=14;
+ elseif ($idprof==3) $formlength=5; // 4 chiffres et 1 lettre depuis janvier
+ elseif ($idprof==4) $formlength=32; // No maximum as we need to include a town name in this id
}
}
- else if ($country_code == 'ES')
+ elseif ($country_code == 'ES')
{
if ($idprof==1) $formlength=9; //CIF/NIF/NIE 9 digits
if ($idprof==2) $formlength=12; //NASS 12 digits without /
@@ -833,9 +833,9 @@ class FormCompany
$selected=$preselected;
if (! $selected && isset($idprof)) {
if ($idprof==1 && ! empty($this->idprof1)) $selected=$this->idprof1;
- else if ($idprof==2 && ! empty($this->idprof2)) $selected=$this->idprof2;
- else if ($idprof==3 && ! empty($this->idprof3)) $selected=$this->idprof3;
- else if ($idprof==4 && ! empty($this->idprof4)) $selected=$this->idprof4;
+ elseif ($idprof==2 && ! empty($this->idprof2)) $selected=$this->idprof2;
+ elseif ($idprof==3 && ! empty($this->idprof3)) $selected=$this->idprof3;
+ elseif ($idprof==4 && ! empty($this->idprof4)) $selected=$this->idprof4;
}
$maxlength=$formlength;
diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php
index f09758aec2d..862c1e56b23 100644
--- a/htdocs/core/class/html.formcontract.class.php
+++ b/htdocs/core/class/html.formcontract.class.php
@@ -78,7 +78,7 @@ class FormContract
// CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
if (empty($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY))
$sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)";
- else if ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all')
+ elseif ($conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all')
{
$sql.= " AND (c.fk_soc IN (".$socid.", ".$conf->global->CONTRACT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") ";
$sql.= " OR c.fk_soc IS NULL)";
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 5bd33520420..8261b737e43 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -380,7 +380,7 @@ class FormFile
$modellist=ModeleThirdPartyDoc::liste_modeles($this->db);
}
}
- else if ($modulepart == 'propal')
+ elseif ($modulepart == 'propal')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
@@ -389,7 +389,7 @@ class FormFile
$modellist=ModelePDFPropales::liste_modeles($this->db);
}
}
- else if ($modulepart == 'supplier_proposal')
+ elseif ($modulepart == 'supplier_proposal')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
@@ -398,7 +398,7 @@ class FormFile
$modellist=ModelePDFSupplierProposal::liste_modeles($this->db);
}
}
- else if ($modulepart == 'commande')
+ elseif ($modulepart == 'commande')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
@@ -434,7 +434,7 @@ class FormFile
$modellist=ModelePDFDeliveryOrder::liste_modeles($this->db);
}
}
- else if ($modulepart == 'ficheinter')
+ elseif ($modulepart == 'ficheinter')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
@@ -524,7 +524,7 @@ class FormFile
$modellist=ModeleExports::liste_modeles($this->db);
}
}
- else if ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order')
+ elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
@@ -533,7 +533,7 @@ class FormFile
$modellist=ModelePDFSuppliersOrders::liste_modeles($this->db);
}
}
- else if ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice')
+ elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
@@ -542,7 +542,7 @@ class FormFile
$modellist=ModelePDFSuppliersInvoices::liste_modeles($this->db);
}
}
- else if ($modulepart == 'supplier_payment')
+ elseif ($modulepart == 'supplier_payment')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
@@ -551,7 +551,7 @@ class FormFile
$modellist=ModelePDFSuppliersPayments::liste_modeles($this->db);
}
}
- else if ($modulepart == 'remisecheque')
+ elseif ($modulepart == 'remisecheque')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
@@ -587,7 +587,7 @@ class FormFile
$modellist=ModeleAction::liste_modeles($this->db);
}
}
- else if ($modulepart == 'expensereport')
+ elseif ($modulepart == 'expensereport')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
@@ -596,7 +596,7 @@ class FormFile
$modellist=ModeleExpenseReport::liste_modeles($this->db);
}
}
- else if ($modulepart == 'unpaid')
+ elseif ($modulepart == 'unpaid')
{
$modellist='';
}
@@ -1465,72 +1465,72 @@ class FormFile
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$object_instance=new Societe($this->db);
}
- else if ($modulepart == 'invoice')
+ elseif ($modulepart == 'invoice')
{
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$object_instance=new Facture($this->db);
}
- else if ($modulepart == 'invoice_supplier')
+ elseif ($modulepart == 'invoice_supplier')
{
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$object_instance=new FactureFournisseur($this->db);
}
- else if ($modulepart == 'propal')
+ elseif ($modulepart == 'propal')
{
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$object_instance=new Propal($this->db);
}
- else if ($modulepart == 'supplier_proposal')
+ elseif ($modulepart == 'supplier_proposal')
{
include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
$object_instance=new SupplierProposal($this->db);
}
- else if ($modulepart == 'order')
+ elseif ($modulepart == 'order')
{
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$object_instance=new Commande($this->db);
}
- else if ($modulepart == 'order_supplier')
+ elseif ($modulepart == 'order_supplier')
{
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$object_instance=new CommandeFournisseur($this->db);
}
- else if ($modulepart == 'contract')
+ elseif ($modulepart == 'contract')
{
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$object_instance=new Contrat($this->db);
}
- else if ($modulepart == 'product')
+ elseif ($modulepart == 'product')
{
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$object_instance=new Product($this->db);
}
- else if ($modulepart == 'tax')
+ elseif ($modulepart == 'tax')
{
include_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
$object_instance=new ChargeSociales($this->db);
}
- else if ($modulepart == 'project')
+ elseif ($modulepart == 'project')
{
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$object_instance=new Project($this->db);
}
- else if ($modulepart == 'fichinter')
+ elseif ($modulepart == 'fichinter')
{
include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
$object_instance=new Fichinter($this->db);
}
- else if ($modulepart == 'user')
+ elseif ($modulepart == 'user')
{
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
$object_instance=new User($this->db);
}
- else if ($modulepart == 'expensereport')
+ elseif ($modulepart == 'expensereport')
{
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$object_instance=new ExpenseReport($this->db);
}
- else if ($modulepart == 'holiday')
+ elseif ($modulepart == 'holiday')
{
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$object_instance=new Holiday($this->db);
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index ac4ce55ebba..6a5cfea92d9 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -614,7 +614,7 @@ class FormMail extends Form
$soc->fetch($this->toid);
$out.= $soc->getNomUrl(1);
}
- else if ($this->totype == 'contact')
+ elseif ($this->totype == 'contact')
{
$contact=new Contact($this->db);
$contact->fetch($this->toid);
@@ -841,7 +841,7 @@ class FormMail extends Form
$out.= ' ';
}
}
- else if (empty($this->withmaindocfile)) // Do not show message if we asked to show the checkbox
+ elseif (empty($this->withmaindocfile)) // Do not show message if we asked to show the checkbox
{
$out.= $langs->trans("NoAttachedFiles").' ';
}
@@ -924,7 +924,7 @@ class FormMail extends Form
// Deal with format differences between message and signature (text / HTML)
if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
$this->substit['__USER_SIGNATURE__'] = dol_nl2br($this->substit['__USER_SIGNATURE__']);
- } else if(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
+ } elseif(!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
$defaultmessage = dol_nl2br($defaultmessage);
}
diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php
index d91142bd6bd..15deb48da01 100644
--- a/htdocs/core/class/html.formprojet.class.php
+++ b/htdocs/core/class/html.formprojet.class.php
@@ -171,7 +171,7 @@ class FormProjets
if ($socid > 0)
{
if (empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
- else if ($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') // PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
+ elseif ($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') // PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
{
$sql.= " AND (p.fk_soc IN (".$socid.", ".$conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") OR p.fk_soc IS NULL)";
}
@@ -233,12 +233,12 @@ class FormProjets
$disabled=1;
$labeltoshow.=' - '.$langs->trans("Draft");
}
- else if ($obj->fk_statut == 2)
+ elseif ($obj->fk_statut == 2)
{
if ($discard_closed == 2) $disabled=1;
$labeltoshow.=' - '.$langs->trans("Closed");
}
- else if ( empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) && $socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
+ elseif ( empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) && $socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
{
$disabled=1;
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
@@ -416,12 +416,12 @@ class FormProjets
$disabled=1;
$labeltoshow.=' - '.$langs->trans("Draft");
}
- else if ($obj->fk_statut == Project::STATUS_CLOSED)
+ elseif ($obj->fk_statut == Project::STATUS_CLOSED)
{
if ($discard_closed == 2) $disabled=1;
$labeltoshow.=' - '.$langs->trans("Closed");
}
- else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
+ elseif ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
{
$disabled=1;
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php
index 9d300db27e8..416b68c71aa 100644
--- a/htdocs/core/class/html.formsms.class.php
+++ b/htdocs/core/class/html.formsms.class.php
@@ -208,7 +208,7 @@ function limitChars(textarea, limit, infodiv)
dol_print_error('','Error to get list of senders: '.$e->getMessage());
}
}
- else if (!empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module'
+ elseif (!empty($conf->global->MAIN_SMS_SENDMODE)) // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module'
{
$tmp=explode('@',$conf->global->MAIN_SMS_SENDMODE);
$classfile=$tmp[0]; $module=(empty($tmp[1])?$tmp[0]:$tmp[1]);
diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php
index 7c8bb689de5..1c488483be3 100644
--- a/htdocs/core/class/interfaces.class.php
+++ b/htdocs/core/class/interfaces.class.php
@@ -212,7 +212,7 @@ class Interfaces
$nbtotal++;
$nbko++;
if (! empty($objMod->errors)) $this->errors=array_merge($this->errors,$objMod->errors);
- else if (! empty($objMod->error)) $this->errors[]=$objMod->error;
+ elseif (! empty($objMod->error)) $this->errors[]=$objMod->error;
//dol_syslog("Error in trigger ".$action." - Nb of error string returned = ".count($this->errors), LOG_ERR);
}
}
@@ -338,7 +338,7 @@ class Interfaces
$module=preg_replace('/^mod/i','',$reg[2]);
$constparam='MAIN_MODULE_'.strtoupper($module);
if (strtolower($module) == 'all') $disabledbymodule=0;
- else if (empty($conf->global->$constparam)) $disabledbymodule=2;
+ elseif (empty($conf->global->$constparam)) $disabledbymodule=2;
$triggers[$j]['module']=strtolower($module);
}
diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php
index 641bfeacdcb..6d6f8471721 100644
--- a/htdocs/core/class/menubase.class.php
+++ b/htdocs/core/class/menubase.class.php
@@ -634,7 +634,7 @@ class Menubase
$tab_titre = explode("/",$menu['titre']);
$title = $langs->trans($tab_titre[0])."/".$langs->trans($tab_titre[1]);
}
- else if (preg_match('/\|\|/',$menu['titre'])) // To manage different translation (Title||AltTitle@ConditionForAltTitle)
+ elseif (preg_match('/\|\|/',$menu['titre'])) // To manage different translation (Title||AltTitle@ConditionForAltTitle)
{
$tab_title = explode("||",$menu['titre']);
$alt_title = explode("@",$tab_title[1]);
diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php
index 931dce263a1..c27a5a71f41 100644
--- a/htdocs/core/class/rssparser.class.php
+++ b/htdocs/core/class/rssparser.class.php
@@ -342,7 +342,7 @@ class RssParser
else $items=$rss->items; // With xmlparse
//var_dump($items);exit;
}
- else if ($rss->_format == 'atom')
+ elseif ($rss->_format == 'atom')
{
//var_dump($rss);
if (! empty($conf->global->EXTERNALRSS_USE_SIMPLEXML))
@@ -410,7 +410,7 @@ class RssParser
}
}
}
- else if ($rss->_format == 'atom')
+ elseif ($rss->_format == 'atom')
{
if (! empty($conf->global->EXTERNALRSS_USE_SIMPLEXML))
{
diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php
index c52261a5530..e83e83dde83 100644
--- a/htdocs/core/class/smtps.class.php
+++ b/htdocs/core/class/smtps.class.php
@@ -1413,7 +1413,7 @@ class SMTPs
die ("Sorry, no content");
// If we have ONE, we can use the simple format
- else if( $keyCount === 1 && empty($conf->global->MAIN_MAIL_USE_MULTI_PART))
+ elseif( $keyCount === 1 && empty($conf->global->MAIN_MAIL_USE_MULTI_PART))
{
$_msgData = $this->_msgContent;
$_msgData = $_msgData[$_types[0]];
@@ -1431,7 +1431,7 @@ class SMTPs
}
// If we have more than ONE, we use the multi-part format
- else if( $keyCount >= 1 || ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART))
+ elseif( $keyCount >= 1 || ! empty($conf->global->MAIN_MAIL_USE_MULTI_PART))
{
// Since this is an actual multi-part message
// We need to define a content message Boundary
@@ -1479,7 +1479,7 @@ class SMTPs
}
}
// @CHANGE LDR
- else if ( $type == 'image' )
+ elseif ( $type == 'image' )
{
// loop through all images
foreach ( $_content as $_image => $_data )
@@ -1751,8 +1751,8 @@ class SMTPs
function _getBoundary($type = 'mixed')
{
if ($type == 'mixed') return $this->_smtpsBoundary;
- else if ($type == 'related') return $this->_smtpsRelatedBoundary;
- else if ($type == 'alternative') return $this->_smtpsAlternativeBoundary;
+ elseif ($type == 'related') return $this->_smtpsRelatedBoundary;
+ elseif ($type == 'alternative') return $this->_smtpsAlternativeBoundary;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index d13ca7eb567..2b3e0ed66a5 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -105,7 +105,7 @@ class Translate
$longforshort=array('ar'=>'ar_SA');
$longforshortexcep=array('ar_EG');
if (isset($longforshort[strtolower($langpart[0])]) && ! in_array($codetouse, $longforshortexcep)) $srclang=$longforshort[strtolower($langpart[0])];
- else if (! is_numeric($langpart[1])) { // Second part YY may be a numeric with some Chrome browser
+ elseif (! is_numeric($langpart[1])) { // Second part YY may be a numeric with some Chrome browser
$srclang=strtolower($langpart[0])."_".strtoupper($langpart[1]);
$longforlong=array('no_nb'=>'nb_NO');
if (isset($longforlong[strtolower($srclang)])) $srclang=$longforlong[strtolower($srclang)];
@@ -116,7 +116,7 @@ class Translate
// Array to convert short lang code into long code.
$longforshort=array('ar'=>'ar_SA', 'el'=>'el_GR', 'ca'=>'ca_ES', 'en'=>'en_US', 'nb'=>'nb_NO', 'no'=>'nb_NO');
if (isset($longforshort[strtolower($langpart[0])])) $srclang=$longforshort[strtolower($langpart[0])];
- else if (! empty($langpart[0])) $srclang=strtolower($langpart[0])."_".strtoupper($langpart[0]);
+ elseif (! empty($langpart[0])) $srclang=strtolower($langpart[0])."_".strtoupper($langpart[0]);
else $srclang='en_US';
}
@@ -247,7 +247,7 @@ class Translate
$usecachekey=$newdomain.'_'.$langofdir.'_'.md5($file_lang); // Should not contains special chars
}
// Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file)
- else if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
+ elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
{
$usecachekey=$newdomain;
}
@@ -441,7 +441,7 @@ class Translate
$usecachekey=$newdomain.'_'.$langofdir; // Should not contains special chars
}
// Using cache with shmop. Speed gain: 40ms - Memory overusage: 200ko (Size of session cache file)
- else if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
+ elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
{
$usecachekey=$newdomain;
}
diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php
index ff2b4d51de7..ea65ad940e3 100644
--- a/htdocs/core/db/mssql.class.php
+++ b/htdocs/core/db/mssql.class.php
@@ -832,19 +832,19 @@ class DoliDBMssql extends DoliDB
$sqlfields[$i] .= $field_desc['type'];
if( preg_match("/^[^\s]/i",$field_desc['value']))
$sqlfields[$i] .= "(".$field_desc['value'].")";
- else if( preg_match("/^[^\s]/i",$field_desc['attribute']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['attribute']))
$sqlfields[$i] .= " ".$field_desc['attribute'];
- else if( preg_match("/^[^\s]/i",$field_desc['default']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['default']))
{
if(preg_match("/null/i",$field_desc['default']))
$sqlfields[$i] .= " default ".$field_desc['default'];
else
$sqlfields[$i] .= " default '".$field_desc['default']."'";
}
- else if( preg_match("/^[^\s]/i",$field_desc['null']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['null']))
$sqlfields[$i] .= " ".$field_desc['null'];
- else if( preg_match("/^[^\s]/i",$field_desc['extra']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['extra']))
$sqlfields[$i] .= " ".$field_desc['extra'];
$i++;
}
diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php
index ad41e78620d..0c8fb3cbd0b 100644
--- a/htdocs/core/db/mysqli.class.php
+++ b/htdocs/core/db/mysqli.class.php
@@ -509,7 +509,7 @@ class DoliDBMysqli extends DoliDB
{
$return = 'AES_ENCRYPT('.$return.',\''.$cryptKey.'\')';
}
- else if ($cryptType == 1)
+ elseif ($cryptType == 1)
{
$return = 'DES_ENCRYPT('.$return.',\''.$cryptKey.'\')';
}
@@ -542,7 +542,7 @@ class DoliDBMysqli extends DoliDB
{
$return = 'AES_DECRYPT('.$value.',\''.$cryptKey.'\')';
}
- else if ($cryptType == 1)
+ elseif ($cryptType == 1)
{
$return = 'DES_DECRYPT('.$value.',\''.$cryptKey.'\')';
}
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index b2c6f52d305..82c51479f79 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -173,8 +173,8 @@ class DoliDBPgsql extends DoliDB
if ($type == 'auto')
{
if (preg_match('/ALTER TABLE/i',$line)) $type='dml';
- else if (preg_match('/CREATE TABLE/i',$line)) $type='dml';
- else if (preg_match('/DROP TABLE/i',$line)) $type='dml';
+ elseif (preg_match('/CREATE TABLE/i',$line)) $type='dml';
+ elseif (preg_match('/DROP TABLE/i',$line)) $type='dml';
}
$line=preg_replace('/ as signed\)/i',' as integer)',$line);
@@ -973,19 +973,19 @@ class DoliDBPgsql extends DoliDB
$sqlfields[$i] .= $field_desc['type'];
if( preg_match("/^[^\s]/i",$field_desc['value']))
$sqlfields[$i] .= "(".$field_desc['value'].")";
- else if( preg_match("/^[^\s]/i",$field_desc['attribute']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['attribute']))
$sqlfields[$i] .= " ".$field_desc['attribute'];
- else if( preg_match("/^[^\s]/i",$field_desc['default']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['default']))
{
if(preg_match("/null/i",$field_desc['default']))
$sqlfields[$i] .= " default ".$field_desc['default'];
else
$sqlfields[$i] .= " default '".$field_desc['default']."'";
}
- else if( preg_match("/^[^\s]/i",$field_desc['null']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['null']))
$sqlfields[$i] .= " ".$field_desc['null'];
- else if( preg_match("/^[^\s]/i",$field_desc['extra']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['extra']))
$sqlfields[$i] .= " ".$field_desc['extra'];
$i++;
}
diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php
index 439c62af122..18dfece171c 100644
--- a/htdocs/core/db/sqlite3.class.php
+++ b/htdocs/core/db/sqlite3.class.php
@@ -150,8 +150,8 @@ class DoliDBSqlite3 extends DoliDB
if ($type == 'auto')
{
if (preg_match('/ALTER TABLE/i',$line)) $type='dml';
- else if (preg_match('/CREATE TABLE/i',$line)) $type='dml';
- else if (preg_match('/DROP TABLE/i',$line)) $type='dml';
+ elseif (preg_match('/CREATE TABLE/i',$line)) $type='dml';
+ elseif (preg_match('/DROP TABLE/i',$line)) $type='dml';
}
if ($type == 'dml')
@@ -742,7 +742,7 @@ class DoliDBSqlite3 extends DoliDB
{
$return = 'AES_ENCRYPT('.$return.',\''.$cryptKey.'\')';
}
- else if ($cryptType == 1)
+ elseif ($cryptType == 1)
{
$return = 'DES_ENCRYPT('.$return.',\''.$cryptKey.'\')';
}
@@ -775,7 +775,7 @@ class DoliDBSqlite3 extends DoliDB
{
$return = 'AES_DECRYPT('.$value.',\''.$cryptKey.'\')';
}
- else if ($cryptType == 1)
+ elseif ($cryptType == 1)
{
$return = 'DES_DECRYPT('.$value.',\''.$cryptKey.'\')';
}
@@ -915,19 +915,19 @@ class DoliDBSqlite3 extends DoliDB
$sqlfields[$i] .= $field_desc['type'];
if( preg_match("/^[^\s]/i",$field_desc['value']))
$sqlfields[$i] .= "(".$field_desc['value'].")";
- else if( preg_match("/^[^\s]/i",$field_desc['attribute']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['attribute']))
$sqlfields[$i] .= " ".$field_desc['attribute'];
- else if( preg_match("/^[^\s]/i",$field_desc['default']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['default']))
{
if(preg_match("/null/i",$field_desc['default']))
$sqlfields[$i] .= " default ".$field_desc['default'];
else
$sqlfields[$i] .= " default '".$field_desc['default']."'";
}
- else if( preg_match("/^[^\s]/i",$field_desc['null']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['null']))
$sqlfields[$i] .= " ".$field_desc['null'];
- else if( preg_match("/^[^\s]/i",$field_desc['extra']))
+ elseif( preg_match("/^[^\s]/i",$field_desc['extra']))
$sqlfields[$i] .= " ".$field_desc['extra'];
$i++;
}
diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php
index 58f7c20c109..1934c702dfb 100644
--- a/htdocs/core/filemanagerdol/connectors/php/commands.php
+++ b/htdocs/core/filemanagerdol/connectors/php/commands.php
@@ -290,7 +290,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
@unlink($sFilePath);
$sErrorNumber = '202' ;
}
- else if ( isset( $detectHtml ) && $detectHtml === -1 && DetectHtml($sFilePath) === true )
+ elseif ( isset( $detectHtml ) && $detectHtml === -1 && DetectHtml($sFilePath) === true )
{
@unlink($sFilePath);
$sErrorNumber = '202' ;
diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php
index 28845122f0d..c03cd09ff16 100644
--- a/htdocs/core/lib/bank.lib.php
+++ b/htdocs/core/lib/bank.lib.php
@@ -292,7 +292,7 @@ function checkBanForAccount($account)
if ($country_code == 'AU') { // Australian
if (strlen($account->code_banque) > 7)
return false; // Sould be 6 but can be 123-456
- else if (strlen($account->code_banque) < 6)
+ elseif (strlen($account->code_banque) < 6)
return false; // Sould be 6
else
return true;
diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php
index 49acbf31517..bdeff0555a4 100644
--- a/htdocs/core/lib/barcode.lib.php
+++ b/htdocs/core/lib/barcode.lib.php
@@ -128,7 +128,7 @@ function barcode_encode($code, $encoding)
dol_syslog("barcode.lib.php::barcode_encode Use barcode_encode_ean");
$bars=barcode_encode_ean($code, $encoding);
}
- else if (file_exists($genbarcode_loc)) // For example C39
+ elseif (file_exists($genbarcode_loc)) // For example C39
{
/* use genbarcode */
dol_syslog("barcode.lib.php::barcode_encode Use genbarcode ".$genbarcode_loc." code=".$code." encoding=".$encoding);
@@ -219,7 +219,7 @@ function barcode_encode_ean($ean, $encoding = "EAN-13")
if ($a>0) $text.=" ";
$text.="$pos:12:{$ean[$a]}";
if ($a==0) $pos+=12;
- else if ($a==6) $pos+=12;
+ elseif ($a==6) $pos+=12;
else $pos+=7;
}
@@ -397,12 +397,12 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0,
header("Content-Type: image/jpeg; name=\"barcode.jpg\"");
imagejpeg($im);
}
- else if ($mode=='gif')
+ elseif ($mode=='gif')
{
header("Content-Type: image/gif; name=\"barcode.gif\"");
imagegif($im);
}
- else if (! empty($filebarcode)) // To wxrite into afile onto disk
+ elseif (! empty($filebarcode)) // To wxrite into afile onto disk
{
imagepng($im,$filebarcode);
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index ebcca729d55..55b4d80ac68 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -459,9 +459,9 @@ function getCountry($searchkey, $withcode = '', $dbtouse = 0, $outputlangs = '',
else $label=($obj->code && ($outputlangs->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code))?$outputlangs->transnoentitiesnoconv("Country".$obj->code):$label;
}
if ($withcode == 1) $result=$label?"$obj->code - $label":"$obj->code";
- else if ($withcode == 2) $result=$obj->code;
- else if ($withcode == 3) $result=$obj->rowid;
- else if ($withcode === 'all') $result=array('id'=>$obj->rowid,'code'=>$obj->code,'label'=>$label);
+ elseif ($withcode == 2) $result=$obj->code;
+ elseif ($withcode == 3) $result=$obj->rowid;
+ elseif ($withcode === 'all') $result=array('id'=>$obj->rowid,'code'=>$obj->code,'label'=>$label);
else $result=$label;
}
else
@@ -525,7 +525,7 @@ function getState($id, $withcode = '', $dbtouse = 0, $withregion = 0, $outputlan
return $label = $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
}
}
- else if ($withcode == 2) {
+ elseif ($withcode == 2) {
if ($withregion == 1) {
return $label = $obj->region_name . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
}
@@ -533,7 +533,7 @@ function getState($id, $withcode = '', $dbtouse = 0, $withregion = 0, $outputlan
return $label = ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
}
}
- else if ($withcode === 'all') {
+ elseif ($withcode === 'all') {
if ($withregion == 1) {
return array('id'=>$obj->id,'code'=>$obj->code,'label'=>$label,'region_code'=>$obj->region_code,'region'=>$obj->region_name);
}
diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php
index b9a4dcbe710..3a34ec6847c 100644
--- a/htdocs/core/lib/date.lib.php
+++ b/htdocs/core/lib/date.lib.php
@@ -246,11 +246,11 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l
return sprintf("%02d",($sWeek*$lengthOfWeek*24 + $sDay*24 + (int) floor($iSecond/3600)));
}
}
- else if ($format == 'hour') // only hour part
+ elseif ($format == 'hour') // only hour part
{
$sTime=dol_print_date($iSecond,'%H',true);
}
- else if ($format == 'fullhour')
+ elseif ($format == 'fullhour')
{
if (!empty($iSecond)) {
$iSecond=$iSecond/3600;
@@ -260,19 +260,19 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l
}
$sTime=$iSecond;
}
- else if ($format == 'min') // only min part
+ elseif ($format == 'min') // only min part
{
$sTime=dol_print_date($iSecond,'%M',true);
}
- else if ($format == 'sec') // only sec part
+ elseif ($format == 'sec') // only sec part
{
$sTime=dol_print_date($iSecond,'%S',true);
}
- else if ($format == 'month') // only month part
+ elseif ($format == 'month') // only month part
{
$sTime=dol_print_date($iSecond,'%m',true);
}
- else if ($format == 'year') // only year part
+ elseif ($format == 'year') // only year part
{
$sTime=dol_print_date($iSecond,'%Y',true);
}
@@ -297,12 +297,12 @@ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date)
if ($year_date > 0 && empty($day_date)) {
$sqldate.= " AND ".$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, false));
$sqldate.= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, false))."'";
- } else if ($year_date > 0 && ! empty($day_date)) {
+ } elseif ($year_date > 0 && ! empty($day_date)) {
$sqldate.= " AND ".$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date));
$sqldate.= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date))."'";
} else
$sqldate.= " AND date_format( ".$datefield.", '%m') = '".$db->escape($month_date)."'";
- } else if ($year_date > 0){
+ } elseif ($year_date > 0){
$sqldate.= " AND ".$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, false));
$sqldate.= "' AND '".$db->idate(dol_get_last_day($year_date, 12, false))."'";
}
@@ -345,7 +345,7 @@ function dol_stringtotime($string, $gm = 1)
if ($syear >= 50 && $syear < 100) $syear+=2000;
$string=sprintf("%04d%02d%02d%02d%02d%02d",$syear,$smonth,$sday,$shour,$smin,$ssec);
}
- else if (
+ elseif (
preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$/i',$string,$reg) // Convert date with format YYYY-MM-DDTHH:MM:SSZ (RFC3339)
|| preg_match('/^([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})$/i',$string,$reg) // Convert date with format YYYY-MM-DD HH:MM:SS
|| preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z$/i',$string,$reg) // Convert date with format YYYYMMDDTHHMMSSZ
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 28095a97ac9..1d82cb81122 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -118,7 +118,7 @@ function dol_dir_list($path, $types = "all", $recursive = 0, $filter = "", $excl
{
$excludefilterarray=array_merge($excludefilterarray,$excludefilter);
}
- else if ($excludefilter) $excludefilterarray[]=$excludefilter;
+ elseif ($excludefilter) $excludefilterarray[]=$excludefilter;
// Check if file is qualified
foreach($excludefilterarray as $filt)
{
@@ -167,7 +167,7 @@ function dol_dir_list($path, $types = "all", $recursive = 0, $filter = "", $excl
}
}
}
- else if (! $isdir && (($types == "files") || ($types == "all")))
+ elseif (! $isdir && (($types == "files") || ($types == "all")))
{
// Add file into file_list array
if ($loaddate || $sortcriteria == 'date') $filedate=dol_filemtime($path."/".$file);
@@ -1608,7 +1608,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
{
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
}
- else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
+ elseif (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
{
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
}
@@ -2358,7 +2358,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping for users
- else if ($modulepart == 'user' && !empty($conf->user->dir_output))
+ elseif ($modulepart == 'user' && !empty($conf->user->dir_output))
{
$canreaduser=(! empty($fuser->admin) || $fuser->rights->user->user->{$lire});
if ($fuser->id == (int) $refname) { $canreaduser=1; } // A user can always read its own card
@@ -2370,7 +2370,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping for third parties
- else if (($modulepart == 'company' || $modulepart == 'societe') && !empty($conf->societe->dir_output))
+ elseif (($modulepart == 'company' || $modulepart == 'societe') && !empty($conf->societe->dir_output))
{
if (empty($entity) || empty($conf->societe->multidir_output[$entity])) return array('accessallowed'=>0, 'error'=>'Value entity must be provided');
if ($fuser->rights->societe->{$lire} || preg_match('/^specimen/i',$original_file))
@@ -2382,7 +2382,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping for contact
- else if ($modulepart == 'contact' && !empty($conf->societe->dir_output))
+ elseif ($modulepart == 'contact' && !empty($conf->societe->dir_output))
{
if (empty($entity) || empty($conf->societe->multidir_output[$entity])) return array('accessallowed'=>0, 'error'=>'Value entity must be provided');
if ($fuser->rights->societe->{$lire})
@@ -2393,7 +2393,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping for invoices
- else if (($modulepart == 'facture' || $modulepart == 'invoice') && !empty($conf->facture->dir_output))
+ elseif (($modulepart == 'facture' || $modulepart == 'invoice') && !empty($conf->facture->dir_output))
{
if ($fuser->rights->facture->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2403,7 +2403,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
}
// Wrapping for mass actions
- else if ($modulepart == 'massfilesarea_proposals' && !empty($conf->propal->multidir_output[$entity]))
+ elseif ($modulepart == 'massfilesarea_proposals' && !empty($conf->propal->multidir_output[$entity]))
{
if ($fuser->rights->propal->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2411,7 +2411,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
$original_file=$conf->propal->multidir_output[$entity].'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
- else if ($modulepart == 'massfilesarea_orders')
+ elseif ($modulepart == 'massfilesarea_orders')
{
if ($fuser->rights->commande->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2419,7 +2419,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
$original_file=$conf->commande->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
- else if ($modulepart == 'massfilesarea_invoices')
+ elseif ($modulepart == 'massfilesarea_invoices')
{
if ($fuser->rights->facture->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2427,7 +2427,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
$original_file=$conf->facture->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
- else if ($modulepart == 'massfilesarea_expensereport')
+ elseif ($modulepart == 'massfilesarea_expensereport')
{
if ($fuser->rights->facture->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2435,7 +2435,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
$original_file=$conf->expensereport->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
- else if ($modulepart == 'massfilesarea_interventions')
+ elseif ($modulepart == 'massfilesarea_interventions')
{
if ($fuser->rights->ficheinter->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2443,7 +2443,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
$original_file=$conf->ficheinter->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
- else if ($modulepart == 'massfilesarea_supplier_proposal' && !empty($conf->supplier_proposal->dir_output))
+ elseif ($modulepart == 'massfilesarea_supplier_proposal' && !empty($conf->supplier_proposal->dir_output))
{
if ($fuser->rights->supplier_proposal->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2451,7 +2451,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
$original_file=$conf->supplier_proposal->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
- else if ($modulepart == 'massfilesarea_supplier_order')
+ elseif ($modulepart == 'massfilesarea_supplier_order')
{
if ($fuser->rights->fournisseur->commande->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2459,7 +2459,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
$original_file=$conf->fournisseur->commande->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
- else if ($modulepart == 'massfilesarea_supplier_invoice')
+ elseif ($modulepart == 'massfilesarea_supplier_invoice')
{
if ($fuser->rights->fournisseur->facture->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2467,7 +2467,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
$original_file=$conf->fournisseur->facture->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file;
}
- else if ($modulepart == 'massfilesarea_contract' && !empty($conf->contrat->dir_output))
+ elseif ($modulepart == 'massfilesarea_contract' && !empty($conf->contrat->dir_output))
{
if ($fuser->rights->contrat->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2477,7 +2477,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping for interventions
- else if (($modulepart == 'fichinter' || $modulepart == 'ficheinter') && !empty($conf->ficheinter->dir_output))
+ elseif (($modulepart == 'fichinter' || $modulepart == 'ficheinter') && !empty($conf->ficheinter->dir_output))
{
if ($fuser->rights->ficheinter->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2488,7 +2488,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les deplacements et notes de frais
- else if ($modulepart == 'deplacement' && !empty($conf->deplacement->dir_output))
+ elseif ($modulepart == 'deplacement' && !empty($conf->deplacement->dir_output))
{
if ($fuser->rights->deplacement->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2498,7 +2498,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
//$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."fichinter WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity;
}
// Wrapping pour les propales
- else if (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity]))
+ elseif (($modulepart == 'propal' || $modulepart == 'propale') && !empty($conf->propal->multidir_output[$entity]))
{
if ($fuser->rights->propale->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2509,7 +2509,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les commandes
- else if (($modulepart == 'commande' || $modulepart == 'order') && !empty($conf->commande->dir_output))
+ elseif (($modulepart == 'commande' || $modulepart == 'order') && !empty($conf->commande->dir_output))
{
if ($fuser->rights->commande->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2520,7 +2520,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les projets
- else if ($modulepart == 'project' && !empty($conf->projet->dir_output))
+ elseif ($modulepart == 'project' && !empty($conf->projet->dir_output))
{
if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2529,7 +2529,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$original_file=$conf->projet->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")";
}
- else if ($modulepart == 'project_task' && !empty($conf->projet->dir_output))
+ elseif ($modulepart == 'project_task' && !empty($conf->projet->dir_output))
{
if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2540,7 +2540,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les commandes fournisseurs
- else if (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output))
+ elseif (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output))
{
if ($fuser->rights->fournisseur->commande->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2551,7 +2551,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les factures fournisseurs
- else if (($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') && !empty($conf->fournisseur->facture->dir_output))
+ elseif (($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') && !empty($conf->fournisseur->facture->dir_output))
{
if ($fuser->rights->fournisseur->facture->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2561,7 +2561,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn WHERE facnumber='".$db->escape($refname)."' AND entity=".$conf->entity;
}
// Wrapping pour les rapport de paiements
- else if ($modulepart == 'supplier_payment')
+ elseif ($modulepart == 'supplier_payment')
{
if ($fuser->rights->fournisseur->facture->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2572,7 +2572,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les rapport de paiements
- else if ($modulepart == 'facture_paiement' && !empty($conf->facture->dir_output))
+ elseif ($modulepart == 'facture_paiement' && !empty($conf->facture->dir_output))
{
if ($fuser->rights->facture->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2583,7 +2583,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping for accounting exports
- else if ($modulepart == 'export_compta' && !empty($conf->accounting->dir_output))
+ elseif ($modulepart == 'export_compta' && !empty($conf->accounting->dir_output))
{
if ($fuser->rights->accounting->bind->write || preg_match('/^specimen/i',$original_file))
{
@@ -2593,7 +2593,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les expedition
- else if ($modulepart == 'expedition' && !empty($conf->expedition->dir_output))
+ elseif ($modulepart == 'expedition' && !empty($conf->expedition->dir_output))
{
if ($fuser->rights->expedition->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2602,7 +2602,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$original_file=$conf->expedition->dir_output."/sending/".$original_file;
}
// Wrapping pour les bons de livraison
- else if ($modulepart == 'livraison' && !empty($conf->expedition->dir_output))
+ elseif ($modulepart == 'livraison' && !empty($conf->expedition->dir_output))
{
if ($fuser->rights->expedition->livraison->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2612,7 +2612,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les actions
- else if ($modulepart == 'actions' && !empty($conf->agenda->dir_output))
+ elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output))
{
if ($fuser->rights->agenda->myactions->{$read} || preg_match('/^specimen/i',$original_file))
{
@@ -2622,7 +2622,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les actions
- else if ($modulepart == 'actionsreport' && !empty($conf->agenda->dir_temp))
+ elseif ($modulepart == 'actionsreport' && !empty($conf->agenda->dir_temp))
{
if ($fuser->rights->agenda->allactions->{$read} || preg_match('/^specimen/i',$original_file))
{
@@ -2632,7 +2632,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les produits et services
- else if ($modulepart == 'product' || $modulepart == 'produit' || $modulepart == 'service' || $modulepart == 'produit|service')
+ elseif ($modulepart == 'product' || $modulepart == 'produit' || $modulepart == 'service' || $modulepart == 'produit|service')
{
if (empty($entity) || (empty($conf->product->multidir_output[$entity]) && empty($conf->service->multidir_output[$entity]))) return array('accessallowed'=>0, 'error'=>'Value entity must be provided');
if (($fuser->rights->produit->{$lire} || $fuser->rights->service->{$lire}) || preg_match('/^specimen/i',$original_file))
@@ -2644,7 +2644,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les lots produits
- else if ($modulepart == 'product_batch' || $modulepart == 'produitlot')
+ elseif ($modulepart == 'product_batch' || $modulepart == 'produitlot')
{
if (empty($entity) || (empty($conf->productbatch->multidir_output[$entity]))) return array('accessallowed'=>0, 'error'=>'Value entity must be provided');
if (($fuser->rights->produit->{$lire} ) || preg_match('/^specimen/i',$original_file))
@@ -2655,7 +2655,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les contrats
- else if ($modulepart == 'contract' && !empty($conf->contrat->dir_output))
+ elseif ($modulepart == 'contract' && !empty($conf->contrat->dir_output))
{
if ($fuser->rights->contrat->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2666,7 +2666,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les dons
- else if ($modulepart == 'donation' && !empty($conf->don->dir_output))
+ elseif ($modulepart == 'donation' && !empty($conf->don->dir_output))
{
if ($fuser->rights->don->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2676,7 +2676,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les dons
- else if ($modulepart == 'dolresource' && !empty($conf->resource->dir_output))
+ elseif ($modulepart == 'dolresource' && !empty($conf->resource->dir_output))
{
if ($fuser->rights->resource->{$read} || preg_match('/^specimen/i',$original_file))
{
@@ -2686,7 +2686,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour les remises de cheques
- else if ($modulepart == 'remisecheque' && !empty($conf->banque->dir_output))
+ elseif ($modulepart == 'remisecheque' && !empty($conf->banque->dir_output))
{
if ($fuser->rights->banque->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2697,7 +2697,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping for bank
- else if ($modulepart == 'bank' && !empty($conf->bank->dir_output))
+ elseif ($modulepart == 'bank' && !empty($conf->bank->dir_output))
{
if ($fuser->rights->banque->{$lire})
{
@@ -2707,7 +2707,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping for export module
- else if ($modulepart == 'export' && !empty($conf->export->dir_temp))
+ elseif ($modulepart == 'export' && !empty($conf->export->dir_temp))
{
// Aucun test necessaire car on force le rep de download sur
// le rep export qui est propre a l'utilisateur
@@ -2716,35 +2716,35 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping for import module
- else if ($modulepart == 'import' && !empty($conf->import->dir_temp))
+ elseif ($modulepart == 'import' && !empty($conf->import->dir_temp))
{
$accessallowed=1;
$original_file=$conf->import->dir_temp.'/'.$original_file;
}
// Wrapping pour l'editeur wysiwyg
- else if ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output))
+ elseif ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output))
{
$accessallowed=1;
$original_file=$conf->fckeditor->dir_output.'/'.$original_file;
}
// Wrapping for backups
- else if ($modulepart == 'systemtools' && !empty($conf->admin->dir_output))
+ elseif ($modulepart == 'systemtools' && !empty($conf->admin->dir_output))
{
if ($fuser->admin) $accessallowed=1;
$original_file=$conf->admin->dir_output.'/'.$original_file;
}
// Wrapping for upload file test
- else if ($modulepart == 'admin_temp' && !empty($conf->admin->dir_temp))
+ elseif ($modulepart == 'admin_temp' && !empty($conf->admin->dir_temp))
{
if ($fuser->admin) $accessallowed=1;
$original_file=$conf->admin->dir_temp.'/'.$original_file;
}
// Wrapping pour BitTorrent
- else if ($modulepart == 'bittorrent' && !empty($conf->bittorrent->dir_output))
+ elseif ($modulepart == 'bittorrent' && !empty($conf->bittorrent->dir_output))
{
$accessallowed=1;
$dir='files';
@@ -2753,7 +2753,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping pour Foundation module
- else if ($modulepart == 'member' && !empty($conf->adherent->dir_output))
+ elseif ($modulepart == 'member' && !empty($conf->adherent->dir_output))
{
if ($fuser->rights->adherent->{$lire} || preg_match('/^specimen/i',$original_file))
{
@@ -2763,7 +2763,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
// Wrapping for Scanner
- else if ($modulepart == 'scanner_user_temp' && !empty($conf->scanner->dir_temp))
+ elseif ($modulepart == 'scanner_user_temp' && !empty($conf->scanner->dir_temp))
{
$accessallowed=1;
$original_file=$conf->scanner->dir_temp.'/'.$fuser->id.'/'.$original_file;
@@ -2790,7 +2790,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($fuser->rights->{$reg[1]}->{$lire} || $fuser->rights->{$reg[1]}->{$read} || ($fuser->rights->{$reg[1]}->{$download})) $accessallowed=1;
$original_file=$conf->{$reg[1]}->dir_temp.'/'.$fuser->id.'/'.$original_file;
}
- else if (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg))
+ elseif (preg_match('/^([a-z]+)_temp$/i',$modulepart,$reg))
{
if (empty($conf->{$reg[1]}->dir_temp)) // modulepart not supported
{
@@ -2800,7 +2800,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($fuser->rights->{$reg[1]}->{$lire} || $fuser->rights->{$reg[1]}->{$read} || ($fuser->rights->{$reg[1]}->{$download})) $accessallowed=1;
$original_file=$conf->{$reg[1]}->dir_temp.'/'.$original_file;
}
- else if (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg))
+ elseif (preg_match('/^([a-z]+)_user$/i',$modulepart,$reg))
{
if (empty($conf->{$reg[1]}->dir_output)) // modulepart not supported
{
@@ -2810,7 +2810,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
if ($fuser->rights->{$reg[1]}->{$lire} || $fuser->rights->{$reg[1]}->{$read} || ($fuser->rights->{$reg[1]}->{$download})) $accessallowed=1;
$original_file=$conf->{$reg[1]}->dir_output.'/'.$fuser->id.'/'.$original_file;
}
- else if (preg_match('/^massfilesarea_([a-z]+)$/i', $modulepart, $reg))
+ elseif (preg_match('/^massfilesarea_([a-z]+)$/i', $modulepart, $reg))
{
if (empty($conf->{$reg[1]}->dir_output)) // modulepart not supported
{
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index ca89eeba47c..81a3adecdd6 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -496,7 +496,7 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
// '../' is dangerous because it allows dir transversals
if (preg_match('/"/',$out)) $out='';
- else if (preg_match('/\.\.\//',$out)) $out='';
+ elseif (preg_match('/\.\.\//',$out)) $out='';
}
break;
case 'san_alpha':
@@ -536,7 +536,7 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
// '../' is dangerous because it allows dir transversals
if (preg_match('/"/',$out)) $out='';
- else if (preg_match('/\.\.\//',$out)) $out='';
+ elseif (preg_match('/\.\.\//',$out)) $out='';
$out=dol_string_nohtmltag($out);
}
break;
@@ -590,7 +590,7 @@ if (! function_exists('dol_getprefix'))
if (! empty($conf->global->MAIL_PREFIX_FOR_EMAIL_ID)) // If MAIL_PREFIX_FOR_EMAIL_ID is set (a value initialized with a random value is recommended)
{
if ($conf->global->MAIL_PREFIX_FOR_EMAIL_ID != 'SERVER_NAME') return $conf->global->MAIL_PREFIX_FOR_EMAIL_ID;
- else if (isset($_SERVER["SERVER_NAME"])) return $_SERVER["SERVER_NAME"];
+ elseif (isset($_SERVER["SERVER_NAME"])) return $_SERVER["SERVER_NAME"];
}
return dol_hash(DOL_DOCUMENT_ROOT.DOL_URL_ROOT, '3');
}
@@ -911,9 +911,9 @@ function dol_escape_js($stringtoescape, $mode = 0, $noescapebackslashn = 0)
//$substitjs['']='<\/'; // We removed this. Should be useless.
if (empty($noescapebackslashn)) { $substitjs["\n"]='\\n'; $substitjs['\\']='\\\\'; }
if (empty($mode)) { $substitjs["'"]="\\'"; $substitjs['"']="\\'"; }
- else if ($mode == 1) $substitjs["'"]="\\'";
- else if ($mode == 2) { $substitjs['"']='\\"'; }
- else if ($mode == 3) { $substitjs["'"]="\\'"; $substitjs['"']="\\\""; }
+ elseif ($mode == 1) $substitjs["'"]="\\'";
+ elseif ($mode == 2) { $substitjs['"']='\\"'; }
+ elseif ($mode == 3) { $substitjs["'"]="\\'"; $substitjs['"']="\\\""; }
return strtr($stringtoescape, $substitjs);
}
@@ -1033,13 +1033,13 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
// This is when server run behind a reverse proxy
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) $data['ip'] = $_SERVER['HTTP_X_FORWARDED_FOR'].(empty($_SERVER["REMOTE_ADDR"])?'':'->'.$_SERVER['REMOTE_ADDR']);
// This is when server run normally on a server
- else if (! empty($_SERVER["REMOTE_ADDR"])) $data['ip'] = $_SERVER['REMOTE_ADDR'];
+ elseif (! empty($_SERVER["REMOTE_ADDR"])) $data['ip'] = $_SERVER['REMOTE_ADDR'];
// This is when PHP session is ran inside a web server but not inside a client request (example: init code of apache)
- else if (! empty($_SERVER['SERVER_ADDR'])) $data['ip'] = $_SERVER['SERVER_ADDR'];
+ elseif (! empty($_SERVER['SERVER_ADDR'])) $data['ip'] = $_SERVER['SERVER_ADDR'];
// This is when PHP session is ran outside a web server, like from Windows command line (Not always defined, but useful if OS defined it).
- else if (! empty($_SERVER['COMPUTERNAME'])) $data['ip'] = $_SERVER['COMPUTERNAME'].(empty($_SERVER['USERNAME'])?'':'@'.$_SERVER['USERNAME']);
+ elseif (! empty($_SERVER['COMPUTERNAME'])) $data['ip'] = $_SERVER['COMPUTERNAME'].(empty($_SERVER['USERNAME'])?'':'@'.$_SERVER['USERNAME']);
// This is when PHP session is ran outside a web server, like from Linux command line (Not always defined, but usefull if OS defined it).
- else if (! empty($_SERVER['LOGNAME'])) $data['ip'] = '???@'.$_SERVER['LOGNAME'];
+ elseif (! empty($_SERVER['LOGNAME'])) $data['ip'] = '???@'.$_SERVER['LOGNAME'];
// Loop on each log handler and send output
foreach ($conf->loghandlers as $loghandlerinstance)
{
@@ -1162,7 +1162,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
$out.=''.$links[$i][1].' '."\n";
}
}
- else if (! empty($links[$i][1]))
+ elseif (! empty($links[$i][1]))
{
//print "x $i $active ".$links[$i][2]." z";
if ($isactive)
@@ -1196,7 +1196,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab
else
$outmore.=''.$links[$i][1].' '."\n";
}
- else if (! empty($links[$i][1]))
+ elseif (! empty($links[$i][1]))
{
$outmore.='';
$outmore.=preg_replace('/([a-z])\/([a-z])/i', '\\1 / \\2', $links[$i][1]); // Replace x/y with x / y to allow wrap on long composed texts.
@@ -1425,7 +1425,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
}
}
}
- else if (! $phototoshow)
+ elseif (! $phototoshow)
{
$phototoshow = $form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos);
}
@@ -1627,7 +1627,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
}
if ($object->zip) $ret .= ($ret?", ":'').$object->zip;
}
- else if (in_array($object->country_code,array('GB','UK'))) // UK: title firstname name \n address lines \n town state \n zip \n country
+ elseif (in_array($object->country_code,array('GB','UK'))) // UK: title firstname name \n address lines \n town state \n zip \n country
{
$ret .= ($ret ? $sep : '' ).$object->town;
if ($object->state)
@@ -1636,7 +1636,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
}
if ($object->zip) $ret .= ($ret ? $sep : '' ).$object->zip;
}
- else if (in_array($object->country_code,array('ES','TR'))) // ES: title firstname name \n address lines \n zip town \n state \n country
+ elseif (in_array($object->country_code,array('ES','TR'))) // ES: title firstname name \n address lines \n zip town \n state \n country
{
$ret .= ($ret ? $sep : '' ).$object->zip;
$ret .= ($object->town?(($object->zip?' ':'').$object->town):'');
@@ -1645,7 +1645,7 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
$ret.="\n".$object->state;
}
}
- else if (in_array($object->country_code,array('IT'))) // IT: tile firstname name\n address lines \n zip (Code Departement) \n country
+ elseif (in_array($object->country_code,array('IT'))) // IT: tile firstname name\n address lines \n zip (Code Departement) \n country
{
$ret .= ($ret ? $sep : '' ).$object->zip;
$ret .= ($object->town?(($object->zip?' ':'').$object->town):'');
@@ -1746,22 +1746,22 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang
// Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default.
// TODO Add format daysmallyear and dayhoursmallyear
if ($format == 'day') $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short);
- else if ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short);
- else if ($format == 'hourduration') $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration);
- else if ($format == 'daytext') $format=($outputlangs->trans("FormatDateText")!="FormatDateText"?$outputlangs->trans("FormatDateText"):$conf->format_date_text);
- else if ($format == 'daytextshort') $format=($outputlangs->trans("FormatDateTextShort")!="FormatDateTextShort"?$outputlangs->trans("FormatDateTextShort"):$conf->format_date_text_short);
- else if ($format == 'dayhour') $format=($outputlangs->trans("FormatDateHourShort")!="FormatDateHourShort"?$outputlangs->trans("FormatDateHourShort"):$conf->format_date_hour_short);
- else if ($format == 'dayhoursec') $format=($outputlangs->trans("FormatDateHourSecShort")!="FormatDateHourSecShort"?$outputlangs->trans("FormatDateHourSecShort"):$conf->format_date_hour_sec_short);
- else if ($format == 'dayhourtext') $format=($outputlangs->trans("FormatDateHourText")!="FormatDateHourText"?$outputlangs->trans("FormatDateHourText"):$conf->format_date_hour_text);
- else if ($format == 'dayhourtextshort') $format=($outputlangs->trans("FormatDateHourTextShort")!="FormatDateHourTextShort"?$outputlangs->trans("FormatDateHourTextShort"):$conf->format_date_hour_text_short);
+ elseif ($format == 'hour') $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short);
+ elseif ($format == 'hourduration') $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration);
+ elseif ($format == 'daytext') $format=($outputlangs->trans("FormatDateText")!="FormatDateText"?$outputlangs->trans("FormatDateText"):$conf->format_date_text);
+ elseif ($format == 'daytextshort') $format=($outputlangs->trans("FormatDateTextShort")!="FormatDateTextShort"?$outputlangs->trans("FormatDateTextShort"):$conf->format_date_text_short);
+ elseif ($format == 'dayhour') $format=($outputlangs->trans("FormatDateHourShort")!="FormatDateHourShort"?$outputlangs->trans("FormatDateHourShort"):$conf->format_date_hour_short);
+ elseif ($format == 'dayhoursec') $format=($outputlangs->trans("FormatDateHourSecShort")!="FormatDateHourSecShort"?$outputlangs->trans("FormatDateHourSecShort"):$conf->format_date_hour_sec_short);
+ elseif ($format == 'dayhourtext') $format=($outputlangs->trans("FormatDateHourText")!="FormatDateHourText"?$outputlangs->trans("FormatDateHourText"):$conf->format_date_hour_text);
+ elseif ($format == 'dayhourtextshort') $format=($outputlangs->trans("FormatDateHourTextShort")!="FormatDateHourTextShort"?$outputlangs->trans("FormatDateHourTextShort"):$conf->format_date_hour_text_short);
// Format not sensitive to language
- else if ($format == 'dayhourlog') $format='%Y%m%d%H%M%S';
- else if ($format == 'dayhourldap') $format='%Y%m%d%H%M%SZ';
- else if ($format == 'dayhourxcard') $format='%Y%m%dT%H%M%SZ';
- else if ($format == 'dayxcard') $format='%Y%m%d';
- else if ($format == 'dayrfc') $format='%Y-%m-%d'; // DATE_RFC3339
- else if ($format == 'dayhourrfc') $format='%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339
- else if ($format == 'standard') $format='%Y-%m-%d %H:%M:%S';
+ elseif ($format == 'dayhourlog') $format='%Y%m%d%H%M%S';
+ elseif ($format == 'dayhourldap') $format='%Y%m%d%H%M%SZ';
+ elseif ($format == 'dayhourxcard') $format='%Y%m%dT%H%M%SZ';
+ elseif ($format == 'dayxcard') $format='%Y%m%d';
+ elseif ($format == 'dayrfc') $format='%Y-%m-%d'; // DATE_RFC3339
+ elseif ($format == 'dayhourrfc') $format='%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339
+ elseif ($format == 'standard') $format='%Y-%m-%d %H:%M:%S';
if ($reduceformat)
{
@@ -1953,7 +1953,7 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = false, $
$default_timezone=@date_default_timezone_get(); // Example 'Europe/Berlin'
$localtz = new DateTimeZone($default_timezone);
}
- else if ($gm === 'user')
+ elseif ($gm === 'user')
{
// We use dol_tz_string first because it is more reliable.
$default_timezone=(empty($_SESSION["dol_tz_string"])?@date_default_timezone_get():$_SESSION["dol_tz_string"]); // Example 'Europe/Berlin'
@@ -1966,7 +1966,7 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = false, $
$default_timezone=@date_default_timezone_get();
}
}
- else if (strrpos($gm, "tz,") !== false)
+ elseif (strrpos($gm, "tz,") !== false)
{
$timezone=str_replace("tz,", "", $gm); // Example 'tz,Europe/Berlin'
try
@@ -2015,7 +2015,7 @@ function dol_now($mode = 'gmt')
// Note that gmmktime and mktime return same value (GMT) when used without parameters
//if ($mode == 'gmt') $ret=gmmktime(); // Strict Standards: gmmktime(): You should be using the time() function instead
if ($mode == 'gmt') $ret=time(); // Time for now at greenwich.
- else if ($mode == 'tzserver') // Time for now with PHP server timezone added
+ elseif ($mode == 'tzserver') // Time for now with PHP server timezone added
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$tzsecond=getServerTimeZoneInt('now'); // Contains tz+dayling saving time
@@ -2027,7 +2027,7 @@ function dol_now($mode = 'gmt')
$tzsecond=getParentCompanyTimeZoneInt(); // Contains tz+dayling saving time
$ret=dol_now('gmt')+($tzsecond*3600);
}*/
- else if ($mode == 'tzuser') // Time for now with user timezone added
+ elseif ($mode == 'tzuser') // Time for now with user timezone added
{
//print 'time: '.time().'-'.mktime().'-'.gmmktime();
$offsettz=(empty($_SESSION['dol_tz'])?0:$_SESSION['dol_tz'])*60*60;
@@ -2527,7 +2527,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
$newphone =' '.$phone.' ';
}
- else if (! empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') // If click to dial, we use click to dial url
+ elseif (! empty($conf->clicktodial->enabled) && $addlink == 'AC_TEL') // If click to dial, we use click to dial url
{
if (empty($user->clicktodial_loaded)) $user->fetch_clicktodial();
@@ -3101,10 +3101,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (! empty($conf->global->MAIN_OVERWRITE_THEME_PATH)) {
$path = $conf->global->MAIN_OVERWRITE_THEME_PATH.'/theme/'.$theme; // If the theme does not have the same name as the module
}
- else if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) {
+ elseif (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) {
$path = $conf->global->MAIN_OVERWRITE_THEME_RES.'/theme/'.$conf->global->MAIN_OVERWRITE_THEME_RES; // To allow an external module to overwrite image resources whatever is activated theme
}
- else if (! empty($conf->modules_parts['theme']) && array_key_exists($theme, $conf->modules_parts['theme'])) {
+ elseif (! empty($conf->modules_parts['theme']) && array_key_exists($theme, $conf->modules_parts['theme'])) {
$path = $theme.'/theme/'.$theme; // If the theme have the same name as the module
}
@@ -4137,7 +4137,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
{
$pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>1 ';
if ($cpt > 2) $pagelist.='dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="inactive"':'').'>... ';
- else if ($cpt == 2) $pagelist.='dol_use_jmobile != 4)?' class="pagination"':'').'>2 ';
+ elseif ($cpt == 2) $pagelist.='dol_use_jmobile != 4)?' class="pagination"':'').'>2 ';
}
do
@@ -4157,7 +4157,7 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
if ($cpt<$nbpages)
{
if ($cpt<$nbpages-2) $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>dol_use_jmobile != 4)?'class="inactive"':'').'>... ';
- else if ($cpt == $nbpages-2) $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>'.($nbpages - 1).' ';
+ elseif ($cpt == $nbpages-2) $pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>'.($nbpages - 1).' ';
$pagelist.= 'dol_use_jmobile != 4)?' class="pagination"':'').'>'.$nbpages.' ';
}
}
@@ -4341,7 +4341,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
if ($outlangs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") $dec=$outlangs->transnoentitiesnoconv("SeparatorDecimal");
if ($outlangs->transnoentitiesnoconv("SeparatorThousand")!= "SeparatorThousand") $thousand=$outlangs->transnoentitiesnoconv("SeparatorThousand");
if ($thousand == 'None') $thousand='';
- else if ($thousand == 'Space') $thousand=' ';
+ elseif ($thousand == 'Space') $thousand=' ';
//print "outlangs=".$outlangs->defaultlang." amount=".$amount." html=".$form." trunc=".$trunc." nbdecimal=".$nbdecimal." dec='".$dec."' thousand='".$thousand."' ";
//print "amount=".$amount."-";
@@ -6294,7 +6294,7 @@ function dolGetFirstLastname($firstname, $lastname, $nameorder = -1)
if ($firstname && $lastname) $ret.=' ';
$ret.=$lastname;
}
- else if ($nameorder == 2 || $nameorder == 3)
+ elseif ($nameorder == 2 || $nameorder == 3)
{
$ret.=$firstname;
if (empty($ret) && $nameorder == 3)
@@ -6518,8 +6518,8 @@ function dol_htmloutput_mesg($mesgstring = '', $mesgarray = array(), $style = 'o
if ($val && preg_match('/class="warning"/i',$val)) { $iswarning++; break; }
}
}
- else if ($mesgstring && preg_match('/class="error"/i',$mesgstring)) $iserror++;
- else if ($mesgstring && preg_match('/class="warning"/i',$mesgstring)) $iswarning++;
+ elseif ($mesgstring && preg_match('/class="error"/i',$mesgstring)) $iserror++;
+ elseif ($mesgstring && preg_match('/class="warning"/i',$mesgstring)) $iswarning++;
if ($style=='error') $iserror++;
if ($style=='warning') $iswarning++;
@@ -7082,7 +7082,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
$h++;
}
}
- else if (count($values) == 5) // deprecated
+ elseif (count($values) == 5) // deprecated
{
dol_syslog('Passing 5Â values in tabs module_parts is deprecated. Please update to 6 with permissions.', LOG_WARNING);
@@ -7102,7 +7102,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
$h++;
}
}
- else if ($mode == 'remove' && preg_match('/^\-/',$values[1]))
+ elseif ($mode == 'remove' && preg_match('/^\-/',$values[1]))
{
if ($values[0] != $type) continue;
$tabname=str_replace('-','',$values[1]);
@@ -7459,12 +7459,12 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
$i2++; // a criteria was added to string
}
}
- else if ($mode == 2)
+ elseif ($mode == 2)
{
$newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $db->escape(trim($crit)) . ")";
$i2++; // a criteria was added to string
}
- else if ($mode == 3)
+ elseif ($mode == 3)
{
$tmparray=explode(',',trim($crit));
if (count($tmparray))
@@ -7482,7 +7482,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
$i2++; // a criteria was added to string
}
}
- else if ($mode == 4)
+ elseif ($mode == 4)
{
$tmparray=explode(',',trim($crit));
if (count($tmparray))
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index db264909819..b4662650c5a 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -717,7 +717,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
global $conf,$user;
if (! is_object($objsoc)) $valueforccc=$objsoc;
- else if ($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=$objsoc->code_fournisseur;
+ elseif ($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=$objsoc->code_fournisseur;
else $valueforccc=$objsoc->code_client;
$sharetable = $table;
@@ -859,7 +859,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
//print "yearoffset=".$yearoffset." yearoffsettype=".$yearoffsettype;
if (is_numeric($yearoffsettype) && $yearoffsettype >= 1)
$maskraz=$yearoffsettype; // For backward compatibility
- else if ($yearoffsettype === '0' || (! empty($yearoffsettype) && ! is_numeric($yearoffsettype) && $conf->global->SOCIETE_FISCAL_MONTH_START > 1))
+ elseif ($yearoffsettype === '0' || (! empty($yearoffsettype) && ! is_numeric($yearoffsettype) && $conf->global->SOCIETE_FISCAL_MONTH_START > 1))
$maskraz = $conf->global->SOCIETE_FISCAL_MONTH_START;
//print "maskraz=".$maskraz; // -1=no reset
@@ -882,8 +882,8 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
else // if reset is for a specific month in year, we need year
{
if (preg_match('/^(.*)\{(m+)\}\{(y+)\}/i',$maskwithonlyymcode,$reg)) { $posy=3; $posm=2; }
- else if (preg_match('/^(.*)\{(y+)\}\{(m+)\}/i',$maskwithonlyymcode,$reg)) { $posy=2; $posm=3; }
- else if (preg_match('/^(.*)\{(y+)\}/i',$maskwithonlyymcode,$reg)) { $posy=2; $posm=0; }
+ elseif (preg_match('/^(.*)\{(y+)\}\{(m+)\}/i',$maskwithonlyymcode,$reg)) { $posy=2; $posm=3; }
+ elseif (preg_match('/^(.*)\{(y+)\}/i',$maskwithonlyymcode,$reg)) { $posy=2; $posm=0; }
else return 'ErrorCantUseRazIfNoYearInMask';
}
// Define length
@@ -917,10 +917,10 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
if ($date < $nextnewyeardate && $yearoffsettype == '+') $yearoffset=1;
}
// If after or equal of current new year date
- else if ($date >= $newyeardate && $yearoffsettype == '-') $yearoffset=-1;
+ elseif ($date >= $newyeardate && $yearoffsettype == '-') $yearoffset=-1;
}
// For backward compatibility
- else if (date("m",$date) < $maskraz && empty($resetEveryMonth)) { $yearoffset=-1; } // If current month lower that month of return to zero, year is previous year
+ elseif (date("m",$date) < $maskraz && empty($resetEveryMonth)) { $yearoffset=-1; } // If current month lower that month of return to zero, year is previous year
if ($yearlen == 4) $yearcomp=sprintf("%04d",date("Y",$date)+$yearoffset);
elseif ($yearlen == 2) $yearcomp=sprintf("%02d",date("y",$date)+$yearoffset);
@@ -938,7 +938,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$sqlwhere.=" AND SUBSTRING(".$field.", ".$monthpos.", ".$monthlen.") < '".str_pad($monthcomp, $monthlen, '0', STR_PAD_LEFT)."') ";
$sqlwhere.=')';
}
- else if ($resetEveryMonth)
+ elseif ($resetEveryMonth)
{
$sqlwhere.="(SUBSTRING(".$field.", ".$yearpos.", ".$yearlen.") = '".$yearcomp."'";
$sqlwhere.=" AND SUBSTRING(".$field.", ".$monthpos.", ".$monthlen.") = '".str_pad($monthcomp, $monthlen, '0', STR_PAD_LEFT)."')";
@@ -989,7 +989,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$sql.= " AND ".$field." NOT LIKE '(PROV%)'";
if ($bentityon) // only if entity enable
$sql.= " AND entity IN (".getEntity($sharetable).")";
- else if (! empty($forceentity))
+ elseif (! empty($forceentity))
$sql.= " AND entity IN (".$forceentity.")";
if ($where) $sql.=$where;
if ($sqlwhere) $sql.=' AND '.$sqlwhere;
@@ -1006,12 +1006,12 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
// Check if we must force counter to maskoffset
if (empty($counter)) $counter=$maskoffset;
- else if (preg_match('/[^0-9]/i',$counter))
+ elseif (preg_match('/[^0-9]/i',$counter))
{
$counter=0;
dol_syslog("Error, the last counter found is '".$counter."' so is not a numeric value. We will restart to 1.", LOG_ERR);
}
- else if ($counter < $maskoffset && empty($conf->global->MAIN_NUMBERING_OFFSET_ONLY_FOR_FIRST)) $counter=$maskoffset;
+ elseif ($counter < $maskoffset && empty($conf->global->MAIN_NUMBERING_OFFSET_ONLY_FOR_FIRST)) $counter=$maskoffset;
if ($mode == 'last') // We found value for counter = last counter value. Now need to get corresponding ref of invoice.
{
@@ -1038,7 +1038,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$sql.= " AND ".$field." NOT LIKE '%PROV%'";
if ($bentityon) // only if entity enable
$sql.= " AND entity IN (".getEntity($sharetable).")";
- else if (! empty($forceentity))
+ elseif (! empty($forceentity))
$sql.= " AND entity IN (".$forceentity.")";
if ($where) $sql.=$where;
if ($sqlwhere) $sql.=' AND '.$sqlwhere;
@@ -1054,7 +1054,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$numFinal=$ref;
}
- else if ($mode == 'next')
+ elseif ($mode == 'next')
{
$counter++;
@@ -1094,7 +1094,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$maskrefclient_sql.= " WHERE ".$field." LIKE '".$maskrefclient_maskLike."'";
if ($bentityon) // only if entity enable
$maskrefclient_sql.= " AND entity IN (".getEntity($sharetable).")";
- else if (! empty($forceentity))
+ elseif (! empty($forceentity))
$sql.= " AND entity IN (".$forceentity.")";
if ($where) $maskrefclient_sql.=$where; //use the same optional where as general mask
if ($sqlwhere) $maskrefclient_sql.=' AND '.$sqlwhere; //use the same sqlwhere as general mask
@@ -1357,9 +1357,9 @@ function numero_semaine($time)
// Definition du Jeudi de la semaine
if (date("w",mktime(12,0,0,$mois,$jour,$annee))==0) // Dimanche
$jeudiSemaine = mktime(12,0,0,$mois,$jour,$annee)-3*24*60*60;
- else if (date("w",mktime(12,0,0,$mois,$jour,$annee))<4) // du Lundi au Mercredi
+ elseif (date("w",mktime(12,0,0,$mois,$jour,$annee))<4) // du Lundi au Mercredi
$jeudiSemaine = mktime(12,0,0,$mois,$jour,$annee)+(4-date("w",mktime(12,0,0,$mois,$jour,$annee)))*24*60*60;
- else if (date("w",mktime(12,0,0,$mois,$jour,$annee))>4) // du Vendredi au Samedi
+ elseif (date("w",mktime(12,0,0,$mois,$jour,$annee))>4) // du Vendredi au Samedi
$jeudiSemaine = mktime(12,0,0,$mois,$jour,$annee)-(date("w",mktime(12,0,0,$mois,$jour,$annee))-4)*24*60*60;
else // Jeudi
$jeudiSemaine = mktime(12,0,0,$mois,$jour,$annee);
@@ -1369,11 +1369,11 @@ function numero_semaine($time)
{
$premierJeudiAnnee = mktime(12,0,0,1,1,date("Y",$jeudiSemaine))+4*24*60*60;
}
- else if (date("w",mktime(12,0,0,1,1,date("Y",$jeudiSemaine)))<4) // du Lundi au Mercredi
+ elseif (date("w",mktime(12,0,0,1,1,date("Y",$jeudiSemaine)))<4) // du Lundi au Mercredi
{
$premierJeudiAnnee = mktime(12,0,0,1,1,date("Y",$jeudiSemaine))+(4-date("w",mktime(12,0,0,1,1,date("Y",$jeudiSemaine))))*24*60*60;
}
- else if (date("w",mktime(12,0,0,1,1,date("Y",$jeudiSemaine)))>4) // du Vendredi au Samedi
+ elseif (date("w",mktime(12,0,0,1,1,date("Y",$jeudiSemaine)))>4) // du Vendredi au Samedi
{
$premierJeudiAnnee = mktime(12,0,0,1,1,date("Y",$jeudiSemaine))+(7-(date("w",mktime(12,0,0,1,1,date("Y",$jeudiSemaine)))-4))*24*60*60;
}
diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php
index 2787b8f1209..ad67ec5e51b 100644
--- a/htdocs/core/lib/geturl.lib.php
+++ b/htdocs/core/lib/geturl.lib.php
@@ -78,7 +78,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
curl_setopt($ch, CURLOPT_POST, 1); // POST
curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // Setting param x=a&y=z as POST fields
}
- else if ($postorget == 'PUT')
+ elseif ($postorget == 'PUT')
{
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
if (! is_array($param)) parse_str($param, $array_param);
@@ -89,17 +89,17 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
}
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_param)); // Setting param x=a&y=z as PUT fields
}
- else if ($postorget == 'PUTALREADYFORMATED')
+ elseif ($postorget == 'PUTALREADYFORMATED')
{
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // HTTP request is 'PUT'
curl_setopt($ch, CURLOPT_POSTFIELDS, $param); // param = content of post, like a xml string
}
- else if ($postorget == 'HEAD')
+ elseif ($postorget == 'HEAD')
{
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD'
curl_setopt($ch, CURLOPT_NOBODY, true);
}
- else if ($postorget == 'DELETE')
+ elseif ($postorget == 'DELETE')
{
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); // POST
}
diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php
index 28e75d494e9..4cb3f534162 100644
--- a/htdocs/core/lib/ldap.lib.php
+++ b/htdocs/core/lib/ldap.lib.php
@@ -113,11 +113,11 @@ function show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass)
{
print ''.$butlabel.' ';
}
- else if (empty($conf->global->LDAP_SERVER_HOST))
+ elseif (empty($conf->global->LDAP_SERVER_HOST))
{
print ''.$butlabel.' ';
}
- else if (empty($key) || empty($dn) || empty($objectclass))
+ elseif (empty($key) || empty($dn) || empty($objectclass))
{
$langs->load("errors");
print ''.$butlabel.' ';
@@ -172,7 +172,7 @@ function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount =
}
show_ldap_content($val,$level+1,$count,$var,$hide,$val["count"]);
}
- else if ($subcount)
+ elseif ($subcount)
{
$subcount--;
$newstring=dol_htmlentitiesbr($val);
diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php
index c8e594f549a..8087f34b43c 100644
--- a/htdocs/core/lib/memory.lib.php
+++ b/htdocs/core/lib/memory.lib.php
@@ -69,7 +69,7 @@ function dol_setcache($memoryid, $data)
return -$rescode;
}
}
- else if (! empty($conf->memcached->enabled) && class_exists('Memcache'))
+ elseif (! empty($conf->memcached->enabled) && class_exists('Memcache'))
{
global $dolmemcache;
if (empty($dolmemcache) || ! is_object($dolmemcache))
@@ -93,7 +93,7 @@ function dol_setcache($memoryid, $data)
}
}
// Using shmop
- else if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
+ elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
{
$result=dol_setshmop($memoryid,$data);
}
@@ -139,7 +139,7 @@ function dol_getcache($memoryid)
return -$rescode;
}
}
- else if (! empty($conf->memcached->enabled) && class_exists('Memcache'))
+ elseif (! empty($conf->memcached->enabled) && class_exists('Memcache'))
{
global $m;
if (empty($m) || ! is_object($m))
@@ -165,7 +165,7 @@ function dol_getcache($memoryid)
}
}
// Using shmop
- else if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
+ elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
{
$data=dol_getshmop($memoryid);
return $data;
diff --git a/htdocs/core/lib/modulebuilder.lib.php b/htdocs/core/lib/modulebuilder.lib.php
index 57928341302..1e3675fe3a0 100644
--- a/htdocs/core/lib/modulebuilder.lib.php
+++ b/htdocs/core/lib/modulebuilder.lib.php
@@ -263,8 +263,8 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
$type = preg_replace('/:.*$/', '', $type); // For case type = 'integer:Societe:societe/class/societe.class.php'
if ($type == 'html') $type = 'text'; // html modulebuilder type is a text type in database
- else if ($type == 'price') $type = 'double'; // html modulebuilder type is a text type in database
- else if ($type == 'link' || $type == 'sellist') $type = 'integer';
+ elseif ($type == 'price') $type = 'double'; // html modulebuilder type is a text type in database
+ elseif ($type == 'link' || $type == 'sellist') $type = 'integer';
$texttoinsert.= "\t".$key." ".$type;
if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY';
if ($key == 'entity') $texttoinsert.= ' DEFAULT 1';
@@ -273,7 +273,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
if ($val['default'] != '')
{
if (preg_match('/^null$/i', $val['default'])) $texttoinsert.= " DEFAULT NULL";
- else if (preg_match('/varchar/', $type )) $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'";
+ elseif (preg_match('/varchar/', $type )) $texttoinsert.= " DEFAULT '".$db->escape($val['default'])."'";
else $texttoinsert.= (($val['default'] > 0)?' DEFAULT '.$val['default']:'');
}
}
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 7b624a02f8a..0b51f226e5e 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -461,7 +461,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t
if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {
$stringaddress.= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code));
}
- else if (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) {
+ elseif (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) {
$stringaddress.= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code));
}
@@ -820,7 +820,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0,
$cur+=1;
}
- else if (! $usedetailedbban) $cury+=1;
+ elseif (! $usedetailedbban) $cury+=1;
// Use correct name of bank id according to country
$ibankey = FormBank::getIBANLabel($account);
@@ -2030,7 +2030,7 @@ function pdf_getTotalQty($object, $type, $outputlangs)
{
$total += $object->lines[$i]->qty;
}
- else if ($type==9 && is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
+ elseif ($type==9 && is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
{
$special_code = $object->lines[$i]->special_code;
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
@@ -2039,11 +2039,11 @@ function pdf_getTotalQty($object, $type, $outputlangs)
$reshook = $hookmanager->executeHooks('pdf_getTotalQty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
}
- else if ($type==0 && $object->lines[$i]->product_type == 0)
+ elseif ($type==0 && $object->lines[$i]->product_type == 0)
{
$total += $object->lines[$i]->qty;
}
- else if ($type==1 && $object->lines[$i]->product_type == 1)
+ elseif ($type==1 && $object->lines[$i]->product_type == 1)
{
$total += $object->lines[$i]->qty;
}
@@ -2087,7 +2087,7 @@ function pdf_getLinkedObjects($object, $outputlangs)
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs);
}
}
- else if ($objecttype == 'commande' || $objecttype == 'supplier_order')
+ elseif ($objecttype == 'commande' || $objecttype == 'supplier_order')
{
$outputlangs->load('orders');
foreach($objects as $elementobject)
@@ -2098,7 +2098,7 @@ function pdf_getLinkedObjects($object, $outputlangs)
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date,'day','',$outputlangs);
}
}
- else if ($objecttype == 'contrat')
+ elseif ($objecttype == 'contrat')
{
$outputlangs->load('contracts');
foreach($objects as $elementobject)
@@ -2109,7 +2109,7 @@ function pdf_getLinkedObjects($object, $outputlangs)
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date_contrat,'day','',$outputlangs);
}
}
- else if ($objecttype == 'shipping')
+ elseif ($objecttype == 'shipping')
{
$outputlangs->loadLangs(array("orders", "sendings"));
diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php
index e1f7e316e20..034d186326a 100644
--- a/htdocs/core/lib/product.lib.php
+++ b/htdocs/core/lib/product.lib.php
@@ -484,7 +484,7 @@ function measuring_units_string($unit, $measuring_style = '')
$measuring_units[98] = $langs->transnoentitiesnoconv("WeightUnitounce");
$measuring_units[99] = $langs->transnoentitiesnoconv("WeightUnitpound");
}
- else if ($measuring_style == 'size')
+ elseif ($measuring_style == 'size')
{
$measuring_units[0] = $langs->transnoentitiesnoconv("SizeUnitm");
$measuring_units[-1] = $langs->transnoentitiesnoconv("SizeUnitdm");
@@ -493,7 +493,7 @@ function measuring_units_string($unit, $measuring_style = '')
$measuring_units[98] = $langs->transnoentitiesnoconv("SizeUnitfoot");
$measuring_units[99] = $langs->transnoentitiesnoconv("SizeUnitinch");
}
- else if ($measuring_style == 'surface')
+ elseif ($measuring_style == 'surface')
{
$measuring_units[0] = $langs->transnoentitiesnoconv("SurfaceUnitm2");
$measuring_units[-2] = $langs->transnoentitiesnoconv("SurfaceUnitdm2");
@@ -502,7 +502,7 @@ function measuring_units_string($unit, $measuring_style = '')
$measuring_units[98] = $langs->transnoentitiesnoconv("SurfaceUnitfoot2");
$measuring_units[99] = $langs->transnoentitiesnoconv("SurfaceUnitinch2");
}
- else if ($measuring_style == 'volume')
+ elseif ($measuring_style == 'volume')
{
$measuring_units[0] = $langs->transnoentitiesnoconv("VolumeUnitm3");
$measuring_units[-3] = $langs->transnoentitiesnoconv("VolumeUnitdm3");
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 80bb9a555b4..fb76fd28867 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -1105,7 +1105,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
// Warning
print '';
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject"));
- else if ($disabledtask)
+ elseif ($disabledtask)
{
$titleassigntask = $langs->trans("AssignTaskToMe");
if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...');
@@ -1383,7 +1383,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
// Warning
print ' ';
if ((! $lines[$i]->public) && $disabledproject) print $form->textwithpicto('',$langs->trans("UserIsNotContactOfProject"));
- else if ($disabledtask)
+ elseif ($disabledtask)
{
$titleassigntask = $langs->trans("AssignTaskToMe");
if ($fuser->id != $user->id) $titleassigntask = $langs->trans("AssignTaskToUser", '...');
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index 573be47c8df..318e93d31ce 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -125,12 +125,12 @@ function dol_hash($chain, $type = '0')
if (! empty($conf->global->MAIN_SECURITY_SALT)) $chain=$conf->global->MAIN_SECURITY_SALT.$chain;
if ($type == '1' || $type == 'sha1') return sha1($chain);
- else if ($type == '2' || $type == 'sha1md5') return sha1(md5($chain));
- else if ($type == '3' || $type == 'md5') return md5($chain);
- else if ($type == '4' || $type == 'md5openldap') return '{md5}'.base64_encode(mhash(MHASH_MD5,$chain)); // For OpenLdap with md5 (based on an unencrypted password in base)
- else if ($type == '5') return hash('sha256',$chain);
- else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
- else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
+ elseif ($type == '2' || $type == 'sha1md5') return sha1(md5($chain));
+ elseif ($type == '3' || $type == 'md5') return md5($chain);
+ elseif ($type == '4' || $type == 'md5openldap') return '{md5}'.base64_encode(mhash(MHASH_MD5,$chain)); // For OpenLdap with md5 (based on an unencrypted password in base)
+ elseif ($type == '5') return hash('sha256',$chain);
+ elseif (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
+ elseif (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
// No particular encoding defined, use default
return md5($chain);
@@ -153,8 +153,8 @@ function dol_verifyHash($chain, $hash, $type = '0')
if ($type == '0' && ! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'password_hash' && function_exists('password_verify')) {
if ($hash[0] == '$') return password_verify($chain, $hash);
- else if(strlen($hash) == 32) return dol_verifyHash($chain, $hash, '3'); // md5
- else if(strlen($hash) == 40) return dol_verifyHash($chain, $hash, '2'); // sha1md5
+ elseif(strlen($hash) == 32) return dol_verifyHash($chain, $hash, '3'); // md5
+ elseif(strlen($hash) == 40) return dol_verifyHash($chain, $hash, '2'); // sha1md5
return false;
}
@@ -199,7 +199,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
// Features/modules to check
$featuresarray = array($features);
if (preg_match('/&/', $features)) $featuresarray = explode("&", $features);
- else if (preg_match('/\|/', $features)) $featuresarray = explode("|", $features);
+ elseif (preg_match('/\|/', $features)) $featuresarray = explode("|", $features);
// More subfeatures to check
if (! empty($feature2)) $feature2 = explode("|", $feature2);
@@ -227,34 +227,34 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
{
if (! $user->rights->societe->lire && ! $user->rights->fournisseur->lire) { $readok=0; $nbko++; }
}
- else if ($feature == 'contact')
+ elseif ($feature == 'contact')
{
if (! $user->rights->societe->contact->lire) { $readok=0; $nbko++; }
}
- else if ($feature == 'produit|service')
+ elseif ($feature == 'produit|service')
{
if (! $user->rights->produit->lire && ! $user->rights->service->lire) { $readok=0; $nbko++; }
}
- else if ($feature == 'prelevement')
+ elseif ($feature == 'prelevement')
{
if (! $user->rights->prelevement->bons->lire) { $readok=0; $nbko++; }
}
- else if ($feature == 'cheque')
+ elseif ($feature == 'cheque')
{
if (! $user->rights->banque->cheque) { $readok=0; $nbko++; }
}
- else if ($feature == 'projet')
+ elseif ($feature == 'projet')
{
if (! $user->rights->projet->lire && ! $user->rights->projet->all->lire) { $readok=0; $nbko++; }
}
- else if (! empty($feature2)) // This should be used for future changes
+ elseif (! empty($feature2)) // This should be used for future changes
{
$tmpreadok=1;
foreach($feature2 as $subfeature)
{
if ($subfeature == 'user' && $user->id == $objectid) continue; // A user can always read its own card
if (! empty($subfeature) && empty($user->rights->$feature->$subfeature->lire) && empty($user->rights->$feature->$subfeature->read)) { $tmpreadok=0; }
- else if (empty($subfeature) && empty($user->rights->$feature->lire) && empty($user->rights->$feature->read)) { $tmpreadok=0; }
+ elseif (empty($subfeature) && empty($user->rights->$feature->lire) && empty($user->rights->$feature->read)) { $tmpreadok=0; }
else { $tmpreadok=1; break; } // Break is to bypass second test if the first is ok
}
if (! $tmpreadok) // We found a test on feature that is ko
@@ -263,7 +263,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
$nbko++;
}
}
- else if (! empty($feature) && ($feature!='user' && $feature!='usergroup')) // This is for old permissions
+ elseif (! empty($feature) && ($feature!='user' && $feature!='usergroup')) // This is for old permissions
{
if (empty($user->rights->$feature->lire)
&& empty($user->rights->$feature->read)
@@ -287,27 +287,27 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
{
if (! $user->rights->societe->contact->creer) { $createok=0; $nbko++; }
}
- else if ($feature == 'produit|service')
+ elseif ($feature == 'produit|service')
{
if (! $user->rights->produit->creer && ! $user->rights->service->creer) { $createok=0; $nbko++; }
}
- else if ($feature == 'prelevement')
+ elseif ($feature == 'prelevement')
{
if (! $user->rights->prelevement->bons->creer) { $createok=0; $nbko++; }
}
- else if ($feature == 'commande_fournisseur')
+ elseif ($feature == 'commande_fournisseur')
{
if (! $user->rights->fournisseur->commande->creer) { $createok=0; $nbko++; }
}
- else if ($feature == 'banque')
+ elseif ($feature == 'banque')
{
if (! $user->rights->banque->modifier) { $createok=0; $nbko++; }
}
- else if ($feature == 'cheque')
+ elseif ($feature == 'cheque')
{
if (! $user->rights->banque->cheque) { $createok=0; $nbko++; }
}
- else if (! empty($feature2)) // This should be used
+ elseif (! empty($feature2)) // This should be used
{
foreach($feature2 as $subfeature)
{
@@ -317,7 +317,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
else { $createok=1; break; } // Break to bypass second test if the first is ok
}
}
- else if (! empty($feature)) // This is for old permissions ('creer' or 'write')
+ elseif (! empty($feature)) // This is for old permissions ('creer' or 'write')
{
//print ' feature='.$feature.' creer='.$user->rights->$feature->creer.' write='.$user->rights->$feature->write;
if (empty($user->rights->$feature->creer)
@@ -353,38 +353,38 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
{
if (! $user->rights->societe->contact->supprimer) $deleteok=0;
}
- else if ($feature == 'produit|service')
+ elseif ($feature == 'produit|service')
{
if (! $user->rights->produit->supprimer && ! $user->rights->service->supprimer) $deleteok=0;
}
- else if ($feature == 'commande_fournisseur')
+ elseif ($feature == 'commande_fournisseur')
{
if (! $user->rights->fournisseur->commande->supprimer) $deleteok=0;
}
- else if ($feature == 'banque')
+ elseif ($feature == 'banque')
{
if (! $user->rights->banque->modifier) $deleteok=0;
}
- else if ($feature == 'cheque')
+ elseif ($feature == 'cheque')
{
if (! $user->rights->banque->cheque) $deleteok=0;
}
- else if ($feature == 'ecm')
+ elseif ($feature == 'ecm')
{
if (! $user->rights->ecm->upload) $deleteok=0;
}
- else if ($feature == 'ftp')
+ elseif ($feature == 'ftp')
{
if (! $user->rights->ftp->write) $deleteok=0;
- }else if ($feature == 'salaries')
+ }elseif ($feature == 'salaries')
{
if (! $user->rights->salaries->delete) $deleteok=0;
}
- else if ($feature == 'salaries')
+ elseif ($feature == 'salaries')
{
if (! $user->rights->salaries->delete) $deleteok=0;
}
- else if (! empty($feature2)) // This should be used for permissions on 2 levels
+ elseif (! empty($feature2)) // This should be used for permissions on 2 levels
{
foreach($feature2 as $subfeature)
{
@@ -392,7 +392,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
else { $deleteok=1; break; } // For bypass the second test if the first is ok
}
}
- else if (! empty($feature)) // This is used for permissions on 1 level
+ elseif (! empty($feature)) // This is used for permissions on 1 level
{
//print ' feature='.$feature.' creer='.$user->rights->$feature->supprimer.' write='.$user->rights->$feature->delete;
if (empty($user->rights->$feature->supprimer)
@@ -500,7 +500,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
}
}
- else if (in_array($feature,$checksoc)) // We check feature = checksoc
+ elseif (in_array($feature,$checksoc)) // We check feature = checksoc
{
// If external user: Check permission for external users
if ($user->socid > 0)
@@ -508,7 +508,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
if ($user->socid <> $objectid) return false;
}
// If internal user: Check permission for internal users that are restricted on their objects
- else if (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir))
+ elseif (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir))
{
$sql = "SELECT COUNT(sc.fk_soc) as nb";
$sql.= " FROM (".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -519,7 +519,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql.= " AND s.entity IN (".getEntity($sharedelement, 1).")";
}
// If multicompany and internal users with all permissions, check user is in correct entity
- else if (! empty($conf->multicompany->enabled))
+ elseif (! empty($conf->multicompany->enabled))
{
$sql = "SELECT COUNT(s.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@@ -527,7 +527,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql.= " AND s.entity IN (".getEntity($sharedelement, 1).")";
}
}
- else if (in_array($feature,$checkother)) // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...).
+ elseif (in_array($feature,$checkother)) // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...).
{
// If external user: Check permission for external users
if ($user->socid > 0)
@@ -538,7 +538,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql.= " AND dbt.fk_soc = ".$user->socid;
}
// If internal user: Check permission for internal users that are restricted on their objects
- else if (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir))
+ elseif (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir))
{
$sql = "SELECT COUNT(dbt.".$dbt_select.") as nb";
$sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
@@ -548,7 +548,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
}
// If multicompany and internal users with all permissions, check user is in correct entity
- else if (! empty($conf->multicompany->enabled))
+ elseif (! empty($conf->multicompany->enabled))
{
$sql = "SELECT COUNT(dbt.".$dbt_select.") as nb";
$sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
@@ -556,7 +556,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
}
}
- else if (in_array($feature,$checkproject))
+ elseif (in_array($feature,$checkproject))
{
if (! empty($conf->projet->enabled) && empty($user->rights->projet->all->lire))
{
@@ -574,7 +574,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
}
}
- else if (in_array($feature,$checktask))
+ elseif (in_array($feature,$checktask))
{
if (! empty($conf->projet->enabled) && empty($user->rights->projet->all->lire))
{
@@ -595,7 +595,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
}
}
- else if (! in_array($feature,$nocheck)) // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield
+ elseif (! in_array($feature,$nocheck)) // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield
{
// If external user: Check permission for external users
if ($user->socid > 0)
@@ -607,7 +607,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql.= " AND dbt.".$dbt_keyfield." = ".$user->socid;
}
// If internal user: Check permission for internal users that are restricted on their objects
- else if (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir))
+ elseif (! empty($conf->societe->enabled) && ($user->rights->societe->lire && ! $user->rights->societe->client->voir))
{
if (empty($dbt_keyfield)) dol_print_error('','Param dbt_keyfield is required but not defined');
$sql = "SELECT COUNT(sc.fk_soc) as nb";
@@ -621,7 +621,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql.= " AND sc.fk_user = ".$user->id;
}
// If multicompany and internal users with all permissions, check user is in correct entity
- else if (! empty($conf->multicompany->enabled))
+ elseif (! empty($conf->multicompany->enabled))
{
$sql = "SELECT COUNT(dbt.".$dbt_select.") as nb";
$sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
@@ -672,7 +672,7 @@ function accessforbidden($message = '', $printheader = 1, $printfooter = 1, $sho
if ($printheader)
{
if (function_exists("llxHeader")) llxHeader('');
- else if (function_exists("llxHeaderVierge")) llxHeaderVierge('');
+ elseif (function_exists("llxHeaderVierge")) llxHeaderVierge('');
}
print '';
if (! $message) print $langs->trans("ErrorForbidden");
diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php
index 313574f6d72..ec41d534871 100644
--- a/htdocs/core/lib/security2.lib.php
+++ b/htdocs/core/lib/security2.lib.php
@@ -498,7 +498,7 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null)
$generated_password=str_shuffle($randomCode);
}
}
- else if (! empty($conf->global->USER_PASSWORD_GENERATED))
+ elseif (! empty($conf->global->USER_PASSWORD_GENERATED))
{
$nomclass="modGeneratePass".ucfirst($conf->global->USER_PASSWORD_GENERATED);
$nomfichier=$nomclass.".class.php";
diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php
index e45afe65af1..6d945c6df42 100644
--- a/htdocs/core/lib/tax.lib.php
+++ b/htdocs/core/lib/tax.lib.php
@@ -163,7 +163,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
$sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
}
- else if ($y)
+ elseif ($y)
{
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'";
@@ -204,7 +204,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
$sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
$sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
}
- else if ($y)
+ elseif ($y)
{
$sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'";
@@ -311,7 +311,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
$sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
}
- else if ($y)
+ elseif ($y)
{
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'";
@@ -352,7 +352,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
$sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
$sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
}
- else if ($y)
+ elseif ($y)
{
$sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'";
@@ -456,7 +456,7 @@ function tax_by_thirdparty($type, $db, $y, $date_start, $date_end, $modetax, $di
$sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
$sql.= " AND p.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
}
- else if ($y)
+ elseif ($y)
{
$sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND p.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'";
@@ -632,7 +632,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
$sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
}
- else if ($y)
+ elseif ($y)
{
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'";
@@ -673,7 +673,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
$sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
$sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
}
- else if ($y)
+ elseif ($y)
{
$sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'";
@@ -780,7 +780,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
$sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
}
- else if ($y)
+ elseif ($y)
{
$sql.= " AND f.datef >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND f.datef <= '".$db->idate(dol_get_last_day($y,12,false))."'";
@@ -821,7 +821,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
$sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
$sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
}
- else if ($y)
+ elseif ($y)
{
$sql.= " AND pa.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND pa.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'";
@@ -925,7 +925,7 @@ function tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $dire
$sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($y,$m,false))."'";
$sql.= " AND p.datep <= '".$db->idate(dol_get_last_day($y,$m,false))."'";
}
- else if ($y)
+ elseif ($y)
{
$sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'";
$sql.= " AND p.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'";
diff --git a/htdocs/core/lib/ws.lib.php b/htdocs/core/lib/ws.lib.php
index 89e8f0da5bd..58157e99bce 100644
--- a/htdocs/core/lib/ws.lib.php
+++ b/htdocs/core/lib/ws.lib.php
@@ -59,7 +59,7 @@ function check_authentication($authentication, &$error, &$errorcode, &$errorlabe
$error++;
$errorcode='ERROR_FETCH_USER'; $errorlabel='A technical error occurred during fetch of user';
}
- else if ($result == 0)
+ elseif ($result == 0)
{
$error++;
$errorcode='BAD_CREDENTIALS'; $errorlabel='Bad value for login or password';
diff --git a/htdocs/core/login/functions_openid.php b/htdocs/core/login/functions_openid.php
index ffba9c09fb6..0aed40186c5 100644
--- a/htdocs/core/login/functions_openid.php
+++ b/htdocs/core/login/functions_openid.php
@@ -90,7 +90,7 @@ function check_user_password_openid($usertotest, $passwordtotest, $entitytotest)
}
}
}
- else if($openid->IsError() === true)
+ elseif($openid->IsError() === true)
{
// ON THE WAY, WE GOT SOME ERROR
$error = $openid->GetError();
@@ -103,7 +103,7 @@ function check_user_password_openid($usertotest, $passwordtotest, $entitytotest)
return false;
}
}
- else if ($_GET['openid_mode'] == 'cancel')
+ elseif ($_GET['openid_mode'] == 'cancel')
{
// User Canceled your Request
//echo "USER CANCELED REQUEST";
diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php
index f6275348f07..dbd538d1543 100644
--- a/htdocs/core/menus/standard/auguria.lib.php
+++ b/htdocs/core/menus/standard/auguria.lib.php
@@ -112,10 +112,10 @@ function print_auguria_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout
// Define the class (top menu selected or not)
if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
- else if (! empty($_SESSION["mainmenu"]) && $newTabMenu[$i]['mainmenu'] == $_SESSION["mainmenu"]) $classname='class="tmenusel"';
+ elseif (! empty($_SESSION["mainmenu"]) && $newTabMenu[$i]['mainmenu'] == $_SESSION["mainmenu"]) $classname='class="tmenusel"';
else $classname='class="tmenu"';
}
- else if ($showmode == 2) $classname='class="tmenu"';
+ elseif ($showmode == 2) $classname='class="tmenu"';
$menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), ($newTabMenu[$i]['mainmenu']?$newTabMenu[$i]['mainmenu']:$newTabMenu[$i]['rowid']), ($newTabMenu[$i]['leftmenu']?$newTabMenu[$i]['leftmenu']:''), $newTabMenu[$i]['position'], $id, $idsel, $classname);
}
@@ -550,7 +550,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
print '
'."\n";
$lastlevel0='enabled';
}
- else if ($showmenu) // Not enabled but visible (so greyed)
+ elseif ($showmenu) // Not enabled but visible (so greyed)
{
print ''."\n";
$lastlevel0='greyed';
@@ -583,7 +583,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
if (! strstr($menu_array[$i]['titre'],'';
print ''."\n";
}
- else if ($showmenu && $lastlevel0 == 'enabled') // Not enabled but visible (so greyed), except if parent was not enabled.
+ elseif ($showmenu && $lastlevel0 == 'enabled') // Not enabled but visible (so greyed), except if parent was not enabled.
{
print ''."\n";
}
diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php
index 8427ca3085c..8b44046b8b9 100644
--- a/htdocs/core/menus/standard/auguria_menu.php
+++ b/htdocs/core/menus/standard/auguria_menu.php
@@ -210,7 +210,7 @@ class MenuManager
{
$lastlevel[0]='enabled';
}
- else if ($showmenu) // Not enabled but visible (so greyed)
+ elseif ($showmenu) // Not enabled but visible (so greyed)
{
$lastlevel[0]='greyed';
}
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 01ca42c9084..fa93c89115b 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -341,10 +341,10 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Define the class (top menu selected or not)
if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
- else if (! empty($_SESSION["mainmenu"]) && $newTabMenu[$i]['mainmenu'] == $_SESSION["mainmenu"]) $classname='class="tmenusel"';
+ elseif (! empty($_SESSION["mainmenu"]) && $newTabMenu[$i]['mainmenu'] == $_SESSION["mainmenu"]) $classname='class="tmenusel"';
else $classname='class="tmenu"';
}
- else if ($showmode == 2) $classname='class="tmenu"';
+ elseif ($showmode == 2) $classname='class="tmenu"';
$menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target']?$newTabMenu[$i]['target']:$atarget), ($newTabMenu[$i]['mainmenu']?$newTabMenu[$i]['mainmenu']:$newTabMenu[$i]['rowid']), ($newTabMenu[$i]['leftmenu']?$newTabMenu[$i]['leftmenu']:''), $newTabMenu[$i]['position'], $id, $idsel, $classname);
}
@@ -1837,7 +1837,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
print ''."\n";
$lastlevel0='enabled';
}
- else if ($showmenu) // Not enabled but visible (so greyed)
+ elseif ($showmenu) // Not enabled but visible (so greyed)
{
print ''."\n";
$lastlevel0='greyed';
@@ -1870,7 +1870,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if (! strstr($menu_array[$i]['titre'],'';
print ''."\n";
}
- else if ($showmenu && $lastlevel0 == 'enabled') // Not enabled but visible (so greyed), except if parent was not enabled.
+ elseif ($showmenu && $lastlevel0 == 'enabled') // Not enabled but visible (so greyed), except if parent was not enabled.
{
print ''."\n";
}
diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php
index 7fae44b445f..834cef65447 100644
--- a/htdocs/core/menus/standard/eldy_menu.php
+++ b/htdocs/core/menus/standard/eldy_menu.php
@@ -225,7 +225,7 @@ class MenuManager
{
$lastlevel[0]='enabled';
}
- else if ($showmenu) // Not enabled but visible (so greyed)
+ elseif ($showmenu) // Not enabled but visible (so greyed)
{
$lastlevel[0]='greyed';
}
diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php
index 99acddd70ec..78417b9bd60 100644
--- a/htdocs/core/menus/standard/empty.php
+++ b/htdocs/core/menus/standard/empty.php
@@ -225,7 +225,7 @@ class MenuManager
{
$lastlevel[0]='enabled';
}
- else if ($showmenu) // Not enabled but visible (so greyed)
+ elseif ($showmenu) // Not enabled but visible (so greyed)
{
$lastlevel[0]='greyed';
}
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 441f73369ca..76033d4c0cb 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -2109,7 +2109,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
if (isset($value['entity'])) { $entity = $value['entity'];
}
}
- else if (isset($value['data']) && !is_array($value['data'])) {
+ elseif (isset($value['data']) && !is_array($value['data'])) {
$newvalue = $value['data'];
if (isset($value['entity'])) { $entity = $value['entity'];
}
diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php
index e58d51135e1..f6eff1e2c5d 100644
--- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php
+++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php
@@ -255,7 +255,7 @@ class modTcpdfbarcode extends ModeleBarCode
if (array_key_exists($dolEncodingType, $tcpdf1dEncodingTypes)) {
$this->is2d = false;
return $tcpdf1dEncodingTypes[$dolEncodingType];
- } else if (array_key_exists($dolEncodingType, $tcpdf2dEncodingTypes)) {
+ } elseif (array_key_exists($dolEncodingType, $tcpdf2dEncodingTypes)) {
$this->is2d = true;
return $tcpdf2dEncodingTypes[$dolEncodingType];
} else {
diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
index 58271615683..50b630ab088 100644
--- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php
+++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
@@ -199,7 +199,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
{
$result=0;
}
- else if (empty($code) && (! $this->code_null || ! empty($conf->global->BARCODE_STANDARD_PRODUCT_MASK)) )
+ elseif (empty($code) && (! $this->code_null || ! empty($conf->global->BARCODE_STANDARD_PRODUCT_MASK)) )
{
$result=-2;
}
diff --git a/htdocs/core/modules/contract/mod_contract_olive.php b/htdocs/core/modules/contract/mod_contract_olive.php
index 509ece14278..2d8cfba3282 100644
--- a/htdocs/core/modules/contract/mod_contract_olive.php
+++ b/htdocs/core/modules/contract/mod_contract_olive.php
@@ -112,7 +112,7 @@ class mod_contract_olive extends ModelNumRefContracts
{
$result=0;
}
- else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED)) )
+ elseif (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED)) )
{
$result=-2;
}
diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php
index e19e8d6839f..faf5b00d2c7 100644
--- a/htdocs/core/modules/dons/html_cerfafr.modules.php
+++ b/htdocs/core/modules/dons/html_cerfafr.modules.php
@@ -136,10 +136,10 @@ class html_cerfafr extends ModeleDon
if ($don->modepaymentcode=='CHQ'){
$ModePaiement = ' Remise d\'espèces Chèque Virement, prélèvement, carte bancaire ';
}
- else if ($don->modepaymentcode=='LIQ'){
+ elseif ($don->modepaymentcode=='LIQ'){
$ModePaiement = ' Remise d\'espèces Chèque Virement, prélèvement, carte bancaire ';
}
- else if ($don->modepaymentcode=='VIR' || $don->modepaymentcode=='PRE' || $don->modepaymentcode=='CB'){
+ elseif ($don->modepaymentcode=='VIR' || $don->modepaymentcode=='PRE' || $don->modepaymentcode=='CB'){
$ModePaiement = ' Remise d\'espèces Chèque Virement, prélèvement, carte bancaire ';
}
else
@@ -316,11 +316,11 @@ class html_cerfafr extends ModeleDon
$secon[$i]='';
$prim[$i]=$chif[$unite[$i]];
}
- else if($dix[$i]==1){
+ elseif($dix[$i]==1){
$secon[$i]='';
$prim[$i]=$chif[($unite[$i]+10)];
}
- else if($dix[$i]==2){
+ elseif($dix[$i]==2){
if($unite[$i]==1){
$secon[$i]='vingt et';
$prim[$i]=$chif[$unite[$i]];
@@ -330,7 +330,7 @@ class html_cerfafr extends ModeleDon
$prim[$i]=$chif[$unite[$i]];
}
}
- else if($dix[$i]==3){
+ elseif($dix[$i]==3){
if($unite[$i]==1){
$secon[$i]='trente et';
$prim[$i]=$chif[$unite[$i]];
@@ -340,7 +340,7 @@ class html_cerfafr extends ModeleDon
$prim[$i]=$chif[$unite[$i]];
}
}
- else if($dix[$i]==4){
+ elseif($dix[$i]==4){
if($unite[$i]==1){
$secon[$i]='quarante et';
$prim[$i]=$chif[$unite[$i]];
@@ -350,7 +350,7 @@ class html_cerfafr extends ModeleDon
$prim[$i]=$chif[$unite[$i]];
}
}
- else if($dix[$i]==5){
+ elseif($dix[$i]==5){
if($unite[$i]==1){
$secon[$i]='cinquante et';
$prim[$i]=$chif[$unite[$i]];
@@ -360,7 +360,7 @@ class html_cerfafr extends ModeleDon
$prim[$i]=$chif[$unite[$i]];
}
}
- else if($dix[$i]==6){
+ elseif($dix[$i]==6){
if($unite[$i]==1){
$secon[$i]='soixante et';
$prim[$i]=$chif[$unite[$i]];
@@ -370,7 +370,7 @@ class html_cerfafr extends ModeleDon
$prim[$i]=$chif[$unite[$i]];
}
}
- else if($dix[$i]==7){
+ elseif($dix[$i]==7){
if($unite[$i]==1){
$secon[$i]='soixante et';
$prim[$i]=$chif[$unite[$i]+10];
@@ -380,7 +380,7 @@ class html_cerfafr extends ModeleDon
$prim[$i]=$chif[$unite[$i]+10];
}
}
- else if($dix[$i]==8){
+ elseif($dix[$i]==8){
if($unite[$i]==1){
$secon[$i]='quatre-vingts et';
$prim[$i]=$chif[$unite[$i]];
@@ -390,7 +390,7 @@ class html_cerfafr extends ModeleDon
$prim[$i]=$chif[$unite[$i]];
}
}
- else if($dix[$i]==9){
+ elseif($dix[$i]==9){
if($unite[$i]==1){
$secon[$i]='quatre-vingts et';
$prim[$i]=$chif[$unite[$i]+10];
@@ -401,25 +401,25 @@ class html_cerfafr extends ModeleDon
}
}
if($cent[$i]==1) $trio[$i]='cent';
- else if($cent[$i]!=0 || $cent[$i]!='') $trio[$i]=$chif[$cent[$i]] .' cents';
+ elseif($cent[$i]!=0 || $cent[$i]!='') $trio[$i]=$chif[$cent[$i]] .' cents';
}
$chif2=array('', 'dix', 'vingt', 'trente', 'quarante', 'cinquante', 'soixante', 'soixante-dix', 'quatre-vingts', 'quatre-vingts dix');
$secon_c=$chif2[$dix_c];
if($cent_c==1) $trio_c='cent';
- else if($cent_c!=0 || $cent_c!='') $trio_c=$chif[$cent_c] .' cents';
+ elseif($cent_c!=0 || $cent_c!='') $trio_c=$chif[$cent_c] .' cents';
if(($cent[3]==0 || $cent[3]=='') && ($dix[3]==0 || $dix[3]=='') && ($unite[3]==1))
$somme = $trio[3]. ' ' .$secon[3]. ' ' . $prim[3]. ' million ';
- else if(($cent[3]!=0 && $cent[3]!='') || ($dix[3]!=0 && $dix[3]!='') || ($unite[3]!=0 && $unite[3]!=''))
+ elseif(($cent[3]!=0 && $cent[3]!='') || ($dix[3]!=0 && $dix[3]!='') || ($unite[3]!=0 && $unite[3]!=''))
$somme = $trio[3]. ' ' .$secon[3]. ' ' . $prim[3]. ' millions ';
else
$somme = $trio[3]. ' ' .$secon[3]. ' ' . $prim[3];
if(($cent[2]==0 || $cent[2]=='') && ($dix[2]==0 || $dix[2]=='') && ($unite[2]==1))
$somme = $somme.' mille ';
- else if(($cent[2]!=0 && $cent[2]!='') || ($dix[2]!=0 && $dix[2]!='') || ($unite[2]!=0 && $unite[2]!=''))
+ elseif(($cent[2]!=0 && $cent[2]!='') || ($dix[2]!=0 && $dix[2]!='') || ($unite[2]!=0 && $unite[2]!=''))
$somme = $somme. $trio[2]. ' ' .$secon[2]. ' ' . $prim[2]. ' milles ';
else
$somme = $somme. $trio[2]. ' ' .$secon[2]. ' ' . $prim[2];
diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
index 644062c3077..ec65dd80f93 100644
--- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
+++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php
@@ -780,7 +780,7 @@ class pdf_standard extends ModeleExpenseReport
$pdf->MultiCell(96,4,$outputlangs->transnoentities("DATE_REFUS")." : ".dol_print_date($object->date_refuse,"day",false,$outputlangs),0,'L');
}
}
- else if($object->fk_statut==4)
+ elseif($object->fk_statut==4)
{
if ($object->fk_user_cancel > 0) {
$userfee=new User($this->db);
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 8365114bbad..8e2b5a8b198 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -572,7 +572,7 @@ class pdf_crabe extends ModelePDFFactures
{
$pdf->MultiCell($this->posxprogress-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
- else if($conf->global->PRODUCT_USE_UNITS)
+ elseif($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-0.8, 4, $qty, 0, 'R');
}
@@ -590,7 +590,7 @@ class pdf_crabe extends ModelePDFFactures
{
$pdf->MultiCell($this->posxunit-$this->posxprogress-1, 3, $progress, 0, 'R');
}
- else if ($this->atleastonediscount)
+ elseif ($this->atleastonediscount)
{
$pdf->MultiCell($this->posxdiscount-$this->posxprogress-1, 3, $progress, 0, 'R');
}
@@ -1486,7 +1486,7 @@ class pdf_crabe extends ModelePDFFactures
{
$pdf->MultiCell($this->posxprogress-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
- else if($conf->global->PRODUCT_USE_UNITS)
+ elseif($conf->global->PRODUCT_USE_UNITS)
{
$pdf->MultiCell($this->posxunit-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
}
@@ -1507,7 +1507,7 @@ class pdf_crabe extends ModelePDFFactures
{
$pdf->MultiCell($this->posxunit-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
}
- else if ($this->atleastonediscount)
+ elseif ($this->atleastonediscount)
{
$pdf->MultiCell($this->posxdiscount-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C');
}
diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php
index 9d67bdc96dc..1c02c646f9f 100644
--- a/htdocs/core/modules/facture/mod_facture_mars.php
+++ b/htdocs/core/modules/facture/mod_facture_mars.php
@@ -155,8 +155,8 @@ class mod_facture_mars extends ModeleNumRefFactures
$prefix=$this->prefixinvoice;
if ($invoice->type == 1) $prefix=$this->prefixreplacement;
- else if ($invoice->type == 2) $prefix=$this->prefixcreditnote;
- else if ($invoice->type == 3) $prefix=$this->prefixdeposit;
+ elseif ($invoice->type == 2) $prefix=$this->prefixcreditnote;
+ elseif ($invoice->type == 3) $prefix=$this->prefixdeposit;
else $prefix=$this->prefixinvoice;
// D'abord on recupere la valeur max
@@ -201,7 +201,7 @@ class mod_facture_mars extends ModeleNumRefFactures
return $ref;
}
- else if ($mode == 'next')
+ elseif ($mode == 'next')
{
$date=$invoice->date; // This is invoice date (not creation date)
$yymm = strftime("%y%m",$date);
diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php
index ccd763eec33..43f98ef6698 100644
--- a/htdocs/core/modules/facture/mod_facture_mercure.php
+++ b/htdocs/core/modules/facture/mod_facture_mercure.php
@@ -151,8 +151,8 @@ class mod_facture_mercure extends ModeleNumRefFactures
$mask=$conf->global->FACTURE_MERCURE_MASK_INVOICE;
}
}
- else if (is_object($invoice) && $invoice->type == 2) $mask=$conf->global->FACTURE_MERCURE_MASK_CREDIT;
- else if (is_object($invoice) && $invoice->type == 3) $mask=$conf->global->FACTURE_MERCURE_MASK_DEPOSIT;
+ elseif (is_object($invoice) && $invoice->type == 2) $mask=$conf->global->FACTURE_MERCURE_MASK_CREDIT;
+ elseif (is_object($invoice) && $invoice->type == 3) $mask=$conf->global->FACTURE_MERCURE_MASK_DEPOSIT;
else $mask=$conf->global->FACTURE_MERCURE_MASK_INVOICE;
if (! $mask)
{
diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php
index f04addb657d..7e8671cc652 100644
--- a/htdocs/core/modules/facture/mod_facture_terre.php
+++ b/htdocs/core/modules/facture/mod_facture_terre.php
@@ -172,7 +172,7 @@ class mod_facture_terre extends ModeleNumRefFactures
global $db;
if ($invoice->type == 2) $prefix=$this->prefixcreditnote;
- else if ($invoice->type == 3) $prefix=$this->prefixdeposit;
+ elseif ($invoice->type == 3) $prefix=$this->prefixdeposit;
else $prefix=$this->prefixinvoice;
// D'abord on recupere la valeur max
$posindice=8;
@@ -216,7 +216,7 @@ class mod_facture_terre extends ModeleNumRefFactures
return $ref;
}
- else if ($mode == 'next')
+ elseif ($mode == 'next')
{
$date=$invoice->date; // This is invoice date (not creation date)
$yymm = strftime("%y%m",$date);
diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index 797f9c86227..81170fc49aa 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -458,7 +458,7 @@ class ImportCsv extends ModeleImports
else
{
if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldValueNotIn',$key,$newval,'code',$langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
- else if (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldRefNotIn',$key,$newval,$langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element']));
+ elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldRefNotIn',$key,$newval,$langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element']));
else $this->errors[$error]['lib']='ErrorFieldValueNotIn';
$this->errors[$error]['type']='FOREIGNKEY';
$errorforthistable++;
@@ -577,7 +577,7 @@ class ImportCsv extends ModeleImports
}
}
// If test is just a static regex
- else if (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i',$newval))
+ elseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i',$newval))
{
//if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]." ";
$this->errors[$error]['lib']=$langs->transnoentitiesnoconv('ErrorWrongValueForField',$key,$newval,$objimport->array_import_regex[0][$val]);
@@ -664,7 +664,7 @@ class ImportCsv extends ModeleImports
if($resql->num_rows == 1) {
$lastinsertid = $res->rowid;
$last_insert_id_array[$tablename] = $lastinsertid;
- } else if($resql->num_rows > 1) {
+ } elseif($resql->num_rows > 1) {
$this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode($filters, ', '));
$this->errors[$error]['type']='SQL';
$error++;
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index beb6b66c479..56fdef5726a 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -485,7 +485,7 @@ class ImportXlsx extends ModeleImports
else
{
if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldValueNotIn',$key,$newval,'code',$langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));
- else if (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldRefNotIn',$key,$newval,$langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element']));
+ elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldRefNotIn',$key,$newval,$langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element']));
else $this->errors[$error]['lib']='ErrorFieldValueNotIn';
$this->errors[$error]['type']='FOREIGNKEY';
$errorforthistable++;
@@ -604,7 +604,7 @@ class ImportXlsx extends ModeleImports
}
}
// If test is just a static regex
- else if (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i',$newval))
+ elseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i',$newval))
{
//if ($key == 19) print "xxx".$newval."zzz".$objimport->array_import_regex[0][$val]." ";
$this->errors[$error]['lib']=$langs->transnoentitiesnoconv('ErrorWrongValueForField',$key,$newval,$objimport->array_import_regex[0][$val]);
@@ -686,7 +686,7 @@ class ImportXlsx extends ModeleImports
if($resql->num_rows == 1) {
$lastinsertid = $res->rowid;
$last_insert_id_array[$tablename] = $lastinsertid;
- } else if($resql->num_rows > 1) {
+ } elseif($resql->num_rows > 1) {
$this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode($filters, ', '));
$this->errors[$error]['type']='SQL';
$error++;
diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php
index ee94516a44c..5c246eecb08 100644
--- a/htdocs/core/modules/mailings/xinputfile.modules.php
+++ b/htdocs/core/modules/mailings/xinputfile.modules.php
@@ -206,7 +206,7 @@ class mailing_xinputfile extends MailingTargets
{
$this->error = ''.$langs->trans("ErrorFileNotUploaded").'
';
}
- else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
+ elseif (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
{
$this->error = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
}
diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php
index e6c023823fd..d11c37e9595 100644
--- a/htdocs/core/modules/member/doc/pdf_standard.class.php
+++ b/htdocs/core/modules/member/doc/pdf_standard.class.php
@@ -165,26 +165,26 @@ class pdf_standard extends CommonStickerGenerator
{
// Output left area
if ($textleft == '__LOGO__' && $logo) $pdf->Image($logo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
- else if ($textleft == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
+ elseif ($textleft == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
else
{
$pdf->SetXY($_PosX+$xleft, $_PosY+$ytop);
$pdf->MultiCell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft),0,'L');
}
}
- else if ($textleft!='' && $textright!='') //
+ elseif ($textleft!='' && $textright!='') //
{
if ($textleft == '__LOGO__' || $textleft == '__PHOTO__')
{
if ($textleft == '__LOGO__' && $logo) $pdf->Image($logo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
- else if ($textleft == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
+ elseif ($textleft == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
$pdf->SetXY($_PosX+$xleft+$widthtouse+1, $_PosY+$ytop);
$pdf->MultiCell($this->_Width-$xleft-$xleft-$widthtouse-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright),0,'R');
}
- else if ($textright == '__LOGO__' || $textright == '__PHOTO__')
+ elseif ($textright == '__LOGO__' || $textright == '__PHOTO__')
{
if ($textright == '__LOGO__' && $logo) $pdf->Image($logo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
- else if ($textright == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
+ elseif ($textright == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
$pdf->SetXY($_PosX+$xleft, $_PosY+$ytop);
$pdf->MultiCell($this->_Width-$widthtouse-$xleft-$xleft-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft),0,'L');
}
@@ -200,7 +200,7 @@ class pdf_standard extends CommonStickerGenerator
{
// Output right area
if ($textright == '__LOGO__' && $logo) $pdf->Image($logo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
- else if ($textright == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
+ elseif ($textright == '__PHOTO__' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
else
{
$pdf->SetXY($_PosX+$xleft, $_PosY+$ytop);
diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
index ad848427c4d..b196a87c52b 100644
--- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
+++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
@@ -152,26 +152,26 @@ class pdf_standardlabel extends CommonStickerGenerator
{
// Output left area
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
- else if ($textleft == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
+ elseif ($textleft == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
else
{
$pdf->SetXY($_PosX+$xleft, $_PosY+$ytop);
$pdf->MultiCell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft),0,'L');
}
}
- else if ($textleft!='' && $textright!='') //
+ elseif ($textleft!='' && $textright!='') //
{
if ($textleft == '%LOGO%' || $textleft == '%PHOTO%')
{
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
- else if ($textleft == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
+ elseif ($textleft == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
$pdf->SetXY($_PosX+$xleft+$widthtouse+1, $_PosY+$ytop);
$pdf->MultiCell($this->_Width-$xleft-$xleft-$widthtouse-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright),0,'R');
}
- else if ($textright == '%LOGO%' || $textright == '%PHOTO%')
+ elseif ($textright == '%LOGO%' || $textright == '%PHOTO%')
{
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
- else if ($textright == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
+ elseif ($textright == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
$pdf->SetXY($_PosX+$xleft, $_PosY+$ytop);
$pdf->MultiCell($this->_Width-$widthtouse-$xleft-$xleft-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft),0,'L');
}
@@ -187,7 +187,7 @@ class pdf_standardlabel extends CommonStickerGenerator
{
// Output right area
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
- else if ($textright == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
+ elseif ($textright == '%PHOTO%' && $photo) $pdf->Image($photo,$_PosX+$this->_Width-$widthtouse-$xleft,$_PosY+$ytop,$widthtouse,$heighttouse);
else
{
$pdf->SetXY($_PosX+$xleft, $_PosY+$ytop);
diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php
index a83d490b7be..1ef90106810 100644
--- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php
+++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php
@@ -163,7 +163,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
{
// Output left area
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, 0, $logoHeight);
- else if ($code && !empty($encoding))
+ elseif ($code && !empty($encoding))
{
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft, $_PosY+$ytop, $widthtouse, $heighttouse);
}
@@ -173,29 +173,29 @@ class pdf_tcpdflabel extends CommonStickerGenerator
$pdf->MultiCell($this->_Width, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft),0,'L');
}
}
- else if ($textleft!='' && $textright!='') // left and right part
+ elseif ($textleft!='' && $textright!='') // left and right part
{
if (($textleft == '%LOGO%' || $textleft == '%PHOTO%' || $textleft == '%BARCODE%') && !strstr($textright, '%') ) // left part logo/barcode right part text
{
if ($textleft == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, 0);
- else if ($code && !empty($encoding))
+ elseif ($code && !empty($encoding))
{
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$xleft, $_PosY+$ytop, $widthtouse/2, $heighttouse);
}
$pdf->SetXY($_PosX+($widthtouse/2), $_PosY+$ytop);
$pdf->MultiCell($widthtouse/2, $this->_Line_Height, $outputlangs->convToOutputCharset($textright), 0, 'R');
}
- else if (($textright == '%LOGO%' || $textright == '%PHOTO%' || $textright == '%BARCODE%') && !strstr($textleft, '%')) // right part logo/barcode left part text
+ elseif (($textright == '%LOGO%' || $textright == '%PHOTO%' || $textright == '%BARCODE%') && !strstr($textleft, '%')) // right part logo/barcode left part text
{
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, 0);
- else if ($code && !empty($encoding))
+ elseif ($code && !empty($encoding))
{
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+($widthtouse/2), $_PosY+$ytop, $widthtouse/2, $heighttouse);
}
$pdf->SetXY($_PosX+$xleft, $_PosY+$ytop);
$pdf->MultiCell($widthtouse/2, $this->_Line_Height, $outputlangs->convToOutputCharset($textleft),0,'L');
}
- else if ($textleft == '%LOGO%') // left part logo right part text/barcode
+ elseif ($textleft == '%LOGO%') // left part logo right part text/barcode
{
if ($logo) $pdf->Image($logo, $_PosX+$xleft, $_PosY+$ytop, 0, $logoHeight);
if ($code && !empty($encoding))
@@ -206,7 +206,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
$pdf->MultiCell($widthtouse-$logoWidth1-1, $this->_Line_Height, $outputlangs->convToOutputCharset($textright),0,'R');
}
}
- else if ($textright == '%LOGO%') // right part logo left part text/barcode
+ elseif ($textright == '%LOGO%') // right part logo left part text/barcode
{
if ($logo) $pdf->Image($logo, $_PosX+$xleft+$widthtouse-$logoWidth+1, $_PosY+$ytop, 0, $logoHeight);
if ($code && !empty($encoding))
@@ -229,7 +229,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator
{
// Output right area
if ($textright == '%LOGO%' && $logo) $pdf->Image($logo, $_PosX+$this->_Width-$widthtouse-$xleft, $_PosY+$ytop, 0, $logoHeight);
- else if ($code && !empty($encoding))
+ elseif ($code && !empty($encoding))
{
$this->writeBarcode($pdf, $code, $encoding, $is2d, $_PosX+$this->_Width-$widthtouse-$xleft, $_PosY+$ytop, $widthtouse, $heighttouse);
}
diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php
index 697add2fccb..f164a5d9dbf 100644
--- a/htdocs/core/modules/product/mod_codeproduct_elephant.php
+++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php
@@ -189,7 +189,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
$mask = '';
if ($type == 0 && ! empty($conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT))
$mask = $conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT;
- else if ($type == 1 && ! empty($conf->global->PRODUCT_ELEPHANT_MASK_SERVICE))
+ elseif ($type == 1 && ! empty($conf->global->PRODUCT_ELEPHANT_MASK_SERVICE))
$mask = $conf->global->PRODUCT_ELEPHANT_MASK_SERVICE;
if (empty($mask))
@@ -204,7 +204,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
$field = 'ref';
//$where = ' AND client in (1,2)';
}
- else if ($type == 1)
+ elseif ($type == 1)
{
$field = 'ref';
//$where = ' AND fournisseur = 1';
@@ -267,7 +267,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
{
$result=0;
}
- else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
+ elseif (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
{
$result=-2;
}
diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php
index a8123c702e9..8f4e5eb5051 100644
--- a/htdocs/core/modules/product/mod_codeproduct_leopard.php
+++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php
@@ -131,7 +131,7 @@ class mod_codeproduct_leopard extends ModeleProductCode
{
$result=0;
}
- else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
+ elseif (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
{
$result=-2;
}
diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php
index c047e6f3661..ab97e14e89a 100644
--- a/htdocs/core/modules/societe/mod_codeclient_elephant.php
+++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php
@@ -222,7 +222,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
$field = 'code_client';
//$where = ' AND client in (1,2)';
}
- else if ($type == 1)
+ elseif ($type == 1)
{
$field = 'code_fournisseur';
//$where = ' AND fournisseur = 1';
@@ -285,7 +285,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
{
$result=0;
}
- else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
+ elseif (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
{
$result=-2;
}
diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php
index 929ad0a8a88..f5618172852 100644
--- a/htdocs/core/modules/societe/mod_codeclient_leopard.php
+++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php
@@ -130,7 +130,7 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode
{
$result=0;
}
- else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
+ elseif (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
{
$result=-2;
}
diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php
index d64b6667bf8..f78e38c5453 100644
--- a/htdocs/core/modules/societe/mod_codeclient_monkey.php
+++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php
@@ -188,7 +188,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
{
$result=0;
}
- else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
+ elseif (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) )
{
$result=-2;
}
diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
index 759b71bd2e8..5cae15e14a6 100644
--- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php
+++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
@@ -147,7 +147,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
$codetouse=(! empty($societe->code_client)?$societe->code_client:'CUSTCODE');
$prefix = $this->prefixcustomeraccountancycode;
}
- else if ($type == 'supplier')
+ elseif ($type == 'supplier')
{
$codetouse=(! empty($societe->code_fournisseur)?$societe->code_fournisseur:'SUPPCODE');
$prefix = $this->prefixsupplieraccountancycode;
@@ -200,11 +200,11 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
{
$sql = "SELECT ";
if ($type == 'customer') $sql.= "code_compta";
- else if ($type == 'supplier') $sql.= "code_compta_fournisseur";
+ elseif ($type == 'supplier') $sql.= "code_compta_fournisseur";
$sql.= " FROM ".MAIN_DB_PREFIX."societe";
$sql.= " WHERE ";
if ($type == 'customer') $sql.= "code_compta";
- else if ($type == 'supplier') $sql.= "code_compta_fournisseur";
+ elseif ($type == 'supplier') $sql.= "code_compta_fournisseur";
$sql.= " = '".$db->escape($code)."'";
if (! empty($societe->id)) $sql.= " AND rowid <> ".$societe->id;
diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php
index 8f139fa2a7d..45895a6e44d 100644
--- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php
+++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php
@@ -287,7 +287,7 @@ class pdf_stdmovement extends ModelePDFMovement
else
$sql.= " AND date_format(m.datem, '%m') = '$month'";
}
- else if ($year > 0)
+ elseif ($year > 0)
{
$sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php
index 1edc3e46024..b4954a1dd9b 100644
--- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php
+++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php
@@ -175,7 +175,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
global $db,$conf;
if ($object->type == 2) $prefix=$this->prefixcreditnote;
- else if ($facture->type == 3) $prefix=$this->prefixdeposit;
+ elseif ($facture->type == 3) $prefix=$this->prefixdeposit;
else $prefix=$this->prefixinvoice;
// D'abord on recupere la valeur max
@@ -220,7 +220,7 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
return $ref;
}
- else if ($mode == 'next')
+ elseif ($mode == 'next')
{
$date=$object->date; // This is invoice date (not creation date)
$yymm = strftime("%y%m",$date);
diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
index 520b2f2ca64..39efa7d676b 100644
--- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
+++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
@@ -169,8 +169,8 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
$mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK;
}
}
- else if (is_object($object) && $object->type == 2) $mask=$conf->global->SUPPLIER_CREDIT_TULIP_MASK;
- else if (is_object($object) && $object->type == 3) $mask=$conf->global->SUPPLIER_DEPOSIT_TULIP_MASK;
+ elseif (is_object($object) && $object->type == 2) $mask=$conf->global->SUPPLIER_CREDIT_TULIP_MASK;
+ elseif (is_object($object) && $object->type == 3) $mask=$conf->global->SUPPLIER_DEPOSIT_TULIP_MASK;
else $mask=$conf->global->SUPPLIER_INVOICE_TULIP_MASK;
if (! $mask)
{
diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php
index c8e6d984539..a863d839a0c 100644
--- a/htdocs/core/photos_resize.php
+++ b/htdocs/core/photos_resize.php
@@ -212,14 +212,14 @@ else {
if (empty($backtourl))
{
if (in_array($modulepart, array('product','produit','service','produit|service'))) $backtourl=DOL_URL_ROOT."/product/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- else if (in_array($modulepart, array('expensereport'))) $backtourl=DOL_URL_ROOT."/expensereport/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- else if (in_array($modulepart, array('holiday'))) $backtourl=DOL_URL_ROOT."/holiday/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- else if (in_array($modulepart, array('member'))) $backtourl=DOL_URL_ROOT."/adherents/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- else if (in_array($modulepart, array('project'))) $backtourl=DOL_URL_ROOT."/projet/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- else if (in_array($modulepart, array('societe'))) $backtourl=DOL_URL_ROOT."/societe/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- else if (in_array($modulepart, array('tax'))) $backtourl=DOL_URL_ROOT."/compta/sociales/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- else if (in_array($modulepart, array('ticket'))) $backtourl=DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
- else if (in_array($modulepart, array('user'))) $backtourl=DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
+ elseif (in_array($modulepart, array('expensereport'))) $backtourl=DOL_URL_ROOT."/expensereport/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
+ elseif (in_array($modulepart, array('holiday'))) $backtourl=DOL_URL_ROOT."/holiday/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
+ elseif (in_array($modulepart, array('member'))) $backtourl=DOL_URL_ROOT."/adherents/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
+ elseif (in_array($modulepart, array('project'))) $backtourl=DOL_URL_ROOT."/projet/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
+ elseif (in_array($modulepart, array('societe'))) $backtourl=DOL_URL_ROOT."/societe/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
+ elseif (in_array($modulepart, array('tax'))) $backtourl=DOL_URL_ROOT."/compta/sociales/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
+ elseif (in_array($modulepart, array('ticket'))) $backtourl=DOL_URL_ROOT."/ticket/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
+ elseif (in_array($modulepart, array('user'))) $backtourl=DOL_URL_ROOT."/user/document.php?id=".$id.'&file='.urldecode($_POST["file"]);
}
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index db3514d7778..5eb2d629a66 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -81,7 +81,7 @@ if ($action == 'presend')
$topicmail='';
if (empty($object->ref_client)) {
$topicmail = $outputlangs->trans($defaulttopic, '__REF__');
- } else if (! empty($object->ref_client)) {
+ } elseif (! empty($object->ref_client)) {
$topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REFCLIENT__)');
}
diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php
index 96510b85617..4f50f55b4ba 100644
--- a/htdocs/core/tpl/login.tpl.php
+++ b/htdocs/core/tpl/login.tpl.php
@@ -325,7 +325,7 @@ if (! empty($morelogincontent) && is_array($morelogincontent)) {
}
}
}
-else if (! empty($moreloginextracontent)) {
+elseif (! empty($moreloginextracontent)) {
echo '';
echo $moreloginextracontent;
}
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index ff29f6999a4..2cd38500d8d 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -186,7 +186,7 @@ else {
if ($object->element == 'contrat')
{
if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set
- else if (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=3;
+ elseif (empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=3;
}
// Free line
@@ -231,13 +231,13 @@ else {
if (empty($senderissupplier))
{
if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToSell');
- else if ((empty($conf->product->enabled) && ! empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell');
+ elseif ((empty($conf->product->enabled) && ! empty($conf->service->enabled)) || ($object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS))) echo $langs->trans('PredefinedServicesToSell');
else echo $langs->trans('PredefinedProductsAndServicesToSell');
}
else
{
if (! empty($conf->product->enabled) && empty($conf->service->enabled)) echo $langs->trans('PredefinedProductsToPurchase');
- else if (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase');
+ elseif (empty($conf->product->enabled) && ! empty($conf->service->enabled)) echo $langs->trans('PredefinedServicesToPurchase');
else echo $langs->trans('PredefinedProductsAndServicesToPurchase');
}
echo '';
diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php
index 4d5e1ad948b..bf74231eb03 100644
--- a/htdocs/core/tpl/passwordforgotten.tpl.php
+++ b/htdocs/core/tpl/passwordforgotten.tpl.php
@@ -214,7 +214,7 @@ if (! empty($morelogincontent)) {
}
}
}
-else if (! empty($moreloginextracontent)) {
+elseif (! empty($moreloginextracontent)) {
echo '';
echo $moreloginextracontent;
}
diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php
index 56a02ed5b14..9acdc897d78 100644
--- a/htdocs/cron/card.php
+++ b/htdocs/cron/card.php
@@ -738,7 +738,7 @@ else
{
print ''.$langs->trans("CronExecute").' ';
}
- else if (empty($object->status))
+ elseif (empty($object->status))
{
print ''.$langs->trans("CronExecute").' ';
}
diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php
index 69736fdaca9..99a801e9e25 100644
--- a/htdocs/don/admin/donation.php
+++ b/htdocs/don/admin/donation.php
@@ -85,7 +85,7 @@ if ($action == 'specimen')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
if (dolibarr_set_const($db, "DON_ADDON_MODEL",$value,'chaine',0,'',$conf->entity))
{
@@ -103,12 +103,12 @@ else if ($action == 'setdoc')
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index 6a63074166c..95438b6bf75 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -239,7 +239,7 @@ if ($action == 'set_paid')
setEventMessages($object->error, $object->errors, 'errors');
}
}
-else if ($action == 'classin' && $user->rights->don->creer)
+elseif ($action == 'classin' && $user->rights->don->creer)
{
$object->fetch($id);
$object->setProject($projectid);
diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php
index 4ce4fd24ff8..3c5ddf66328 100644
--- a/htdocs/don/class/don.class.php
+++ b/htdocs/don/class/don.class.php
@@ -651,7 +651,7 @@ class Don extends CommonObject
{
$sql.= " AND d.rowid=".$id;
}
- else if (! empty($ref))
+ elseif (! empty($ref))
{
$sql.= " AND d.ref='".$this->db->escape($ref)."'";
}
diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php
index e689dde3142..a7613e993f9 100644
--- a/htdocs/ecm/class/ecmdirectory.class.php
+++ b/htdocs/ecm/class/ecmdirectory.class.php
@@ -306,8 +306,8 @@ class EcmDirectory // extends CommonObject
else
{
if (preg_match('/[0-9]+/', $value)) $this->cachenbofdoc = (int) $value;
- else if ($value == '+') $this->cachenbofdoc++;
- else if ($value == '-') $this->cachenbofdoc--;
+ elseif ($value == '+') $this->cachenbofdoc++;
+ elseif ($value == '-') $this->cachenbofdoc--;
}
return 1;
diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php
index c8e8d79046b..a2c0762321c 100644
--- a/htdocs/ecm/dir_add_card.php
+++ b/htdocs/ecm/dir_add_card.php
@@ -201,7 +201,7 @@ if ($action == 'add' && $permtoadd)
}
// Deleting file
-else if ($action == 'confirm_deletesection' && $confirm == 'yes')
+elseif ($action == 'confirm_deletesection' && $confirm == 'yes')
{
$result=$ecmdir->delete($user);
setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs');
diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php
index ac744cc42e1..db6b6abf0f3 100644
--- a/htdocs/ecm/dir_card.php
+++ b/htdocs/ecm/dir_card.php
@@ -118,7 +118,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
}
- else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
+ elseif (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
{
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
}
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index e99f04415b3..4f08da56365 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -281,7 +281,7 @@ if (empty($reshook))
}
}
}
- else if (isset($_POST[$stockLocation]))
+ elseif (isset($_POST[$stockLocation]))
{
//shipment line from multiple stock locations
$qty .= '_'.$j;
@@ -416,7 +416,7 @@ if (empty($reshook))
/*
* Build a receiving receipt
*/
- else if ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)
+ elseif ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)
{
$result = $object->create_delivery($user);
if ($result > 0)
@@ -430,7 +430,7 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_valid' && $confirm == 'yes' &&
+ elseif ($action == 'confirm_valid' && $confirm == 'yes' &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
)
@@ -466,7 +466,7 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->supprimer)
+ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->supprimer)
{
$result = $object->delete();
if ($result > 0)
@@ -489,7 +489,7 @@ if (empty($reshook))
}
}*/
- else if ($action == 'setdate_livraison' && $user->rights->expedition->creer)
+ elseif ($action == 'setdate_livraison' && $user->rights->expedition->creer)
{
//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datedelivery=dol_mktime(GETPOST('liv_hour','int'), GETPOST('liv_min','int'), 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'), GETPOST('liv_year','int'));
@@ -503,7 +503,7 @@ if (empty($reshook))
}
// Action update
- else if (
+ elseif (
($action == 'settracking_number'
|| $action == 'settracking_url'
|| $action == 'settrueWeight'
@@ -614,7 +614,7 @@ if (empty($reshook))
/*
* Update a line
*/
- else if ($action == 'updateline' && $user->rights->expedition->creer && GETPOST('save'))
+ elseif ($action == 'updateline' && $user->rights->expedition->creer && GETPOST('save'))
{
// Clean parameters
$qty=0;
@@ -701,7 +701,7 @@ if (empty($reshook))
$lineIdToAddLot = $line_id;
}
}
- else if (count($lines[$i]->details_entrepot) > 1)
+ elseif (count($lines[$i]->details_entrepot) > 1)
{
// multi warehouse shipment lines
foreach ($lines[$i]->details_entrepot as $detail_entrepot)
@@ -776,7 +776,7 @@ if (empty($reshook))
unset($_POST[$stockLocation]);
unset($_POST[$qty]);
}
- else if (count($lines[$i]->details_entrepot) > 1)
+ elseif (count($lines[$i]->details_entrepot) > 1)
{
// multi warehouse shipment lines
foreach ($lines[$i]->details_entrepot as $detail_entrepot)
@@ -844,7 +844,7 @@ if (empty($reshook))
}
}
- else if ($action == 'updateline' && $user->rights->expedition->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
+ elseif ($action == 'updateline' && $user->rights->expedition->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}
@@ -940,7 +940,7 @@ if ($action == 'create')
// Ref client
print '';
if ($origin == 'commande') print $langs->trans('RefCustomerOrder');
- else if ($origin == 'propal') print $langs->trans('RefCustomerOrder');
+ elseif ($origin == 'propal') print $langs->trans('RefCustomerOrder');
else print $langs->trans('RefCustomer');
print ' ';
print ' ';
@@ -1604,7 +1604,7 @@ if ($action == 'create')
}
}
}
-else if ($id || $ref)
+elseif ($id || $ref)
/* *************************************************************************** */
/* */
/* Edit and view mode */
@@ -2253,7 +2253,7 @@ else if ($id || $ref)
print ' ' . $formproduct->selectLotStock('', 'batchl'.$line_id.'_0', '', 1, 0, $lines[$i]->fk_product). ' ';
print ' ';
}
- else if (! empty($conf->stock->enabled))
+ elseif (! empty($conf->stock->enabled))
{
if ($lines[$i]->fk_product > 0)
{
@@ -2269,7 +2269,7 @@ else if ($id || $ref)
print ' - ' . $langs->trans("NA") . ' ';
print '';
}
- else if (count($lines[$i]->details_entrepot) > 1)
+ elseif (count($lines[$i]->details_entrepot) > 1)
{
print '';
foreach ($lines[$i]->details_entrepot as $detail_entrepot)
@@ -2320,7 +2320,7 @@ else if ($id || $ref)
$entrepot->fetch($lines[$i]->entrepot_id);
print $entrepot->getNomUrl(1);
}
- else if (count($lines[$i]->details_entrepot) > 1)
+ elseif (count($lines[$i]->details_entrepot) > 1)
{
$detail = '';
foreach ($lines[$i]->details_entrepot as $detail_entrepot)
@@ -2389,7 +2389,7 @@ else if ($id || $ref)
print ' ';
print ' ';
}
- else if ($object->statut == 0)
+ elseif ($object->statut == 0)
{
// edit-delete buttons
print '';
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index b8e3f9929f3..82c6a481b4c 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -2747,7 +2747,7 @@ class ExpeditionLigne extends CommonObjectLine
$qty = price2num($this->detail_batch[0]->qty);
}
}
- else if (! empty($this->detail_batch))
+ elseif (! empty($this->detail_batch))
{
$batch = $this->detail_batch->batch;
$batch_id = $this->detail_batch->fk_origin_stock;
diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php
index f9ea697e50d..e3d1cc42e68 100644
--- a/htdocs/expedition/contact.php
+++ b/htdocs/expedition/contact.php
@@ -103,13 +103,13 @@ if ($action == 'addcontact' && $user->rights->expedition->creer)
}
// bascule du statut d'un contact
-else if ($action == 'swapstatut' && $user->rights->expedition->creer)
+elseif ($action == 'swapstatut' && $user->rights->expedition->creer)
{
$result=$objectsrc->swapContactStatus(GETPOST('ligne'));
}
// Efface un contact
-else if ($action == 'deletecontact' && $user->rights->expedition->creer)
+elseif ($action == 'deletecontact' && $user->rights->expedition->creer)
{
$result = $objectsrc->delete_contact(GETPOST("lineid"));
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 48bfd1f4ce2..584f420a8dd 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -91,7 +91,7 @@ if (empty($reshook))
}
// Positionne ref commande client
- else if ($action == 'setref_client' && $user->rights->commande->creer) {
+ elseif ($action == 'setref_client' && $user->rights->commande->creer) {
$result = $object->set_ref_client($user, GETPOST('ref_client'));
if ($result < 0)
{
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 4646c8779ca..a2713bd836f 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -2417,7 +2417,7 @@ if ($action != 'create' && $action != 'edit')
// Delete
print '';
}
- else if($user->rights->expensereport->supprimer && $object->fk_statut != 6)
+ elseif($user->rights->expensereport->supprimer && $object->fk_statut != 6)
{
// Delete
print '';
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index de029081b1f..858db46b3f5 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -186,7 +186,7 @@ if ($action=='selectfield') // Selection of field at step 2
if (is_array($tmp)) $listofdependencies=$tmp;
else $listofdependencies=array($tmp);
}
- else if (! empty($field) && ! empty($fieldsdependenciesarray[$field]))
+ elseif (! empty($field) && ! empty($fieldsdependenciesarray[$field]))
{
// We found a dependency on a dedicated field
$tmp=$fieldsdependenciesarray[$field]; // $fieldsdependenciesarray=array('fd.fieldx'=>'fd.rowid') or array('fd.fieldx'=>array('fd.rowid','ab.rowid'))
diff --git a/htdocs/externalsite/frames.php b/htdocs/externalsite/frames.php
index c7f92142381..eb8e06919d3 100644
--- a/htdocs/externalsite/frames.php
+++ b/htdocs/externalsite/frames.php
@@ -63,7 +63,7 @@ if (! empty($keyforcontent))
$langs->load("errors");
print $langs->trans("ErrorBadSyntaxForParamKeyForContent", 'EXTERNAL_SITE_CONTENT_', 'EXTERNAL_SITE_URL_');
}
- else if (empty($conf->global->$keyforcontent))
+ elseif (empty($conf->global->$keyforcontent))
{
$langs->load("errors");
print $langs->trans("ErrorVariableKeyForContentMustBeSet", 'EXTERNAL_SITE_CONTENT_'.$keyforcontent, 'EXTERNAL_SITE_URL_'.$keyforcontent);
diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php
index e896c9682e4..837b77eb3aa 100644
--- a/htdocs/fichinter/card-rec.php
+++ b/htdocs/fichinter/card-rec.php
@@ -370,7 +370,7 @@ if ($action == 'create') {
$title = $langs->trans("ProductsAndServices");
if (empty($conf->service->enabled))
$title = $langs->trans("Products");
- else if (empty($conf->product->enabled))
+ elseif (empty($conf->product->enabled))
$title = $langs->trans("Services");
print load_fiche_titre($title, '', '');
@@ -712,7 +712,7 @@ if ($action == 'create') {
$title = $langs->trans("ProductsAndServices");
if (empty($conf->service->enabled))
$title = $langs->trans("Products");
- else if (empty($conf->product->enabled))
+ elseif (empty($conf->product->enabled))
$title = $langs->trans("Services");
print load_fiche_titre($title);
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index a8ddb343a94..507ce8d01f3 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -180,7 +180,7 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer)
+ elseif ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->ficheinter->creer)
{
$result = $object->setDraft($user);
if ($result >= 0)
@@ -209,7 +209,7 @@ if (empty($reshook))
}
}
- else if ($action == 'add' && $user->rights->ficheinter->creer)
+ elseif ($action == 'add' && $user->rights->ficheinter->creer)
{
$object->socid = $socid;
$object->duration = GETPOST('duration','int');
@@ -432,7 +432,7 @@ if (empty($reshook))
}
}
- else if ($action == 'update' && $user->rights->ficheinter->creer)
+ elseif ($action == 'update' && $user->rights->ficheinter->creer)
{
$object->socid = $socid;
$object->fk_project = GETPOST('projectid','int');
@@ -448,20 +448,20 @@ if (empty($reshook))
}
// Set into a project
- else if ($action == 'classin' && $user->rights->ficheinter->creer)
+ elseif ($action == 'classin' && $user->rights->ficheinter->creer)
{
$result=$object->setProject(GETPOST('projectid','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
// Set into a contract
- else if ($action == 'setcontract' && $user->rights->contrat->creer)
+ elseif ($action == 'setcontract' && $user->rights->contrat->creer)
{
$result=$object->set_contrat($user,GETPOST('contratid','int'));
if ($result < 0) dol_print_error($db,$object->error);
}
- else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->ficheinter->supprimer)
+ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->ficheinter->supprimer)
{
$result=$object->delete($user);
if ($result<0) {
@@ -472,14 +472,14 @@ if (empty($reshook))
exit;
}
- else if ($action == 'setdescription' && $user->rights->ficheinter->creer)
+ elseif ($action == 'setdescription' && $user->rights->ficheinter->creer)
{
$result=$object->set_description($user,GETPOST('description'));
if ($result < 0) dol_print_error($db,$object->error);
}
// Add line
- else if ($action == "addline" && $user->rights->ficheinter->creer)
+ elseif ($action == "addline" && $user->rights->ficheinter->creer)
{
if (!GETPOST('np_desc','none') && empty($conf->global->FICHINTER_EMPTY_LINE_DESC) )
{
@@ -547,7 +547,7 @@ if (empty($reshook))
}
// Classify Billed
- else if ($action == 'classifybilled' && $user->rights->ficheinter->creer)
+ elseif ($action == 'classifybilled' && $user->rights->ficheinter->creer)
{
$result=$object->setStatut(2);
if ($result > 0)
@@ -562,7 +562,7 @@ if (empty($reshook))
}
// Classify unbilled
- else if ($action == 'classifyunbilled' && $user->rights->ficheinter->creer)
+ elseif ($action == 'classifyunbilled' && $user->rights->ficheinter->creer)
{
$result=$object->setStatut(1);
if ($result > 0)
@@ -577,7 +577,7 @@ if (empty($reshook))
}
// Classify Done
- else if ($action == 'classifydone' && $user->rights->ficheinter->creer)
+ elseif ($action == 'classifydone' && $user->rights->ficheinter->creer)
{
$result=$object->setStatut(3);
if ($result > 0)
@@ -594,7 +594,7 @@ if (empty($reshook))
/*
* Mise a jour d'une ligne d'intervention
*/
- else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save','alpha') == $langs->trans("Save"))
+ elseif ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save','alpha') == $langs->trans("Save"))
{
$objectline = new FichinterLigne($db);
if ($objectline->fetch($lineid) <= 0)
@@ -650,7 +650,7 @@ if (empty($reshook))
/*
* Supprime une ligne d'intervention AVEC confirmation
*/
- else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->ficheinter->creer)
+ elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->ficheinter->creer)
{
$objectline = new FichinterLigne($db);
if ($objectline->fetch($lineid) <= 0)
@@ -683,7 +683,7 @@ if (empty($reshook))
* Ordonnancement des lignes
*/
- else if ($action == 'up' && $user->rights->ficheinter->creer)
+ elseif ($action == 'up' && $user->rights->ficheinter->creer)
{
$object->line_up($lineid);
@@ -703,7 +703,7 @@ if (empty($reshook))
exit;
}
- else if ($action == 'down' && $user->rights->ficheinter->creer)
+ elseif ($action == 'down' && $user->rights->ficheinter->creer)
{
$object->line_down($lineid);
@@ -789,13 +789,13 @@ if (empty($reshook))
}
// bascule du statut d'un contact
- else if ($action == 'swapstatut')
+ elseif ($action == 'swapstatut')
{
$result=$object->swapContactStatus(GETPOST('ligne','int'));
}
// Efface un contact
- else if ($action == 'deletecontact')
+ elseif ($action == 'deletecontact')
{
$result = $object->delete_contact(GETPOST('lineid','int'));
@@ -1099,7 +1099,7 @@ if ($action == 'create')
print '';
}
}
-else if ($id > 0 || ! empty($ref))
+elseif ($id > 0 || ! empty($ref))
{
/*
* Affichage en mode visu
diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php
index 54ad6733e69..7da8a8aba44 100644
--- a/htdocs/fichinter/contact.php
+++ b/htdocs/fichinter/contact.php
@@ -81,13 +81,13 @@ if ($action == 'addcontact' && $user->rights->ficheinter->creer)
}
// Toggle the status of a contact
-else if ($action == 'swapstatut' && $user->rights->ficheinter->creer)
+elseif ($action == 'swapstatut' && $user->rights->ficheinter->creer)
{
$result=$object->swapContactStatus(GETPOST('ligne','int'));
}
// Deletes a contact
-else if ($action == 'deletecontact' && $user->rights->ficheinter->creer)
+elseif ($action == 'deletecontact' && $user->rights->ficheinter->creer)
{
$result = $object->delete_contact(GETPOST('lineid','int'));
diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php
index 4edfa3d0623..472af9f14d9 100644
--- a/htdocs/filefunc.inc.php
+++ b/htdocs/filefunc.inc.php
@@ -80,7 +80,7 @@ if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not do
$path=$_SERVER["CONTEXT_PREFIX"]; // example '/dolibarr/' when using an apache alias.
if (! preg_match('/\/$/', $path)) $path.='/';
}
- else if (preg_match('/index\.php/', $_SERVER['PHP_SELF']))
+ elseif (preg_match('/index\.php/', $_SERVER['PHP_SELF']))
{
// When we ask index.php, we MUST BE SURE that $path is '' at the end. This is required to make install process
// when using apache alias like '/dolibarr/' that point to htdocs.
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 6a0ca6abddf..e4463d7ba65 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -1335,7 +1335,7 @@ class FactureFournisseur extends CommonInvoice
{
$num = $force_number;
}
- else if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life
+ elseif (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life
{
$num = $this->getNextNumRef($this->thirdparty);
}
diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index a7469367fb6..3da909d8f35 100644
--- a/htdocs/fourn/class/paiementfourn.class.php
+++ b/htdocs/fourn/class/paiementfourn.class.php
@@ -95,9 +95,9 @@ class PaiementFourn extends Paiement
$sql.= ' WHERE p.entity IN ('.getEntity('facture_fourn').')';
if ($id > 0)
$sql.= ' AND p.rowid = '.$id;
- else if ($ref)
+ elseif ($ref)
$sql.= ' AND p.rowid = '.$ref;
- else if ($fk_bank)
+ elseif ($fk_bank)
$sql.= ' AND p.fk_bank = '.$fk_bank;
//print $sql;
@@ -636,8 +636,8 @@ class PaiementFourn extends Paiement
// Clean parameters (if not defined or using deprecated value)
if (empty($conf->global->SUPPLIER_PAYMENT_ADDON)) $conf->global->SUPPLIER_PAYMENT_ADDON='mod_supplier_payment_bronan';
- else if ($conf->global->SUPPLIER_PAYMENT_ADDON=='brodator') $conf->global->SUPPLIER_PAYMENT_ADDON='mod_supplier_payment_brodator';
- else if ($conf->global->SUPPLIER_PAYMENT_ADDON=='bronan') $conf->global->SUPPLIER_PAYMENT_ADDON='mod_supplier_payment_bronan';
+ elseif ($conf->global->SUPPLIER_PAYMENT_ADDON=='brodator') $conf->global->SUPPLIER_PAYMENT_ADDON='mod_supplier_payment_brodator';
+ elseif ($conf->global->SUPPLIER_PAYMENT_ADDON=='bronan') $conf->global->SUPPLIER_PAYMENT_ADDON='mod_supplier_payment_bronan';
if (! empty($conf->global->SUPPLIER_PAYMENT_ADDON))
{
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index d8a1c2fa51c..04835089809 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -101,7 +101,7 @@ if ($id > 0 || ! empty($ref))
$ret = $object->fetch_thirdparty();
if ($ret < 0) dol_print_error($db,$object->error);
}
-else if (! empty($socid) && $socid > 0)
+elseif (! empty($socid) && $socid > 0)
{
$fourn = new Fournisseur($db);
$ret=$fourn->fetch($socid);
@@ -170,12 +170,12 @@ if (empty($reshook))
}
// Multicurrency Code
- else if ($action == 'setmulticurrencycode' && $user->rights->fournisseur->commande->creer) {
+ elseif ($action == 'setmulticurrencycode' && $user->rights->fournisseur->commande->creer) {
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
}
// Multicurrency rate
- else if ($action == 'setmulticurrencyrate' && $user->rights->fournisseur->commande->creer) {
+ elseif ($action == 'setmulticurrencyrate' && $user->rights->fournisseur->commande->creer) {
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')));
}
@@ -211,10 +211,10 @@ if (empty($reshook))
if (in_array($object->statut, array(1, 2, 3, 4, 5, 6, 7, 9)))
{
if ($object->statut == 1) $newstatus=0; // Validated->Draft
- else if ($object->statut == 2) $newstatus=0; // Approved->Draft
- else if ($object->statut == 3) $newstatus=2; // Ordered->Approved
- else if ($object->statut == 4) $newstatus=3;
- else if ($object->statut == 5)
+ elseif ($object->statut == 2) $newstatus=0; // Approved->Draft
+ elseif ($object->statut == 3) $newstatus=2; // Ordered->Approved
+ elseif ($object->statut == 4) $newstatus=3;
+ elseif ($object->statut == 5)
{
//$newstatus=2; // Ordered
// TODO Can we set it to submited ?
@@ -222,9 +222,9 @@ if (empty($reshook))
// TODO If there is at least one reception, we can set to Received->Received partially
$newstatus=4; // Received partially
}
- else if ($object->statut == 6) $newstatus=2; // Canceled->Approved
- else if ($object->statut == 7) $newstatus=3; // Canceled->Process running
- else if ($object->statut == 9) $newstatus=1; // Refused->Validated
+ elseif ($object->statut == 6) $newstatus=2; // Canceled->Approved
+ elseif ($object->statut == 7) $newstatus=3; // Canceled->Process running
+ elseif ($object->statut == 9) $newstatus=1; // Refused->Validated
else $newstatus = 2;
//print "old status = ".$object->statut.' new status = '.$newstatus;
@@ -458,7 +458,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors');
}
}
- else if (empty($error)) // $price_ht is already set
+ elseif (empty($error)) // $price_ht is already set
{
$pu_ht = price2num($price_ht, 'MU');
$pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
@@ -921,7 +921,7 @@ if (empty($reshook))
setEventMessages($langs->trans("DeliveryStateSaved"), null);
$action = '';
}
- else if($result == -3)
+ elseif($result == -3)
{
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -1235,9 +1235,9 @@ if (empty($reshook))
//Is sync supplier web services module activated? and everything filled?
if (empty($conf->syncsupplierwebservices->enabled)) {
setEventMessages($langs->trans("WarningModuleNotActive",$langs->transnoentities("Module2650Name")), null, 'mesgs');
- } else if (empty($ws_url) || empty($ws_key)) {
+ } elseif (empty($ws_url) || empty($ws_key)) {
setEventMessages($langs->trans("ErrorWebServicesFieldsRequired"), null, 'errors');
- } else if (empty($ws_user) || empty($ws_password) || empty($ws_thirdparty)) {
+ } elseif (empty($ws_user) || empty($ws_password) || empty($ws_thirdparty)) {
setEventMessages($langs->trans("ErrorFieldsRequired"),null, 'errors');
}
else
@@ -1295,7 +1295,7 @@ if (empty($reshook))
{
setEventMessages($langs->trans("SOAPError")." '".$soapclient_order->error_str."'", null, 'errors');
}
- else if ($result_order["result"]["result_code"] != "OK") //Something went wrong
+ elseif ($result_order["result"]["result_code"] != "OK") //Something went wrong
{
setEventMessages($langs->trans("SOAPError")." '".$result_order["result"]["result_code"]."' - '".$result_order["result"]["result_label"]."'", null, 'errors');
}
@@ -1336,13 +1336,13 @@ if (empty($reshook))
}
// bascule du statut d'un contact
- else if ($action == 'swapstatut' && $object->id > 0)
+ elseif ($action == 'swapstatut' && $object->id > 0)
{
$result=$object->swapContactStatus(GETPOST('ligne'));
}
// Efface un contact
- else if ($action == 'deletecontact' && $object->id > 0)
+ elseif ($action == 'deletecontact' && $object->id > 0)
{
$result = $object->delete_contact($_GET["lineid"]);
@@ -2407,7 +2407,7 @@ elseif (! empty($object->id))
{
print 'id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").' ';
}
- else if (!empty($object->linkedObjectsIds['invoice_supplier']))
+ elseif (!empty($object->linkedObjectsIds['invoice_supplier']))
{
if ($user->rights->fournisseur->facture->creer)
{
@@ -2575,7 +2575,7 @@ elseif (! empty($object->id))
setEventMessages($langs->trans("ErrorWebServicesFieldsRequired"), null, 'errors');
$mode = "init";
$error_occurred = true; //Don't allow to set the user/pass if thirdparty fields are not filled
- } else if ($mode != "init" && (empty($ws_user) || empty($ws_password))) {
+ } elseif ($mode != "init" && (empty($ws_user) || empty($ws_password))) {
setEventMessages($langs->trans("ErrorFieldsRequired"), null, 'errors');
$mode = "init";
}
@@ -2674,7 +2674,7 @@ elseif (! empty($object->id))
{
setEventMessages($langs->trans("SOAPError")." '".$soapclient_order->error_str."'", null, 'errors');
}
- else if ($status_code != "OK") //Something went wrong
+ elseif ($status_code != "OK") //Something went wrong
{
if ($status_code == "NOT_FOUND")
{
diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php
index 08e30d04b7f..2ee0890c813 100644
--- a/htdocs/fourn/commande/contact.php
+++ b/htdocs/fourn/commande/contact.php
@@ -81,7 +81,7 @@ if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer)
}
// Toggle the status of a contact
-else if ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer)
+elseif ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer)
{
if ($object->fetch($id))
{
@@ -94,7 +94,7 @@ else if ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer)
}
// Deleting a contact
-else if ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer)
+elseif ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer)
{
$object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]);
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 931942debb7..a268619c84f 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -886,7 +886,7 @@ if ($id > 0 || ! empty($ref)) {
}
}
print ' ';
- }else if(!empty($conf->reception->enabled)){
+ }elseif(!empty($conf->reception->enabled)){
print '';
if(!empty($reception->id)){
print $reception->getLibStatut(5);
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 7129821ab56..5c616a70b0e 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -245,7 +245,7 @@ if (empty($reshook))
}
// Remove a product line
- else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer)
+ elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer)
{
$result = $object->deleteline($lineid);
if ($result > 0)
@@ -278,7 +278,7 @@ if (empty($reshook))
}
// Delete link of credit note to invoice
- else if ($action == 'unlinkdiscount' && $user->rights->fournisseur->facture->creer)
+ elseif ($action == 'unlinkdiscount' && $user->rights->fournisseur->facture->creer)
{
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(GETPOST("discountid"));
@@ -336,23 +336,23 @@ if (empty($reshook))
}
// payment mode
- else if ($action == 'setmode' && $user->rights->fournisseur->facture->creer)
+ elseif ($action == 'setmode' && $user->rights->fournisseur->facture->creer)
{
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int'));
}
// Multicurrency Code
- else if ($action == 'setmulticurrencycode' && $user->rights->fournisseur->facture->creer) {
+ elseif ($action == 'setmulticurrencycode' && $user->rights->fournisseur->facture->creer) {
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
}
// Multicurrency rate
- else if ($action == 'setmulticurrencyrate' && $user->rights->fournisseur->facture->creer) {
+ elseif ($action == 'setmulticurrencyrate' && $user->rights->fournisseur->facture->creer) {
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx', 'alpha')));
}
// bank account
- else if ($action == 'setbankaccount' && $user->rights->fournisseur->facture->creer) {
+ elseif ($action == 'setbankaccount' && $user->rights->fournisseur->facture->creer) {
$result=$object->setBankAccount(GETPOST('fk_account', 'int'));
}
@@ -459,7 +459,7 @@ if (empty($reshook))
}
}
// Convertir en reduc
- else if ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer)
+ elseif ($action == 'confirm_converttoreduc' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer)
{
$object->fetch($id);
$object->fetch_thirdparty();
@@ -972,7 +972,7 @@ if (empty($reshook))
$error++;
}
}
- else if (! $error)
+ elseif (! $error)
{
$id = $object->create($user);
if ($id < 0)
@@ -1301,7 +1301,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors');
}
}
- else if (empty($error)) // $price_ht is already set
+ elseif (empty($error)) // $price_ht is already set
{
$tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0);
$tva_tx = str_replace('*', '', $tva_tx);
@@ -1576,7 +1576,7 @@ if (empty($reshook))
}
// bascule du statut d'un contact
- else if ($action == 'swapstatut')
+ elseif ($action == 'swapstatut')
{
if ($object->fetch($id))
{
@@ -1589,7 +1589,7 @@ if (empty($reshook))
}
// Efface un contact
- else if ($action == 'deletecontact')
+ elseif ($action == 'deletecontact')
{
$object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]);
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index ffd3cb00d7b..e9ec9bf95e1 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -81,7 +81,7 @@ if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer)
}
// bascule du statut d'un contact
-else if ($action == 'swapstatut' && $user->rights->fournisseur->facture->creer)
+elseif ($action == 'swapstatut' && $user->rights->fournisseur->facture->creer)
{
if ($object->fetch($id))
{
@@ -94,7 +94,7 @@ else if ($action == 'swapstatut' && $user->rights->fournisseur->facture->creer)
}
// Efface un contact
-else if ($action == 'deletecontact' && $user->rights->fournisseur->facture->creer)
+elseif ($action == 'deletecontact' && $user->rights->fournisseur->facture->creer)
{
$object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]);
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 4a1b004fed7..c5194aa7344 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -774,12 +774,12 @@ if (empty($action))
{
if ($year > 0 && empty($day))
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
- else if ($year > 0 && ! empty($day))
+ elseif ($year > 0 && ! empty($day))
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
else
$sql.= " AND date_format(p.datep, '%m') = '".$month."'";
}
- else if ($year > 0)
+ elseif ($year > 0)
{
$sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index 449be9daccf..59553f626c1 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -107,7 +107,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
}
- else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
+ elseif (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus
{
setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors');
}
@@ -529,7 +529,7 @@ else
// Is it a directory ?
$is_directory=0;
if ($file == '..') $is_directory=1;
- else if (! $rawlisthasfailed)
+ elseif (! $rawlisthasfailed)
{
if (preg_match('/^d/',$vals[0])) $is_directory=1;
if (preg_match('/^l/',$vals[0])) $is_link=1;
@@ -586,7 +586,7 @@ else
if ($file != '..') print ''.img_delete().' ';
else print ' ';
}
- else if ($is_link)
+ elseif ($is_link)
{
$newfile=$file;
$newfile=preg_replace('/ ->.*/','',$newfile);
@@ -671,7 +671,7 @@ if ($conn_id)
{
}
- else if (! empty($conf->global->FTP_CONNECT_WITH_SSL))
+ elseif (! empty($conf->global->FTP_CONNECT_WITH_SSL))
{
ftp_close($conn_id);
}
@@ -719,7 +719,7 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
dol_syslog('Try to connect with ssh2_ftp');
$tmp_conn_id = ssh2_connect($ftp_server, $ftp_port);
}
- else if (! empty($conf->global->FTP_CONNECT_WITH_SSL))
+ elseif (! empty($conf->global->FTP_CONNECT_WITH_SSL))
{
dol_syslog('Try to connect with ftp_ssl_connect');
$conn_id = ftp_ssl_connect($ftp_server, $ftp_port, $connecttimeout);
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index 0f22e07245b..f6b6586a9ec 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -95,8 +95,8 @@ if ($action == 'create')
$type=GETPOST('type');
$halfday=0;
if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2;
- else if ($starthalfday == 'afternoon') $halfday=-1;
- else if ($endhalfday == 'morning') $halfday=1;
+ elseif ($starthalfday == 'afternoon') $halfday=-1;
+ elseif ($endhalfday == 'morning') $halfday=1;
$valideur = GETPOST('valideur');
$description = trim(GETPOST('description'));
@@ -201,8 +201,8 @@ if ($action == 'update')
$endhalfday=GETPOST('endhalfday');
$halfday=0;
if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2;
- else if ($starthalfday == 'afternoon') $halfday=-1;
- else if ($endhalfday == 'morning') $halfday=1;
+ elseif ($starthalfday == 'afternoon') $halfday=-1;
+ elseif ($endhalfday == 'morning') $halfday=1;
// If no right to modify a request
if (! $user->rights->holiday->write)
diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php
index 77126100068..4343e3a2c50 100644
--- a/htdocs/hrm/establishment/card.php
+++ b/htdocs/hrm/establishment/card.php
@@ -70,7 +70,7 @@ if ($action == 'confirm_delete' && $confirm == "yes")
}
}
-else if ($action == 'add')
+elseif ($action == 'add')
{
if (! $cancel)
{
@@ -120,7 +120,7 @@ else if ($action == 'add')
}
// Update record
-else if ($action == 'update')
+elseif ($action == 'update')
{
$error = 0;
diff --git a/htdocs/install/check.php b/htdocs/install/check.php
index 7eb0bce2dde..145992c0902 100644
--- a/htdocs/install/check.php
+++ b/htdocs/install/check.php
@@ -83,7 +83,7 @@ if (versioncompare(versionphparray(),$arrayphpminversionerror) < 0) // Mi
print ' '.$langs->trans("ErrorPHPVersionTooLow", versiontostring($arrayphpminversionerror));
$checksok=0; // 0=error, 1=warning
}
-else if (versioncompare(versionphparray(),$arrayphpminversionwarning) < 0) // Minimum supported (warning if lower)
+elseif (versioncompare(versionphparray(),$arrayphpminversionwarning) < 0) // Minimum supported (warning if lower)
{
print ' '.$langs->trans("ErrorPHPVersionTooLow",versiontostring($arrayphpminversionwarning));
$checksok=0; // 0=error, 1=warning
diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php
index 6c2cdcead72..0ee3dca9fe1 100644
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -225,10 +225,10 @@ if (! defined('SYSLOG_HANDLERS')) define('SYSLOG_HANDLERS','["mod_syslog_file"]'
if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant already defined
{
if (@is_writable('/tmp')) define('SYSLOG_FILE','/tmp/dolibarr_install.log');
- else if (! empty($_ENV["TMP"]) && @is_writable($_ENV["TMP"])) define('SYSLOG_FILE',$_ENV["TMP"].'/dolibarr_install.log');
- else if (! empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"])) define('SYSLOG_FILE',$_ENV["TEMP"].'/dolibarr_install.log');
- else if (@is_writable('../../../../') && @file_exists('../../../../startdoliwamp.bat')) define('SYSLOG_FILE','../../../../dolibarr_install.log'); // For DoliWamp
- else if (@is_writable('../../')) define('SYSLOG_FILE','../../dolibarr_install.log'); // For others
+ elseif (! empty($_ENV["TMP"]) && @is_writable($_ENV["TMP"])) define('SYSLOG_FILE',$_ENV["TMP"].'/dolibarr_install.log');
+ elseif (! empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"])) define('SYSLOG_FILE',$_ENV["TEMP"].'/dolibarr_install.log');
+ elseif (@is_writable('../../../../') && @file_exists('../../../../startdoliwamp.bat')) define('SYSLOG_FILE','../../../../dolibarr_install.log'); // For DoliWamp
+ elseif (@is_writable('../../')) define('SYSLOG_FILE','../../dolibarr_install.log'); // For others
//print 'SYSLOG_FILE='.SYSLOG_FILE;exit;
}
if (defined('SYSLOG_FILE')) $conf->global->SYSLOG_FILE=constant('SYSLOG_FILE');
@@ -331,10 +331,10 @@ function conf($dolibarr_main_document_root)
if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant already defined
{
if (@is_writable('/tmp')) define('SYSLOG_FILE','/tmp/dolibarr_install.log');
- else if (! empty($_ENV["TMP"]) && @is_writable($_ENV["TMP"])) define('SYSLOG_FILE',$_ENV["TMP"].'/dolibarr_install.log');
- else if (! empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"])) define('SYSLOG_FILE',$_ENV["TEMP"].'/dolibarr_install.log');
- else if (@is_writable('../../../../') && @file_exists('../../../../startdoliwamp.bat')) define('SYSLOG_FILE','../../../../dolibarr_install.log'); // For DoliWamp
- else if (@is_writable('../../')) define('SYSLOG_FILE','../../dolibarr_install.log'); // For others
+ elseif (! empty($_ENV["TMP"]) && @is_writable($_ENV["TMP"])) define('SYSLOG_FILE',$_ENV["TMP"].'/dolibarr_install.log');
+ elseif (! empty($_ENV["TEMP"]) && @is_writable($_ENV["TEMP"])) define('SYSLOG_FILE',$_ENV["TEMP"].'/dolibarr_install.log');
+ elseif (@is_writable('../../../../') && @file_exists('../../../../startdoliwamp.bat')) define('SYSLOG_FILE','../../../../dolibarr_install.log'); // For DoliWamp
+ elseif (@is_writable('../../')) define('SYSLOG_FILE','../../dolibarr_install.log'); // For others
//print 'SYSLOG_FILE='.SYSLOG_FILE;exit;
}
if (defined('SYSLOG_FILE')) $conf->global->SYSLOG_FILE=constant('SYSLOG_FILE');
diff --git a/htdocs/install/lib/repair.lib.php b/htdocs/install/lib/repair.lib.php
index 43a6d2bce27..eb4a87ee8c2 100644
--- a/htdocs/install/lib/repair.lib.php
+++ b/htdocs/install/lib/repair.lib.php
@@ -62,13 +62,13 @@ function checkLinkedElements($sourcetype, $targettype)
$targettable=$targettype;
if ($sourcetype == 'shipping') $sourcetable = 'expedition';
- else if ($targettype == 'shipping') $targettable = 'expedition';
+ elseif ($targettype == 'shipping') $targettable = 'expedition';
if ($sourcetype == 'delivery') $sourcetable = 'livraison';
- else if ($targettype == 'delivery') $targettable = 'livraison';
+ elseif ($targettype == 'delivery') $targettable = 'livraison';
if ($sourcetype == 'order_supplier') $sourcetable = 'commande_fournisseur';
- else if ($targettype == 'order_supplier') $targettable = 'commande_fournisseur';
+ elseif ($targettype == 'order_supplier') $targettable = 'commande_fournisseur';
if ($sourcetype == 'invoice_supplier') $sourcetable = 'facture_fourn';
- else if ($targettype == 'invoice_supplier') $targettable = 'facture_fourn';
+ elseif ($targettype == 'invoice_supplier') $targettable = 'facture_fourn';
$out = $langs->trans('SourceType').': '.$sourcetype.' => '.$langs->trans('TargetType').': '.$targettype.' ';
diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php
index 888daa4abe2..0994fcedd2f 100644
--- a/htdocs/install/repair.php
+++ b/htdocs/install/repair.php
@@ -617,32 +617,32 @@ if ($ok && GETPOST('clean_orphelin_dir','alpha'))
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$object_instance=new Facture($db);
}
- else if ($modulepart == 'invoice_supplier')
+ elseif ($modulepart == 'invoice_supplier')
{
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$object_instance=new FactureFournisseur($db);
}
- else if ($modulepart == 'propal')
+ elseif ($modulepart == 'propal')
{
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$object_instance=new Propal($db);
}
- else if ($modulepart == 'order')
+ elseif ($modulepart == 'order')
{
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$object_instance=new Commande($db);
}
- else if ($modulepart == 'order_supplier')
+ elseif ($modulepart == 'order_supplier')
{
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
$object_instance=new CommandeFournisseur($db);
}
- else if ($modulepart == 'contract')
+ elseif ($modulepart == 'contract')
{
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
$object_instance=new Contrat($db);
}
- else if ($modulepart == 'tax')
+ elseif ($modulepart == 'tax')
{
include_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
$object_instance=new ChargeSociales($db);
@@ -702,7 +702,7 @@ if ($ok && GETPOST('clean_orphelin_dir','alpha'))
}
print " ";
}
- else if ($result < 0) print 'Error in '.get_class($object_instance).'.fetch of id'.$id.' ref='.$ref.', result='.$result.' ';
+ elseif ($result < 0) print 'Error in '.get_class($object_instance).'.fetch of id'.$id.' ref='.$ref.', result='.$result.' ';
}
}
}
diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php
index a55c14195e5..ceeb9066940 100644
--- a/htdocs/install/step1.php
+++ b/htdocs/install/step1.php
@@ -546,11 +546,11 @@ if (! $error && $db->connected && $action == "set")
{
$databasefortest='mysql';
}
- else if ($conf->db->type == 'pgsql')
+ elseif ($conf->db->type == 'pgsql')
{
$databasefortest='postgres';
}
- else if ($conf->db->type == 'mssql')
+ elseif ($conf->db->type == 'mssql')
{
$databasefortest='master';
}
diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php
index 14856d8b6b7..1b2e6e7e18d 100644
--- a/htdocs/install/upgrade.php
+++ b/htdocs/install/upgrade.php
@@ -347,7 +347,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
{
$filelist[]=$file;
}
- else if (preg_match('/'.$to.'/i',$file)) // First test may be false if we migrate from x.y.* to x.y.*
+ elseif (preg_match('/'.$to.'/i',$file)) // First test may be false if we migrate from x.y.* to x.y.*
{
$filelist[]=$file;
}
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index acddde53988..1e8dc536404 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -4175,7 +4175,7 @@ function migrate_remise_except_entity($db, $langs, $conf)
$sqlSelect2.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sqlSelect2.= " WHERE f.rowid = " . $fk_facture;
}
- else if (!empty($obj->fk_facture_line))
+ elseif (!empty($obj->fk_facture_line))
{
$sqlSelect2 = "SELECT f.entity";
$sqlSelect2.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd";
diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php
index b6e9c904f80..183810b7ab0 100644
--- a/htdocs/livraison/card.php
+++ b/htdocs/livraison/card.php
@@ -130,7 +130,7 @@ if ($action == 'add')
}
}
-else if ($action == 'confirm_valid' && $confirm == 'yes' &&
+elseif ($action == 'confirm_valid' && $confirm == 'yes' &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->livraison_advance->validate)))
)
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index cec094ef04d..3bab5474b08 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -162,7 +162,7 @@ if (empty($reshook))
}
// Update record
- else if ($action == 'update' && $user->rights->loan->write)
+ elseif ($action == 'update' && $user->rights->loan->write)
{
if (! $cancel)
{
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 2fd75e4f4c6..cb02dbdc772 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1226,7 +1226,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
print '';
$titletoshow='';
if ($title && ! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/noapp/',$conf->global->MAIN_HTML_TITLE)) $titletoshow = dol_htmlentities($title);
- else if ($title) $titletoshow = dol_htmlentities($appli.' - '.$title);
+ elseif ($title) $titletoshow = dol_htmlentities($appli.' - '.$title);
else $titletoshow = dol_htmlentities($appli);
$parameters=array('title'=>$titletoshow);
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index 10ff15fbabf..80e9e8c4e2e 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -148,15 +148,15 @@ if (session_id() && ! empty($_SESSION["dol_entity"])) // Entity inside an open
{
$conf->entity = $_SESSION["dol_entity"];
}
-else if (! empty($_ENV["dol_entity"])) // Entity inside a CLI script
+elseif (! empty($_ENV["dol_entity"])) // Entity inside a CLI script
{
$conf->entity = $_ENV["dol_entity"];
}
-else if (isset($_POST["loginfunction"]) && GETPOST("entity",'int')) // Just after a login page
+elseif (isset($_POST["loginfunction"]) && GETPOST("entity",'int')) // Just after a login page
{
$conf->entity = GETPOST("entity",'int');
}
-else if (defined('DOLENTITY') && is_numeric(DOLENTITY)) // For public page with MultiCompany module
+elseif (defined('DOLENTITY') && is_numeric(DOLENTITY)) // For public page with MultiCompany module
{
$conf->entity = DOLENTITY;
}
diff --git a/htdocs/opensurvey/exportcsv.php b/htdocs/opensurvey/exportcsv.php
index b36a5256059..787aaa3042b 100644
--- a/htdocs/opensurvey/exportcsv.php
+++ b/htdocs/opensurvey/exportcsv.php
@@ -109,7 +109,7 @@ if ($resql)
$input.='OK;';
$somme[$k]++;
}
- else if ($car == "2")
+ elseif ($car == "2")
{
$input.='KO;';
$somme[$k]++;
diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php
index 34945504943..8720accfe90 100644
--- a/htdocs/opensurvey/results.php
+++ b/htdocs/opensurvey/results.php
@@ -71,7 +71,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
{
$nouveauchoix.="1";
}
- else if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2')
+ elseif (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2')
{
$nouveauchoix.="2";
}
@@ -136,7 +136,7 @@ if ($testmodifier)
{
$nouveauchoix.="1";
}
- else if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2')
+ elseif (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2')
{
$nouveauchoix.="2";
}
@@ -821,7 +821,7 @@ while ($compteur < $num)
if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno')
{
if (((string) $car) == "1") print ''.$langs->trans("Yes").' '."\n";
- else if (((string) $car) == "0") print ''.$langs->trans("No").' '."\n";
+ elseif (((string) $car) == "0") print ''.$langs->trans("No").' '."\n";
else print ' '."\n";
// Total
if (! isset($sumfor[$i])) $sumfor[$i] = 0;
@@ -832,7 +832,7 @@ while ($compteur < $num)
if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst')
{
if (((string) $car) == "1") print ''.$langs->trans("For").' '."\n";
- else if (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
+ elseif (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
else print ' '."\n";
// Total
if (! isset($sumfor[$i])) $sumfor[$i] = 0;
@@ -886,7 +886,7 @@ while ($compteur < $num)
if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno')
{
if (((string) $car) == "1") print ''.$langs->trans("For").' '."\n";
- else if (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
+ elseif (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
else print ' '."\n";
// Total
if (! isset($sumfor[$i])) $sumfor[$i] = 0;
@@ -897,7 +897,7 @@ while ($compteur < $num)
if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst')
{
if (((string) $car) == "1") print ''.$langs->trans("For").' '."\n";
- else if (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
+ elseif (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
else print ' '."\n";
// Total
if (! isset($sumfor[$i])) $sumfor[$i] = 0;
diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php
index 334640e87d3..124b7af40ee 100644
--- a/htdocs/product/admin/product.php
+++ b/htdocs/product/admin/product.php
@@ -277,7 +277,7 @@ if (empty($conf->produit->enabled))
$title = $langs->trans('ServiceSetup');
$tab = $langs->trans('Services');
}
-else if (empty($conf->service->enabled))
+elseif (empty($conf->service->enabled))
{
$title = $langs->trans('ProductSetup');
$tab = $langs->trans('Products');
diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php
index 23780df895e..a71bfb9cf42 100644
--- a/htdocs/product/admin/product_extrafields.php
+++ b/htdocs/product/admin/product_extrafields.php
@@ -66,7 +66,7 @@ if (empty($conf->produit->enabled))
$title = $langs->trans('ServiceSetup');
$textobject = $langs->trans('Services');
}
-else if (empty($conf->service->enabled))
+elseif (empty($conf->service->enabled))
{
$title = $langs->trans('ProductSetup');
$textobject = $langs->trans('Products');
diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php
index 897f9e98c6b..0d00fa1c74a 100644
--- a/htdocs/product/canvas/product/actions_card_product.class.php
+++ b/htdocs/product/canvas/product/actions_card_product.class.php
@@ -409,16 +409,16 @@ class ActionsCardProduct
$this->entity = $obj->entity;
$datas[$alias] = $this->getNomUrl(1,'',24);
}
- else if ($alias == 'stock')
+ elseif ($alias == 'stock')
{
$this->load_stock();
if ($this->stock_reel < $obj->seuil_stock_alerte) $datas[$alias] = $this->stock_reel.' '.img_warning($langs->trans("StockTooLow"));
else $datas[$alias] = $this->stock_reel;
}
- else if ($alias == 'label') $datas[$alias] = dol_trunc($obj->$alias,40);
- else if (preg_match('/price/i',$alias)) $datas[$alias] = price($obj->$alias);
- else if ($alias == 'datem') $datas[$alias] = dol_print_date($this->db->jdate($obj->$alias),'day');
- else if ($alias == 'status') $datas[$alias] = $this->LibStatut($obj->$alias,5);
+ elseif ($alias == 'label') $datas[$alias] = dol_trunc($obj->$alias,40);
+ elseif (preg_match('/price/i',$alias)) $datas[$alias] = price($obj->$alias);
+ elseif ($alias == 'datem') $datas[$alias] = dol_print_date($this->db->jdate($obj->$alias),'day');
+ elseif ($alias == 'status') $datas[$alias] = $this->LibStatut($obj->$alias,5);
else $datas[$alias] = $obj->$alias;
}
}
diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php
index fefa1f4da1f..a165957e384 100644
--- a/htdocs/product/canvas/service/actions_card_service.class.php
+++ b/htdocs/product/canvas/service/actions_card_service.class.php
@@ -206,7 +206,7 @@ class ActionsCardService
{
$dur=array("h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
}
- else if ($this->object->duration_value > 0)
+ elseif ($this->object->duration_value > 0)
{
$dur=array("h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
}
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 698d65795f1..d9fc881ce7b 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -175,8 +175,8 @@ if (empty($reshook))
{
$langs->load("errors");
if ($result == -1) $errors[] = 'ErrorBadBarCodeSyntax';
- else if ($result == -2) $errors[] = 'ErrorBarCodeRequired';
- else if ($result == -3) $errors[] = 'ErrorBarCodeAlreadyUsed';
+ elseif ($result == -2) $errors[] = 'ErrorBarCodeRequired';
+ elseif ($result == -3) $errors[] = 'ErrorBarCodeAlreadyUsed';
else $errors[] = 'FailedToValidateBarCode';
$error++;
@@ -1248,7 +1248,7 @@ else
* Product card
*/
- else if ($object->id > 0)
+ elseif ($object->id > 0)
{
// Fiche en mode edition
if ($action == 'edit' && $usercancreate)
@@ -1826,7 +1826,7 @@ else
{
$dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
}
- else if ($object->duration_value > 0)
+ elseif ($object->duration_value > 0)
{
$dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
}
@@ -1943,7 +1943,7 @@ else
dol_fiche_end();
}
}
- else if ($action != 'create')
+ elseif ($action != 'create')
{
exit;
}
diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php
index 4ddda70c7c0..93f58ba4b0b 100644
--- a/htdocs/product/class/html.formproduct.class.php
+++ b/htdocs/product/class/html.formproduct.class.php
@@ -104,7 +104,7 @@ class FormProduct
$sql.= ", ps.reel as stock";
}
}
- else if ($sumStock)
+ elseif ($sumStock)
{
$sql.= ", sum(ps.reel) as stock";
}
@@ -318,9 +318,9 @@ class FormProduct
$measuring_units=array();
if ($measuring_style == 'weight') $measuring_units=array(-6=>1,-3=>1,0=>1,3=>1,98=>1,99=>1);
- else if ($measuring_style == 'size') $measuring_units=array(-3=>1,-2=>1,-1=>1,0=>1,98=>1,99=>1);
- else if ($measuring_style == 'surface') $measuring_units=array(-6=>1,-4=>1,-2=>1,0=>1,98=>1,99=>1);
- else if ($measuring_style == 'volume') $measuring_units=array(-9=>1,-6=>1,-3=>1,0=>1,88=>1,89=>1,97=>1,99=>1,/* 98=>1 */); // Liter is not used as already available with dm3
+ elseif ($measuring_style == 'size') $measuring_units=array(-3=>1,-2=>1,-1=>1,0=>1,98=>1,99=>1);
+ elseif ($measuring_style == 'surface') $measuring_units=array(-6=>1,-4=>1,-2=>1,0=>1,98=>1,99=>1);
+ elseif ($measuring_style == 'volume') $measuring_units=array(-9=>1,-6=>1,-3=>1,0=>1,88=>1,89=>1,97=>1,99=>1,/* 98=>1 */); // Liter is not used as already available with dm3
$return.= '';
if ($adddefault) $return.= ''.$langs->trans("Default").' ';
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 8eae7052a74..9e07dc90d46 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1269,7 +1269,7 @@ class Product extends CommonObject
return -1;
}
}
- else if (isset($this->multilangs[$key])) {
+ elseif (isset($this->multilangs[$key])) {
$sql = "SELECT rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."product_lang";
$sql.= " WHERE fk_product=".$this->id;
@@ -2009,8 +2009,8 @@ class Product extends CommonObject
{
$sql.= " WHERE entity IN (".getEntity($this->element).")";
if ($ref) { $sql.= " AND ref = '".$this->db->escape($ref)."'";
- } else if ($ref_ext) { $sql.= " AND ref_ext = '".$this->db->escape($ref_ext)."'";
- } else if ($barcode) { $sql.= " AND barcode = '".$this->db->escape($barcode)."'";
+ } elseif ($ref_ext) { $sql.= " AND ref_ext = '".$this->db->escape($ref_ext)."'";
+ } elseif ($barcode) { $sql.= " AND barcode = '".$this->db->escape($barcode)."'";
}
}
@@ -2178,7 +2178,7 @@ class Product extends CommonObject
{
// Nothing loaded by default. List may be very long.
}
- else if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) // prices per quantity
+ elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) // prices per quantity
{
$sql = "SELECT price, price_ttc, price_min, price_min_ttc,";
$sql.= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid";
@@ -2229,7 +2229,7 @@ class Product extends CommonObject
return -1;
}
}
- else if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) // prices per customer and quantity
+ elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) // prices per customer and quantity
{
for ($i=1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++)
{
@@ -3912,9 +3912,9 @@ class Product extends CommonObject
if ($option == 'supplier' || $option == 'category') {
$url = DOL_URL_ROOT.'/product/fournisseurs.php?id='.$this->id;
- } else if ($option == 'stock') {
+ } elseif ($option == 'stock') {
$url = DOL_URL_ROOT.'/product/stock/product.php?id='.$this->id;
- } else if ($option == 'composition') {
+ } elseif ($option == 'composition') {
$url = DOL_URL_ROOT.'/product/composition/card.php?id='.$this->id;
} else {
$url = DOL_URL_ROOT.'/product/card.php?id='.$this->id;
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 521b9dfeca7..001efe037f4 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -112,7 +112,7 @@ if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->se
exit;
}
}
-else if($action==='save_composed_product')
+elseif($action==='save_composed_product')
{
$TProduct = GETPOST('TProduct', 'array');
if (!empty($TProduct))
diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php
index 3249671d173..dffb8ee0b2c 100644
--- a/htdocs/product/dynamic_price/class/price_parser.class.php
+++ b/htdocs/product/dynamic_price/class/price_parser.class.php
@@ -104,15 +104,15 @@ class PriceParser
{
return $langs->trans("ErrorPriceExpression".$code);
}
- else if (in_array($code, array(1, 2, 3, 4, 5, 8, 10, 11, 17, 21, 22))) //Errors which have 1 arg
+ elseif (in_array($code, array(1, 2, 3, 4, 5, 8, 10, 11, 17, 21, 22))) //Errors which have 1 arg
{
return $langs->trans("ErrorPriceExpression".$code, $info);
}
- else if (in_array($code, array(6, 23))) //Errors which have 2 args
+ elseif (in_array($code, array(6, 23))) //Errors which have 2 args
{
return $langs->trans("ErrorPriceExpression".$code, $info[0], $info[1]);
}
- else if (in_array($code, array(7, 12, 13, 15, 16, 18))) //Internal errors
+ elseif (in_array($code, array(7, 12, 13, 15, 16, 18))) //Internal errors
{
return $langs->trans("ErrorPriceExpressionInternal", $code);
}
diff --git a/htdocs/product/dynamic_price/editor.php b/htdocs/product/dynamic_price/editor.php
index 3e4a87fe9f9..84440a3595a 100644
--- a/htdocs/product/dynamic_price/editor.php
+++ b/htdocs/product/dynamic_price/editor.php
@@ -55,7 +55,7 @@ if (empty($eid)) //This also disables fetch when eid == 0
{
$eid = 0;
}
-else if ($action != 'delete')
+elseif ($action != 'delete')
{
$price_expression->fetch($eid);
}
@@ -94,7 +94,7 @@ if ($action == 'add')
}
}
}
- else if ($result < 0)
+ elseif ($result < 0)
{
setEventMessages("add find: ".$price_expression->error, $price_expression->errors, 'errors');
}
@@ -134,7 +134,7 @@ if ($action == 'update')
}
}
}
- else if ($result < 0)
+ elseif ($result < 0)
{
setEventMessages("update find: ".$price_expression->error, $price_expression->errors, 'errors');
}
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 8556160b767..e190e3a55d1 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -235,7 +235,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ReferenceSupplierIsAlreadyAssociatedWithAProduct",$productLink), null, 'errors');
}
- else if ($ret < 0)
+ elseif ($ret < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 56519e6f46b..f3e8ce50037 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -36,7 +36,7 @@ if ($type =='' && !$user->rights->service->lire) $type='0'; // Force global page
// Security check
if ($type=='0') $result=restrictedArea($user,'produit');
-else if ($type=='1') $result=restrictedArea($user,'service');
+elseif ($type=='1') $result=restrictedArea($user,'service');
else $result=restrictedArea($user,'produit|service');
// Load translation files required by the page
@@ -174,7 +174,7 @@ if ($type == '0')
print $statProducts;
$total=round($prodser[0][0])+round($prodser[0][1])+round($prodser[0][2]);
}
-else if ($type == '1')
+elseif ($type == '1')
{
print $statServices;
$total=round($prodser[1][0])+round($prodser[1][1])+round($prodser[1][2]);
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index ca3691edd83..491a66f9562 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -115,7 +115,7 @@ if (! empty($canvas))
// Security check
if ($search_type=='0') $result=restrictedArea($user,'produit','','','','','',$objcanvas);
-else if ($search_type=='1') $result=restrictedArea($user,'service','','','','','',$objcanvas);
+elseif ($search_type=='1') $result=restrictedArea($user,'service','','','','','',$objcanvas);
else $result=restrictedArea($user,'produit|service','','','','','',$objcanvas);
// Define virtualdiffersfromphysical
@@ -381,7 +381,7 @@ if ($resql)
{
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
}
- else if ($search_type == 1)
+ elseif ($search_type == 1)
{
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
}
@@ -787,7 +787,7 @@ if ($resql)
{
$dur=array("i"=>$langs->trans("Minutes"),"h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
}
- else if ((float) $duration_value > 0)
+ elseif ((float) $duration_value > 0)
{
$dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
}
diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php
index 687054d1cde..1c064922783 100644
--- a/htdocs/product/popuprop.php
+++ b/htdocs/product/popuprop.php
@@ -63,7 +63,7 @@ if ($type == '0')
{
$helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
}
-else if ($type == '1')
+elseif ($type == '1')
{
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
}
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 5c06bfee335..1c73758c5f2 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -1958,7 +1958,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
print $langs->trans('None');
}
}
- else if ($action != 'showlog_default_price' && $action != 'edit_price')
+ elseif ($action != 'showlog_default_price' && $action != 'edit_price')
{
// List of all prices by customers
print ''."\n";
diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php
index 40848e6bb81..af6d9336588 100644
--- a/htdocs/product/stats/card.php
+++ b/htdocs/product/stats/card.php
@@ -90,7 +90,7 @@ if (! $id && empty($ref))
//$title=$langs->trans("StatisticsOfProducts");
$title=$langs->trans("Statistics");
}
- else if ($type == '1')
+ elseif ($type == '1')
{
$helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
//$title=$langs->trans("StatisticsOfServices");
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index 82fc8cb7561..864b0dc89b6 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -433,7 +433,7 @@ class MouvementStock extends CommonObject
//print "qty=".$qty." newpmp=".$newpmp;
//exit;
}
- else if ($type == 1 || $type == 2)
+ elseif ($type == 1 || $type == 2)
{
// After a stock decrease, we don't change value of PMP for product.
$newpmp = $oldpmp;
@@ -465,7 +465,7 @@ class MouvementStock extends CommonObject
$this->errors[]=$this->db->lasterror();
$error = -3;
}
- else if (empty($fk_product_stock))
+ elseif (empty($fk_product_stock))
{
$fk_product_stock = $this->db->last_insert_id(MAIN_DB_PREFIX."product_stock");
}
@@ -822,7 +822,7 @@ class MouvementStock extends CommonObject
$result = -2;
}
}
- else if (is_array($dluo))
+ elseif (is_array($dluo))
{
if (isset($dluo['fk_product_stock']))
{
diff --git a/htdocs/product/stock/lib/replenishment.lib.php b/htdocs/product/stock/lib/replenishment.lib.php
index 486e8373255..86cb1a3d7ba 100644
--- a/htdocs/product/stock/lib/replenishment.lib.php
+++ b/htdocs/product/stock/lib/replenishment.lib.php
@@ -122,7 +122,7 @@ function ordered($product_id)
$sql .= ' ON cfd.fk_commande = cf.rowid WHERE';
if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) {
$sql .= ' cf.fk_statut < 3';
- } else if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) {
+ } elseif ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) {
$sql .= ' cf.fk_statut < 6 AND cf.rowid NOT IN ' . dispatchedOrders();
} else {
$sql .= ' cf.fk_statut < 5';
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index f6a694c57fa..68ad4d96789 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -468,7 +468,7 @@ if ($month > 0)
else
$sql.= " AND date_format(m.datem, '%m') = '$month'";
}
-else if ($year > 0)
+elseif ($year > 0)
{
$sql.= " AND m.datem BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php
index c0e2973b4f8..76616bf06bc 100644
--- a/htdocs/product/stock/replenishorders.php
+++ b/htdocs/product/stock/replenishorders.php
@@ -136,12 +136,12 @@ if ($search_datemonth > 0)
{
if ($search_dateyear > 0 && empty($search_dateday))
$sql.= " AND cf.date_creation BETWEEN '".$db->idate(dol_get_first_day($search_dateyear,$search_datemonth,false))."' AND '".$db->idate(dol_get_last_day($search_dateyear,$search_datemonth,false))."'";
- else if ($search_dateyear > 0 && ! empty($search_dateday))
+ elseif ($search_dateyear > 0 && ! empty($search_dateday))
$sql.= " AND cf.date_creation BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_datemonth, $search_dateday, $search_dateyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_datemonth, $search_dateday, $search_dateyear))."'";
else
$sql.= " AND date_format(cf.date_creation, '%m') = '".$search_datemonth."'";
}
-else if ($search_dateyear > 0)
+elseif ($search_dateyear > 0)
{
$sql.= " AND cf.date_creation BETWEEN '".$db->idate(dol_get_first_day($search_dateyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_dateyear,12,false))."'";
}
diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php
index 855675be956..b6c99d23374 100644
--- a/htdocs/product/traduction.php
+++ b/htdocs/product/traduction.php
@@ -277,7 +277,7 @@ if ($action == 'edit')
print '';
}
-else if ($action != 'add')
+elseif ($action != 'add')
{
if (! empty($object->multilangs))
{
diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index 5665a2fb505..e00d4ca6730 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -81,7 +81,7 @@ $yearofday=GETPOST('addtimeyear');
$daytoparse = $now;
if ($yearofday && $monthofday && $dayofday) $daytoparse=dol_mktime(0, 0, 0, $monthofday, $dayofday, $yearofday); // xxxofday is value of day after submit action 'addtime'
-else if ($year && $month && $day) $daytoparse=dol_mktime(0, 0, 0, $month, $day, $year); // this are value submited after submit of action 'submitdateselect'
+elseif ($year && $month && $day) $daytoparse=dol_mktime(0, 0, 0, $month, $day, $year); // this are value submited after submit of action 'submitdateselect'
if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id)
diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php
index 71755fbdca3..fd0d78b6a27 100644
--- a/htdocs/projet/admin/project.php
+++ b/htdocs/projet/admin/project.php
@@ -61,7 +61,7 @@ if ($action == 'setmainoptions')
else dolibarr_set_const($db, "PROJECT_HIDE_TASKS",1,'chaine',0,'',$conf->entity);
}
-else if ($action == 'updateMask')
+elseif ($action == 'updateMask')
{
$maskconstproject=GETPOST('maskconstproject','alpha');
$maskproject=GETPOST('maskproject','alpha');
@@ -99,7 +99,7 @@ if ($action == 'updateMaskTask')
}
}
-else if ($action == 'specimen')
+elseif ($action == 'specimen')
{
$modele=GETPOST('module','alpha');
@@ -144,7 +144,7 @@ else if ($action == 'specimen')
}
}
-else if ($action == 'specimentask')
+elseif ($action == 'specimentask')
{
$modele=GETPOST('module','alpha');
@@ -190,17 +190,17 @@ else if ($action == 'specimentask')
}
// Activate a model
-else if ($action == 'set')
+elseif ($action == 'set')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
// Activate a model for task
-else if ($action == 'settask')
+elseif ($action == 'settask')
{
$ret = addDocumentModel($value,'project_task', $label, $scandir);
}
-else if ($action == 'del')
+elseif ($action == 'del')
{
$ret = delDocumentModel($value, $type);
if ($ret > 0)
@@ -218,7 +218,7 @@ if ($action == 'deltask')
}
// Set default model
-else if ($action == 'setdoc')
+elseif ($action == 'setdoc')
{
dolibarr_set_const($db, "PROJECT_ADDON_PDF",$value,'chaine',0,'',$conf->entity);
@@ -230,7 +230,7 @@ else if ($action == 'setdoc')
}
}
-else if ($action == 'setdoctask')
+elseif ($action == 'setdoctask')
{
if (dolibarr_set_const($db, "PROJECT_TASK_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
{
@@ -247,7 +247,7 @@ else if ($action == 'setdoctask')
}
}
-else if ($action == 'setmod')
+elseif ($action == 'setmod')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@@ -255,7 +255,7 @@ else if ($action == 'setmod')
dolibarr_set_const($db, "PROJECT_ADDON",$value,'chaine',0,'',$conf->entity);
}
-else if ($action == 'setmodtask')
+elseif ($action == 'setmodtask')
{
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 454ccf446e0..fe3dac9d3ea 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -445,7 +445,7 @@ class Project extends CommonObject
{
$sql.= " WHERE rowid=".$id;
}
- else if (! empty($ref))
+ elseif (! empty($ref))
{
$sql.= " WHERE ref='".$this->db->escape($ref)."'";
$sql.= " AND entity IN (".getEntity('project').")";
@@ -1039,7 +1039,7 @@ class Project extends CommonObject
if (preg_match('/\.php$/',$option)) {
$url = dol_buildpath($option,1) . '?id=' . $this->id;
}
- else if ($option == 'task')
+ elseif ($option == 'task')
{
$url = DOL_URL_ROOT . '/projet/tasks.php?id=' . $this->id;
}
@@ -1155,7 +1155,7 @@ class Project extends CommonObject
{
$userAccess = 1;
}
- else if ($this->public && (($mode == 'read' && ! empty($user->rights->projet->lire)) || ($mode == 'write' && ! empty($user->rights->projet->creer)) || ($mode == 'delete' && ! empty($user->rights->projet->supprimer))))
+ elseif ($this->public && (($mode == 'read' && ! empty($user->rights->projet->lire)) || ($mode == 'write' && ! empty($user->rights->projet->creer)) || ($mode == 'delete' && ! empty($user->rights->projet->supprimer))))
{
$userAccess = 1;
}
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 96b21b09bf9..d4b0e4c8dae 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -604,7 +604,7 @@ foreach ($listofreferent as $key => $value)
if ($tablename != 'expensereport_det' && method_exists($element, 'fetch_thirdparty')) $element->fetch_thirdparty();
if ($tablename == 'don' || $tablename == 'chargesociales') $total_ht_by_line=$element->amount;
elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty);
- else if($tablename == 'fichinter') $total_ht_by_line=$element->getAmount();
+ elseif($tablename == 'fichinter') $total_ht_by_line=$element->getAmount();
elseif ($tablename == 'projet_task')
{
if ($idofelementuser)
@@ -633,7 +633,7 @@ foreach ($listofreferent as $key => $value)
if ($qualifiedfortotal) $total_ht = $total_ht + $total_ht_by_line;
if ($tablename == 'don' || $tablename == 'chargesociales') $total_ttc_by_line=$element->amount;
- else if($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount();
+ elseif($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount();
elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty);
elseif ($tablename == 'projet_task')
{
@@ -911,7 +911,7 @@ foreach ($listofreferent as $key => $value)
$element_doc='commande_fournisseur';
$filedir = $conf->fournisseur->commande->multidir_output[$element->entity].'/'.dol_sanitizeFileName($element->ref);
}
- else if ($element_doc === 'invoice_supplier') {
+ elseif ($element_doc === 'invoice_supplier') {
$element_doc='facture_fournisseur';
$filename = get_exdir($element->id,2,0,0,$element,'product').dol_sanitizeFileName($element->ref);
$filedir = $conf->fournisseur->facture->multidir_output[$element->entity].'/'.get_exdir($element->id,2,0,0,$element,'invoice_supplier').dol_sanitizeFileName($element->ref);
@@ -956,7 +956,7 @@ foreach ($listofreferent as $key => $value)
print dol_print_date($element->datep,'dayhour');
if ($element->datef && $element->datef > $element->datep) print " - ".dol_print_date($element->datef,'dayhour');
}
- else if (in_array($tablename, array('projet_task')))
+ elseif (in_array($tablename, array('projet_task')))
{
$tmpprojtime = $element->getSumOfAmount($elementuser, $dates, $datee); // $element is a task. $elementuser may be empty
print '';
@@ -970,19 +970,19 @@ foreach ($listofreferent as $key => $value)
// Third party or user
print ' ';
if (is_object($element->thirdparty)) print $element->thirdparty->getNomUrl(1,'',48);
- else if ($tablename == 'expensereport_det')
+ elseif ($tablename == 'expensereport_det')
{
$tmpuser=new User($db);
$tmpuser->fetch($expensereport->fk_user_author);
print $tmpuser->getNomUrl(1,'',48);
}
- else if ($tablename == 'payment_salary')
+ elseif ($tablename == 'payment_salary')
{
$tmpuser=new User($db);
$tmpuser->fetch($element->fk_user);
print $tmpuser->getNomUrl(1,'',48);
}
- else if ($tablename == 'don' || $tablename == 'stock_mouvement')
+ elseif ($tablename == 'don' || $tablename == 'stock_mouvement')
{
if ($element->fk_user_author > 0)
{
@@ -991,7 +991,7 @@ foreach ($listofreferent as $key => $value)
print $tmpuser2->getNomUrl(1,'',48);
}
}
- else if ($tablename == 'projet_task' && $key == 'project_task_time') // if $key == 'project_task', we don't want details per user
+ elseif ($tablename == 'projet_task' && $key == 'project_task_time') // if $key == 'project_task', we don't want details per user
{
print $elementuser->getNomUrl(1);
}
@@ -1004,7 +1004,7 @@ foreach ($listofreferent as $key => $value)
$total_ht_by_line=null;
$othermessage='';
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') $total_ht_by_line=$element->amount;
- else if($tablename == 'fichinter') $total_ht_by_line=$element->getAmount();
+ elseif($tablename == 'fichinter') $total_ht_by_line=$element->getAmount();
elseif ($tablename == 'stock_mouvement') $total_ht_by_line=$element->price*abs($element->qty);
elseif (in_array($tablename, array('projet_task')))
{
@@ -1045,7 +1045,7 @@ foreach ($listofreferent as $key => $value)
{
$total_ttc_by_line=null;
if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'payment_salary') $total_ttc_by_line=$element->amount;
- else if($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount();
+ elseif($tablename == 'fichinter') $total_ttc_by_line=$element->getAmount();
elseif ($tablename == 'stock_mouvement') $total_ttc_by_line=$element->price*abs($element->qty);
elseif ($tablename == 'projet_task')
{
@@ -1083,19 +1083,19 @@ foreach ($listofreferent as $key => $value)
{
print $expensereport->getLibStatut(5);
}
- else if ($element instanceof CommonInvoice)
+ elseif ($element instanceof CommonInvoice)
{
//This applies for Facture and FactureFournisseur
print $element->getLibStatut(5, $element->getSommePaiement());
}
- else if ($element instanceof Task)
+ elseif ($element instanceof Task)
{
if ($element->progress != '')
{
print $element->progress.' %';
}
}
- else if ($tablename == 'stock_mouvement')
+ elseif ($tablename == 'stock_mouvement')
{
print $element->getLibStatut(3);
}
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 252942ced6c..0d944099de3 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -320,12 +320,12 @@ if ($search_smonth > 0)
{
if ($search_syear > 0 && empty($search_sday))
$sql.= " AND p.dateo BETWEEN '".$db->idate(dol_get_first_day($search_syear,$search_smonth,false))."' AND '".$db->idate(dol_get_last_day($search_syear,$search_smonth,false))."'";
- else if ($search_syear > 0 && ! empty($search_sday))
+ elseif ($search_syear > 0 && ! empty($search_sday))
$sql.= " AND p.dateo BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_smonth, $search_sday, $search_syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_smonth, $search_sday, $search_syear))."'";
else
$sql.= " AND date_format(p.dateo, '%m') = '".$search_smonth."'";
}
-else if ($search_syear > 0)
+elseif ($search_syear > 0)
{
$sql.= " AND p.dateo BETWEEN '".$db->idate(dol_get_first_day($search_syear,1,false))."' AND '".$db->idate(dol_get_last_day($search_syear,12,false))."'";
}
@@ -333,12 +333,12 @@ if ($search_emonth > 0)
{
if ($search_eyear > 0 && empty($search_eday))
$sql.= " AND p.datee BETWEEN '".$db->idate(dol_get_first_day($search_eyear,$search_emonth,false))."' AND '".$db->idate(dol_get_last_day($search_eyear,$search_emonth,false))."'";
- else if ($search_eyear > 0 && ! empty($search_eday))
+ elseif ($search_eyear > 0 && ! empty($search_eday))
$sql.= " AND p.datee BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_emonth, $search_eday, $search_eyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_emonth, $search_eday, $search_eyear))."'";
else
$sql.= " AND date_format(p.datee, '%m') = '".$search_emonth."'";
}
-else if ($search_eyear > 0)
+elseif ($search_eyear > 0)
{
$sql.= " AND p.datee BETWEEN '".$db->idate(dol_get_first_day($search_eyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_eyear,12,false))."'";
}
@@ -760,7 +760,7 @@ while ($i < min($num,$limit))
print $nbofsalesrepresentative;
print '';
}
- else if ($nbofsalesrepresentative > 0)
+ elseif ($nbofsalesrepresentative > 0)
{
$userstatic=new User($db);
$j=0;
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index fb2399175c2..a17c42a3691 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -133,13 +133,13 @@ if ($search_dtstartmonth > 0)
{
if ($search_dtstartyear > 0 && empty($search_dtstartday)) {
$morewherefilterarray[]= " (t.dateo BETWEEN '".$db->idate(dol_get_first_day($search_dtstartyear,$search_dtstartmonth,false))."' AND '".$db->idate(dol_get_last_day($search_dtstartyear,$search_dtstartmonth,false))."')";
- }else if ($search_dtstartyear > 0 && ! empty($search_dtstartday)) {
+ }elseif ($search_dtstartyear > 0 && ! empty($search_dtstartday)) {
$morewherefilterarray[]= " (t.dateo BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_dtstartmonth, $search_dtstartday, $search_dtstartyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_dtstartmonth, $search_dtstartday, $search_dtstartyear))."')";
}else {
$morewherefilterarray[]= " date_format(t.dateo, '%m') = '".$search_dtstartmonth."'";
}
}
-else if ($search_dtstartyear > 0)
+elseif ($search_dtstartyear > 0)
{
$morewherefilterarray[]= " (t.dateo BETWEEN '".$db->idate(dol_get_first_day($search_dtstartyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_dtstartyear,12,false))."')";
}
@@ -148,13 +148,13 @@ if ($search_dtendmonth > 0)
{
if ($search_dtendyear > 0 && empty($search_dtendday)) {
$morewherefilterarray[]= " (t.datee BETWEEN '".$db->idate(dol_get_first_day($search_dtendyear,$search_dtendmonth,false))."' AND '".$db->idate(dol_get_last_day($search_dtendyear,$search_dtendmonth,false))."')";
- }else if ($search_dtendyear > 0 && ! empty($search_dtendday)) {
+ }elseif ($search_dtendyear > 0 && ! empty($search_dtendday)) {
$morewherefilterarray[]= " (t.datee BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_dtendmonth, $search_dtendday, $search_dtendyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_dtendmonth, $search_dtendday, $search_dtendyear))."')";
}else {
$morewherefilterarray[]= " date_format(t.datee, '%m') = '".$search_dtendmonth."'";
}
}
-else if ($search_dtendyear > 0)
+elseif ($search_dtendyear > 0)
{
$morewherefilterarray[]= " (t.datee BETWEEN '".$db->idate(dol_get_first_day($search_dtendyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_dtendyear,12,false))."')";
}
@@ -207,7 +207,7 @@ if ($action == 'createtask' && $user->rights->projet->creer)
$action='create';
$error++;
}
- else if (empty($_POST['task_parent']))
+ elseif (empty($_POST['task_parent']))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ChildOfProjectTask")), null, 'errors');
$action='create';
@@ -268,7 +268,7 @@ if ($action == 'createtask' && $user->rights->projet->creer)
header("Location: ".$backtopage);
exit;
}
- else if (empty($projectid))
+ elseif (empty($projectid))
{
header("Location: ".DOL_URL_ROOT.'/projet/tasks/list.php'.(empty($mode)?'':'?mode='.$mode));
exit;
@@ -283,7 +283,7 @@ if ($action == 'createtask' && $user->rights->projet->creer)
header("Location: ".$backtopage);
exit;
}
- else if (empty($id))
+ elseif (empty($id))
{
// We go back on task list
header("Location: ".DOL_URL_ROOT.'/projet/tasks/list.php'.(empty($mode)?'':'?mode='.$mode));
@@ -563,7 +563,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print '';
}
}
-else if ($id > 0 || ! empty($ref))
+elseif ($id > 0 || ! empty($ref))
{
/*
* Projet card in view mode
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 61ae1ce652e..a152000acaa 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -284,12 +284,12 @@ if ($search_smonth > 0)
{
if ($search_syear > 0 && empty($search_sday))
$sql.= " AND t.dateo BETWEEN '".$db->idate(dol_get_first_day($search_syear,$search_smonth,false))."' AND '".$db->idate(dol_get_last_day($search_syear,$search_smonth,false))."'";
- else if ($search_syear > 0 && ! empty($search_sday))
+ elseif ($search_syear > 0 && ! empty($search_sday))
$sql.= " AND t.dateo BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_smonth, $search_sday, $search_syear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_smonth, $search_sday, $search_syear))."'";
else
$sql.= " AND date_format(t.dateo, '%m') = '".$search_smonth."'";
}
-else if ($search_syear > 0)
+elseif ($search_syear > 0)
{
$sql.= " AND t.dateo BETWEEN '".$db->idate(dol_get_first_day($search_syear,1,false))."' AND '".$db->idate(dol_get_last_day($search_syear,12,false))."'";
}
@@ -297,12 +297,12 @@ if ($search_emonth > 0)
{
if ($search_eyear > 0 && empty($search_eday))
$sql.= " AND t.datee BETWEEN '".$db->idate(dol_get_first_day($search_eyear,$search_emonth,false))."' AND '".$db->idate(dol_get_last_day($search_eyear,$search_emonth,false))."'";
- else if ($search_eyear > 0 && ! empty($search_eday))
+ elseif ($search_eyear > 0 && ! empty($search_eday))
$sql.= " AND t.datee BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_emonth, $search_eday, $search_eyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_emonth, $search_eday, $search_eyear))."'";
else
$sql.= " AND date_format(t.datee, '%m') = '".$search_emonth."'";
}
-else if ($search_eyear > 0)
+elseif ($search_eyear > 0)
{
$sql.= " AND t.datee BETWEEN '".$db->idate(dol_get_first_day($search_eyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_eyear,12,false))."'";
}
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 9433925d933..e2025812e65 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -837,12 +837,12 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
{
if ($search_year > 0 && empty($search_day))
$sql.= " AND t.task_datehour BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
- else if ($search_year > 0 && ! empty($search_day))
+ elseif ($search_year > 0 && ! empty($search_day))
$sql.= " AND t.task_datehour BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(t.task_datehour, '%m') = '".$db->escape($search_month)."'";
}
- else if ($search_year > 0)
+ elseif ($search_year > 0)
{
$sql.= " AND t.task_datehour BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
@@ -1273,7 +1273,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print ' ';
print ' ';
}
- else if ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks
+ elseif ($user->rights->projet->lire || $user->rights->projet->all->creer) // Read project and enter time consumed on assigned tasks
{
if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer)
{
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index 669c64877ba..efbf449ae26 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -353,7 +353,7 @@ if ($action == 'add')
}
if (! empty($backtopage)) $urlback=$backtopage;
- else if (! empty($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION))
+ elseif (! empty($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION))
{
$urlback=$conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION;
// TODO Make replacement of __AMOUNT__, etc...
@@ -379,7 +379,7 @@ if ($action == 'add')
}
}
}
- else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox')
+ elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox')
{
$urlback=DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
if (price2num(GETPOST('amount','alpha'))) $urlback.='&amount='.price2num(GETPOST('amount','alpha'));
@@ -396,7 +396,7 @@ if ($action == 'add')
}
}
}
- else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal')
+ elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal')
{
$urlback=DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
if (price2num(GETPOST('amount','alpha'))) $urlback.='&amount='.price2num(GETPOST('amount','alpha'));
@@ -413,7 +413,7 @@ if ($action == 'add')
}
}
}
- else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'stripe')
+ elseif ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'stripe')
{
$urlback=DOL_MAIN_URL_ROOT.'/public/stripe/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref;
if (price2num(GETPOST('amount','alpha'))) $urlback.='&amount='.price2num(GETPOST('amount','alpha'));
diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php
index b580a508ed0..84ea1571cee 100644
--- a/htdocs/public/onlinesign/newonlinesign.php
+++ b/htdocs/public/onlinesign/newonlinesign.php
@@ -167,7 +167,7 @@ $logosmall=$mysoc->logo_small;
$logo=$mysoc->logo;
$paramlogo='ONLINE_SIGN_LOGO_'.$suffix;
if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo;
-else if (! empty($conf->global->ONLINE_SIGN_LOGO)) $logosmall=$conf->global->ONLINE_SIGN_LOGO;
+elseif (! empty($conf->global->ONLINE_SIGN_LOGO)) $logosmall=$conf->global->ONLINE_SIGN_LOGO;
//print ''."\n";
// Define urllogo
$urllogo='';
diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php
index acf986bb226..dab212b663e 100644
--- a/htdocs/public/opensurvey/studs.php
+++ b/htdocs/public/opensurvey/studs.php
@@ -109,7 +109,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) // bout
{
$nouveauchoix.="1";
}
- else if (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2')
+ elseif (isset($_POST["choix$i"]) && $_POST["choix$i"] == '2')
{
$nouveauchoix.="2";
}
@@ -211,7 +211,7 @@ if ($testmodifier)
{
$nouveauchoix.="1";
}
- else if (isset($_POST["choix".$i]) && $_POST["choix".$i] == '2')
+ elseif (isset($_POST["choix".$i]) && $_POST["choix".$i] == '2')
{
$nouveauchoix.="2";
}
@@ -462,7 +462,7 @@ while ($compteur < $num)
if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno')
{
if (((string) $car) == "1") print ' '.$langs->trans("Yes").' '."\n";
- else if (((string) $car) == "0") print ''.$langs->trans("No").' '."\n";
+ elseif (((string) $car) == "0") print ''.$langs->trans("No").' '."\n";
else print ' '."\n";
// Total
if (! isset($sumfor[$i])) $sumfor[$i] = 0;
@@ -473,7 +473,7 @@ while ($compteur < $num)
if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst')
{
if (((string) $car) == "1") print ''.$langs->trans("For").' '."\n";
- else if (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
+ elseif (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
else print ' '."\n";
// Total
if (! isset($sumfor[$i])) $sumfor[$i] = 0;
@@ -527,7 +527,7 @@ while ($compteur < $num)
if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno')
{
if (((string) $car) == "1") print ''.$langs->trans("For").' '."\n";
- else if (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
+ elseif (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
else print ' '."\n";
// Total
if (! isset($sumfor[$i])) $sumfor[$i] = 0;
@@ -538,7 +538,7 @@ while ($compteur < $num)
if (! empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst')
{
if (((string) $car) == "1") print ''.$langs->trans("For").' '."\n";
- else if (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
+ elseif (((string) $car) == "0") print ''.$langs->trans("Against").' '."\n";
else print ' '."\n";
// Total
if (! isset($sumfor[$i])) $sumfor[$i] = 0;
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 2b5874005f3..910d63e0d0b 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -255,7 +255,7 @@ $creditor=$mysoc->name;
$paramcreditor='ONLINE_PAYMENT_CREDITOR';
$paramcreditorlong='ONLINE_PAYMENT_CREDITOR_'.$suffix;
if (! empty($conf->global->$paramcreditorlong)) $creditor=$conf->global->$paramcreditorlong;
-else if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor;
+elseif (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$paramcreditor;
@@ -699,7 +699,7 @@ $logosmall=$mysoc->logo_small;
$logo=$mysoc->logo;
$paramlogo='ONLINE_PAYMENT_LOGO_'.$suffix;
if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo;
-else if (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO;
+elseif (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO;
//print ''."\n";
// Define urllogo
$urllogo='';
diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php
index 783493f375c..f9e83b4a5d6 100644
--- a/htdocs/public/payment/paymentko.php
+++ b/htdocs/public/payment/paymentko.php
@@ -216,7 +216,7 @@ $logosmall=$mysoc->logo_small;
$logo=$mysoc->logo;
$paramlogo='ONLINE_PAYMENT_LOGO_'.$suffix;
if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo;
-else if (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO;
+elseif (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO;
//print ''."\n";
// Define urllogo
$urllogo='';
diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php
index e48fc014749..2831da07b13 100644
--- a/htdocs/public/payment/paymentok.php
+++ b/htdocs/public/payment/paymentok.php
@@ -151,7 +151,7 @@ $logosmall=$mysoc->logo_small;
$logo=$mysoc->logo;
$paramlogo='ONLINE_PAYMENT_LOGO_'.$suffix;
if (! empty($conf->global->$paramlogo)) $logosmall=$conf->global->$paramlogo;
-else if (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO;
+elseif (! empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall=$conf->global->ONLINE_PAYMENT_LOGO;
//print ''."\n";
// Define urllogo
$urllogo='';
@@ -378,8 +378,8 @@ if ($ispaymentok)
// Define default choice for complementary actions
$option='';
if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $option='bankviainvoice';
- else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $option='bankdirect';
- else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $option='invoiceonly';
+ elseif (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $option='bankdirect';
+ elseif (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $option='invoiceonly';
if (empty($option)) $option='none';
$sendalsoemail = 1;
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 90082d638c2..68edf809fea 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -79,7 +79,7 @@ else {
$result=restrictedArea($user, 'reception');
if($origin == 'supplierorder'){
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) accessforbidden();
- }else if (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) accessforbidden();
+ }elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) accessforbidden();
}
$action = GETPOST('action','alpha');
@@ -209,7 +209,7 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
- } else if ($reshook < 0)
+ } elseif ($reshook < 0)
$error++;
}
@@ -388,7 +388,7 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_valid' && $confirm == 'yes' &&
+ elseif ($action == 'confirm_valid' && $confirm == 'yes' &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->reception->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->reception->reception_advance->validate)))
)
@@ -424,7 +424,7 @@ if (empty($reshook))
}
}
- else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->reception->supprimer)
+ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->reception->supprimer)
{
$result = $object->delete($user);
if ($result > 0)
@@ -447,7 +447,7 @@ if (empty($reshook))
}
}*/
- else if ($action == 'setdate_livraison' && $user->rights->reception->creer)
+ elseif ($action == 'setdate_livraison' && $user->rights->reception->creer)
{
//print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year'];
$datedelivery=dol_mktime(GETPOST('liv_hour','int'), GETPOST('liv_min','int'), 0, GETPOST('liv_month','int'), GETPOST('liv_day','int'), GETPOST('liv_year','int'));
@@ -461,7 +461,7 @@ if (empty($reshook))
}
// Action update
- else if ($action == 'settracking_number' || $action == 'settracking_url'
+ elseif ($action == 'settracking_number' || $action == 'settracking_url'
|| $action == 'settrueWeight'
|| $action == 'settrueWidth'
|| $action == 'settrueHeight'
@@ -498,7 +498,7 @@ if (empty($reshook))
}
// Build document
- else if ($action == 'builddoc') // En get ou en post
+ elseif ($action == 'builddoc') // En get ou en post
{
// Save last template used to generate document
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
@@ -590,7 +590,7 @@ if (empty($reshook))
/*
* Update a line
*/
- else if ($action == 'updateline' && $user->rights->reception->creer && GETPOST('save'))
+ elseif ($action == 'updateline' && $user->rights->reception->creer && GETPOST('save'))
{
// Clean parameters
$qty = 0;
@@ -689,7 +689,7 @@ if (empty($reshook))
}
}
- else if ($action == 'updateline' && $user->rights->reception->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
+ elseif ($action == 'updateline' && $user->rights->reception->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}
@@ -1218,7 +1218,7 @@ if ($action == 'create')
}
}
}
-else if ($id || $ref)
+elseif ($id || $ref)
/* *************************************************************************** */
/* */
/* Edit and view mode */
@@ -1979,7 +1979,7 @@ else if ($id || $ref)
print ' ';
print ' ';
}
- else if ($object->statut == 0)
+ elseif ($object->statut == 0)
{
// edit-delete buttons
print '';
diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php
index 8f3c45b3128..022b9db1924 100644
--- a/htdocs/reception/class/reception.class.php
+++ b/htdocs/reception/class/reception.class.php
@@ -297,7 +297,7 @@ class Reception extends CommonObject
}
}
}
- else if ($reshook < 0) $error++;
+ elseif ($reshook < 0) $error++;
if (! $error && ! $notrigger)
{
diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php
index 7fc1ed889f5..81379fa81ce 100644
--- a/htdocs/reception/contact.php
+++ b/htdocs/reception/contact.php
@@ -106,13 +106,13 @@ if ($action == 'addcontact' && $user->rights->reception->creer)
}
// bascule du statut d'un contact
-else if ($action == 'swapstatut' && $user->rights->reception->creer)
+elseif ($action == 'swapstatut' && $user->rights->reception->creer)
{
$result=$objectsrc->swapContactStatus(GETPOST('ligne'));
}
// Efface un contact
-else if ($action == 'deletecontact' && $user->rights->reception->creer)
+elseif ($action == 'deletecontact' && $user->rights->reception->creer)
{
$result = $objectsrc->delete_contact(GETPOST("lineid"));
diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php
index e4f588b7f0d..e4791a9970f 100644
--- a/htdocs/resource/contact.php
+++ b/htdocs/resource/contact.php
@@ -77,13 +77,13 @@ if ($action == 'addcontact' && $user->rights->resource->write)
}
// Toggle the status of a contact
-else if ($action == 'swapstatut' && $user->rights->resource->write)
+elseif ($action == 'swapstatut' && $user->rights->resource->write)
{
$result=$object->swapContactStatus(GETPOST('ligne','int'));
}
// Erase a contact
-else if ($action == 'deletecontact' && $user->rights->resource->write)
+elseif ($action == 'deletecontact' && $user->rights->resource->write)
{
$result = $object->delete_contact(GETPOST('lineid','int'));
diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php
index 4628f241728..74f24c36399 100644
--- a/htdocs/societe/admin/societe.php
+++ b/htdocs/societe/admin/societe.php
@@ -545,7 +545,7 @@ foreach ($dirsociete as $dirroot)
$modulequalified=1;
if (! empty($module->version)) {
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
- else if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
+ elseif ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
}
if ($modulequalified)
diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php
index 3b2fd88c6c6..e4e1e9b9dd9 100644
--- a/htdocs/societe/canvas/actions_card_common.class.php
+++ b/htdocs/societe/canvas/actions_card_common.class.php
@@ -310,7 +310,7 @@ abstract class ActionsCardCommon
$this->tpl['sales_representatives'].= $nbofsalesrepresentative;
$this->tpl['sales_representatives'].= '';
}
- else if ($nbofsalesrepresentative > 0)
+ elseif ($nbofsalesrepresentative > 0)
{
$userstatic=new User($this->db);
$i=0;
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 617e9f9a1f7..dbb7fbcd91b 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -471,7 +471,7 @@ if (empty($reshook))
}
if (GETPOST('deletephoto')) $object->logo = '';
- else if (! empty($_FILES['photo']['name'])) $object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
+ elseif (! empty($_FILES['photo']['name'])) $object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
// Check parameters
if (! GETPOST('cancel','alpha'))
@@ -631,7 +631,7 @@ if (empty($reshook))
{
$url=$_SERVER["PHP_SELF"]."?socid=".$object->id;
if (($object->client == 1 || $object->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $url=DOL_URL_ROOT."/comm/card.php?socid=".$object->id;
- else if ($object->fournisseur == 1) $url=DOL_URL_ROOT."/fourn/card.php?socid=".$object->id;
+ elseif ($object->fournisseur == 1) $url=DOL_URL_ROOT."/fourn/card.php?socid=".$object->id;
header("Location: ".$url);
exit;
@@ -1786,7 +1786,7 @@ else
if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0);
print ' ';
}
- else if ($object->codeclient_modifiable())
+ elseif ($object->codeclient_modifiable())
{
print ' ';
}
@@ -1826,7 +1826,7 @@ else
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
print ' ';
}
- else if ($object->codefournisseur_modifiable())
+ elseif ($object->codefournisseur_modifiable())
{
print ' ';
}
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 0c68562cb75..90c20ca1cf2 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2332,7 +2332,7 @@ class Societe extends CommonObject
{
$obj = $this->db->fetch_object($resql);
if ($mode == 'email') $property=$obj->email;
- else if ($mode == 'mobile') $property=$obj->phone_mobile;
+ elseif ($mode == 'mobile') $property=$obj->phone_mobile;
else $property=$obj->$mode;
// Show all contact. If hidedisabled is 1, showonly contacts with status = 1
@@ -2341,7 +2341,7 @@ class Societe extends CommonObject
if (empty($property))
{
if ($mode == 'email') $property=$langs->transnoentitiesnoconv("NoEMail");
- else if ($mode == 'mobile') $property=$langs->transnoentitiesnoconv("NoMobilePhone");
+ elseif ($mode == 'mobile') $property=$langs->transnoentitiesnoconv("NoMobilePhone");
}
if (!empty($obj->poste))
@@ -2465,7 +2465,7 @@ class Societe extends CommonObject
$obj = $this->db->fetch_object($resql);
if ($mode == 'email') $contact_property = dol_string_nospecial(dolGetFirstLastname($obj->firstname, $obj->lastname), ' ', array(","))." <".$obj->email.">";
- else if ($mode == 'mobile') $contact_property = $obj->phone_mobile;
+ elseif ($mode == 'mobile') $contact_property = $obj->phone_mobile;
}
return $contact_property;
}
@@ -2787,7 +2787,7 @@ class Societe extends CommonObject
$result = $mod->get_code($this->db, $this, $type);
if ($type == 'customer') $this->code_compta = $mod->code;
- else if ($type == 'supplier') $this->code_compta_fournisseur = $mod->code;
+ elseif ($type == 'supplier') $this->code_compta_fournisseur = $mod->code;
return $result;
}
@@ -2800,7 +2800,7 @@ class Societe extends CommonObject
else
{
if ($type == 'customer') $this->code_compta = '';
- else if ($type == 'supplier') $this->code_compta_fournisseur = '';
+ elseif ($type == 'supplier') $this->code_compta_fournisseur = '';
return 0;
}
@@ -3225,7 +3225,7 @@ class Societe extends CommonObject
// Define if third party is treated as company (or not) when nature is unknown
$isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default
if (! empty($this->tva_intra)) $isacompany=1;
- else if (! empty($this->typent_code) && $this->typent_code != 'TE_UNKNOWN')
+ elseif (! empty($this->typent_code) && $this->typent_code != 'TE_UNKNOWN')
{
// TODO Add a field is_a_company into dictionary
if (preg_match('/^TE_PRIVATE/', $this->typent_code)) $isacompany=0;
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index dd4134bae86..61292d4f4fe 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -313,7 +313,7 @@ if (!empty($sql_select))
} else {
$sql.= " AND date_format(".$dateprint.", '%m') = '".sprintf('%02d',$month)."'";
}
- } else if ($year > 0) {
+ } elseif ($year > 0) {
$start = dol_mktime(0, 0, 0, 1, 1, $year);
$end = dol_time_plus_duree($start,1,'y') - 1;
$sql.= " AND ".$dateprint." BETWEEN '".$db->idate($start)."' AND '".$db->idate($end)."'";
@@ -622,7 +622,7 @@ if ($sql_select)
}
$db->free($resql);
}
-else if (empty($type_element) || $type_element == -1)
+elseif (empty($type_element) || $type_element == -1)
{
print_barre_liste($langs->trans('ProductsIntoElements').' '.$typeElementString.' '.$button, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, '', '');
diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php
index 630b8fa4723..2144c11f3ed 100644
--- a/htdocs/societe/societecontact.php
+++ b/htdocs/societe/societecontact.php
@@ -82,7 +82,7 @@ if ($action == 'addcontact' && $user->rights->societe->creer)
}
// bascule du statut d'un contact
-else if ($action == 'swapstatut' && $user->rights->societe->creer)
+elseif ($action == 'swapstatut' && $user->rights->societe->creer)
{
if ($object->fetch($id))
{
@@ -95,7 +95,7 @@ else if ($action == 'swapstatut' && $user->rights->societe->creer)
}
// Efface un contact
-else if ($action == 'deletecontact' && $user->rights->societe->creer)
+elseif ($action == 'deletecontact' && $user->rights->societe->creer)
{
$object->fetch($id);
$result = $object->delete_contact($_GET["lineid"]);
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 0affce21c93..ab08caa6d9f 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -151,7 +151,7 @@ if (empty($reshook))
}
// Delete askprice
- else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->supplier_proposal->supprimer)
+ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->supplier_proposal->supprimer)
{
$result = $object->delete($user);
if ($result > 0) {
@@ -164,7 +164,7 @@ if (empty($reshook))
}
// Remove line
- else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->supplier_proposal->creer)
+ elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->supplier_proposal->creer)
{
$result = $object->deleteline($lineid);
// reorder lines
@@ -188,7 +188,7 @@ if (empty($reshook))
}
// Validation
- else if ($action == 'confirm_validate' && $confirm == 'yes' &&
+ elseif ($action == 'confirm_validate' && $confirm == 'yes' &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->supplier_proposal->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->supplier_proposal->validate_advance)))
)
@@ -222,7 +222,7 @@ if (empty($reshook))
}
}
- else if ($action == 'setdate_livraison' && $user->rights->supplier_proposal->creer)
+ elseif ($action == 'setdate_livraison' && $user->rights->supplier_proposal->creer)
{
$result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']));
if ($result < 0)
@@ -230,7 +230,7 @@ if (empty($reshook))
}
// Create askprice
- else if ($action == 'add' && $user->rights->supplier_proposal->creer)
+ elseif ($action == 'add' && $user->rights->supplier_proposal->creer)
{
$object->socid = $socid;
$object->fetch_thirdparty();
@@ -445,7 +445,7 @@ if (empty($reshook))
}
// Reopen proposal
- else if ($action == 'confirm_reopen' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) {
+ elseif ($action == 'confirm_reopen' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) {
// prevent browser refresh from reopening proposal several times
if ($object->statut == SupplierProposal::STATUS_SIGNED || $object->statut == SupplierProposal::STATUS_NOTSIGNED || $object->statut == SupplierProposal::STATUS_CLOSE) {
$object->reopen($user, SupplierProposal::STATUS_VALIDATED);
@@ -453,7 +453,7 @@ if (empty($reshook))
}
// Close proposal
- else if ($action == 'close' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) {
+ elseif ($action == 'close' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) {
// prevent browser refresh from reopening proposal several times
if ($object->statut == SupplierProposal::STATUS_SIGNED) {
$object->setStatut(SupplierProposal::STATUS_CLOSE);
@@ -461,7 +461,7 @@ if (empty($reshook))
}
// Set accepted/refused
- else if ($action == 'setstatut' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) {
+ elseif ($action == 'setstatut' && $user->rights->supplier_proposal->cloturer && ! GETPOST('cancel','alpha')) {
if (! GETPOST('statut')) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), null, 'errors');
$action = 'statut';
@@ -507,7 +507,7 @@ if (empty($reshook))
}
}
- else if ($action == "setabsolutediscount" && $user->rights->supplier_proposal->creer) {
+ elseif ($action == "setabsolutediscount" && $user->rights->supplier_proposal->creer) {
if ($_POST["remise_id"]) {
if ($object->id > 0) {
$result = $object->insert_discount($_POST["remise_id"]);
@@ -688,7 +688,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorQtyTooLowForThisSupplier"), null, 'errors');
}
}
- else if((GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') && empty($error)) // Free product. // $price_ht is already set
+ elseif((GETPOST('price_ht')!=='' || GETPOST('price_ttc')!=='') && empty($error)) // Free product. // $price_ht is already set
{
$pu_ht = price2num($price_ht, 'MU');
$pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
@@ -793,7 +793,7 @@ if (empty($reshook))
}
// Mise a jour d'une ligne dans la demande de prix
- else if ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('save') == $langs->trans("Save")) {
+ elseif ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('save') == $langs->trans("Save")) {
// Define info_bits
$info_bits = 0;
@@ -919,50 +919,50 @@ if (empty($reshook))
}
}
- else if ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
+ elseif ($action == 'updateline' && $user->rights->supplier_proposal->creer && GETPOST('cancel','alpha') == $langs->trans('Cancel')) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
}
// Set project
- else if ($action == 'classin' && $user->rights->supplier_proposal->creer) {
+ elseif ($action == 'classin' && $user->rights->supplier_proposal->creer) {
$object->setProject(GETPOST('projectid'),'int');
}
// Delai de livraison
- else if ($action == 'setavailability' && $user->rights->supplier_proposal->creer) {
+ elseif ($action == 'setavailability' && $user->rights->supplier_proposal->creer) {
$result = $object->availability($_POST['availability_id']);
}
// Conditions de reglement
- else if ($action == 'setconditions' && $user->rights->supplier_proposal->creer) {
+ elseif ($action == 'setconditions' && $user->rights->supplier_proposal->creer) {
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
}
- else if ($action == 'setremisepercent' && $user->rights->supplier_proposal->creer) {
+ elseif ($action == 'setremisepercent' && $user->rights->supplier_proposal->creer) {
$result = $object->set_remise_percent($user, $_POST['remise_percent']);
}
- else if ($action == 'setremiseabsolue' && $user->rights->supplier_proposal->creer) {
+ elseif ($action == 'setremiseabsolue' && $user->rights->supplier_proposal->creer) {
$result = $object->set_remise_absolue($user, $_POST['remise_absolue']);
}
// Mode de reglement
- else if ($action == 'setmode' && $user->rights->supplier_proposal->creer) {
+ elseif ($action == 'setmode' && $user->rights->supplier_proposal->creer) {
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
}
// Multicurrency Code
- else if ($action == 'setmulticurrencycode' && $user->rights->supplier_proposal->creer) {
+ elseif ($action == 'setmulticurrencycode' && $user->rights->supplier_proposal->creer) {
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
}
// Multicurrency rate
- else if ($action == 'setmulticurrencyrate' && $user->rights->supplier_proposal->creer) {
+ elseif ($action == 'setmulticurrencyrate' && $user->rights->supplier_proposal->creer) {
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')));
}
- else if ($action == 'update_extras') {
+ elseif ($action == 'update_extras') {
$object->oldcopy = dol_clone($object);
// Fill array 'array_options' with data from update form
@@ -1329,22 +1329,22 @@ if ($action == 'create')
}
// Confirm delete
- else if ($action == 'delete') {
+ elseif ($action == 'delete') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteAsk'), $langs->trans('ConfirmDeleteAsk', $object->ref), 'confirm_delete', '', 0, 1);
}
// Confirm reopen
- else if ($action == 'reopen') {
+ elseif ($action == 'reopen') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenAsk', $object->ref), 'confirm_reopen', '', 0, 1);
}
// Confirmation delete product/service line
- else if ($action == 'ask_deleteline') {
+ elseif ($action == 'ask_deleteline') {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
}
// Confirm validate askprice
- else if ($action == 'validate') {
+ elseif ($action == 'validate') {
$error = 0;
// on verifie si l'objet est en numerotation provisoire
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 4582d2582b0..4c2b6fbcc02 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -1953,7 +1953,7 @@ class SupplierProposal extends CommonObject
{
$ga[$obj->supplier_proposalid] = $obj->ref;
}
- else if ($shortlist == 2)
+ elseif ($shortlist == 2)
{
$ga[$obj->supplier_proposalid] = $obj->ref.' ('.$obj->name.')';
}
diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php
index 7e862e7682d..819618530be 100644
--- a/htdocs/supplier_proposal/contact.php
+++ b/htdocs/supplier_proposal/contact.php
@@ -81,7 +81,7 @@ if ($action == 'addcontact' && $permissiontoedit)
}
// Toggle the status of a contact
-else if ($action == 'swapstatut' && $permissiontoedit)
+elseif ($action == 'swapstatut' && $permissiontoedit)
{
if ($object->fetch($id))
{
@@ -94,7 +94,7 @@ else if ($action == 'swapstatut' && $permissiontoedit)
}
// Deleting a contact
-else if ($action == 'deletecontact' && $permissiontoedit)
+elseif ($action == 'deletecontact' && $permissiontoedit)
{
$object->fetch($id);
$result = $object->delete_contact(GETPOST("lineid",'int'));
diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php
index 82f5ad56416..6a9710a4b37 100644
--- a/htdocs/supplier_proposal/index.php
+++ b/htdocs/supplier_proposal/index.php
@@ -360,7 +360,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
{
print ' '.$langs->trans("XMoreLines", ($num - $nbofloop))." ";
}
- else if ($total>0)
+ elseif ($total>0)
{
print ''.$langs->trans("Total")." ".price($total)." ";
}
diff --git a/htdocs/takepos/customers.php b/htdocs/takepos/customers.php
index 41738861702..e17cce187be 100644
--- a/htdocs/takepos/customers.php
+++ b/htdocs/takepos/customers.php
@@ -353,7 +353,7 @@ if ($search_level_from != '' && $search_level_to != '')
$sortwhere = '(sortorder BETWEEN '.$search_level_from.' AND '.$search_level_to.') AS is_in_range';
}
// If only "from" parameter is set, search for everything GREATER THAN it
-else if ($search_level_from != '')
+elseif ($search_level_from != '')
{
// Ensure that this parameter is a number
$search_level_from = (int) $search_level_from;
@@ -362,7 +362,7 @@ else if ($search_level_from != '')
$sortwhere = '(sortorder >= '.$search_level_from.') AS is_in_range';
}
// If only "to" parameter is set, search for everything LOWER THAN it
-else if ($search_level_to != '')
+elseif ($search_level_to != '')
{
// Ensure that this parameter is a number
$search_level_to = (int) $search_level_to;
diff --git a/htdocs/takepos/genimg/index.php b/htdocs/takepos/genimg/index.php
index ff1b368b743..c3e26345a09 100644
--- a/htdocs/takepos/genimg/index.php
+++ b/htdocs/takepos/genimg/index.php
@@ -83,7 +83,7 @@ if ($query=="cat")
// Output
imagejpeg($image_p, null, 100);
}
-else if ($query=="pro")
+elseif ($query=="pro")
{
require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 6baf5e6cd0a..308bd47f799 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -66,8 +66,8 @@ if (!$placeid) { $placeid = 0; // not necesary
if ($action == 'valid' && $user->rights->facture->creer)
{
if ($pay=="cash") $bankaccount=$conf->global->CASHDESK_ID_BANKACCOUNT_CASH;
- else if ($pay=="card") $bankaccount=$conf->global->CASHDESK_ID_BANKACCOUNT_CB;
- else if ($pay=="cheque") $bankaccount=$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE;
+ elseif ($pay=="card") $bankaccount=$conf->global->CASHDESK_ID_BANKACCOUNT_CB;
+ elseif ($pay=="cheque") $bankaccount=$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE;
$now=dol_now();
$invoice = new Facture($db);
$invoice->fetch($placeid);
@@ -80,8 +80,8 @@ if ($action == 'valid' && $user->rights->facture->creer)
$payment->amounts[$invoice->id]=$invoice->total_ttc;
if ($pay=="cash") $payment->paiementid=4;
- else if ($pay=="card") $payment->paiementid=6;
- else if ($pay=="cheque") $payment->paiementid=7;
+ elseif ($pay=="card") $payment->paiementid=6;
+ elseif ($pay=="cheque") $payment->paiementid=7;
$payment->num_paiement=$invoice->ref;
$payment->create($user);
@@ -125,8 +125,7 @@ if ($action == "deleteline") {
$invoice->deleteline($idline);
$invoice->fetch($placeid);
}
- else
- if ($placeid > 0) { //If exist invoice, but no line selected, proced to delete last line
+ elseif ($placeid > 0) { //If exist invoice, but no line selected, proced to delete last line
$sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture='$placeid' order by rowid DESC";
$resql = $db->query($sql);
$row = $db->fetch_array($resql);
diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php
index c8d9b3f07bc..069e0ddde69 100644
--- a/htdocs/takepos/takepos.php
+++ b/htdocs/takepos/takepos.php
@@ -433,7 +433,7 @@ foreach($menus as $menu) {
echo ''.$langs->trans("Next").' ';
echo ''.$menu['title'].' ';
}
- else if ($i>9) echo ''.$menu['title'].' ';
+ elseif ($i>9) echo ''.$menu['title'].' ';
else echo ''.$menu['title'].' ';
}
?>
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index c5c2e77a4b8..f4799e7b17f 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -390,7 +390,7 @@ if (empty($reshook)) {
{
$object->entity = 0;
}
- else if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
+ elseif (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{
$object->entity = 1; // all users in master entity
}
@@ -1404,11 +1404,11 @@ else
{
$valuetoshow.=($valuetoshow?(' '.$langs->trans("or").' '):'').$langs->trans("LdapUacf_".$statutUACF);
}
- else if($userChangePassNextLogon)
+ elseif($userChangePassNextLogon)
{
$valuetoshow.=($valuetoshow?(' '.$langs->trans("or").' '):'').''.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).' ';
}
- else if($userDisabled)
+ elseif($userDisabled)
{
$valuetoshow.=($valuetoshow?(' '.$langs->trans("or").' '):'').''.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).' ';
}
@@ -1460,7 +1460,7 @@ else
{
print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin");
}
- else if ($object->admin)
+ elseif ($object->admin)
{
print $form->textwithpicto(yn($object->admin),$langs->trans("AdministratorDesc"),1,"admin");
}
@@ -1774,7 +1774,7 @@ else
{
print '';
}
- else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
+ elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
{
if ($object->email) print '';
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 8a7c778ad0e..fbc0237c37b 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -279,7 +279,7 @@ class User extends CommonObject
{
$sql.= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."') LIMIT 1";
}
- else if ($login)
+ elseif ($login)
{
$sql.= " AND u.login = '".$this->db->escape($login)."'";
}
@@ -538,7 +538,7 @@ class User extends CommonObject
$whereforadd="id=".$this->db->escape($rid);
// Ajout des droits induits
if (! empty($subperms)) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
- else if (! empty($perms)) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
+ elseif (! empty($perms)) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
}
else {
// On a pas demande un droit en particulier mais une liste de droits
@@ -3187,7 +3187,7 @@ class User extends CommonObject
$obj = $this->db->fetch_object($resql);
if ($mode == 'email') $user_property = dolGetFirstLastname($obj->firstname, $obj->lastname)." <".$obj->email.">";
- else if ($mode == 'mobile') $user_property = $obj->user_mobile;
+ elseif ($mode == 'mobile') $user_property = $obj->user_mobile;
}
return $user_property;
}
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index 0695e1b84bb..a6e443a26dc 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -326,7 +326,7 @@ class UserGroup extends CommonObject
$whereforadd="id=".$this->db->escape($rid);
// Ajout des droits induits
if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
- else if ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
+ elseif ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
// Pour compatibilite, si lowid = 0, on est en mode ajout de tout
// TODO A virer quand sera gere par l'appelant
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index 61c817a4c72..b940e6befe6 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -473,7 +473,7 @@ else
print '';
print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login');
if ($useringroup->admin && ! $useringroup->entity) print img_picto($langs->trans("SuperAdministrator"),'redstar');
- else if ($useringroup->admin) print img_picto($langs->trans("Administrator"),'star');
+ elseif ($useringroup->admin) print img_picto($langs->trans("Administrator"),'star');
print ' ';
print ''.$useringroup->lastname.' ';
print ''.$useringroup->firstname.' ';
diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php
index 65723b4d65d..f0673966f44 100644
--- a/htdocs/user/hierarchy.php
+++ b/htdocs/user/hierarchy.php
@@ -121,7 +121,7 @@ foreach($fulltree as $key => $val)
{
$li.=img_picto($langs->trans("SuperAdministrator"),'redstar');
}
- else if ($userstatic->admin)
+ elseif ($userstatic->admin)
{
$li.=img_picto($langs->trans("Administrator"),'star');
}
diff --git a/htdocs/user/home.php b/htdocs/user/home.php
index fb97549e9a1..efb1ba33b78 100644
--- a/htdocs/user/home.php
+++ b/htdocs/user/home.php
@@ -156,7 +156,7 @@ if ($resql)
{
print img_picto($langs->trans("SuperAdministrator"),'redstar');
}
- else if ($obj->admin)
+ elseif ($obj->admin)
{
print img_picto($langs->trans("Administrator"),'star');
}
diff --git a/htdocs/user/list.php b/htdocs/user/list.php
index dcede3a5576..ea8d340e0ae 100644
--- a/htdocs/user/list.php
+++ b/htdocs/user/list.php
@@ -504,7 +504,7 @@ while ($i < min($num,$limit))
{
print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"');
}
- else if ($obj->admin)
+ elseif ($obj->admin)
{
print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"');
}
@@ -553,7 +553,7 @@ while ($i < min($num,$limit))
$companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1);
}
- else if ($obj->ldap_sid)
+ elseif ($obj->ldap_sid)
{
print $langs->trans("DomainUser");
}
@@ -604,7 +604,7 @@ while ($i < min($num,$limit))
{
print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"');
}
- else if ($obj->admin2)
+ elseif ($obj->admin2)
{
print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"');
}
diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index c74178609aa..495cd3d913d 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -350,7 +350,7 @@ if ($result)
print img_picto($langs->trans("Active"),'tick');
print '';
}
- else if (in_array($obj->id, $permsuser)) // Permission granted by user
+ elseif (in_array($obj->id, $permsuser)) // Permission granted by user
{
if ($caneditperms)
{
@@ -361,7 +361,7 @@ if ($result)
print '';
}
- else if (is_array($permsgroupbyentity[$entity]))
+ elseif (is_array($permsgroupbyentity[$entity]))
{
if (in_array($obj->id, $permsgroupbyentity[$entity])) // Permission granted by group
{
diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php
index 93e85827c14..b4ad2460700 100644
--- a/htdocs/webservices/server_productorservice.php
+++ b/htdocs/webservices/server_productorservice.php
@@ -903,7 +903,7 @@ function deleteProductOrService($authentication, $listofidstring)
//$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel), 'listofid'=>$listofiddeleted);
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel), 'nbdeleted'=>0);
}
- else if (count($listofiddeleted) == 0)
+ elseif (count($listofiddeleted) == 0)
{
//$objectresp=array('result'=>array('result_code'=>'NOT_FOUND', 'result_label'=>'No product or service with id '.join(',',$listofid).' found'), 'listofid'=>$listofiddeleted);
$objectresp=array('result'=>array('result_code'=>'NOT_FOUND', 'result_label'=>'No product or service with id '.join(',',$listofid).' found'), 'nbdeleted'=>0);
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 1433ae5324c..db253adafbf 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -677,7 +677,7 @@ if ($action == 'addcontainer')
$error++;
$action='createcontainer';
}
- else if (! preg_match('/^[a-z0-9\-\_]+$/i', $objectpage->pageurl))
+ elseif (! preg_match('/^[a-z0-9\-\_]+$/i', $objectpage->pageurl))
{
$langs->load("errors");
setEventMessages($langs->transnoentities("ErrorFieldCanNotContainSpecialCharacters", $langs->transnoentities('WEBSITE_PAGENAME')), null, 'errors');
diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php
index 4063d2f9321..d63f80f459e 100755
--- a/scripts/user/sync_groups_ldap2dolibarr.php
+++ b/scripts/user/sync_groups_ldap2dolibarr.php
@@ -197,7 +197,7 @@ if ($result >= 0)
if($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_SID) {
$fuser->fetch('','',$userKey[0]); // Chargement du user concerné par le SID
- } else if($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) {
+ } elseif($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) {
$fuser->fetch('',$userKey[0]); // Chargement du user concerné par le login
}
diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php
index 320a1f495ad..6da28bc58f8 100755
--- a/scripts/user/sync_users_ldap2dolibarr.php
+++ b/scripts/user/sync_users_ldap2dolibarr.php
@@ -195,7 +195,7 @@ if ($result >= 0)
if($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_SID) {
$fuser->fetch('','',$ldapuser[$conf->global->LDAP_KEY_USERS]); // Chargement du user concerné par le SID
- } else if($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) {
+ } elseif($conf->global->LDAP_KEY_USERS == $conf->global->LDAP_FIELD_LOGIN) {
$fuser->fetch('',$ldapuser[$conf->global->LDAP_KEY_USERS]); // Chargement du user concerné par le login
}