diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 3c96a80926f..db3991eac7d 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -127,7 +127,7 @@ if (isModEnabled("product") || isModEnabled("service")) { echo ''; } -if (getDolGlobalString('BOM_SUB_BOM') && $filtertype!=1) { +if (getDolGlobalString('BOM_SUB_BOM') && $filtertype != 1) { print '
'.$langs->trans("or").'
'.$langs->trans("BOM"); print $form->select_bom('', 'bom_id', 0, 1, 0, '1', '', 1); } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 40140b43167..1a9286c6091 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -285,13 +285,13 @@ if (empty($reshook)) { $substitutionarray['__ONLINEPAYMENTLINK_INVOICE__'] = getHtmlOnlinePaymentLink('invoice', $obj->source_id); $substitutionarray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = getHtmlOnlinePaymentLink('contractline', $obj->source_id); - $substitutionarray['__SECUREKEYPAYMENT__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); + $substitutionarray['__SECUREKEYPAYMENT__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); if (!getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { - $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); - $substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); - $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); - $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); - $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); + $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYMENT_INVOICE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); + $substitutionarray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2); } else { $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'member'.$obj->source_id, 2); $substitutionarray['__SECUREKEYPAYMENT_DONATION__'] = dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN') . 'donation'.$obj->source_id, 2); @@ -305,28 +305,28 @@ if (empty($reshook)) { } /* For backward compatibility, deprecated */ if (isModEnabled('paypal') && getDolGlobalString('PAYPAL_SECURITY_TOKEN')) { - $substitutionarray['__SECUREKEYPAYPAL__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2); + $substitutionarray['__SECUREKEYPAYPAL__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2); if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) { - $substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2); + $substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2); } else { $substitutionarray['__SECUREKEYPAYPAL_MEMBER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'membersubscription'.$obj->source_id, 2); } if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) { - $substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2); + $substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2); } else { $substitutionarray['__SECUREKEYPAYPAL_ORDER__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'order'.$obj->source_id, 2); } if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) { - $substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2); + $substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2); } else { $substitutionarray['__SECUREKEYPAYPAL_INVOICE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'invoice'.$obj->source_id, 2); } if (!getDolGlobalString('PAYPAL_SECURITY_TOKEN_UNIQUE')) { - $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2); + $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN'), 2); } else { $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__'] = dol_hash(getDolGlobalString('PAYPAL_SECURITY_TOKEN') . 'contractline'.$obj->source_id, 2); } diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 9139e41d189..5b708cb3995 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -430,7 +430,7 @@ if ($object->fetch($id) >= 0) { $handle = @opendir($dir); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { - if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') { + if (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS') { $reg = array(); if (preg_match("/(.*)\.modules\.php$/i", $file, $reg)) { if ($reg[1] == 'example') { diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index cf3d18adbac..1f28a16a9d3 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -86,7 +86,7 @@ $handle = opendir($dir); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { - if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') { + if (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS') { if (preg_match("/(.*)\.(.*)\.(.*)/i", $file, $reg)) { $modulename = $reg[1]; if ($modulename == 'example') { diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 39bd6bb44a5..a3da222a216 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -206,7 +206,7 @@ if (GETPOST('action', 'aZ09') == 'confirm_remove' && GETPOST("confirm") == 'yes' $db->begin(); $discount = new DiscountAbsolute($db); - $result = $discount->fetch(GETPOST("remid")); + $result = $discount->fetch(GETPOSTINT("remid")); $result = $discount->delete($user); if ($result > 0) { $db->commit(); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index d3cbb3c2367..aec3c8390f1 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -893,7 +893,7 @@ if ($sall) { if ($search_billed != '' && $search_billed >= 0) { $sql .= ' AND c.facture = '.((int) $search_billed); } -if ($search_status <> '') { +if ($search_status != '') { if ($search_status <= 3 && $search_status >= -1) { // status from -1 to 3 are real status (other are virtual combination) if ($search_status == 1 && !isModEnabled('expedition')) { $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated' diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 80fff860a05..61a363ae3fa 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -470,7 +470,7 @@ if ($sall) { if ($search_billed != '' && $search_billed >= 0) { $sql .= ' AND c.facture = '.((int) $search_billed); } -if ($search_status <> '') { +if ($search_status != '') { if ($search_status <= 3 && $search_status >= -1) { // status from -1 to 3 are real status (other are virtual combination) if ($search_status == 1 && !isModEnabled('expedition')) { $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated' diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ba3707fd1bf..3a2d80e8709 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2757,7 +2757,7 @@ if (empty($reshook)) { $all_progress = GETPOST('all_progress', 'int'); foreach ($object->lines as $line) { $percent = $line->get_prev_progress($object->id); - if (floatval($all_progress) < floatval($percent)) { + if ((float) $all_progress < (float) $percent) { $mesg = $langs->trans("Line").' '.$i.' : '.$langs->trans("CantBeLessThanMinPercent"); setEventMessages($mesg, null, 'warnings'); $result = -1; @@ -3847,7 +3847,7 @@ if ($action == 'create') { if($( this ).prop("checked") && $.inArray($( this ).val(), '.json_encode($retainedWarrantyInvoiceAvailableType).' ) !== -1) { $(".retained-warranty-line").show(); - $("#new-situation-invoice-retained-warranty").val("'.floatval($retained_warranty_js_default).'"); + $("#new-situation-invoice-retained-warranty").val("'.(float) $retained_warranty_js_default.'"); } else{ $(".retained-warranty-line").hide(); @@ -5264,7 +5264,7 @@ if ($action == 'create') { } print ''; - $label = ($langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code)) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label; + $label = ($langs->trans("PaymentType".$objp->payment_code) != "PaymentType".$objp->payment_code) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label; print ''.dol_escape_htmltag($label.' '.$objp->num_payment).''; if (isModEnabled("banque")) { $bankaccountstatic->id = $objp->baid; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index de73c07b98a..cbf57df3ab7 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2488,7 +2488,7 @@ class Facture extends CommonInvoice $this->import_key = trim($this->import_key); } if (isset($this->retained_warranty)) { - $this->retained_warranty = floatval($this->retained_warranty); + $this->retained_warranty = (float) $this->retained_warranty; } @@ -5432,7 +5432,7 @@ class Facture extends CommonInvoice $hasDelay = $this->date_lim_reglement < ($now - $conf->facture->client->warning_delay); if ($hasDelay && !empty($this->retained_warranty) && !empty($this->retained_warranty_date_limit)) { $totalpaid = $this->getSommePaiement(); - $totalpaid = floatval($totalpaid); + $totalpaid = (float) $totalpaid; $RetainedWarrantyAmount = $this->getRetainedWarrantyAmount(); if ($totalpaid >= 0 && $RetainedWarrantyAmount >= 0) { if (($totalpaid < $this->total_ttc - $RetainedWarrantyAmount) && $this->date_lim_reglement < ($now - $conf->facture->client->warning_delay)) { @@ -5532,7 +5532,7 @@ class Facture extends CommonInvoice } if ($rounding < 0) { - $rounding = min(getDolGlobalString('MAIN_MAX_DECIMALS_UNIT'), $conf->global->MAIN_MAX_DECIMALS_TOT); + $rounding = min(getDolGlobalString('MAIN_MAX_DECIMALS_UNIT'), getDolGlobalString('MAIN_MAX_DECIMALS_TOT')); } if ($rounding > 0) { @@ -5559,7 +5559,7 @@ class Facture extends CommonInvoice $sql .= ' WHERE rowid='.((int) $this->id); if ($this->db->query($sql)) { - $this->retained_warranty = floatval($value); + $this->retained_warranty = (float) $value; return 1; } else { dol_syslog(get_class($this).'::setRetainedWarranty Erreur '.$sql.' - '.$this->db->error()); @@ -6755,7 +6755,7 @@ class FactureLigne extends CommonInvoiceLine if ($resql && $this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); - $returnPercent = floatval($res['situation_percent']); + $returnPercent = (float) $res['situation_percent']; if ($include_credit_note) { $sql = 'SELECT fd.situation_percent FROM '.MAIN_DB_PREFIX.'facturedet fd'; @@ -6767,7 +6767,7 @@ class FactureLigne extends CommonInvoiceLine $res = $this->db->query($sql); if ($res) { while ($obj = $this->db->fetch_object($res)) { - $returnPercent = $returnPercent + floatval($obj->situation_percent); + $returnPercent = $returnPercent + (float) $obj->situation_percent; } } else { dol_print_error($this->db); diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 32e05251fde..ae2a97958b7 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -141,7 +141,7 @@ if (empty($reshook)) { } elseif (substr($key, 0, 21) == 'multicurrency_amount_') { $cursorfacid = substr($key, 21); $multicurrency_amounts[$cursorfacid] = price2num(GETPOST($key)); - $multicurrency_totalpayment += floatval($multicurrency_amounts[$cursorfacid]); + $multicurrency_totalpayment += (float) $multicurrency_amounts[$cursorfacid]; if (!empty($multicurrency_amounts[$cursorfacid])) { $atleastonepaymentnotnull++; } @@ -301,7 +301,7 @@ if (empty($reshook)) { $invoiceid = 0; foreach ($paiement->amounts as $key => $amount) { $facid = $key; - if (is_numeric($amount) && $amount <> 0) { + if (is_numeric($amount) && $amount != 0) { if ($invoiceid != 0) { $invoiceid = -1; // There is more than one invoice payed by this payment } else { diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index adb1e38af89..63a47618cd7 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -308,7 +308,7 @@ print $form->editfieldval("Date", 'datep', $object->date, $object, $user->hasRig print ''; // Payment type (VIR, LIQ, ...) -$labeltype = $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; +$labeltype = $langs->trans("PaymentType".$object->type_code) != "PaymentType".$object->type_code ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; print ''.$langs->trans('PaymentMode').''.$labeltype; print $object->num_payment ? ' - '.$object->num_payment : ''; print ''; diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 7eba56434fe..e9ea56f19ed 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -258,7 +258,7 @@ class RemiseCheque extends CommonObject } if ($this->id > 0 && $this->errno == 0) { - if ($this->updateAmount() <> 0) { + if ($this->updateAmount() != 0) { $this->errno = -1027; dol_syslog("RemiseCheque::Create Error update amount ".$this->errno, LOG_ERR); } @@ -307,7 +307,7 @@ class RemiseCheque extends CommonObject if ($resql) { $num = $this->db->affected_rows($resql); - if ($num <> 1) { + if ($num != 1) { $this->errno = -2; dol_syslog("Remisecheque::Delete Erreur Lecture ID ($this->errno)"); } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 64335484aa1..b35b091f315 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -362,7 +362,7 @@ class Paiement extends CommonObject // Insert links amount / invoices foreach ($this->amounts as $key => $amount) { $facid = $key; - if (is_numeric($amount) && $amount <> 0) { + if (is_numeric($amount) && $amount != 0) { $amount = price2num($amount); $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount, multicurrency_amount, multicurrency_code, multicurrency_tx)"; $sql .= " VALUES (".((int) $facid).", ".((int) $this->id).", ".((float) $amount).", ".((float) $this->multicurrency_amounts[$key]).", ".($currencyofpayment ? "'".$this->db->escape($currencyofpayment)."'" : 'NULL').", ".(!empty($this->multicurrency_tx) ? (float) $currencytxofpayment : 1).")"; diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index dfb25dd6c69..5984c9f2f04 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -273,7 +273,7 @@ if ($action == 'create') { print ''; - if ($sumpaid <> $objp->amount) { + if ($sumpaid != $objp->amount) { $namef = "amount_".$objp->id; $nameRemain = "remain_".$objp->id; /* Disabled, we autofil the amount with remain to pay by default diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 48b82d45d8a..cee1d06260a 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1309,7 +1309,7 @@ class BonPrelevement extends CommonObject */ $ri = $this->AddFacture($fac[0], $fac[2], $fac[8], $fac[7], $fac[3], $fac[4], $fac[5], $fac[6], $type, $sourcetype); - if ($ri <> 0) { + if ($ri != 0) { $error++; } diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 6be43d6525d..2471ade63ee 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -375,7 +375,7 @@ if ($modecompta == 'BOOKKEEPING') { } - if ($showaccountdetail == 'all' || $resultN <> 0) { + if ($showaccountdetail == 'all' || $resultN != 0) { print ''; print ''; print '     '.length_accountg($cpt['account_number']).' - '.$cpt['account_label'].''; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 564de96b4f4..591d1c0a68b 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -719,7 +719,7 @@ if ($id > 0) { print ''; print ''.dol_print_date($db->jdate($objp->dp), 'day')."\n"; - $labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; + $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "".$labeltype.' '.$objp->num_payment."\n"; if (isModEnabled("banque")) { $bankaccountstatic->id = $objp->baid; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 5b0782a6598..645f1d0c25f 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -229,7 +229,7 @@ class PaymentSocialContribution extends CommonObject // Insere tableau des montants / factures foreach ($this->amounts as $key => $amount) { $contribid = $key; - if (is_numeric($amount) && $amount <> 0) { + if (is_numeric($amount) && $amount != 0) { $amount = price2num($amount); // If we want to closed paid invoices diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 0b89a923153..65d8cb7de58 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -713,7 +713,7 @@ if ($id > 0) { print ''.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.''; print ''; print ''.dol_print_date($db->jdate($objp->dp), 'day')."\n"; - $labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; + $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "".$labeltype.' '.$objp->num_payment."\n"; if (isModEnabled("banque")) { $bankaccountstatic->id = $objp->baid; diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php index 3d0d51bebf8..713cc9a6ed0 100644 --- a/htdocs/compta/tva/class/paymentvat.class.php +++ b/htdocs/compta/tva/class/paymentvat.class.php @@ -233,7 +233,7 @@ class PaymentVAT extends CommonObject // Insert table of amounts / invoices foreach ($this->amounts as $key => $amount) { $contribid = $key; - if (is_numeric($amount) && $amount <> 0) { + if (is_numeric($amount) && $amount != 0) { $amount = price2num($amount); // If we want to closed paid invoices diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index e160abfc3b8..8eac0e00140 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -891,18 +891,18 @@ class Tva extends CommonObject //$langs->load("mymodule"); $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid'); $this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid'); - if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) { + if ($status == self::STATUS_UNPAID && $alreadypaid != 0) { $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid'); $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid'); - if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) { + if ($status == self::STATUS_UNPAID && $alreadypaid != 0) { $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } } $statusType = 'status1'; - if ($status == 0 && $alreadypaid <> 0) { + if ($status == 0 && $alreadypaid != 0) { $statusType = 'status3'; } if ($status == 1) { diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 9f549577365..028ad27c755 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1028,7 +1028,7 @@ class Contact extends CommonObject $this->ref_ext = $obj->ref_ext; $this->civility_code = $obj->civility_code; - $this->civility = $obj->civility_code ? ($langs->trans("Civility".$obj->civility_code) != ("Civility".$obj->civility_code) ? $langs->trans("Civility".$obj->civility_code) : $obj->civility_code) : ''; + $this->civility = $obj->civility_code ? ($langs->trans("Civility".$obj->civility_code) != "Civility".$obj->civility_code ? $langs->trans("Civility".$obj->civility_code) : $obj->civility_code) : ''; $this->lastname = $obj->lastname; $this->firstname = $obj->firstname; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 9b6c0b4bf75..81683c81d18 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1712,7 +1712,7 @@ abstract class CommonDocGenerator $def = array( 'rank' => intval($extrafields->attributes[$object->table_element]['pos'][$key]), 'width' => 25, // in mm - 'status' => boolval($enabled), + 'status' => (bool) $enabled, 'title' => array( 'label' => $outputlangs->transnoentities($label) ), diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 575b3ab2da2..627f1b8c0e7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4847,7 +4847,7 @@ abstract class CommonObject $qty = $obj->qty; $total_ht = $obj->total_ht; - $total_discount_line = floatval(price2num(($pu_ht * $qty) - $total_ht, 'MT')); + $total_discount_line = (float) price2num(($pu_ht * $qty) - $total_ht, 'MT'); $total_discount += $total_discount_line; $i++; diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php index 4c7f1246587..e09a6ce88fb 100644 --- a/htdocs/core/class/cunits.class.php +++ b/htdocs/core/class/cunits.class.php @@ -424,7 +424,7 @@ class CUnits extends CommonDict */ public function unitConverter($value, $fk_unit, $fk_new_unit = 0) { - $value = floatval(price2num($value)); + $value = (float) price2num($value); $fk_unit = intval($fk_unit); // Calcul en unité de base @@ -463,10 +463,10 @@ class CUnits extends CommonDict // TODO : if base exists in unit dictionary table, remove this convertion exception and update convertion infos in database. // Example time hour currently scale 3600 will become scale 2 base 60 if ($unit->unit_type == 'time') { - return floatval($unit->scale); + return (float) $unit->scale; } - return pow($base, floatval($unit->scale)); + return pow($base, (float) $unit->scale); } } diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 07e3ffe8d94..abb82dd9e2e 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -152,8 +152,6 @@ class DiscountAbsolute */ public function fetch($rowid, $fk_facture_source = 0, $fk_invoice_supplier_source = 0) { - global $conf; - // Check parameters if (!$rowid && !$fk_facture_source && !$fk_invoice_supplier_source) { $this->error = 'ErrorBadParameters'; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index d0659dc3036..0a77e11981b 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2315,9 +2315,9 @@ class ExtraFields $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. - $dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') !='-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23'; - $dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') !='-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59'; - $dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') !='-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59'; + $dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') != '-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23'; + $dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') != '-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59'; + $dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') != '-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59'; if ($key_type == 'datetimegmt') { $value_key = array( 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'gmt'), diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 73d9e78a02c..f5a05e2bf97 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4039,7 +4039,7 @@ class Form $obj = $this->db->fetch_object($resql); // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut - $label = ($langs->trans("PaymentConditionShort" . $obj->code) != ("PaymentConditionShort" . $obj->code) ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); + $label = ($langs->trans("PaymentConditionShort" . $obj->code) != "PaymentConditionShort" . $obj->code ? $langs->trans("PaymentConditionShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); $this->cache_conditions_paiements[$obj->rowid]['code'] = $obj->code; $this->cache_conditions_paiements[$obj->rowid]['label'] = $label; $this->cache_conditions_paiements[$obj->rowid]['deposit_percent'] = $obj->deposit_percent; @@ -4088,7 +4088,7 @@ class Form $obj = $this->db->fetch_object($resql); // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut - $label = ($langs->trans("AvailabilityType" . $obj->code) != ("AvailabilityType" . $obj->code) ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); + $label = ($langs->trans("AvailabilityType" . $obj->code) != "AvailabilityType" . $obj->code ? $langs->trans("AvailabilityType" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); $this->cache_availability[$obj->rowid]['code'] = $obj->code; $this->cache_availability[$obj->rowid]['label'] = $label; $this->cache_availability[$obj->rowid]['position'] = $obj->position; @@ -4170,7 +4170,7 @@ class Form // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut $label = ($obj->label != '-' ? $obj->label : ''); - if ($langs->trans("DemandReasonType" . $obj->code) != ("DemandReasonType" . $obj->code)) { + if ($langs->trans("DemandReasonType" . $obj->code) != "DemandReasonType" . $obj->code) { $label = $langs->trans("DemandReasonType" . $obj->code); // So translation key DemandReasonTypeSRC_XXX will work } if ($langs->trans($obj->code) != $obj->code) { @@ -4269,7 +4269,7 @@ class Form $obj = $this->db->fetch_object($resql); // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); $this->cache_types_paiements[$obj->id]['id'] = $obj->id; $this->cache_types_paiements[$obj->id]['code'] = $obj->code; $this->cache_types_paiements[$obj->id]['label'] = $label; @@ -4583,7 +4583,7 @@ class Form $obj = $this->db->fetch_object($resql); // If traduction exist, we use it else we take the default label - $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != ("PaymentTypeShort" . $obj->code) ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); + $label = ($langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) != "PaymentTypeShort" . $obj->code ? $langs->transnoentitiesnoconv("PaymentTypeShort" . $obj->code) : ($obj->label != '-' ? $obj->label : '')); $this->cache_transport_mode[$obj->rowid]['rowid'] = $obj->rowid; $this->cache_transport_mode[$obj->rowid]['code'] = $obj->code; $this->cache_transport_mode[$obj->rowid]['label'] = $label; @@ -10891,7 +10891,7 @@ class Form $obj = $this->db->fetch_object($resql); // If translation exists, we use it, otherwise we take the default wording - $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != ("InvoiceSubtype" . $obj->rowid)) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); + $label = ($langs->trans("InvoiceSubtype" . $obj->rowid) != "InvoiceSubtype" . $obj->rowid) ? $langs->trans("InvoiceSubtype" . $obj->rowid) : (($obj->label != '-') ? $obj->label : ''); $this->cache_invoice_subtype[$obj->rowid]['rowid'] = $obj->rowid; $this->cache_invoice_subtype[$obj->rowid]['code'] = $obj->code; $this->cache_invoice_subtype[$obj->rowid]['label'] = $label; diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index c0d6174b1c8..346ec645e14 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -201,7 +201,7 @@ class FormAdmin $handle = opendir($dir); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { - if (is_file($dir."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && substr($file, 0, 5) != 'index') { + if (is_file($dir."/".$file) && substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS' && substr($file, 0, 5) != 'index') { if (preg_match('/lib\.php$/i', $file)) { continue; // We exclude library files } @@ -301,7 +301,7 @@ class FormAdmin $handle = opendir($dir); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { - if (is_file($dir."/".$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') { + if (is_file($dir."/".$file) && substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS') { $filelib = preg_replace('/(_backoffice|_frontoffice)?\.php$/i', '', $file); if (preg_match('/^index/i', $filelib)) { continue; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 9df01212214..3c09c410e22 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1469,7 +1469,7 @@ class FormOther } else { print ''; $i++; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 0112d617ac4..972458dd5c8 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -845,7 +845,7 @@ class FormTicket } $label = ($arraycategories['label'] != '-' ? $arraycategories['label'] : ''); - if ($outputlangs->trans("TicketCategoryShort".$arraycategories['code']) != ("TicketCategoryShort".$arraycategories['code'])) { + if ($outputlangs->trans("TicketCategoryShort".$arraycategories['code']) != "TicketCategoryShort".$arraycategories['code']) { $label = $outputlangs->trans("TicketCategoryShort".$arraycategories['code']); } elseif ($outputlangs->trans($arraycategories['code']) != $arraycategories['code']) { $label = $outputlangs->trans($arraycategories['code']); @@ -907,7 +907,7 @@ class FormTicket } print ajax_combobox('select'.$htmlname); - } elseif ($htmlname!='') { + } elseif ($htmlname != '') { $selectedgroups = array(); $groupvalue = ""; $groupticket=GETPOST($htmlname, 'aZ09'); @@ -958,7 +958,7 @@ class FormTicket $obj = $this->db->fetch_object($resql); if ($obj) { $label = ($obj->label != '-' ? $obj->label : ''); - if ($outputlangs->trans("TicketCategoryShort".$obj->code) != ("TicketCategoryShort".$obj->code)) { + if ($outputlangs->trans("TicketCategoryShort".$obj->code) != "TicketCategoryShort".$obj->code) { $label = $outputlangs->trans("TicketCategoryShort".$obj->code); } elseif ($outputlangs->trans($obj->code) != $obj->code) { $label = $outputlangs->trans($obj->code); @@ -1029,7 +1029,7 @@ class FormTicket $obj = $this->db->fetch_object($resql); if ($obj) { $label = ($obj->label != '-' ? $obj->label : ''); - if ($outputlangs->trans("TicketCategoryShort".$obj->code) != ("TicketCategoryShort".$obj->code)) { + if ($outputlangs->trans("TicketCategoryShort".$obj->code) != "TicketCategoryShort".$obj->code) { $label = $outputlangs->trans("TicketCategoryShort".$obj->code); } elseif ($outputlangs->trans($obj->code) != $obj->code) { $label = $outputlangs->trans($obj->code); diff --git a/htdocs/core/class/lessc.class.php b/htdocs/core/class/lessc.class.php index a3e6398a00a..0484968f526 100644 --- a/htdocs/core/class/lessc.class.php +++ b/htdocs/core/class/lessc.class.php @@ -1225,7 +1225,7 @@ class Lessc } list($color, $delta) = $args[2]; $color = $this->assertColor($color); - $delta = floatval($delta[1]); + $delta = (float) $delta[1]; return array($color, $delta); } @@ -1654,7 +1654,7 @@ class Lessc $i = 0; foreach ($rawComponents as $c) { $val = $this->reduce($c); - $val = isset($val[1]) ? floatval($val[1]) : 0; + $val = isset($val[1]) ? (float) $val[1] : 0; if ($i == 0) { $clamp = 360; @@ -1682,13 +1682,13 @@ class Lessc if ($c[0] == "number" && $c[2] == "%") { $components[] = 255 * ($c[1] / 100); } else { - $components[] = floatval($c[1]); + $components[] = (float) $c[1]; } } elseif ($i == 4) { if ($c[0] == "number" && $c[2] == "%") { $components[] = 1.0 * ($c[1] / 100); } else { - $components[] = floatval($c[1]); + $components[] = (float) $c[1]; } } else { break; diff --git a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php index 4259e1e1a63..ec02afa8817 100644 --- a/htdocs/core/filemanagerdol/connectors/php/connector.lib.php +++ b/htdocs/core/filemanagerdol/connectors/php/connector.lib.php @@ -649,7 +649,7 @@ function GetRootPath() // This can check only that this script isn't run from a virtual dir // But it avoids the problems that arise if it isn't checked - if ($position === false || $position <> strlen($sRealPath) - strlen($sSelfPath)) { + if ($position === false || $position != strlen($sRealPath) - strlen($sSelfPath)) { SendError(1, 'Sorry, can\'t map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.inc.php".'); } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 02683de3c61..cebf9ac7b3e 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -764,7 +764,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $nbFerie = 0; // Check to ensure we use correct parameters - if ((($timestampEnd - $timestampStart) % 86400) != 0) { + if (($timestampEnd - $timestampStart) % 86400 != 0) { return 'Error Dates must use same hours and must be GMT dates'; } diff --git a/htdocs/core/lib/doleditor.lib.php b/htdocs/core/lib/doleditor.lib.php index 43e59c01e65..275b69aea2b 100644 --- a/htdocs/core/lib/doleditor.lib.php +++ b/htdocs/core/lib/doleditor.lib.php @@ -87,8 +87,8 @@ function show_skin($fuser, $edit = 0) $handle = opendir($dirskin); if (is_resource($handle)) { while (($subdir = readdir($handle)) !== false) { - if (is_dir($dirskin."/".$subdir) && substr($subdir, 0, 1) <> '.' - && substr($subdir, 0, 3) <> 'CVS' && !preg_match('/common|phones/i', $subdir)) { + if (is_dir($dirskin."/".$subdir) && substr($subdir, 0, 1) != '.' + && substr($subdir, 0, 3) != 'CVS' && !preg_match('/common|phones/i', $subdir)) { // Disable not stable themes (dir ends with _exp or _dev) if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && preg_match('/_dev$/i', $subdir)) { continue; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f0c62c0bd5c..90e8faf65ed 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6044,7 +6044,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ } $amount = (is_numeric($amount) ? $amount : 0); // Check if amount is numeric, for example, an error occured when amount value = o (letter) instead 0 (number) if ($rounding == -1) { - $rounding = min(getDolGlobalString('MAIN_MAX_DECIMALS_UNIT'), $conf->global->MAIN_MAX_DECIMALS_TOT); + $rounding = min(getDolGlobalString('MAIN_MAX_DECIMALS_UNIT'), getDolGlobalString('MAIN_MAX_DECIMALS_TOT')); } $nbdecimal = $rounding; @@ -8244,7 +8244,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->delivery_date) ? dol_print_date($object->delivery_date, 'day', 0, $outputlangs) : ''); - $substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? ($outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : '')) : ''); + $substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? ($outputlangs->transnoentities("AvailabilityType".$object->availability_code) != 'AvailabilityType'.$object->availability_code ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : '')) : ''); $substitutionarray['__EXPIRATION_DATE__'] = (isset($object->fin_validite) ? dol_print_date($object->fin_validite, 'daytext') : ''); if (is_object($object) && ($object->element == 'adherent' || $object->element == 'member') && $object->id > 0) { diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 906a658b445..d2781ffd31a 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -97,7 +97,7 @@ function dolGetModulesDirs($subdir = '') continue; // We discard module if it contains disabled into name. } - if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS' && $file != 'includes') { + if (is_dir($dirroot.'/'.$file) && substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS' && $file != 'includes') { if (is_dir($dirroot.'/'.$file.'/core/modules'.$subdir.'/')) { $modulesdir[$dirroot.'/'.$file.'/core/modules'.$subdir.'/'] = $dirroot.'/'.$file.'/core/modules'.$subdir.'/'; } @@ -1690,7 +1690,7 @@ function weight_convert($weight, &$from_unit, $to_unit) * */ $weight = is_numeric($weight) ? $weight : 0; - while ($from_unit <> $to_unit) { + while ($from_unit != $to_unit) { if ($from_unit > $to_unit) { $weight = $weight * 10; $from_unit = $from_unit - 1; @@ -2513,7 +2513,7 @@ function colorHexToRgb($hex, $alpha = false, $returnArray = false) $rgb['g'] = hexdec($length == 6 ? substr($hex, 2, 2) : ($length == 3 ? str_repeat(substr($hex, 1, 1), 2) : 0)); $rgb['b'] = hexdec($length == 6 ? substr($hex, 4, 2) : ($length == 3 ? str_repeat(substr($hex, 2, 1), 2) : 0)); if ($alpha !== false) { - $rgb['a'] = floatval($alpha); + $rgb['a'] = (float) $alpha; $string = 'rgba('.implode(',', $rgb).')'; } else { $string = 'rgb('.implode(',', $rgb).')'; diff --git a/htdocs/core/lib/memory.lib.php b/htdocs/core/lib/memory.lib.php index 0236afaddf5..c4d7ddac7e9 100644 --- a/htdocs/core/lib/memory.lib.php +++ b/htdocs/core/lib/memory.lib.php @@ -272,7 +272,7 @@ function dol_setshmop($memoryid, $data, $expire) if ($handle) { $shm_bytes_written1 = shmop_write($handle, str_pad($size, 6), 0); $shm_bytes_written2 = shmop_write($handle, $newdata, 6); - if (($shm_bytes_written1 + $shm_bytes_written2) != (6 + dol_strlen($newdata))) { + if ($shm_bytes_written1 + $shm_bytes_written2 != 6 + dol_strlen($newdata)) { print "Couldn't write the entire length of data\n"; } shmop_close($handle); diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index abb50904502..7e422f130ff 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -263,7 +263,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'y if (!getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { $out .= '&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN); } else { - $out .= '&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2)); + $out .= '&securekey='.urlencode(dol_hash(getDolGlobalString('PAYMENT_SECURITY_TOKEN'), 2)); } } //if ($mode) $out.='&noidempotency=1'; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1449fb333f5..37c630ba212 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1263,7 +1263,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ // Option for set top margin height of footer after freetext if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalInt('PDF_FOOTER_TOP_MARGIN') === 0) { - $posy -= floatval(getDolGlobalString('PDF_FOOTER_TOP_MARGIN')); + $posy -= (float) getDolGlobalString('PDF_FOOTER_TOP_MARGIN'); } else { $posy--; } @@ -1317,7 +1317,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ // Option for set top margin height of footer after freetext if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalInt('PDF_FOOTER_TOP_MARGIN') === 0) { - $posy -= floatval(getDolGlobalString('PDF_FOOTER_TOP_MARGIN')); + $posy -= (float) getDolGlobalString('PDF_FOOTER_TOP_MARGIN'); } else { $posy--; } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index ddcae0393c5..b7af2262de4 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2860,7 +2860,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide $progressBarClass = 'progress-bar-info'; $progressCalculated = 0; if ($task->planned_workload) { - $progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2); + $progressCalculated = round(100 * (float) $task->duration_effective / (float) $task->planned_workload, 2); // this conf is actually hidden, by default we use 10% for "be carefull or warning" $warningRatio = getDolGlobalString('PROJECT_TIME_SPEND_WARNING_PERCENT') ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; @@ -2869,11 +2869,11 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide $diffTitle .= '
'.$langs->trans('ProgressCalculated').' : '.$progressCalculated.(isset($progressCalculated) ? '%' : ''); //var_dump($progressCalculated.' '.$warningRatio.' '.$task->progress.' '.floatval($task->progress * $warningRatio)); - if (floatval($progressCalculated) > floatval($task->progress * $warningRatio)) { + if ((float) $progressCalculated > (float) ($task->progress * $warningRatio)) { $progressBarClass = 'progress-bar-danger'; $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress - $progressCalculated).' '.$langs->trans("point")); $diff = ' '.($task->progress - $progressCalculated).'%'; - } elseif (floatval($progressCalculated) > floatval($task->progress)) { // warning if close at 10% + } elseif ((float) $progressCalculated > (float) $task->progress) { // warning if close at 10% $progressBarClass = 'progress-bar-warning'; $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress - $progressCalculated).' '.$langs->trans("point")); $diff = ' '.($task->progress - $progressCalculated).'%'; @@ -2937,18 +2937,18 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide $out .= ''; $out .= '
'; - $diffval = floatval($task->progress) - floatval($progressCalculated); + $diffval = (float) $task->progress - (float) $progressCalculated; if ($diffval >= 0) { // good - $out .= '
'; + $out .= '
'; if (!empty($task->progress)) { - $out .= '
'; + $out .= '
'; } $out .= '
'; } else { // bad - $out .= '
'; - $out .= '
'; + $out .= '
'; + $out .= '
'; $out .= '
'; } $out .= '
'; @@ -2977,17 +2977,17 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '') // define color according to time spend vs workload $badgeClass = 'badge '; if ($task->planned_workload) { - $progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2); + $progressCalculated = round(100 * (float) $task->duration_effective / (float) $task->planned_workload, 2); // this conf is actually hidden, by default we use 10% for "be carefull or warning" $warningRatio = getDolGlobalString('PROJECT_TIME_SPEND_WARNING_PERCENT') ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; - if (floatval($progressCalculated) > floatval($task->progress * $warningRatio)) { + if ((float) $progressCalculated > (float) ($task->progress * $warningRatio)) { $badgeClass .= 'badge-danger'; if (empty($tooltip)) { $tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%'; } - } elseif (floatval($progressCalculated) > floatval($task->progress)) { // warning if close at 10% + } elseif ((float) $progressCalculated > (float) $task->progress) { // warning if close at 10% $badgeClass .= 'badge-warning'; if (empty($tooltip)) { $tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%'; diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 60b52ba3101..bed487971d5 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -406,8 +406,8 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) $handle = opendir($dirtheme); if (is_resource($handle)) { while (($subdir = readdir($handle)) !== false) { - if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' - && substr($subdir, 0, 3) <> 'CVS' && !preg_match('/common|phones/i', $subdir)) { + if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) != '.' + && substr($subdir, 0, 3) != 'CVS' && !preg_match('/common|phones/i', $subdir)) { // Disable not stable themes (dir ends with _exp or _dev) if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && preg_match('/_dev$/i', $subdir)) { continue; diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 144d46d31de..8767a8a227c 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -581,7 +581,7 @@ function showWebsiteTemplates(Website $website) $handle = opendir($dirtheme); if (is_resource($handle)) { while (($subdir = readdir($handle)) !== false) { - if (is_file($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS' && preg_match('/\.zip$/i', $subdir)) { + if (is_file($dirtheme."/".$subdir) && substr($subdir, 0, 1) != '.' && substr($subdir, 0, 3) != 'CVS' && preg_match('/\.zip$/i', $subdir)) { $subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir); // Disable not stable themes (dir ends with _exp or _dev) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 13ff885a2d0..1f300718385 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -619,7 +619,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it global $langs; $langs->load("admin"); - if ($langs->transnoentitiesnoconv("Module".$this->numero."Name") != ("Module".$this->numero."Name")) { + if ($langs->transnoentitiesnoconv("Module".$this->numero."Name") != "Module".$this->numero."Name") { // If module name translation exists return $langs->transnoentitiesnoconv("Module".$this->numero."Name"); } else { @@ -632,7 +632,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } } - if ($langs->trans("Module".$this->name."Name") != ("Module".$this->name."Name")) { + if ($langs->trans("Module".$this->name."Name") != "Module".$this->name."Name") { // If module name translation exists return $langs->transnoentitiesnoconv("Module".$this->name."Name"); } @@ -653,7 +653,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it global $langs; $langs->load("admin"); - if ($langs->transnoentitiesnoconv("Module".$this->numero."Desc") != ("Module".$this->numero."Desc")) { + if ($langs->transnoentitiesnoconv("Module".$this->numero."Desc") != "Module".$this->numero."Desc") { // If module description translation exists return $langs->transnoentitiesnoconv("Module".$this->numero."Desc"); } else { @@ -666,7 +666,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } } - if ($langs->transnoentitiesnoconv("Module".$this->name."Desc") != ("Module".$this->name."Desc")) { + if ($langs->transnoentitiesnoconv("Module".$this->name."Desc") != "Module".$this->name."Desc") { // If module name translation exists return $langs->trans("Module".$this->name."Desc"); } diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index cf8e067b8d4..6a8feaefccd 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -261,7 +261,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode } else { if ($this->verif_syntax($code, $type) >= 0) { $is_dispo = $this->verif_dispo($db, $code, $product); - if ($is_dispo <> 0) { + if ($is_dispo != 0) { $result = -3; } else { $result = 0; diff --git a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php index 7c7921cf461..3037f29d33d 100644 --- a/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php @@ -262,7 +262,7 @@ class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode } else { if ($this->verif_syntax($code, $type) >= 0) { $is_dispo = $this->verif_dispo($db, $code, $thirdparty); - if ($is_dispo <> 0) { + if ($is_dispo != 0) { $result = -3; } else { $result = 0; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index dddb16a3dd7..3c9a8d348e3 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -719,7 +719,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = ($outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); if ($object->deposit_percent > 0) { $lib_condition_paiement = str_replace('__DEPOSIT_PERCENT__', $object->deposit_percent, $lib_condition_paiement); @@ -778,7 +778,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_availability = $outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : ''); + $lib_availability = $outputlangs->transnoentities("AvailabilityType".$object->availability_code) != 'AvailabilityType'.$object->availability_code ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : ''); $lib_availability = str_replace('\n', "\n", $lib_availability); $pdf->MultiCell(80, 4, $lib_availability, 0, 'L'); @@ -796,7 +796,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index a55f63c2233..74851a34c7e 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -921,7 +921,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = ($outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); if ($object->deposit_percent > 0) { $lib_condition_paiement = str_replace('__DEPOSIT_PERCENT__', $object->deposit_percent, $lib_condition_paiement); @@ -979,7 +979,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_availability = $outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : ''); + $lib_availability = $outputlangs->transnoentities("AvailabilityType".$object->availability_code) != 'AvailabilityType'.$object->availability_code ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : ''); $lib_availability = str_replace('\n', "\n", $lib_availability); $pdf->MultiCell(80, 4, $lib_availability, 0, 'L'); @@ -997,7 +997,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ed3701527c0..018d41dbb53 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1145,7 +1145,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = ($outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L'); @@ -1199,7 +1199,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); //#21654: add account number used for the debit if ($object->mode_reglement_code == "PRE") { require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php'; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 7a3e443d6ac..de9ec3f2a09 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1238,7 +1238,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = ($outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell($posxend - $posxval, 4, $lib_condition_paiement, 0, 'L'); @@ -1292,7 +1292,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); //#21654: add account number used for the debit if ($object->mode_reglement_code == "PRE") { diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 83059884b80..4868f64dbfc 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -454,7 +454,7 @@ class mailing_contacts1 extends MailingTargets $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); - if ($old <> $obj->email) { + if ($old != $obj->email) { $cibles[$j] = array( 'email' => $obj->email, 'fk_contact' => $obj->fk_contact, diff --git a/htdocs/core/modules/mailings/eventorganization.modules.php b/htdocs/core/modules/mailings/eventorganization.modules.php index c2a2c0d3c8d..006405f63c8 100644 --- a/htdocs/core/modules/mailings/eventorganization.modules.php +++ b/htdocs/core/modules/mailings/eventorganization.modules.php @@ -99,7 +99,7 @@ class mailing_eventorganization extends MailingTargets $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); - if ($old <> $obj->email) { + if ($old != $obj->email) { $otherTxt = ($obj->ref ? $langs->transnoentities("Project").'='.$obj->ref : ''); if (strlen($addDescription) > 0 && strlen($otherTxt) > 0) { $otherTxt .= ";"; diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 1ffd718a44f..43ece5ec3f6 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -297,7 +297,7 @@ class mailing_fraise extends MailingTargets $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); - if ($old <> $obj->email) { + if ($old != $obj->email) { $cibles[$j] = array( 'email' => $obj->email, 'fk_contact' => $obj->fk_contact, diff --git a/htdocs/core/modules/mailings/partnership.modules.php b/htdocs/core/modules/mailings/partnership.modules.php index 03d6a59dba8..739ef8c52f8 100644 --- a/htdocs/core/modules/mailings/partnership.modules.php +++ b/htdocs/core/modules/mailings/partnership.modules.php @@ -121,7 +121,7 @@ class mailing_partnership extends MailingTargets $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); - if ($old <> $obj->email) { + if ($old != $obj->email) { $otherTxt = ($obj->label ? $langs->transnoentities("PartnershipType").'='.$obj->label : ''); if (strlen($addDescription) > 0 && strlen($otherTxt) > 0) { $otherTxt .= ";"; diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 25d4d8a4192..9dc1c18f696 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -199,7 +199,7 @@ class mailing_pomme extends MailingTargets $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); - if ($old <> $obj->email) { + if ($old != $obj->email) { $cibles[$j] = array( 'email' => $obj->email, 'fk_contact' => $obj->fk_contact, diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index dcda0f2b0aa..b11f80712ec 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -69,7 +69,7 @@ class mailing_thirdparties extends MailingTargets $addDescription = ""; $addFilter = ""; - if (GETPOSTISSET("filter_client_thirdparties") && GETPOST("filter_client_thirdparties") <> '-1') { + if (GETPOSTISSET("filter_client_thirdparties") && GETPOST("filter_client_thirdparties") != '-1') { $addFilter .= " AND s.client=".((int) GETPOST("filter_client_thirdparties", 'int')); $addDescription = $langs->trans('ProspectCustomer')."="; if (GETPOST("filter_client_thirdparties") == 0) { @@ -84,7 +84,7 @@ class mailing_thirdparties extends MailingTargets $addDescription .= "Unknown status ".GETPOST("filter_client_thirdparties"); } } - if (GETPOSTISSET("filter_supplier_thirdparties") && GETPOST("filter_supplier_thirdparties") <> '-1') { + if (GETPOSTISSET("filter_supplier_thirdparties") && GETPOST("filter_supplier_thirdparties") != '-1') { $addFilter .= " AND s.fournisseur = ".((int) GETPOST("filter_supplier_thirdparties", 'int')); $addDescription = $langs->trans('Supplier')."="; if (GETPOST("filter_supplier_thirdparties") == 0) { @@ -188,7 +188,7 @@ class mailing_thirdparties extends MailingTargets $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); - if ($old <> $obj->email) { + if ($old != $obj->email) { $otherTxt = ($obj->label ? $langs->transnoentities("Category").'='.$obj->label : ''); if (strlen($addDescription) > 0 && strlen($otherTxt) > 0) { $otherTxt .= ";"; diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 4d0ac4ea0bb..b628890f8a8 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -129,7 +129,7 @@ class mailing_thirdparties_services_expired extends MailingTargets $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); - if ($old <> $obj->email) { + if ($old != $obj->email) { $cibles[$j] = array( 'email' => $obj->email, 'lastname' => $obj->name, // For thirdparties, lastname must be name diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 3fcbace468b..e1eed1ffb6d 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -165,7 +165,7 @@ class mailing_xinputfile extends MailingTargets if (!empty($buffer)) { //print 'xx'.dol_strlen($buffer).empty($buffer)."
\n"; if (isValidEMail($email)) { - if ($old <> $email) { + if ($old != $email) { $cibles[$j] = array( 'email' => $email, 'lastname' => $name, diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 36ae75629c2..865452c6e6a 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -704,7 +704,7 @@ class pdf_vinci extends ModelePDFMo $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = ($outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); @@ -720,7 +720,7 @@ class pdf_vinci extends ModelePDFMo $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 0f83b667b95..53a2b63ec49 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -925,7 +925,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_availability = $outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset($object->availability); + $lib_availability = ($outputlangs->transnoentities("AvailabilityType".$object->availability_code) != 'AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset($object->availability); $lib_availability = str_replace('\n', "\n", $lib_availability); $pdf->MultiCell(80, 4, $lib_availability, 0, 'L'); @@ -966,7 +966,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); if ($object->deposit_percent > 0) { $lib_condition_paiement = str_replace('__DEPOSIT_PERCENT__', $object->deposit_percent, $lib_condition_paiement); @@ -987,7 +987,7 @@ class pdf_azur extends ModelePDFPropales $pdf->MultiCell(80, 5, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 1cda855a095..4bed358b2ba 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1018,7 +1018,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_availability = $outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset($object->availability); + $lib_availability = ($outputlangs->transnoentities("AvailabilityType".$object->availability_code) != 'AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset($object->availability); $lib_availability = str_replace('\n', "\n", $lib_availability); $pdf->MultiCell(80, 4, $lib_availability, 0, 'L'); @@ -1059,7 +1059,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); if ($object->deposit_percent > 0) { $lib_condition_paiement = str_replace('__DEPOSIT_PERCENT__', $object->deposit_percent, $lib_condition_paiement); @@ -1080,7 +1080,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->MultiCell(80, 5, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 62091507449..50100967a03 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -490,7 +490,7 @@ class pdf_paiement extends CommonDocGenerator $pdf->SetFont('', '', $default_font_size - 1); $yp = 0; } - if ($oldprowid <> $lines[$j][7]) { + if ($oldprowid != $lines[$j][7]) { if ($yp > $this->tab_height - 15) { $pdf->SetFillColor(255, 255, 255); $pdf->Rect($this->marge_gauche + 1, $this->tab_top + 10 + $yp, $this->posxpaymentamount - $this->marge_droite - 3, $this->line_height, 'F', array(), array()); @@ -547,7 +547,7 @@ class pdf_paiement extends CommonDocGenerator $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][6], 0, 'R', 0); $yp = $yp + 5; - if ($oldprowid <> $lines[$j][7]) { + if ($oldprowid != $lines[$j][7]) { $oldprowid = $lines[$j][7]; } diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 89dcab90827..1c27d563ecb 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -329,7 +329,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode return -6; } else { $is_dispo = $this->verif_dispo($db, $code, $soc, $type); - if ($is_dispo <> 0) { + if ($is_dispo != 0) { $result = -3; } } diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index bf7a5ea84f4..4ae2207fecf 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 } else { if ($this->verif_syntax($code) >= 0) { $is_dispo = $this->verif_dispo($db, $code, $soc, $type); - if ($is_dispo <> 0) { + if ($is_dispo != 0) { $result = -3; } else { $result = 0; diff --git a/htdocs/core/modules/societe/mod_codecompta_digitaria.php b/htdocs/core/modules/societe/mod_codecompta_digitaria.php index 0a33980e694..ccb480dcc52 100644 --- a/htdocs/core/modules/societe/mod_codecompta_digitaria.php +++ b/htdocs/core/modules/societe/mod_codecompta_digitaria.php @@ -237,7 +237,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode if (!isset($conf->global->COMPANY_DIGITARIA_UNIQUE_CODE) || getDolGlobalString('COMPANY_DIGITARIA_UNIQUE_CODE')) { $disponibility = $this->checkIfAccountancyCodeIsAlreadyUsed($db, $this->code, $type); - while ($disponibility <> 0 && $i < 1000) { + while ($disponibility != 0 && $i < 1000) { $widthsupplier = $this->supplieraccountancycodecharacternumber; $widthcustomer = $this->customeraccountancycodecharacternumber; diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index de7a1f65f5e..76db4f7a157 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -855,7 +855,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); + $lib_condition_paiement = ($outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L'); @@ -910,7 +910,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_availability = $outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : ''); + $lib_availability = $outputlangs->transnoentities("AvailabilityType".$object->availability_code) != 'AvailabilityType'.$object->availability_code ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : ''); $lib_availability = str_replace('\n', "\n", $lib_availability); $pdf->MultiCell(80, 4, $lib_availability, 0, 'L'); @@ -928,7 +928,7 @@ class pdf_eagle_proforma extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 940a4f09a6d..44abdcd64a3 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -875,7 +875,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = ($outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); @@ -891,7 +891,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 09604265236..1bbb8cbf623 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -754,7 +754,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = ($outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); @@ -770,7 +770,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index ee84d168da9..958382e0a34 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -779,7 +779,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = ($outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); @@ -797,7 +797,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(80, 5, $titre, 0, 'L'); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy - 2); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index d87861f0ab9..b500aeae310 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -874,7 +874,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); + $lib_condition_paiement = ($outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); @@ -890,7 +890,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - $diffsizetitle); $pdf->SetXY($posxval, $posy); - $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != ('PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); + $lib_mode_reg = $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) != 'PaymentType'.$object->mode_reglement_code ? $outputlangs->transnoentities("PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement); $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); $posy = $pdf->GetY() + 2; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 1499e29b7fa..b4d72e29738 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -848,7 +848,7 @@ if (!empty($id) && $action != 'edit') { print ''; print ''.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.''; print ''.dol_print_date($db->jdate($objp->dp), 'day')."\n"; - $labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; + $labeltype = ($langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "".$labeltype.' '.$objp->num_payment."\n"; print ''.price($objp->amount)."\n"; print ""; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 0a065a71933..b8a07790426 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -325,7 +325,7 @@ if ($socid > 0) { if ($socid) { $sql .= " AND e.fk_soc = ".((int) $socid); } -if ($search_status <> '' && $search_status >= 0) { +if ($search_status != '' && $search_status >= 0) { $sql .= " AND e.fk_statut = ".((int) $search_status); } if ($search_ref_customer != '') { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 5426fc1a8ac..90f808087cd 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1970,7 +1970,7 @@ if ($action == 'create') { print $paymentexpensereportstatic->getNomUrl(1); print ''; print ''.dol_print_date($db->jdate($objp->dp), 'day')."\n"; - $labeltype = $langs->trans("PaymentType".$objp->payment_code) != ("PaymentType".$objp->payment_code) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_type; + $labeltype = $langs->trans("PaymentType".$objp->payment_code) != "PaymentType".$objp->payment_code ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_type; print "".$labeltype.' '.$objp->num_payment."\n"; // Bank account if (isModEnabled("banque")) { diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index 6f9dc7e8355..5b67b635ff4 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -586,7 +586,7 @@ while ($i < $imaxinloop) { // Pyament type if (!empty($arrayfields['c.libelle']['checked'])) { - $payment_type = $langs->trans("PaymentType".$objp->paiement_type) != ("PaymentType".$objp->paiement_type) ? $langs->trans("PaymentType".$objp->paiement_type) : $objp->paiement_libelle; + $payment_type = $langs->trans("PaymentType".$objp->paiement_type) != "PaymentType".$objp->paiement_type ? $langs->trans("PaymentType".$objp->paiement_type) : $objp->paiement_libelle; print ''.$payment_type.' '.dol_trunc($objp->num_payment, 32).''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index f004f25b290..0f83e21ea93 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1512,7 +1512,7 @@ if ($action == 'create') { $db->free($resql); // Add new line - if ($object->statut == 0 && $user->hasRight('ficheinter', 'creer') && $action <> 'editline' && !getDolGlobalString('FICHINTER_DISABLE_DETAILS')) { + if ($object->statut == 0 && $user->hasRight('ficheinter', 'creer') && $action != 'editline' && !getDolGlobalString('FICHINTER_DISABLE_DETAILS')) { if (!$num) { print '
'; print ''; diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 4ca0db593c5..a9e401840fe 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -243,7 +243,7 @@ class PaiementFourn extends Paiement $this->db->begin(); - if ($totalamount <> 0) { // On accepte les montants negatifs + if ($totalamount != 0) { // On accepte les montants negatifs $ref = $this->getNextNumRef(is_object($thirdparty) ? $thirdparty : ''); if ($way == 'dolibarr') { @@ -266,7 +266,7 @@ class PaiementFourn extends Paiement // Insere tableau des montants / factures foreach ($this->amounts as $key => $amount) { $facid = $key; - if (is_numeric($amount) && $amount <> 0) { + if (is_numeric($amount) && $amount != 0) { $amount = price2num($amount); $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn_facturefourn (fk_facturefourn, fk_paiementfourn, amount, multicurrency_amount, multicurrency_code, multicurrency_tx)'; $sql .= " VALUES (".((int) $facid).", ".((int) $this->id).", ".((float) $amount).', '.((float) $this->multicurrency_amounts[$key]).', '.($currencyofpayment ? "'".$this->db->escape($currencyofpayment)."'" : 'NULL').', '.(!empty($currencytxofpayment) ? (float) $currencytxofpayment : 1).')'; @@ -408,7 +408,7 @@ class PaiementFourn extends Paiement $error++; } - if ($totalamount <> 0 && $error == 0) { // On accepte les montants negatifs + if ($totalamount != 0 && $error == 0) { // On accepte les montants negatifs $this->amount = $total; $this->total = $total; $this->multicurrency_amount = $mtotal; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index d275fe0a94e..de1e9ae45ae 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -346,7 +346,7 @@ if (empty($reshook)) { $invoiceid = 0; foreach ($paiement->amounts as $key => $amount) { $facid = $key; - if (is_numeric($amount) && $amount <> 0) { + if (is_numeric($amount) && $amount != 0) { if ($invoiceid != 0) { $invoiceid = -1; // There is more than one invoice payed by this payment } else { diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index e6112780885..93de58280d7 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -205,7 +205,7 @@ if ($result > 0) { print ''; // Payment mode - $labeltype = $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; + $labeltype = $langs->trans("PaymentType".$object->type_code) != "PaymentType".$object->type_code ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; print ''; print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index 25b970a77da..d0b5b20610e 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -193,7 +193,7 @@ if ($action == "set") { if ($fp) { while (!feof($fp)) { $buf = fgets($fp, 4096); - if (substr($buf, 0, 2) <> '--') { + if (substr($buf, 0, 2) != '--') { $buf = preg_replace('/--(.+)*/', '', $buf); $buffer .= $buf; } @@ -405,7 +405,7 @@ if ($action == "set") { $buffer = ''; while (!feof($fp)) { $buf = fgets($fp, 4096); - if (substr($buf, 0, 2) <> '--') { + if (substr($buf, 0, 2) != '--') { $buffer .= $buf."§"; } } diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 6e101a7e3c3..20035b2f935 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -103,7 +103,7 @@ $error = 0; // If install, check password and password_verification used to create admin account if ($action == "set") { - if ($pass <> $pass_verif) { + if ($pass != $pass_verif) { header("Location: step4.php?error=1&selectlang=$setuplang".(isset($login) ? '&login='.$login : '')); exit; } diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 1014f3f367b..ce19af91590 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -102,7 +102,7 @@ $search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if ($key == "lang") { - $search[$key] = GETPOST('search_'.$key, 'alpha')!='0' ? GETPOST('search_'.$key, 'alpha') : ''; + $search[$key] = GETPOST('search_'.$key, 'alpha') != '0' ? GETPOST('search_'.$key, 'alpha') : ''; } else { $search[$key] = GETPOST('search_'.$key, 'alpha'); } diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 885440a6812..1285b09c9cc 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -177,7 +177,7 @@ if ($action == 'add_payment') { // Update loan schedule with payment value if (!$error && !empty($line)) { // If payment values are modified, recalculate schedule - if (($line->amount_capital <> $pay_amount_capital) || ($line->amount_insurance <> $pay_amount_insurance) || ($line->amount_interest <> $pay_amount_interest)) { + if (($line->amount_capital != $pay_amount_capital) || ($line->amount_insurance != $pay_amount_insurance) || ($line->amount_interest != $pay_amount_interest)) { $arr_term = loanCalcMonthlyPayment(($pay_amount_capital + $pay_amount_interest), $remaindertopay, ($loan->rate / 100), $echance, $loan->nbterm); foreach ($arr_term as $k => $v) { // Update fk_bank for current line diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 4999067b62c..1e1a2267067 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -123,7 +123,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets $old = ''; while ($i < $num) { $obj = $this->db->fetch_object($result); - if ($old <> $obj->email) { + if ($old != $obj->email) { $target[$j] = array( 'email' => $obj->email, 'name' => $obj->lastname, diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index 4962830db07..c3900271e42 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -392,7 +392,7 @@ class Mos extends DolibarrApi if (empty($value["qty"])) { throw new RestException(500, "Field qty required in ".$arrayname); } - if ($value["qty"]!=0) { + if ($value["qty"] != 0) { $qtytoprocess = $value["qty"]; if (isset($value["fk_warehouse"])) { // If there is a warehouse to set if (!($value["fk_warehouse"] > 0)) { // If there is no warehouse set. diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c25993cac5d..cff3bb2cb2a 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2891,11 +2891,11 @@ if ($action != 'create' && $action != 'edit') { $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { if ($usercancreate) { - if (!isset($object->no_button_edit) || $object->no_button_edit <> 1) { + if (!isset($object->no_button_edit) || $object->no_button_edit != 1) { print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, '', $usercancreate); } - if (!isset($object->no_button_copy) || $object->no_button_copy <> 1) { + if (!isset($object->no_button_copy) || $object->no_button_copy != 1) { if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { $cloneProductUrl = ''; $cloneButtonId = 'action-clone'; @@ -2906,7 +2906,7 @@ if ($action != 'create' && $action != 'edit') { $object_is_used = $object->isObjectUsed($object->id); if ($usercandelete) { - if (empty($object_is_used) && (!isset($object->no_button_delete) || $object->no_button_delete <> 1)) { + if (empty($object_is_used) && (!isset($object->no_button_delete) || $object->no_button_delete != 1)) { if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { print dolGetButtonAction($langs->trans('Delete'), '', 'delete', '#', 'action-delete', true); } else { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bf930472395..4a5b413177d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1189,7 +1189,7 @@ class Product extends CommonObject } // Quantities in batch details are not same as stock quantity, // so we add a default batch record to complete and get same qty in parent and child table - if ($ObjW->real <> $qty_batch) { + if ($ObjW->real != $qty_batch) { $ObjBatch = new Productbatch($this->db); $ObjBatch->batch = $valueforundefinedlot; $ObjBatch->qty = ($ObjW->real - $qty_batch); @@ -1874,13 +1874,13 @@ class Product extends CommonObject $lastPrice = array( 'level' => $level ? $level : 1, - 'multiprices' => doubleval($this->multiprices[$level]), - 'multiprices_ttc' => doubleval($this->multiprices_ttc[$level]), + 'multiprices' => (float) $this->multiprices[$level], + 'multiprices_ttc' => (float) $this->multiprices_ttc[$level], 'multiprices_base_type' => $this->multiprices_base_type[$level], - 'multiprices_min' => doubleval($this->multiprices_min[$level]), - 'multiprices_min_ttc' => doubleval($this->multiprices_min_ttc[$level]), - 'multiprices_tva_tx' => doubleval($this->multiprices_tva_tx[$level]), - 'multiprices_recuperableonly' => doubleval($this->multiprices_recuperableonly[$level]), + 'multiprices_min' => (float) $this->multiprices_min[$level], + 'multiprices_min_ttc' => (float) $this->multiprices_min_ttc[$level], + 'multiprices_tva_tx' => (float) $this->multiprices_tva_tx[$level], + 'multiprices_recuperableonly' => (float) $this->multiprices_recuperableonly[$level], ); return $lastPrice; @@ -3151,7 +3151,7 @@ class Product extends CommonObject if ($socid > 0) { $sql .= " AND c.fk_soc = ".((int) $socid); } - if ($filtrestatut <> '') { + if ($filtrestatut != '') { $sql .= " AND c.fk_statut in (".$this->db->sanitize($filtrestatut).")"; } @@ -3344,7 +3344,7 @@ class Product extends CommonObject if ($socid > 0) { $sql .= " AND e.fk_soc = ".((int) $socid); } - if ($filtrestatut <> '') { + if ($filtrestatut != '') { $sql .= " AND c.fk_statut IN (".$this->db->sanitize($filtrestatut).")"; } if (!empty($filterShipmentStatus)) { @@ -3426,7 +3426,7 @@ class Product extends CommonObject if ($socid > 0) { $sql .= " AND cf.fk_soc = ".((int) $socid); } - if ($filtrestatut <> '') { + if ($filtrestatut != '') { $sql .= " AND cf.fk_statut IN (".$this->db->sanitize($filtrestatut).")"; } if (!empty($dateofvirtualstock)) { @@ -3486,7 +3486,7 @@ class Product extends CommonObject if ($socid > 0) { $sql .= " AND m.fk_soc = ".((int) $socid); } - if ($filtrestatut <> '') { + if ($filtrestatut != '') { $sql .= " AND m.status IN (".$this->db->sanitize($filtrestatut).")"; } if (!empty($dateofvirtualstock)) { diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d31602a2552..cb46caba07f 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -294,7 +294,7 @@ if (getDolGlobalString('PRODUIT_MULTIPRICES')) { } else { $labelp = $langs->transnoentitiesnoconv("SellingPrice")." ".$i; } - $arrayfields['p.sellprice'.$i] = array('label'=>$labelp, 'checked'=>($i == 1 ? 1 : 0), 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>floatval('40.'.sprintf('%03s', $i))); + $arrayfields['p.sellprice'.$i] = array('label'=>$labelp, 'checked'=>($i == 1 ? 1 : 0), 'enabled'=>$conf->global->PRODUIT_MULTIPRICES, 'position'=>(float) ('40.'.sprintf('%03s', $i))); $arraypricelevel[$i] = array($i); } } diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 52bbd21c37f..610d0ca36ec 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -406,7 +406,7 @@ if ($action == 'create') { } // View mode - if ($action <> 'edit' && $action <> 're-edit') { + if ($action != 'edit' && $action != 're-edit') { $head = stock_prepare_head($object); print dol_get_fiche_head($head, 'card', $langs->trans("Warehouse"), -1, 'stock'); diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 5a49139386b..697e886c2d3 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -195,7 +195,7 @@ if ($action == 'createmovements' && $user->hasRight('stock', 'mouvement', 'creer $dlc = -1; // They are loaded later from serial $dluo = -1; // They are loaded later from serial - if (!$error && $id_sw <> $id_tw && is_numeric($qty) && $id_product) { + if (!$error && $id_sw != $id_tw && is_numeric($qty) && $id_product) { $result = $product->fetch($id_product); $product->load_stock('novirtual'); // Load array product->stock_warehouse diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index 873f5a80e50..d484ab49ac1 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -86,7 +86,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $object = new ActionComm($db); // Not older than -if (empty($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) { +if (!getDolGlobalString('MAIN_AGENDA_EXPORT_PAST_DELAY')) { $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY = 100; // default limit } diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 39bcc797207..8cc4f573e38 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -247,7 +247,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; } // If the price has been set, name is required for the invoice - if (!GETPOST("societe") && !empty(floatval($project->price_registration))) { + if (!GETPOST("societe") && !empty((float) $project->price_registration)) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Company"))."
\n"; } @@ -444,7 +444,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen } // If price is empty, no need to create a thirdparty, so we force $resultfetchthirdparty as if we have already found thirdp party. - if (empty(floatval($project->price_registration))) { + if (empty((float) $project->price_registration)) { $resultfetchthirdparty = 1; } @@ -505,7 +505,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen if (!$error) { // If the registration needs a payment - if (!empty(floatval($project->price_registration))) { + if (!empty((float) $project->price_registration)) { $outputlangs = $langs; // TODO Use default language of $thirdparty->default_lang to build $outputlang @@ -576,7 +576,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // If there is no lines yet, we add one if (empty($facture->lines)) { - $pu_ttc = floatval($project->price_registration); + $pu_ttc = (float) $project->price_registration; $pu_ht = 0; $price_base_type = 'TTC'; @@ -816,16 +816,16 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS // Company print '' . "\n"; + print 'price_registration) ? '' : ' required').'>' . "\n"; // Email company for invoice if ($project->price_registration) { diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 60c770ed9bb..20be7cf9e5a 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -209,7 +209,7 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; } - if (!GETPOST("country_id") && !empty(floatval($project->price_booth))) { + if (!GETPOST("country_id") && !empty((float) $project->price_booth)) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; } @@ -414,7 +414,7 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $conforbooth->error; } else { // If this is a paying booth, we have to redirect to payment page and create an invoice - if (!empty(floatval($project->price_booth))) { + if (!empty((float) $project->price_booth)) { $productforinvoicerow = new Product($db); $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); if ($resultprod < 0) { @@ -452,7 +452,7 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Add line to draft invoice $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); - $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), (float) $project->price_booth, 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); if ($result <= 0) { $contact->error = $facture->error; $contact->errors = $facture->errors; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 1239a6dc2c4..06a0d69ff82 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -629,7 +629,7 @@ $sql .= " WHERE e.entity IN (".getEntity('reception').")"; if ($socid) { $sql .= " AND e.fk_soc = ".((int) $socid); } -if ($search_status <> '' && $search_status >= 0) { +if ($search_status != '' && $search_status >= 0) { $sql .= " AND e.fk_statut = ".((int) $search_status); } if ($search_billed != '' && $search_billed >= 0) { diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 6286b4dcf06..142fbf6eae9 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -754,7 +754,7 @@ class Dolresource extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $label = ($langs->trans("ResourceTypeShort".$obj->code) != ("ResourceTypeShort".$obj->code) ? $langs->trans("ResourceTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); + $label = ($langs->trans("ResourceTypeShort".$obj->code) != "ResourceTypeShort".$obj->code ? $langs->trans("ResourceTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); $this->cache_code_type_resource[$obj->rowid]['code'] = $obj->code; $this->cache_code_type_resource[$obj->rowid]['label'] = $label; $this->cache_code_type_resource[$obj->rowid]['active'] = $obj->active; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 81a08807db7..19092a8383d 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -1029,7 +1029,7 @@ if ($id > 0) { print $paymentsalarytemp->getNomUrl(1); print ''; print '\n"; - $labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; + $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; if (isModEnabled("banque")) { $bankaccountstatic->id = $objp->baid; diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index f6cebf0c07f..e04f4430225 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -775,18 +775,18 @@ class Salary extends CommonObject //$langs->load("mymodule"); $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid'); $this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid'); - if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) { + if ($status == self::STATUS_UNPAID && $alreadypaid != 0) { $this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid'); $this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid'); - if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) { + if ($status == self::STATUS_UNPAID && $alreadypaid != 0) { $this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted"); } } $statusType = 'status1'; - if ($status == 0 && $alreadypaid <> 0) { + if ($status == 0 && $alreadypaid != 0) { $statusType = 'status3'; } if ($status == 1) { diff --git a/htdocs/salaries/virement_request.php b/htdocs/salaries/virement_request.php index 01d9ca9b186..f51af45622c 100644 --- a/htdocs/salaries/virement_request.php +++ b/htdocs/salaries/virement_request.php @@ -389,7 +389,7 @@ if ($resql) { print ''; print '\n"; - $labeltype = $langs->trans("PaymentType".$objp->type_code) != ("PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; + $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; if (isModEnabled("banque")) { $bankaccountstatic->id = $objp->baid; diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 1fc6a5067a7..e4fa05d1b0e 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -61,7 +61,7 @@ print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company @@ -72,7 +72,7 @@ print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 093b8c896e5..b23df41c5b9 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -56,7 +56,7 @@ if ($this->control->tpl['action_delete']) { @@ -67,7 +67,7 @@ if ($this->control->tpl['action_delete']) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8489ae8d290..3efd92cb089 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3863,7 +3863,7 @@ class Societe extends CommonObject $sum = 0; for ($index = 0; $index < 9; $index++) { $number = (int) $chaine[$index]; - if (($index % 2) != 0) { + if ($index % 2 != 0) { if (($number *= 2) > 9) { $number -= 9; } @@ -3872,7 +3872,7 @@ class Societe extends CommonObject } // le numéro est valide si la somme des chiffres est multiple de 10 - if (($sum % 10) != 0) { + if ($sum % 10 != 0) { return -1; } } @@ -3905,7 +3905,7 @@ class Societe extends CommonObject } // le numéro est valide si la somme des chiffres est multiple de 10 - if (($sum % 10) != 0) { + if ($sum % 10 != 0) { return -1; } } diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 7acf9a45117..55b3b04336f 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -364,7 +364,7 @@ if (getDolGlobalString('TAKEPOS_ADDON') == "terminal") { $handle = opendir($dir); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { - if (!is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) { + if (!is_dir($dir.$file) || (substr($file, 0, 1) != '.' && substr($file, 0, 3) != 'CVS')) { $filebis = $file; $classname = preg_replace('/\.php$/', '', $file); // For compatibility diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 96225b848ed..2ac22024573 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -212,7 +212,7 @@ if ($action == 'getProducts') { if (isset($barcode_value_list['qd'])) { $qty_str .= '.' . $barcode_value_list['qd']; } - $qty = floatval($qty_str); + $qty = (float) $qty_str; } $objProd = new Product($db); diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 1380c032c86..5541afa2457 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1425,7 +1425,7 @@ if (getDolGlobalString('TAKEPOS_WEIGHING_SCALE')) { echo ''; } } ?> - +
@@ -1471,7 +1471,7 @@ if (getDolGlobalString('TAKEPOS_WEIGHING_SCALE')) { print ''; } } ?> - +
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index f76069a7d23..0d8c98a2ec7 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -537,7 +537,7 @@ if (empty($reshook)) { $nbofsuggested = 0; $prod->load_stock('warehouseopen'); $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; - if ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch!="") { + if ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch != "") { if (is_object($prod->stock_warehouse[getDolGlobalString($constantforkey)]) && count($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch)) { foreach ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch as $dbatch) { $nbofsuggested++; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index fe35dfb4b0a..e8c787a1585 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -716,15 +716,15 @@ class Ticket extends CommonObject $this->timing = $obj->timing; $this->type_code = $obj->type_code; - $label_type = ($langs->trans("TicketTypeShort".$obj->type_code) != ("TicketTypeShort".$obj->type_code) ? $langs->trans("TicketTypeShort".$obj->type_code) : ($obj->type_label != '-' ? $obj->type_label : '')); + $label_type = ($langs->trans("TicketTypeShort".$obj->type_code) != "TicketTypeShort".$obj->type_code ? $langs->trans("TicketTypeShort".$obj->type_code) : ($obj->type_label != '-' ? $obj->type_label : '')); $this->type_label = $label_type; $this->category_code = $obj->category_code; - $label_category = ($langs->trans("TicketCategoryShort".$obj->category_code) != ("TicketCategoryShort".$obj->category_code) ? $langs->trans("TicketCategoryShort".$obj->category_code) : ($obj->category_label != '-' ? $obj->category_label : '')); + $label_category = ($langs->trans("TicketCategoryShort".$obj->category_code) != "TicketCategoryShort".$obj->category_code ? $langs->trans("TicketCategoryShort".$obj->category_code) : ($obj->category_label != '-' ? $obj->category_label : '')); $this->category_label = $label_category; $this->severity_code = $obj->severity_code; - $label_severity = ($langs->trans("TicketSeverityShort".$obj->severity_code) != ("TicketSeverityShort".$obj->severity_code) ? $langs->trans("TicketSeverityShort".$obj->severity_code) : ($obj->severity_label != '-' ? $obj->severity_label : '')); + $label_severity = ($langs->trans("TicketSeverityShort".$obj->severity_code) != "TicketSeverityShort".$obj->severity_code ? $langs->trans("TicketSeverityShort".$obj->severity_code) : ($obj->severity_label != '-' ? $obj->severity_label : '')); $this->severity_label = $label_severity; $this->datec = $this->db->jdate($obj->datec); @@ -884,15 +884,15 @@ class Ticket extends CommonObject $line->progress = $obj->progress; $line->timing = $obj->timing; - $label_type = ($langs->trans("TicketTypeShort".$obj->type_code) != ("TicketTypeShort".$obj->type_code) ? $langs->trans("TicketTypeShort".$obj->type_code) : ($obj->type_label != '-' ? $obj->type_label : '')); + $label_type = ($langs->trans("TicketTypeShort".$obj->type_code) != "TicketTypeShort".$obj->type_code ? $langs->trans("TicketTypeShort".$obj->type_code) : ($obj->type_label != '-' ? $obj->type_label : '')); $line->type_label = $label_type; $this->category_code = $obj->category_code; - $label_category = ($langs->trans("TicketCategoryShort".$obj->category_code) != ("TicketCategoryShort".$obj->category_code) ? $langs->trans("TicketCategoryShort".$obj->category_code) : ($obj->category_label != '-' ? $obj->category_label : '')); + $label_category = ($langs->trans("TicketCategoryShort".$obj->category_code) != "TicketCategoryShort".$obj->category_code ? $langs->trans("TicketCategoryShort".$obj->category_code) : ($obj->category_label != '-' ? $obj->category_label : '')); $line->category_label = $label_category; $this->severity_code = $obj->severity_code; - $label_severity = ($langs->trans("TicketSeverityShort".$obj->severity_code) != ("TicketSeverityShort".$obj->severity_code) ? $langs->trans("TicketSeverityShort".$obj->severity_code) : ($obj->severity_label != '-' ? $obj->severity_label : '')); + $label_severity = ($langs->trans("TicketSeverityShort".$obj->severity_code) != "TicketSeverityShort".$obj->severity_code ? $langs->trans("TicketSeverityShort".$obj->severity_code) : ($obj->severity_label != '-' ? $obj->severity_label : '')); $line->severity_label = $label_severity; $line->datec = $this->db->jdate($obj->datec); @@ -1286,7 +1286,7 @@ class Ticket extends CommonObject $i = 0; while ($i < $num) { $obj = $this->db->fetch_object($resql); - $label = ($langs->trans("TicketTypeShort".$obj->code) != ("TicketTypeShort".$obj->code) ? $langs->trans("TicketTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); + $label = ($langs->trans("TicketTypeShort".$obj->code) != "TicketTypeShort".$obj->code ? $langs->trans("TicketTypeShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); $this->cache_types_tickets[$obj->rowid]['code'] = $obj->code; $this->cache_types_tickets[$obj->rowid]['label'] = $label; $this->cache_types_tickets[$obj->rowid]['use_default'] = $obj->use_default; @@ -1342,7 +1342,7 @@ class Ticket extends CommonObject // If translation exists, we use it to store already translated string. // Warning: You should not use this and recompute the translated string into caller code to get the value into expected language - $label = ($langs->trans("TicketCategoryShort".$obj->code) != ("TicketCategoryShort".$obj->code) ? $langs->trans("TicketCategoryShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); + $label = ($langs->trans("TicketCategoryShort".$obj->code) != "TicketCategoryShort".$obj->code ? $langs->trans("TicketCategoryShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); $this->cache_category_tickets[$obj->rowid]['label'] = $label; $i++; @@ -1382,7 +1382,7 @@ class Ticket extends CommonObject $obj = $this->db->fetch_object($resql); $this->cache_severity_tickets[$obj->rowid]['code'] = $obj->code; - $label = ($langs->trans("TicketSeverityShort".$obj->code) != ("TicketSeverityShort".$obj->code) ? $langs->trans("TicketSeverityShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); + $label = ($langs->trans("TicketSeverityShort".$obj->code) != "TicketSeverityShort".$obj->code ? $langs->trans("TicketSeverityShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); $this->cache_severity_tickets[$obj->rowid]['label'] = $label; $this->cache_severity_tickets[$obj->rowid]['use_default'] = $obj->use_default; $this->cache_severity_tickets[$obj->rowid]['pos'] = $obj->pos; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 700dd744382..f27a82d84c8 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2034,12 +2034,12 @@ if ($action == 'create' || $action == 'adduserldap') { 'class' => 'classfortooltip' ) ); - if ($user->id <> $id && $candisableuser && $object->statut == 0 && + if ($user->id != $id && $candisableuser && $object->statut == 0 && ((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) { print dolGetButtonAction($langs->trans('Reactivate'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=enable&token='.newToken(), '', true, $params); } // Disable user - if ($user->id <> $id && $candisableuser && $object->statut == 1 && + if ($user->id != $id && $candisableuser && $object->statut == 1 && ((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) { print dolGetButtonAction($langs->trans('DisableUser'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disable&token='.newToken(), '', true, $params); } else { @@ -2049,7 +2049,7 @@ if ($action == 'create' || $action == 'adduserldap') { } } // Delete - if ($user->id <> $id && $candisableuser && + if ($user->id != $id && $candisableuser && ((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) { if ($user->admin || !$object->admin) { // If user edited is admin, delete is possible on for an admin print dolGetButtonAction($langs->trans('DeleteUser'), '', 'default', $_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$object->id, '', true, $params); diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 915642c7ab6..fea12e1b372 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -207,7 +207,7 @@ if ($id > 0) { */ print '
'; - if (!empty($user->admin) && $action <> 'edit') { + if (!empty($user->admin) && $action != 'edit') { print ''.$langs->trans("Modify").''; } diff --git a/htdocs/user/document.php b/htdocs/user/document.php index e88017f12cb..2e36a90fdfe 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -77,7 +77,7 @@ $feature2 = 'user'; $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); -if ($user->id <> $id && !$canreaduser) { +if ($user->id != $id && !$canreaduser) { accessforbidden(); } diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 885774b517a..3418e5a616a 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -326,7 +326,7 @@ if ($object->id > 0) { $isexpanded = ! $ishidden; // Break found, it's a new module to catch - if (isset($obj->module) && ($oldmod <> $obj->module)) { + if (isset($obj->module) && ($oldmod != $obj->module)) { $oldmod = $obj->module; $j++; @@ -424,7 +424,7 @@ if ($object->id > 0) { } // Description of permission (2 columns) - $permlabel = (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); + $permlabel = (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && ($langs->trans("PermissionAdvanced".$obj->id) != "PermissionAdvanced".$obj->id) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != "Permission".$obj->id) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); print '
'.$langs->trans('PaymentMode').''.$labeltype; print $object->num_payment ? ' - '.$object->num_payment : ''; diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index 81d08b9be4c..2bd45de41d3 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -119,7 +119,7 @@ if ($object->id > 0) { // Payment mode $morehtmlref .= '
'.$langs->trans('PaymentMode').' : '; - $morehtmlref .= $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; + $morehtmlref .= $langs->trans("PaymentType".$object->type_code) != "PaymentType".$object->type_code ? $langs->trans("PaymentType".$object->type_code) : $object->type_label; $morehtmlref .= $object->num_payment ? ' - '.$object->num_payment : ''; // Thirdparty diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 60abc2dcece..cd42464d2f3 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -618,7 +618,7 @@ while ($i < $imaxinloop) { // Pyament type if (!empty($arrayfields['c.libelle']['checked'])) { - $payment_type = $langs->trans("PaymentType".$objp->paiement_type) != ("PaymentType".$objp->paiement_type) ? $langs->trans("PaymentType".$objp->paiement_type) : $objp->paiement_libelle; + $payment_type = $langs->trans("PaymentType".$objp->paiement_type) != "PaymentType".$objp->paiement_type ? $langs->trans("PaymentType".$objp->paiement_type) : $objp->paiement_libelle; print '
'.$payment_type.' '.dol_trunc($objp->num_payment, 32).'
'; - if (!empty(floatval($project->price_registration))) { + if (!empty((float) $project->price_registration)) { print ''; } print $langs->trans("Company"); - if (!empty(floatval($project->price_registration))) { + if (!empty((float) $project->price_registration)) { print ''; } print ''; print img_picto('', 'company', 'class="pictofixedwidth"'); - print 'price_registration)) ? '' : ' required').'>
'.dol_print_date($db->jdate($objp->dp), 'dayhour', 'tzuserrel')."".$labeltype.' '.$objp->num_payment."
'; print ''.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.''.dol_print_date($db->jdate($objp->dp), 'dayhour', 'tzuserrel')."".$labeltype.' '.$objp->num_payment."
trans('CustomerCode'); ?> control->tpl['code_client']; ?> - control->tpl['checkcustomercode'] <> 0) { ?> + control->tpl['checkcustomercode'] != 0) { ?> (trans("WrongCustomerCode"); ?>)
trans('SupplierCode'); ?> control->tpl['code_fournisseur']; ?> - control->tpl['checksuppliercode'] <> 0) { ?> + control->tpl['checksuppliercode'] != 0) { ?> (trans("WrongSupplierCode"); ?>)
trans('CustomerCode'); ?> control->tpl['code_client']; ?> - control->tpl['checkcustomercode'] <> 0) { ?> + control->tpl['checkcustomercode'] != 0) { ?> (trans("WrongCustomerCode"); ?>)
trans('SupplierCode'); ?> control->tpl['code_fournisseur']; ?> - control->tpl['checksuppliercode'] <> 0) { ?> + control->tpl['checksuppliercode'] != 0) { ?> (trans("WrongSupplierCode"); ?>) '; print $permlabel; if (getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) { diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index c7264752f92..a0958a4d6fc 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -57,7 +57,7 @@ if ($user->socid > 0) { $feature2 = (($socid && $user->hasRight("user", "self", "write")) ? '' : 'user'); $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); -if ($user->id <> $id && !$canreaduser) { +if ($user->id != $id && !$canreaduser) { accessforbidden(); } diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 2ff74ba145e..e30e7f19f4f 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -74,7 +74,7 @@ if ($user->id == $id && (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user } $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); -if ($user->id <> $id && !$canreaduser) { +if ($user->id != $id && !$canreaduser) { accessforbidden(); } @@ -512,7 +512,7 @@ if ($result) { //var_dump($permsgroupbyentitypluszero); // Break found, it's a new module to catch - if (isset($obj->module) && ($oldmod <> $obj->module)) { + if (isset($obj->module) && ($oldmod != $obj->module)) { $oldmod = $obj->module; $j++; @@ -664,7 +664,7 @@ if ($result) { } // Description of permission (2 columns) - $permlabel = (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); + $permlabel = (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && ($langs->trans("PermissionAdvanced".$obj->id) != "PermissionAdvanced".$obj->id) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != "Permission".$obj->id) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); if (!$user->admin) { print ''; } else { diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 7763146fcda..7a2212ca55b 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -530,8 +530,8 @@ class ProductCombination if ($parent->multiprices[$i] != '' || isset($this->combination_price_levels[$i]->variation_price)) { $new_type = empty($parent->multiprices_base_type[$i]) ? 'HT' : $parent->multiprices_base_type[$i]; $new_min_price = $parent->multiprices_min[$i]; - $variation_price = floatval(!isset($this->combination_price_levels[$i]->variation_price) ? $this->variation_price : $this->combination_price_levels[$i]->variation_price); - $variation_price_percentage = floatval(!isset($this->combination_price_levels[$i]->variation_price_percentage) ? $this->variation_price_percentage : $this->combination_price_levels[$i]->variation_price_percentage); + $variation_price = (float) (!isset($this->combination_price_levels[$i]->variation_price) ? $this->variation_price : $this->combination_price_levels[$i]->variation_price); + $variation_price_percentage = (float) (!isset($this->combination_price_levels[$i]->variation_price_percentage) ? $this->variation_price_percentage : $this->combination_price_levels[$i]->variation_price_percentage); if ($parent->prices_by_qty_list[$i]) { $new_psq = 1; @@ -1144,9 +1144,9 @@ class ProductCombinationLevel } $this->id = $obj->rowid; - $this->fk_product_attribute_combination = floatval($obj->fk_product_attribute_combination); + $this->fk_product_attribute_combination = (float) $obj->fk_product_attribute_combination; $this->fk_price_level = intval($obj->fk_price_level); - $this->variation_price = floatval($obj->variation_price); + $this->variation_price = (float) $obj->variation_price; $this->variation_price_percentage = (bool) $obj->variation_price_percentage; return 1; @@ -1183,7 +1183,7 @@ class ProductCombinationLevel // Update if (!empty($this->id)) { $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql .= ' SET variation_price = '.floatval($this->variation_price).' , variation_price_percentage = '.intval($this->variation_price_percentage); + $sql .= ' SET variation_price = '.(float) $this->variation_price.' , variation_price_percentage = '.intval($this->variation_price_percentage); $sql .= ' WHERE rowid = '.((int) $this->id); $res = $this->db->query($sql); @@ -1201,7 +1201,7 @@ class ProductCombinationLevel $sql .= ") VALUES ("; $sql .= (int) $this->fk_product_attribute_combination; $sql .= ", ".intval($this->fk_price_level); - $sql .= ", ".floatval($this->variation_price); + $sql .= ", ".(float) $this->variation_price; $sql .= ", ".intval($this->variation_price_percentage); $sql .= ")"; diff --git a/htdocs/webservices/server_payment.php b/htdocs/webservices/server_payment.php index 7a3b58b68df..db26fc970e0 100644 --- a/htdocs/webservices/server_payment.php +++ b/htdocs/webservices/server_payment.php @@ -188,7 +188,7 @@ function createPayment($authentication, $payment) $soc->fetch($payment['thirdparty_id']); $new_payment = new Paiement($db); - $new_payment->amount = floatval($payment['amount']); + $new_payment->amount = (float) $payment['amount']; $new_payment->num_payment = $payment['num_payment']; $new_payment->fk_account = intval($payment['bank_account']); $new_payment->paiementid = !empty($payment['payment_mode_id']) ? intval($payment['payment_mode_id']) : $soc->mode_reglement_id;