Clean code

This commit is contained in:
Laurent Destailleur 2023-12-27 12:12:20 +01:00
parent 89686e74dc
commit b28ae5d8d3
115 changed files with 238 additions and 240 deletions

View file

@ -127,7 +127,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
echo '</span>';
}
if (getDolGlobalString('BOM_SUB_BOM') && $filtertype!=1) {
if (getDolGlobalString('BOM_SUB_BOM') && $filtertype != 1) {
print '<br><span class="opacitymedium">'.$langs->trans("or").'</span><br>'.$langs->trans("BOM");
print $form->select_bom('', 'bom_id', 0, 1, 0, '1', '', 1);
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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 '</td>';
$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 '<td class="tdoverflowmax80" title="'.dol_escape_htmltag($label.' '.$objp->num_payment).'">'.dol_escape_htmltag($label.' '.$objp->num_payment).'</td>';
if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid;

View file

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

View file

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

View file

@ -308,7 +308,7 @@ print $form->editfieldval("Date", 'datep', $object->date, $object, $user->hasRig
print '</td></tr>';
// 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 '<tr><td>'.$langs->trans('PaymentMode').'</td><td>'.$labeltype;
print $object->num_payment ? ' - '.$object->num_payment : '';
print '</td></tr>';

View file

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

View file

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

View file

@ -273,7 +273,7 @@ if ($action == 'create') {
print '<td class="center">';
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

View file

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

View file

@ -375,7 +375,7 @@ if ($modecompta == 'BOOKKEEPING') {
}
if ($showaccountdetail == 'all' || $resultN <> 0) {
if ($showaccountdetail == 'all' || $resultN != 0) {
print '<tr>';
print '<td></td>';
print '<td class="tdoverflowmax200"> &nbsp; &nbsp; '.length_accountg($cpt['account_number']).' - '.$cpt['account_label'].'</td>';

View file

@ -719,7 +719,7 @@ if ($id > 0) {
print '</td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\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 "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid;

View file

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

View file

@ -713,7 +713,7 @@ if ($id > 0) {
print '<a href="'.DOL_URL_ROOT.'/compta/payment_vat/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.'</a>';
print '</td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\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 "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1469,7 +1469,7 @@ class FormOther
} else {
print '<option value="'.$obj->{$keyfield}.'">';
}
$label = ($langs->trans($dictionarytable.$obj->{$keyfield}) != ($dictionarytable.$obj->{$labelfield}) ? $langs->trans($dictionarytable.$obj->{$keyfield}) : $obj->{$labelfield});
$label = ($langs->trans($dictionarytable.$obj->{$keyfield}) != $dictionarytable.$obj->{$labelfield} ? $langs->trans($dictionarytable.$obj->{$keyfield}) : $obj->{$labelfield});
print $label;
print '</option>';
$i++;

View file

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

View file

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

View file

@ -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".');
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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 .= '<br>'.$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 = '<span class="text-danger classfortooltip paddingrightonly" title="'.dol_htmlentities($title.$diffTitle).'" ><i class="fa fa-caret-down"></i> '.($task->progress - $progressCalculated).'%</span>';
} 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 = '<span class="text-warning classfortooltip paddingrightonly" title="'.dol_htmlentities($title.$diffTitle).'" ><i class="fa fa-caret-left"></i> '.($task->progress - $progressCalculated).'%</span>';
@ -2937,18 +2937,18 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
$out .= '</span>';
$out .= ' <div class="progress sm '.$spaced.'">';
$diffval = floatval($task->progress) - floatval($progressCalculated);
$diffval = (float) $task->progress - (float) $progressCalculated;
if ($diffval >= 0) {
// good
$out .= ' <div class="progress-bar '.$progressBarClass.'" style="width: '.floatval($task->progress).'%" title="'.floatval($task->progress).'%">';
$out .= ' <div class="progress-bar '.$progressBarClass.'" style="width: '.(float) $task->progress.'%" title="'.(float) $task->progress.'%">';
if (!empty($task->progress)) {
$out .= ' <div class="progress-bar progress-bar-consumed" style="width: '.floatval($progressCalculated / (floatval($task->progress) == 0 ? 1 : $task->progress) * 100).'%" title="'.floatval($progressCalculated).'%"></div>';
$out .= ' <div class="progress-bar progress-bar-consumed" style="width: '.(float) ($progressCalculated / ((float) $task->progress == 0 ? 1 : $task->progress) * 100).'%" title="'.(float) $progressCalculated.'%"></div>';
}
$out .= ' </div>';
} else {
// bad
$out .= ' <div class="progress-bar progress-bar-consumed-late" style="width: '.floatval($progressCalculated).'%" title="'.floatval($progressCalculated).'%">';
$out .= ' <div class="progress-bar '.$progressBarClass.'" style="width: '.($task->progress ? floatval($task->progress / (floatval($progressCalculated) == 0 ? 1 : $progressCalculated) * 100).'%' : '1px').'" title="'.floatval($task->progress).'%"></div>';
$out .= ' <div class="progress-bar progress-bar-consumed-late" style="width: '.(float) $progressCalculated.'%" title="'.(float) $progressCalculated.'%">';
$out .= ' <div class="progress-bar '.$progressBarClass.'" style="width: '.($task->progress ? (float) ($task->progress / ((float) $progressCalculated == 0 ? 1 : $progressCalculated) * 100).'%' : '1px').'" title="'.(float) $task->progress.'%"></div>';
$out .= ' </div>';
}
$out .= ' </div>';
@ -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.'%';

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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 .= ";";

View file

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

View file

@ -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 .= ";";

View file

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

View file

@ -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 .= ";";

View file

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

View file

@ -165,7 +165,7 @@ class mailing_xinputfile extends MailingTargets
if (!empty($buffer)) {
//print 'xx'.dol_strlen($buffer).empty($buffer)."<br>\n";
if (isValidEMail($email)) {
if ($old <> $email) {
if ($old != $email) {
$cibles[$j] = array(
'email' => $email,
'lastname' => $name,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -848,7 +848,7 @@ if (!empty($id) && $action != 'edit') {
print '<tr class="oddeven"><td>';
print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.'</a></td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\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 "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
print '<td class="right">'.price($objp->amount)."</td>\n";
print "</tr>";

View file

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

View file

@ -1970,7 +1970,7 @@ if ($action == 'create') {
print $paymentexpensereportstatic->getNomUrl(1);
print '</td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\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 "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
// Bank account
if (isModEnabled("banque")) {

View file

@ -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 '<td>'.$payment_type.' '.dol_trunc($objp->num_payment, 32).'</td>';
if (!$i) {
$totalarray['nbfield']++;

View file

@ -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 '<br>';
print '<table class="noborder centpercent">';

View file

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

View file

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

View file

@ -205,7 +205,7 @@ if ($result > 0) {
print '</td></tr>';
// 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 '<tr><td>'.$langs->trans('PaymentMode').'</td>';
print '<td>'.$labeltype;
print $object->num_payment ? ' - '.$object->num_payment : '';

View file

@ -119,7 +119,7 @@ if ($object->id > 0) {
// Payment mode
$morehtmlref .= '<br>'.$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

View file

@ -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 '<td>'.$payment_type.' '.dol_trunc($objp->num_payment, 32).'</td>';
if (!$i) {
$totalarray['nbfield']++;

View file

@ -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."§";
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -247,7 +247,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\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"))."<br>\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 '<tr id="trcompany" class="trcompany"><td>';
if (!empty(floatval($project->price_registration))) {
if (!empty((float) $project->price_registration)) {
print '<span class="fieldrequired">';
}
print $langs->trans("Company");
if (!empty(floatval($project->price_registration))) {
if (!empty((float) $project->price_registration)) {
print '</span>';
}
print '</td><td>';
print img_picto('', 'company', 'class="pictofixedwidth"');
print '<input type="text" name="societe" class="minwidth200 widthcentpercentminusx maxwidth300" value="' . dol_escape_htmltag(GETPOST('societe')) . '"'.(empty(floatval($project->price_registration)) ? '' : ' required').'></td></tr>' . "\n";
print '<input type="text" name="societe" class="minwidth200 widthcentpercentminusx maxwidth300" value="' . dol_escape_htmltag(GETPOST('societe')) . '"'.(empty((float) $project->price_registration) ? '' : ' required').'></td></tr>' . "\n";
// Email company for invoice
if ($project->price_registration) {

View file

@ -209,7 +209,7 @@ if (empty($reshook) && $action == 'add') {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\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"))."<br>\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;

View file

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

View file

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

View file

@ -1029,7 +1029,7 @@ if ($id > 0) {
print $paymentsalarytemp->getNomUrl(1);
print '</td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'dayhour', 'tzuserrel')."</td>\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 "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid;

View file

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

View file

@ -389,7 +389,7 @@ if ($resql) {
print '<tr class="oddeven"><td>';
print '<a href="'.DOL_URL_ROOT.'/salaries/payment_salary/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.'</a></td>';
print '<td>'.dol_print_date($db->jdate($objp->dp), 'dayhour', 'tzuserrel')."</td>\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 "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
if (isModEnabled("banque")) {
$bankaccountstatic->id = $objp->baid;

View file

@ -61,7 +61,7 @@ print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company
<tr>
<td><?php echo $langs->trans('CustomerCode'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['code_client']; ?>
<?php if ($this->control->tpl['checkcustomercode'] <> 0) { ?>
<?php if ($this->control->tpl['checkcustomercode'] != 0) { ?>
<span class="error">(<?php echo $langs->trans("WrongCustomerCode"); ?>)</span>
<?php } ?>
</td>
@ -72,7 +72,7 @@ print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company
<tr>
<td><?php echo $langs->trans('SupplierCode'); ?></td>
<td colspan="3"><?php echo $this->control->tpl['code_fournisseur']; ?>
<?php if ($this->control->tpl['checksuppliercode'] <> 0) { ?>
<?php if ($this->control->tpl['checksuppliercode'] != 0) { ?>
<span class="error">(<?php echo $langs->trans("WrongSupplierCode"); ?>)</span>
<?php } ?>
</td>

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