mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 17:48:25 +01:00
Qual: Enable Phan Simplify rule and fix notices (#30537)
* Qual: Phan - Enable Simplyfy expression * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Qual: Simplify expression (phan notice) * Update functions2.lib.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
@@ -386,7 +386,7 @@ return [
|
||||
'UnknownElementTypePlugin',
|
||||
'WhitespacePlugin',
|
||||
//'RemoveDebugStatementPlugin', // Reports echo, print, ...
|
||||
//'SimplifyExpressionPlugin',
|
||||
'SimplifyExpressionPlugin',
|
||||
//'StrictComparisonPlugin', // Expects ===
|
||||
'SuspiciousParamOrderPlugin',
|
||||
'UnsafeCodePlugin',
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2017 André Schild <a.schild@aarboard.ch>
|
||||
* Copyright (C) 2020 Guillaume Alexandre <guillaume@tag-info.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -179,7 +180,7 @@ class AccountancyImport
|
||||
}
|
||||
|
||||
// at least one record value has changed, so we search for the next piece number from database or increment it
|
||||
if ($atLeastOneLastRecordChanged === true) {
|
||||
if ($atLeastOneLastRecordChanged) {
|
||||
$lastPieceNum = 0;
|
||||
if (empty($conf->cache['accounting']['nextPieceNum'])) {
|
||||
// get last piece number from database
|
||||
|
||||
@@ -302,7 +302,7 @@ foreach ($arrayofmodules as $file => $modCodeMember) {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print "</td>\n";
|
||||
} else {
|
||||
$disabled = (isModEnabled('multicompany') && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false);
|
||||
$disabled = isModEnabled('multicompany') && ((is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity));
|
||||
print '<td class="center">';
|
||||
if (!$disabled) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setcodemember&token='.newToken().'&value='.urlencode($file).'">';
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2012-2107 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2021-2022 Anthony Berton <bertonanthony@gmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -266,7 +267,7 @@ print dol_get_fiche_head($head, 'general', '', -1, '');
|
||||
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFDesc"), $s)."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$noCountryCode = (empty($mysoc->country_code) ? true : false);
|
||||
$noCountryCode = empty($mysoc->country_code);
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2018 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -116,7 +117,7 @@ print "</tr>";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ApiProductionMode").'</td>';
|
||||
$production_mode = (!getDolGlobalString('API_PRODUCTION_MODE') ? false : true);
|
||||
$production_mode = !(!getDolGlobalString('API_PRODUCTION_MODE'));
|
||||
if ($production_mode) {
|
||||
print '<td><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setproductionmode&token='.newToken().'&status=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
@@ -131,7 +132,7 @@ print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("API_DISABLE_COMPRESSION").'</td>';
|
||||
$disable_compression = (!getDolGlobalString('API_DISABLE_COMPRESSION') ? false : true);
|
||||
$disable_compression = !(!getDolGlobalString('API_DISABLE_COMPRESSION'));
|
||||
if ($disable_compression) {
|
||||
print '<td><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setdisablecompression&token='.newToken().'&status=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
|
||||
@@ -55,7 +55,7 @@ class DolibarrApi
|
||||
Defaults::$cacheDirectory = $cachedir;
|
||||
|
||||
$this->db = $db;
|
||||
$production_mode = (!getDolGlobalString('API_PRODUCTION_MODE') ? false : true);
|
||||
$production_mode = !(!getDolGlobalString('API_PRODUCTION_MODE'));
|
||||
$this->r = new Restler($production_mode, $refreshCache);
|
||||
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
|
||||
@@ -1542,7 +1542,7 @@ class Asset extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -866,7 +866,7 @@ class BOM extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -969,7 +969,7 @@ class Availabilities extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -960,7 +960,7 @@ class Calendar extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -1783,7 +1783,7 @@ while ($i < $imaxinloop) {
|
||||
}
|
||||
|
||||
$marginInfo = array();
|
||||
if ($with_margin_info === true) {
|
||||
if ($with_margin_info) {
|
||||
$objectstatic->fetch_lines();
|
||||
$marginInfo = $formmargin->getMarginInfosArray($objectstatic);
|
||||
$total_ht += $obj->total_ht;
|
||||
|
||||
@@ -443,7 +443,7 @@ class Commande extends CommonOrder
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -2149,7 +2149,7 @@ while ($i < $imaxinloop) {
|
||||
$projectstatic->title = $obj->project_label;
|
||||
|
||||
$marginInfo = array();
|
||||
if ($with_margin_info === true) {
|
||||
if ($with_margin_info) {
|
||||
$generic_commande->fetch_lines();
|
||||
$marginInfo = $formmargin->getMarginInfosArray($generic_commande);
|
||||
$total_ht += $obj->total_ht;
|
||||
|
||||
@@ -1547,7 +1547,7 @@ if ($resql) {
|
||||
$projectstatic->title = $obj->project_label;
|
||||
|
||||
$marginInfo = array();
|
||||
if ($with_margin_info === true) {
|
||||
if ($with_margin_info) {
|
||||
$generic_commande->fetch_lines();
|
||||
$marginInfo = $formmargin->getMarginInfosArray($generic_commande);
|
||||
$total_ht += $obj->total_ht;
|
||||
|
||||
@@ -119,7 +119,7 @@ if ($currentInvId) { // Here to breakdown
|
||||
$toJsonArray['amount_'.$currentInvId] = price2num($currentAmount); // Param will exist only if an img has been clicked
|
||||
}
|
||||
|
||||
$toJsonArray['makeRed'] = ($totalRemaining < price2num($result) || price2num($result) < 0) ? true : false;
|
||||
$toJsonArray['makeRed'] = ($totalRemaining < price2num($result) || price2num($result) < 0);
|
||||
$toJsonArray['result'] = price($result); // Return value to user format
|
||||
$toJsonArray['resultnum'] = price2num($result); // Return value to numeric format
|
||||
|
||||
|
||||
@@ -2031,7 +2031,7 @@ if ($num > 0) {
|
||||
$facturestatic->totalpaid = $paiement;
|
||||
|
||||
$marginInfo = array();
|
||||
if ($with_margin_info === true) {
|
||||
if ($with_margin_info) {
|
||||
$facturestatic->fetch_lines();
|
||||
$marginInfo = $formmargin->getMarginInfosArray($facturestatic);
|
||||
$total_ht += $obj->total_ht;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -212,7 +213,7 @@ if (!empty($selected_type)) {
|
||||
if (!empty($typent_id)) {
|
||||
$tableparams['typent_id'] = $typent_id;
|
||||
}
|
||||
$tableparams['subcat'] = ($subcat === true) ? 'yes' : '';
|
||||
$tableparams['subcat'] = $subcat ? 'yes' : '';
|
||||
|
||||
// Adding common parameters
|
||||
$allparams = array_merge($commonparams, $headerparams, $tableparams);
|
||||
@@ -306,7 +307,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= ",".MAIN_DB_PREFIX."facturedet as l";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid";
|
||||
if ($typent_id >0) {
|
||||
if ($typent_id > 0) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc ON (soc.rowid = f.fk_soc)";
|
||||
}
|
||||
$parameters = array();
|
||||
@@ -401,7 +402,7 @@ if ($modecompta == 'CREANCES-DETTES') {
|
||||
$sql .= " AND f.fk_soc = ".((int) $selected_soc);
|
||||
}
|
||||
|
||||
if ($typent_id >0) {
|
||||
if ($typent_id > 0) {
|
||||
$sql .= " AND soc.fk_typent = ".((int) $typent_id);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -190,7 +191,7 @@ $tableparams['search_societe'] = $search_societe;
|
||||
$tableparams['search_zip'] = $search_zip;
|
||||
$tableparams['search_town'] = $search_town;
|
||||
$tableparams['search_country'] = $search_country;
|
||||
$tableparams['subcat'] = ($subcat === true) ? 'yes' : '';
|
||||
$tableparams['subcat'] = $subcat ? 'yes' : '';
|
||||
|
||||
// Adding common parameters
|
||||
$allparams = array_merge($commonparams, $headerparams, $tableparams);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2020 Maxime Kohlhaas <maxime@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -182,7 +183,7 @@ if (!empty($selected_soc)) {
|
||||
if (!empty($selected_type)) {
|
||||
$tableparams['search_type'] = $selected_type;
|
||||
}
|
||||
$tableparams['subcat'] = ($subcat === true) ? 'yes' : '';
|
||||
$tableparams['subcat'] = $subcat ? 'yes' : '';
|
||||
|
||||
// Adding common parameters
|
||||
$allparams = array_merge($commonparams, $headerparams, $tableparams);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2020 Maxime Kohlhaas <maxime@atm-consulting.fr>
|
||||
* Copyright (C) 2023 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -161,7 +162,7 @@ $tableparams['search_societe'] = $search_societe;
|
||||
$tableparams['search_zip'] = $search_zip;
|
||||
$tableparams['search_town'] = $search_town;
|
||||
$tableparams['search_country'] = $search_country;
|
||||
$tableparams['subcat'] = ($subcat === true) ? 'yes' : '';
|
||||
$tableparams['subcat'] = $subcat ? 'yes' : '';
|
||||
|
||||
// Adding common parameters
|
||||
$allparams = array_merge($commonparams, $headerparams, $tableparams);
|
||||
|
||||
@@ -47,7 +47,7 @@ require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.clas
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin"));
|
||||
|
||||
$refresh = (GETPOSTISSET('submit') || GETPOSTISSET('vat_rate_show') || GETPOSTISSET('invoice_type')) ? true : false;
|
||||
$refresh = (GETPOSTISSET('submit') || GETPOSTISSET('vat_rate_show') || GETPOSTISSET('invoice_type'));
|
||||
$invoice_type = GETPOSTISSET('invoice_type') ? GETPOST('invoice_type', 'alpha') : '';
|
||||
$vat_rate_show = GETPOSTISSET('vat_rate_show') ? GETPOST('vat_rate_show', 'alphanohtml') : -1;
|
||||
|
||||
|
||||
@@ -1356,7 +1356,7 @@ class ExtraFields
|
||||
}
|
||||
}
|
||||
|
||||
if ($filter_categorie === false) {
|
||||
if (!$filter_categorie) {
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($fields_label)) {
|
||||
$keyList .= ', ';
|
||||
@@ -1526,7 +1526,7 @@ class ExtraFields
|
||||
}
|
||||
}
|
||||
|
||||
if ($filter_categorie === false) {
|
||||
if (!$filter_categorie) {
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($fields_label)) {
|
||||
$keyList .= ', ';
|
||||
@@ -1913,7 +1913,7 @@ class ExtraFields
|
||||
dol_syslog(get_class($this).':showOutputField:$type=sellist', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($filter_categorie === false) {
|
||||
if (!$filter_categorie) {
|
||||
$value = ''; // value was used, so now we reset it to use it to build final output
|
||||
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
@@ -2023,7 +2023,7 @@ class ExtraFields
|
||||
dol_syslog(get_class($this).':showOutputField:$type=chkbxlst', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($filter_categorie === false) {
|
||||
if (!$filter_categorie) {
|
||||
$value = ''; // value was used, so now we reset it to use it to build final output
|
||||
$toprint = array();
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
@@ -2205,7 +2205,7 @@ class ExtraFields
|
||||
$expand_display = false;
|
||||
if (is_array($extrafield_param_list) && count($extrafield_param_list) > 0) {
|
||||
$extrafield_collapse_display_value = intval($extrafield_param_list[0]);
|
||||
$expand_display = ((isset($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) || GETPOSTINT('ignorecollapsesetup')) ? (empty($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) ? false : true) : ($extrafield_collapse_display_value == 2 ? false : true));
|
||||
$expand_display = ((isset($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) || GETPOSTINT('ignorecollapsesetup')) ? (!empty($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key])) : !($extrafield_collapse_display_value == 2));
|
||||
}
|
||||
$disabledcookiewrite = 0;
|
||||
if ($mode == 'create') {
|
||||
@@ -2239,7 +2239,7 @@ class ExtraFields
|
||||
$out .= '<script nonce="'.getNonce().'" type="text/javascript">'."\n";
|
||||
$out .= 'jQuery(document).ready(function(){'."\n";
|
||||
if (empty($disabledcookiewrite)) {
|
||||
if ($expand_display === false) {
|
||||
if (!$expand_display) {
|
||||
$out .= ' console.log("Inject js for the collapsing of extrafield '.$key.' - hide");'."\n";
|
||||
$out .= ' jQuery(".trextrafields_collapse'.$collapse_group.'").hide();'."\n";
|
||||
} else {
|
||||
|
||||
@@ -398,7 +398,7 @@ class FormFile
|
||||
$printer = 0;
|
||||
// The direct print feature is implemented only for such elements
|
||||
if (in_array($modulepart, array('contract', 'facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) {
|
||||
$printer = ($user->hasRight('printing', 'read') && !empty($conf->printing->enabled)) ? true : false;
|
||||
$printer = ($user->hasRight('printing', 'read') && !empty($conf->printing->enabled));
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('formfile'));
|
||||
@@ -1135,7 +1135,7 @@ class FormFile
|
||||
// Download
|
||||
$tmpout .= '<li class="nowrap"><a class="pictopreview nowrap" ';
|
||||
if (getDolGlobalInt('MAIN_DISABLE_FORCE_SAVEAS') == 2) {
|
||||
$tmpout .= 'target="_blank" ';
|
||||
$tmpout .= 'target="_blank" ';
|
||||
}
|
||||
$tmpout .= 'href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&entity='.$entity.'&file='.urlencode($relativepath).'"';
|
||||
$mime = dol_mimetype($relativepath, '', 0);
|
||||
|
||||
@@ -322,7 +322,7 @@ class Ldap
|
||||
$this->error = '';
|
||||
$this->connectedServer = '';
|
||||
|
||||
$ldapdebug = ((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false") ? false : true);
|
||||
$ldapdebug = !((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false"));
|
||||
|
||||
if ($ldapdebug) {
|
||||
dol_syslog(get_class($this)."::connectBind");
|
||||
|
||||
@@ -946,7 +946,7 @@ class TimeSpent extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
//var_dump($sFileName); var_dump(image_format_supported($sFileName));exit;
|
||||
$imgsupported = image_format_supported($sFileName);
|
||||
$isImageValid = ($imgsupported >= 0 ? true : false);
|
||||
$isImageValid = ($imgsupported >= 0);
|
||||
if (!$isImageValid) {
|
||||
$sErrorNumber = '202';
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
*/
|
||||
function is_empty($var, $allow_false = false, $allow_ws = false)
|
||||
{
|
||||
if (is_null($var) || !isset($var) || ($allow_ws == false && trim($var) == "" && !is_bool($var)) || ($allow_false === false && is_bool($var) && $var === false) || (is_array($var) && empty($var))) {
|
||||
if (is_null($var) || !isset($var) || ($allow_ws == false && trim($var) == "" && !is_bool($var)) || ($allow_false === false && $var === false) || (is_array($var) && empty($var))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1898,7 +1898,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = null, $nopr
|
||||
}
|
||||
|
||||
$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
|
||||
if ($force_filter_contact === false) {
|
||||
if (!$force_filter_contact) {
|
||||
if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) {
|
||||
$sql .= " AND a.fk_soc = ".((int) $filterobj->id);
|
||||
} elseif (is_object($filterobj) && get_class($filterobj) == 'Dolresource') {
|
||||
|
||||
@@ -2051,13 +2051,13 @@ function getSoapParams()
|
||||
global $conf;
|
||||
|
||||
$params = array();
|
||||
$proxyuse = (!getDolGlobalString('MAIN_PROXY_USE') ? false : true);
|
||||
$proxyhost = (!getDolGlobalString('MAIN_PROXY_USE') ? false : $conf->global->MAIN_PROXY_HOST);
|
||||
$proxyport = (!getDolGlobalString('MAIN_PROXY_USE') ? false : $conf->global->MAIN_PROXY_PORT);
|
||||
$proxyuser = (!getDolGlobalString('MAIN_PROXY_USE') ? false : $conf->global->MAIN_PROXY_USER);
|
||||
$proxypass = (!getDolGlobalString('MAIN_PROXY_USE') ? false : $conf->global->MAIN_PROXY_PASS);
|
||||
$timeout = (!getDolGlobalString('MAIN_USE_CONNECT_TIMEOUT') ? 10 : $conf->global->MAIN_USE_CONNECT_TIMEOUT); // Connection timeout
|
||||
$response_timeout = (!getDolGlobalString('MAIN_USE_RESPONSE_TIMEOUT') ? 30 : $conf->global->MAIN_USE_RESPONSE_TIMEOUT); // Response timeout
|
||||
$proxyuse = getDolGlobalString('MAIN_PROXY_USE');
|
||||
$proxyhost = (!$proxyuse ? false : $conf->global->MAIN_PROXY_HOST);
|
||||
$proxyport = (!$proxyuse ? false : $conf->global->MAIN_PROXY_PORT);
|
||||
$proxyuser = (!$proxyuse ? false : $conf->global->MAIN_PROXY_USER);
|
||||
$proxypass = (!$proxyuse ? false : $conf->global->MAIN_PROXY_PASS);
|
||||
$timeout = getDolGlobalInt('MAIN_USE_CONNECT_TIMEOUT', 10); // Connection timeout
|
||||
$response_timeout = getDolGlobalInt('MAIN_USE_RESPONSE_TIMEOUT', 30); // Response timeout
|
||||
//print extension_loaded('soap');
|
||||
if ($proxyuse) {
|
||||
$params = array('connection_timeout' => $timeout,
|
||||
|
||||
@@ -196,21 +196,21 @@ if (!function_exists('dol_loginfunction')) {
|
||||
if (getDolGlobalString('MAIN_SESSION_TIMEOUT')) {
|
||||
if (session_status() != PHP_SESSION_ACTIVE) {
|
||||
if (PHP_VERSION_ID < 70300) {
|
||||
session_set_cookie_params(0, '/', null, ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true), true); // Add tag secure and httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
|
||||
session_set_cookie_params(0, '/', null, !(empty($dolibarr_main_force_https) && isHTTPS() === false), true); // Add tag secure and httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
|
||||
} else {
|
||||
// Only available for php >= 7.3
|
||||
$sessioncookieparams = array(
|
||||
'lifetime' => 0,
|
||||
'path' => '/',
|
||||
//'domain' => '.mywebsite.com', // the dot at the beginning allows compatibility with subdomains
|
||||
'secure' => ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true),
|
||||
'secure' => !(empty($dolibarr_main_force_https) && isHTTPS() === false),
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax' // None || Lax || Strict
|
||||
);
|
||||
session_set_cookie_params($sessioncookieparams);
|
||||
}
|
||||
|
||||
setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", '', (empty($dolibarr_main_force_https) ? false : true), true);
|
||||
setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", '', !empty($dolibarr_main_force_https), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
|
||||
$ldapdn = $dolibarr_main_auth_ldap_dn;
|
||||
$ldapadminlogin = $dolibarr_main_auth_ldap_admin_login;
|
||||
$ldapadminpass = $dolibarr_main_auth_ldap_admin_pass;
|
||||
$ldapdebug = ((empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false") ? false : true);
|
||||
$ldapdebug = !(empty($dolibarr_main_auth_ldap_debug) || $dolibarr_main_auth_ldap_debug == "false");
|
||||
|
||||
if ($ldapdebug) {
|
||||
print "DEBUG: Logging LDAP steps<br>\n";
|
||||
|
||||
@@ -920,7 +920,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
|
||||
$this->atleastoneratenotnull = 0;
|
||||
if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
|
||||
$tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||
$tvaisnull = (!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']));
|
||||
if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL') && $tvaisnull) {
|
||||
// Nothing to do
|
||||
} else {
|
||||
|
||||
@@ -1127,7 +1127,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
|
||||
$this->atleastoneratenotnull = 0;
|
||||
if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
|
||||
$tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||
$tvaisnull = (!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']));
|
||||
if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL') && $tvaisnull) {
|
||||
// Nothing to do
|
||||
} else {
|
||||
@@ -1783,7 +1783,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
$this->cols['position'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 10,
|
||||
'status' => getDolGlobalInt('PDF_ERATOSHTENE_ADD_POSITION') ? true : (getDolGlobalInt('PDF_ADD_POSITION') ? true : false),
|
||||
'status' => getDolGlobalInt('PDF_ERATOSHTENE_ADD_POSITION') ? true : ((bool) getDolGlobalInt('PDF_ADD_POSITION')),
|
||||
'title' => array(
|
||||
'textkey' => '#', // use lang key is useful in somme case with module
|
||||
'align' => 'C',
|
||||
@@ -1915,7 +1915,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
$this->cols['totalexcltax'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 26, // in mm
|
||||
'status' => !getDolGlobalString('PDF_ORDER_HIDE_PRICE_EXCL_TAX') ? true : false,
|
||||
'status' => !getDolGlobalString('PDF_ORDER_HIDE_PRICE_EXCL_TAX'),
|
||||
'title' => array(
|
||||
'textkey' => 'TotalHTShort'
|
||||
),
|
||||
@@ -1926,7 +1926,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
$this->cols['totalincltax'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 26, // in mm
|
||||
'status' => !getDolGlobalString('PDF_ORDER_SHOW_PRICE_INCL_TAX') ? false : true,
|
||||
'status' => !(!getDolGlobalString('PDF_ORDER_SHOW_PRICE_INCL_TAX')),
|
||||
'title' => array(
|
||||
'textkey' => 'TotalTTCShort'
|
||||
),
|
||||
|
||||
@@ -1397,7 +1397,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
$this->atleastoneratenotnull = 0;
|
||||
if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
|
||||
$tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||
$tvaisnull = (!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']));
|
||||
if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL') && $tvaisnull) {
|
||||
// Nothing to do
|
||||
} else {
|
||||
|
||||
@@ -1609,7 +1609,7 @@ class pdf_octopus extends ModelePDFFactures
|
||||
|
||||
$this->atleastoneratenotnull = 0;
|
||||
if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
|
||||
$tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||
$tvaisnull = (!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']));
|
||||
if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL') && $tvaisnull) {
|
||||
// Nothing to do
|
||||
} else {
|
||||
|
||||
@@ -1684,7 +1684,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
|
||||
$this->atleastoneratenotnull = 0;
|
||||
if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
|
||||
$tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||
$tvaisnull = (!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']));
|
||||
if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL') && $tvaisnull) {
|
||||
// Nothing to do
|
||||
} else {
|
||||
@@ -2697,7 +2697,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$this->cols['totalexcltax'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 26, // in mm
|
||||
'status' => !getDolGlobalString('PDF_PROPAL_HIDE_PRICE_EXCL_TAX') ? true : false,
|
||||
'status' => !getDolGlobalString('PDF_PROPAL_HIDE_PRICE_EXCL_TAX'),
|
||||
'title' => array(
|
||||
'textkey' => 'TotalHTShort'
|
||||
),
|
||||
@@ -2708,7 +2708,7 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$this->cols['totalincltax'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 26, // in mm
|
||||
'status' => !getDolGlobalString('PDF_PROPAL_SHOW_PRICE_INCL_TAX') ? false : true,
|
||||
'status' => !(!getDolGlobalString('PDF_PROPAL_SHOW_PRICE_INCL_TAX')),
|
||||
'title' => array(
|
||||
'textkey' => 'TotalTTCShort'
|
||||
),
|
||||
|
||||
@@ -1105,7 +1105,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
|
||||
$this->atleastoneratenotnull = 0;
|
||||
if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
|
||||
$tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||
$tvaisnull = (!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']));
|
||||
if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL') && $tvaisnull) {
|
||||
// Nothing to do
|
||||
} else {
|
||||
|
||||
@@ -1209,7 +1209,7 @@ class pdf_cyan extends ModelePDFPropales
|
||||
|
||||
$this->atleastoneratenotnull = 0;
|
||||
if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
|
||||
$tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||
$tvaisnull = (!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']));
|
||||
if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL') && $tvaisnull) {
|
||||
// Nothing to do
|
||||
} else {
|
||||
@@ -2039,7 +2039,7 @@ class pdf_cyan extends ModelePDFPropales
|
||||
$this->cols['totalexcltax'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 26, // in mm
|
||||
'status' => !getDolGlobalString('PDF_PROPAL_HIDE_PRICE_EXCL_TAX') ? true : false,
|
||||
'status' => !getDolGlobalString('PDF_PROPAL_HIDE_PRICE_EXCL_TAX'),
|
||||
'title' => array(
|
||||
'textkey' => 'TotalHTShort'
|
||||
),
|
||||
@@ -2050,7 +2050,7 @@ class pdf_cyan extends ModelePDFPropales
|
||||
$this->cols['totalincltax'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 26, // in mm
|
||||
'status' => !getDolGlobalString('PDF_PROPAL_SHOW_PRICE_INCL_TAX') ? false : true,
|
||||
'status' => !(!getDolGlobalString('PDF_PROPAL_SHOW_PRICE_INCL_TAX')),
|
||||
'title' => array(
|
||||
'textkey' => 'TotalTTCShort'
|
||||
),
|
||||
|
||||
@@ -909,7 +909,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
||||
|
||||
$this->atleastoneratenotnull = 0;
|
||||
if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) {
|
||||
$tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
|
||||
$tvaisnull = (!empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000']));
|
||||
if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL') && $tvaisnull) {
|
||||
// Nothing to do
|
||||
} else {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,10 +26,10 @@ if (empty($blocname)) {
|
||||
|
||||
$hide = true; // Hide by default
|
||||
if (isset($parameters['showblocbydefault'])) {
|
||||
$hide = (empty($parameters['showblocbydefault']) ? true : false);
|
||||
$hide = empty($parameters['showblocbydefault']);
|
||||
}
|
||||
if (isset($object->extraparams[$blocname]['showhide'])) {
|
||||
$hide = (empty($object->extraparams[$blocname]['showhide']) ? true : false);
|
||||
$hide = empty($object->extraparams[$blocname]['showhide']);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -117,7 +117,7 @@ class EmailCollector extends CommonObject
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => 2, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'default' => 1, 'notnull' => 1, 'index' => 1, 'position' => 20),
|
||||
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 10, 'searchall' => 1, 'help' => 'Example: MyCollector1', 'csslist' => 'tdoverflowmax200'),
|
||||
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'notnull' => -1, 'searchall' => 1, 'help' => 'Example: My Email collector', 'csslist' => 'tdoverflowmax150', 'tdcss'=>'titlefieldmiddle'),
|
||||
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'visible' => 1, 'enabled' => 1, 'position' => 30, 'notnull' => -1, 'searchall' => 1, 'help' => 'Example: My Email collector', 'csslist' => 'tdoverflowmax150', 'tdcss' => 'titlefieldmiddle'),
|
||||
'description' => array('type' => 'text', 'label' => 'Description', 'visible' => -1, 'enabled' => 1, 'position' => 60, 'notnull' => -1, 'cssview' => 'small', 'csslist' => 'small tdoverflowmax200'),
|
||||
'host' => array('type' => 'varchar(255)', 'label' => 'EMailHost', 'visible' => 1, 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'searchall' => 1, 'comment' => "IMAP server", 'help' => 'Example: imap.gmail.com', 'csslist' => 'tdoverflowmax125'),
|
||||
'port' => array('type' => 'varchar(10)', 'label' => 'EMailHostPort', 'visible' => 1, 'enabled' => 1, 'position' => 91, 'notnull' => 1, 'searchall' => 0, 'comment' => "IMAP server port", 'help' => 'Example: 993', 'csslist' => 'tdoverflowmax50', 'default' => '993'),
|
||||
@@ -1151,16 +1151,16 @@ class EmailCollector extends CommonObject
|
||||
if (array_key_exists($keyforsupportedoauth2array, $supportedoauth2array)
|
||||
&& array_key_exists('name', $supportedoauth2array[$keyforsupportedoauth2array])
|
||||
&& !empty($supportedoauth2array[$keyforsupportedoauth2array]['name'])) {
|
||||
$OAUTH_SERVICENAME = $supportedoauth2array[$keyforsupportedoauth2array]['name'].(!empty($keyforprovider) ? '-'.$keyforprovider : '');
|
||||
$OAUTH_SERVICENAME = $supportedoauth2array[$keyforsupportedoauth2array]['name'].(!empty($keyforprovider) ? '-'.$keyforprovider : '');
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||
//$debugtext = "Host: ".$this->host."<br>Port: ".$this->port."<br>Login: ".$this->login."<br>Password: ".$this->password."<br>access type: ".$this->acces_type."<br>oauth service: ".$this->oauth_service."<br>Max email per collect: ".$this->maxemailpercollect;
|
||||
//dol_syslog($debugtext);
|
||||
require_once DOL_DOCUMENT_ROOT.'/includes/OAuth/bootstrap.php';
|
||||
//$debugtext = "Host: ".$this->host."<br>Port: ".$this->port."<br>Login: ".$this->login."<br>Password: ".$this->password."<br>access type: ".$this->acces_type."<br>oauth service: ".$this->oauth_service."<br>Max email per collect: ".$this->maxemailpercollect;
|
||||
//dol_syslog($debugtext);
|
||||
|
||||
$token = '';
|
||||
$token = '';
|
||||
|
||||
$storage = new DoliStorage($db, $conf, $keyforprovider);
|
||||
$storage = new DoliStorage($db, $conf, $keyforprovider);
|
||||
|
||||
try {
|
||||
$tokenobj = $storage->retrieveAccessToken($OAUTH_SERVICENAME);
|
||||
@@ -1178,7 +1178,7 @@ class EmailCollector extends CommonObject
|
||||
getDolGlobalString('OAUTH_'.$this->oauth_service.'_ID'),
|
||||
getDolGlobalString('OAUTH_'.$this->oauth_service.'_SECRET'),
|
||||
getDolGlobalString('OAUTH_'.$this->oauth_service.'_URLAUTHORIZE')
|
||||
);
|
||||
);
|
||||
$serviceFactory = new \OAuth\ServiceFactory();
|
||||
$oauthname = explode('-', $OAUTH_SERVICENAME);
|
||||
// ex service is Google-Emails we need only the first part Google
|
||||
@@ -1203,17 +1203,17 @@ class EmailCollector extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
$cm = new ClientManager();
|
||||
$client = $cm->make([
|
||||
'host' => $this->host,
|
||||
'port' => $this->port,
|
||||
'encryption' => !empty($this->imap_encryption) ? $this->imap_encryption : false,
|
||||
'validate_cert' => true,
|
||||
'protocol' => 'imap',
|
||||
'username' => $this->login,
|
||||
'password' => $token,
|
||||
'authentication' => "oauth",
|
||||
]);
|
||||
$cm = new ClientManager();
|
||||
$client = $cm->make([
|
||||
'host' => $this->host,
|
||||
'port' => $this->port,
|
||||
'encryption' => !empty($this->imap_encryption) ? $this->imap_encryption : false,
|
||||
'validate_cert' => true,
|
||||
'protocol' => 'imap',
|
||||
'username' => $this->login,
|
||||
'password' => $token,
|
||||
'authentication' => "oauth",
|
||||
]);
|
||||
} else {
|
||||
// Mode LOGIN (login/pass) with PHP-IMAP
|
||||
$this->debuginfo .= 'doCollectOneCollector is using method MAIN_IMAP_USE_PHPIMAP=1, access_type=0 (LOGIN)<br>';
|
||||
@@ -1804,7 +1804,7 @@ class EmailCollector extends CommonObject
|
||||
$isreplytook = 0;
|
||||
foreach ($rulesreplyto as $key => $rulereplyto) {
|
||||
if (preg_match('/'.preg_quote($rulereplyto, '/').'/', $headers['Reply-To'])) {
|
||||
$isreplytook ++;
|
||||
$isreplytook++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2220,7 +2220,7 @@ class EmailCollector extends CommonObject
|
||||
} else {
|
||||
foreach ($arrayofreferences as $key => $referencetmp) {
|
||||
if (!str_contains($objectemail->origin_references, $referencetmp)) {
|
||||
$objectemail->origin_references.= " ".$referencetmp;
|
||||
$objectemail->origin_references .= " ".$referencetmp;
|
||||
$changeonticket_references = true;
|
||||
}
|
||||
}
|
||||
@@ -3541,7 +3541,7 @@ class EmailCollector extends CommonObject
|
||||
|
||||
if (empty($mode) && empty($error)) {
|
||||
$res = imap_mail_move($connection, $imapemail, $targetdir, CP_UID);
|
||||
if ($res == false) {
|
||||
if (!$res) {
|
||||
// $errorforemail++; // Not in loop, not needed, not initialised
|
||||
$this->error = imap_last_error();
|
||||
$this->errors[] = $this->error;
|
||||
|
||||
@@ -989,7 +989,7 @@ class ConferenceOrBoothAttendee extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -1026,7 +1026,7 @@ class Fichinter extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -1119,7 +1119,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -784,12 +784,12 @@ class PaiementFourn extends Paiement
|
||||
|
||||
// Load file with numbering class (if found)
|
||||
if (is_file($dir.$file) && is_readable($dir.$file)) {
|
||||
$mybool = (include_once $dir.$file) || $mybool;
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
}
|
||||
|
||||
// For compatibility
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
$file = getDolGlobalString('SUPPLIER_PAYMENT_ADDON') . ".php";
|
||||
$classname = "mod_supplier_payment_" . getDolGlobalString('SUPPLIER_PAYMENT_ADDON');
|
||||
$classname = preg_replace('/\-.*$/', '', $classname);
|
||||
@@ -799,12 +799,12 @@ class PaiementFourn extends Paiement
|
||||
|
||||
// Load file with numbering class (if found)
|
||||
if (is_file($dir.$file) && is_readable($dir.$file)) {
|
||||
$mybool = (include_once $dir.$file) || $mybool;
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ class Holiday extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -946,7 +946,7 @@ class Evaluation extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -926,7 +926,7 @@ class EvaluationLine extends CommonObjectLine
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -955,7 +955,7 @@ class Job extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -995,7 +995,7 @@ class Position extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file " . $file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -995,7 +995,7 @@ class Skill extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -894,7 +894,7 @@ class Skilldet extends CommonObjectLine
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -959,7 +959,7 @@ class SkillRank extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -1015,7 +1015,7 @@ class KnowledgeRecord extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -378,14 +378,14 @@ if (GETPOST("DOL_AUTOSET_COOKIE")) {
|
||||
$cookievalue = json_encode($cookiearrayvalue);
|
||||
//var_dump('setcookie cookiename='.$cookiename.' cookievalue='.$cookievalue);
|
||||
if (PHP_VERSION_ID < 70300) {
|
||||
setcookie($cookiename, empty($cookievalue) ? '' : $cookievalue, empty($cookievalue) ? 0 : (time() + (86400 * 354)), '/', '', ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true), true); // keep cookie 1 year and add tag httponly
|
||||
setcookie($cookiename, empty($cookievalue) ? '' : $cookievalue, empty($cookievalue) ? 0 : (time() + (86400 * 354)), '/', '', !(empty($dolibarr_main_force_https) && isHTTPS() === false), true); // keep cookie 1 year and add tag httponly
|
||||
} else {
|
||||
// Only available for php >= 7.3
|
||||
$cookieparams = array(
|
||||
'expires' => empty($cookievalue) ? 0 : (time() + (86400 * 354)),
|
||||
'path' => '/',
|
||||
//'domain' => '.mywebsite.com', // the dot at the beginning allows compatibility with subdomains
|
||||
'secure' => ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true),
|
||||
'secure' => !(empty($dolibarr_main_force_https) && isHTTPS() === false),
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax' // None || Lax || Strict
|
||||
);
|
||||
@@ -416,14 +416,14 @@ if (!empty($_COOKIE[$sessiontimeout])) {
|
||||
// We need this lock as long as we read/write $_SESSION ['vars']. We can remove lock when finished.
|
||||
if (!defined('NOSESSION')) {
|
||||
if (PHP_VERSION_ID < 70300) {
|
||||
session_set_cookie_params(0, '/', null, ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true), true); // Add tag secure and httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
|
||||
session_set_cookie_params(0, '/', null, !(empty($dolibarr_main_force_https) && isHTTPS() === false), true); // Add tag secure and httponly on session cookie (same as setting session.cookie_httponly into php.ini). Must be called before the session_start.
|
||||
} else {
|
||||
// Only available for php >= 7.3
|
||||
$sessioncookieparams = array(
|
||||
'lifetime' => 0,
|
||||
'path' => '/',
|
||||
//'domain' => '.mywebsite.com', // the dot at the beginning allows compatibility with subdomains
|
||||
'secure' => ((empty($dolibarr_main_force_https) && isHTTPS() === false) ? false : true),
|
||||
'secure' => !(empty($dolibarr_main_force_https) && isHTTPS() === false),
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax' // None || Lax || Strict
|
||||
);
|
||||
@@ -835,7 +835,7 @@ if (!defined('NOLOGIN')) {
|
||||
// Verification security graphic code
|
||||
if ($test && GETPOST("username", "alpha", 2) && getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA') && !isset($_SESSION['dol_bypass_antispam'])) {
|
||||
$sessionkey = 'dol_antispam_value';
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) === strtolower(GETPOST('code', 'restricthtml'))));
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) === strtolower(GETPOST('code', 'restricthtml'))));
|
||||
|
||||
// Check code
|
||||
if (!$ok) {
|
||||
@@ -1023,7 +1023,7 @@ if (!defined('NOLOGIN')) {
|
||||
if ($resultFetchUser <= 0 || $user->isNotIntoValidityDateRange()) {
|
||||
dol_syslog('User not found or not valid, connection refused');
|
||||
session_destroy();
|
||||
session_set_cookie_params(0, '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Add tag secure and httponly on session cookie
|
||||
session_set_cookie_params(0, '/', null, !empty($dolibarr_main_force_https), true); // Add tag secure and httponly on session cookie
|
||||
session_name($sessionname);
|
||||
dol_session_start();
|
||||
|
||||
@@ -1110,7 +1110,7 @@ if (!defined('NOLOGIN')) {
|
||||
dol_syslog("The user login has a validity between [".$user->datestartvalidity." and ".$user->dateendvalidity."], current date is ".dol_now());
|
||||
}
|
||||
session_destroy();
|
||||
session_set_cookie_params(0, '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Add tag secure and httponly on session cookie
|
||||
session_set_cookie_params(0, '/', null, !empty($dolibarr_main_force_https), true); // Add tag secure and httponly on session cookie
|
||||
session_name($sessionname);
|
||||
dol_session_start();
|
||||
|
||||
|
||||
@@ -1021,7 +1021,7 @@ class Mo extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
@@ -1386,7 +1386,7 @@ class Mo extends CommonObject
|
||||
global $langs;
|
||||
|
||||
$langs->loadLangs(['mrp', 'products']);
|
||||
$nofetch = isset($params['nofetch']) ? true : false;
|
||||
$nofetch = isset($params['nofetch']);
|
||||
|
||||
$datas = [];
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ function issetAndNoEmpty($name, $tableau = null)
|
||||
$tableau = $_POST;
|
||||
}
|
||||
|
||||
return (isset($tableau[$name]) === true && empty($tableau[$name]) === false);
|
||||
return (isset($tableau[$name]) && !empty($tableau[$name]));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2013-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -272,7 +273,7 @@ if (GETPOSTISSET("ajoutercolonne") && $object->format == "D") {
|
||||
$reponsesadd = str_split($obj->reponses);
|
||||
$lengthresponses = count($reponsesadd);
|
||||
for ($cpt = $lengthresponses; $cpt > $cleinsertion; $cpt--) {
|
||||
$reponsesadd[$cpt] = $reponsesadd[$cpt-1];
|
||||
$reponsesadd[$cpt] = $reponsesadd[$cpt - 1];
|
||||
}
|
||||
$reponsesadd[$cleinsertion] = '0';
|
||||
$reponsesadd = implode($reponsesadd);
|
||||
@@ -437,7 +438,7 @@ $toutsujet = explode(",", $object->sujet);
|
||||
$listofanswers = array();
|
||||
foreach ($toutsujet as $value) {
|
||||
$tmp = explode('@', $value);
|
||||
$listofanswers[] = array('label'=>$tmp[0], 'format'=>(!empty($tmp[1]) ? $tmp[1] : 'checkbox'));
|
||||
$listofanswers[] = array('label' => $tmp[0], 'format' => (!empty($tmp[1]) ? $tmp[1] : 'checkbox'));
|
||||
}
|
||||
$toutsujet = str_replace("@", "<br>", $toutsujet);
|
||||
$toutsujet = str_replace("°", "'", $toutsujet);
|
||||
@@ -590,7 +591,7 @@ if (GETPOST('ajoutsujet')) {
|
||||
if ($object->format == "A") {
|
||||
print $langs->trans("AddNewColumn").':<br><br>';
|
||||
print $langs->trans("Title").' <input type="text" name="nouvellecolonne" size="40"><br>';
|
||||
$tmparray = array('checkbox'=>$langs->trans("CheckBox"), 'yesno'=>$langs->trans("YesNoList"), 'foragainst'=>$langs->trans("PourContreList"));
|
||||
$tmparray = array('checkbox' => $langs->trans("CheckBox"), 'yesno' => $langs->trans("YesNoList"), 'foragainst' => $langs->trans("PourContreList"));
|
||||
print $langs->trans("Type").' '.$form->selectarray("typecolonne", $tmparray, GETPOST('typecolonne')).'<br><br>';
|
||||
print '<input type="submit" class="button" name="ajoutercolonne" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
|
||||
print '<input type="hidden" name="id_sondage" value="'.dol_escape_htmltag($object->id_sondage).'">';
|
||||
@@ -728,7 +729,7 @@ if ($object->format == "D") {
|
||||
for ($i = 0; $i < $nbofsujet; $i++) {
|
||||
$cur = intval($toutsujet[$i]); // intval() est utiliser pour supprimer le suffixe @* qui déplaît logiquement à strftime()
|
||||
|
||||
if (isset($toutsujet[$i + 1]) === false) {
|
||||
if (!isset($toutsujet[$i + 1])) {
|
||||
$next = false;
|
||||
} else {
|
||||
$next = intval($toutsujet[$i + 1]);
|
||||
@@ -756,7 +757,7 @@ if ($object->format == "D") {
|
||||
$colspan = 1;
|
||||
for ($i = 0; $i < $nbofsujet; $i++) {
|
||||
$cur = intval($toutsujet[$i]);
|
||||
if (isset($toutsujet[$i + 1]) === false) {
|
||||
if (!isset($toutsujet[$i + 1])) {
|
||||
$next = false;
|
||||
} else {
|
||||
$next = intval($toutsujet[$i + 1]);
|
||||
@@ -919,11 +920,11 @@ while ($compteur < $num) {
|
||||
print '>';
|
||||
}
|
||||
if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno') {
|
||||
$arraychoice = array('2'=>' ', '0'=>$langs->trans("No"), '1'=>$langs->trans("Yes"));
|
||||
$arraychoice = array('2' => ' ', '0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("choix".$i, $arraychoice, $car);
|
||||
}
|
||||
if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst') {
|
||||
$arraychoice = array('2'=>' ', '0'=>$langs->trans("Against"), '1'=>$langs->trans("For"));
|
||||
$arraychoice = array('2' => ' ', '0' => $langs->trans("Against"), '1' => $langs->trans("For"));
|
||||
print $form->selectarray("choix".$i, $arraychoice, $car);
|
||||
}
|
||||
print '</td>'."\n";
|
||||
@@ -1032,11 +1033,11 @@ if (empty($testligneamodifier)) {
|
||||
print '>';
|
||||
}
|
||||
if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno') {
|
||||
$arraychoice = array('2'=>' ', '0'=>$langs->trans("No"), '1'=>$langs->trans("Yes"));
|
||||
$arraychoice = array('2' => ' ', '0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("choix".$i, $arraychoice);
|
||||
}
|
||||
if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst') {
|
||||
$arraychoice = array('2'=>' ', '0'=>$langs->trans("Against"), '1'=>$langs->trans("For"));
|
||||
$arraychoice = array('2' => ' ', '0' => $langs->trans("Against"), '1' => $langs->trans("For"));
|
||||
print $form->selectarray("choix".$i, $arraychoice);
|
||||
}
|
||||
print '</td>'."\n";
|
||||
@@ -1129,7 +1130,7 @@ $toutsujet = explode(",", $object->sujet); // With old versions, this field was
|
||||
$compteursujet = 0;
|
||||
$meilleursujet = '';
|
||||
for ($i = 0; $i < $nbcolonnes; $i++) {
|
||||
if (isset($sumfor[$i]) === true && isset($meilleurecolonne) === true && $sumfor[$i] == $meilleurecolonne) {
|
||||
if (isset($sumfor[$i]) && isset($meilleurecolonne) && ($sumfor[$i] == $meilleurecolonne)) {
|
||||
$meilleursujet .= ($meilleursujet ? ", " : "");
|
||||
|
||||
if ($object->format == "D") {
|
||||
|
||||
@@ -129,7 +129,7 @@ print '<table>'."\n";
|
||||
//affichage des cases texte de formulaire
|
||||
for ($i = 0; $i < $_SESSION["nbrecases"]; $i++) {
|
||||
$j = $i + 1;
|
||||
if (isset($_SESSION["choix$i"]) === false) {
|
||||
if (!isset($_SESSION["choix$i"])) {
|
||||
$_SESSION["choix$i"] = '';
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("TitleChoice").' '.$j.': </td><td><input type="text" name="choix[]" size="40" maxlength="40" value="'.dol_escape_htmltag($_SESSION["choix$i"]).'" id="choix'.$i.'">';
|
||||
|
||||
@@ -525,7 +525,7 @@ for ($i = 0; $i < $nbrejourmois + $premierjourmois; $i++) {
|
||||
}
|
||||
|
||||
// If no red button, we show green or grey button with number of day
|
||||
if (isset($dejafait) === false || $dejafait != $numerojour) {
|
||||
if (!isset($dejafait) || $dejafait != $numerojour) {
|
||||
// green button
|
||||
if (($numerojour >= $jourAJ && $_SESSION["mois"] == $moisAJ && $_SESSION["annee"] == $anneeAJ) || ($_SESSION["mois"] > $moisAJ && $_SESSION["annee"] == $anneeAJ) || $_SESSION["annee"] > $anneeAJ) {
|
||||
print '<td class="center libre"><input type="submit" class="bouton ON centpercent nomarginleft buttonwebsite" name="choixjourajout[]" value="'.$numerojour.'"></td>'."\n";
|
||||
|
||||
@@ -1224,7 +1224,7 @@ class Partnership extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ class PartnershipUtils
|
||||
$href = $hrefs->item($i);
|
||||
$url = $href->getAttribute('href');
|
||||
$url = filter_var($url, FILTER_SANITIZE_URL);
|
||||
if (!filter_var($url, FILTER_VALIDATE_URL) === false) {
|
||||
if (!(!filter_var($url, FILTER_VALIDATE_URL))) {
|
||||
$webcontent .= $url;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -78,4 +79,4 @@ $PROXY_HOST = getDolGlobalString('MAIN_PROXY_HOST');
|
||||
$PROXY_PORT = getDolGlobalString('MAIN_PROXY_PORT');
|
||||
$PROXY_USER = getDolGlobalString('MAIN_PROXY_USER');
|
||||
$PROXY_PASS = getDolGlobalString('MAIN_PROXY_PASS');
|
||||
$USE_PROXY = !getDolGlobalString('MAIN_PROXY_USE') ? false : true;
|
||||
$USE_PROXY = !(!getDolGlobalString('MAIN_PROXY_USE'));
|
||||
|
||||
@@ -343,7 +343,7 @@ foreach ($dirproduct as $dirroot) {
|
||||
print "</td>\n";
|
||||
} else {
|
||||
$disabled = false;
|
||||
if (isModEnabled('multicompany') && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] == $conf->entity) ? false : true) {
|
||||
if (!(isModEnabled('multicompany') && ((is_object($mc) && !empty($mc->sharings['referent'])) && ($mc->sharings['referent'] == $conf->entity)))) {
|
||||
}
|
||||
print '<td class="center">';
|
||||
if (!$disabled) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015-2017 Francis Appels <francis.appels@yahoo.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -414,7 +415,7 @@ class FormProduct
|
||||
|
||||
dol_syslog(get_class($this)."::selectWorkstations $selected, $htmlname, $empty, $disabled, $fk_product, $empty_label, $forcecombo, $morecss", LOG_DEBUG);
|
||||
|
||||
$filterstatus='';
|
||||
$filterstatus = '';
|
||||
$out = '';
|
||||
if (!empty($fk_product) && $fk_product > 0) {
|
||||
$this->cache_workstations = array();
|
||||
@@ -873,7 +874,7 @@ class FormProduct
|
||||
if (count($productIdArray) && count($this->cache_lot)) {
|
||||
// check cache already loaded for product id's
|
||||
foreach ($productIdArray as $productId) {
|
||||
$cacheLoaded = !empty($this->cache_lot[$productId]) ? true : false;
|
||||
$cacheLoaded = !empty($this->cache_lot[$productId]);
|
||||
}
|
||||
}
|
||||
if ($cacheLoaded) {
|
||||
|
||||
@@ -819,7 +819,7 @@ class ProductFournisseurPrice extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -305,13 +305,13 @@ class Productlot extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if ($checkSellByMandatory === true) {
|
||||
if ($checkSellByMandatory) {
|
||||
if (!isset($sellBy) || dol_strlen($sellBy) == 0) {
|
||||
// error : sell by is mandatory
|
||||
$errorMsgArr[] = $langs->trans('ErrorFieldRequired', $langs->transnoentities('SellByDate'));
|
||||
}
|
||||
}
|
||||
if ($checkEatByMandatory === true) {
|
||||
if ($checkEatByMandatory) {
|
||||
if (!isset($eatBy) || dol_strlen($eatBy) == 0) {
|
||||
// error : eat by is mandatory
|
||||
$errorMsgArr[] = $langs->trans('ErrorFieldRequired', $langs->transnoentities('EatByDate'));
|
||||
|
||||
@@ -1005,7 +1005,7 @@ class StockTransfer extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -479,8 +479,8 @@ class StockTransferLine extends CommonObjectLine
|
||||
return $result;
|
||||
}
|
||||
} else {
|
||||
$this->error=$langs->trans('StockTransferNoBatchForProduct', $p->getNomUrl());
|
||||
$this->errors[]= $this->error;
|
||||
$this->error = $langs->trans('StockTransferNoBatchForProduct', $p->getNomUrl());
|
||||
$this->errors[] = $this->error;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -912,7 +912,7 @@ class StockTransferLine extends CommonObjectLine
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -1515,7 +1515,7 @@ class Task extends CommonObjectLine
|
||||
}
|
||||
}
|
||||
|
||||
if ($ret == true) {
|
||||
if ($ret) {
|
||||
$this->db->commit();
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
|
||||
@@ -204,7 +204,7 @@ if (empty($reshook) && $action == 'add') {
|
||||
// Check Captcha code if is enabled
|
||||
if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
|
||||
$sessionkey = 'dol_antispam_value';
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code'))));
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code'))));
|
||||
if (!$ok) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorBadValueForCode") . "<br>\n";
|
||||
|
||||
@@ -264,7 +264,7 @@ if (empty($reshook) && $action == 'add') {
|
||||
// Check Captcha code if is enabled
|
||||
if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {
|
||||
$sessionkey = 'dol_antispam_value';
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code'))));
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code'))));
|
||||
if (!$ok) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorBadValueForCode")."<br>\n";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -325,7 +326,7 @@ $toutsujet = explode(",", $object->sujet);
|
||||
$listofanswers = array();
|
||||
foreach ($toutsujet as $value) {
|
||||
$tmp = explode('@', $value);
|
||||
$listofanswers[] = array('label'=>$tmp[0], 'format'=>(!empty($tmp[1]) ? $tmp[1] : 'checkbox'));
|
||||
$listofanswers[] = array('label' => $tmp[0], 'format' => (!empty($tmp[1]) ? $tmp[1] : 'checkbox'));
|
||||
}
|
||||
$toutsujet = str_replace("°", "'", $toutsujet);
|
||||
|
||||
@@ -405,7 +406,7 @@ if ($object->format == "D") {
|
||||
for ($i = 0; $i < $nbofsujet; $i++) {
|
||||
$cur = intval($toutsujet[$i]); // intval() est utiliser pour supprimer le suffixe @* qui déplaît logiquement à strftime()
|
||||
|
||||
if (isset($toutsujet[$i + 1]) === false) {
|
||||
if (!isset($toutsujet[$i + 1])) {
|
||||
$next = false;
|
||||
} else {
|
||||
$next = intval($toutsujet[$i + 1]);
|
||||
@@ -427,7 +428,7 @@ if ($object->format == "D") {
|
||||
$colspan = 1;
|
||||
for ($i = 0; $i < $nbofsujet; $i++) {
|
||||
$cur = intval($toutsujet[$i]);
|
||||
if (isset($toutsujet[$i + 1]) === false) {
|
||||
if (!isset($toutsujet[$i + 1])) {
|
||||
$next = false;
|
||||
} else {
|
||||
$next = intval($toutsujet[$i + 1]);
|
||||
@@ -583,11 +584,11 @@ while ($compteur < $num) {
|
||||
print '>';
|
||||
}
|
||||
if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno') {
|
||||
$arraychoice = array('2'=>' ', '0'=>$langs->trans("No"), '1'=>$langs->trans("Yes"));
|
||||
$arraychoice = array('2' => ' ', '0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("choix".$i, $arraychoice, $car);
|
||||
}
|
||||
if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst') {
|
||||
$arraychoice = array('2'=>' ', '0'=>$langs->trans("Against"), '1'=>$langs->trans("For"));
|
||||
$arraychoice = array('2' => ' ', '0' => $langs->trans("Against"), '1' => $langs->trans("For"));
|
||||
print $form->selectarray("choix".$i, $arraychoice, $car);
|
||||
}
|
||||
print '</td>'."\n";
|
||||
@@ -701,11 +702,11 @@ if ($ligneamodifier < 0 && (!isset($_SESSION['nom']))) {
|
||||
print '>';
|
||||
}
|
||||
if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'yesno') {
|
||||
$arraychoice = array('2'=>' ', '0'=>$langs->trans("No"), '1'=>$langs->trans("Yes"));
|
||||
$arraychoice = array('2' => ' ', '0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("choix".$i, $arraychoice, GETPOST('choix'.$i));
|
||||
}
|
||||
if (!empty($listofanswers[$i]['format']) && $listofanswers[$i]['format'] == 'foragainst') {
|
||||
$arraychoice = array('2'=>' ', '0'=>$langs->trans("Against"), '1'=>$langs->trans("For"));
|
||||
$arraychoice = array('2' => ' ', '0' => $langs->trans("Against"), '1' => $langs->trans("For"));
|
||||
print $form->selectarray("choix".$i, $arraychoice, GETPOST('choix'.$i));
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -231,7 +232,7 @@ if (empty($reshook)) {
|
||||
// Check Captcha code if is enabled
|
||||
if (getDolGlobalInt('MAIN_SECURITY_ENABLECAPTCHA_TICKET')) {
|
||||
$sessionkey = 'dol_antispam_value';
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) === strtolower(GETPOST('code', 'restricthtml'))));
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) === strtolower(GETPOST('code', 'restricthtml'))));
|
||||
if (!$ok) {
|
||||
$error++;
|
||||
array_push($object->errors, $langs->trans("ErrorBadValueForCode"));
|
||||
|
||||
@@ -179,7 +179,7 @@ if (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->access
|
||||
if (empty($webportal_logged_thirdparty_account_id)) {
|
||||
// Set cookie for timeout management
|
||||
if (getDolGlobalString('MAIN_SESSION_TIMEOUT')) {
|
||||
setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", '', (empty($dolibarr_main_force_https) ? false : true), true);
|
||||
setcookie($sessiontimeout, $conf->global->MAIN_SESSION_TIMEOUT, 0, "/", '', !empty($dolibarr_main_force_https), true);
|
||||
}
|
||||
|
||||
$context->controller = 'login';
|
||||
@@ -199,7 +199,7 @@ if (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->access
|
||||
// Account has been removed after login
|
||||
dol_syslog("Can't load third-party account (ID: $webportal_logged_thirdparty_account_id) even if session logged.", LOG_WARNING);
|
||||
session_destroy();
|
||||
session_set_cookie_params(0, '/', null, (empty($dolibarr_main_force_https) ? false : true), true); // Add tag secure and httponly on session cookie
|
||||
session_set_cookie_params(0, '/', null, !empty($dolibarr_main_force_https), true); // Add tag secure and httponly on session cookie
|
||||
session_name($sessionname);
|
||||
session_start();
|
||||
|
||||
|
||||
@@ -945,7 +945,7 @@ class RecruitmentCandidature extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ class RecruitmentJobPosition extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print "</td>\n";
|
||||
} else {
|
||||
$disabled = (isModEnabled('multicompany') && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false);
|
||||
$disabled = (isModEnabled('multicompany') && ((is_object($mc) && !empty($mc->sharings['referent'])) && ($mc->sharings['referent'] != $conf->entity)));
|
||||
print '<td class="center">';
|
||||
if (!$disabled) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setcodeclient&token='.newToken().'&value='.urlencode($file).'">';
|
||||
@@ -717,9 +717,9 @@ foreach ($profid as $key => $val) {
|
||||
$idprof_mandatory = 'SOCIETE_'.$key.'_MANDATORY';
|
||||
$idprof_invoice_mandatory = 'SOCIETE_'.$key.'_INVOICE_MANDATORY';
|
||||
|
||||
$verif = (empty($conf->global->$idprof_unique) ? false : true);
|
||||
$mandatory = (empty($conf->global->$idprof_mandatory) ? false : true);
|
||||
$invoice_mandatory = (empty($conf->global->$idprof_invoice_mandatory) ? false : true);
|
||||
$verif = !empty($conf->global->$idprof_unique);
|
||||
$mandatory = !empty($conf->global->$idprof_mandatory);
|
||||
$invoice_mandatory = !empty($conf->global->$idprof_invoice_mandatory);
|
||||
|
||||
if ($verif) {
|
||||
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setprofid&token='.newToken().'&value='.$key.'&status=0">';
|
||||
|
||||
@@ -3778,22 +3778,22 @@ class Societe extends CommonObject
|
||||
|
||||
switch ($idprof) {
|
||||
case 1:
|
||||
$ret = (!getDolGlobalString('SOCIETE_IDPROF1_UNIQUE') ? false : true);
|
||||
$ret = !(!getDolGlobalString('SOCIETE_IDPROF1_UNIQUE'));
|
||||
break;
|
||||
case 2:
|
||||
$ret = (!getDolGlobalString('SOCIETE_IDPROF2_UNIQUE') ? false : true);
|
||||
$ret = !(!getDolGlobalString('SOCIETE_IDPROF2_UNIQUE'));
|
||||
break;
|
||||
case 3:
|
||||
$ret = (!getDolGlobalString('SOCIETE_IDPROF3_UNIQUE') ? false : true);
|
||||
$ret = !(!getDolGlobalString('SOCIETE_IDPROF3_UNIQUE'));
|
||||
break;
|
||||
case 4:
|
||||
$ret = (!getDolGlobalString('SOCIETE_IDPROF4_UNIQUE') ? false : true);
|
||||
$ret = !(!getDolGlobalString('SOCIETE_IDPROF4_UNIQUE'));
|
||||
break;
|
||||
case 5:
|
||||
$ret = (!getDolGlobalString('SOCIETE_IDPROF5_UNIQUE') ? false : true);
|
||||
$ret = !(!getDolGlobalString('SOCIETE_IDPROF5_UNIQUE'));
|
||||
break;
|
||||
case 6:
|
||||
$ret = (!getDolGlobalString('SOCIETE_IDPROF6_UNIQUE') ? false : true);
|
||||
$ret = !(!getDolGlobalString('SOCIETE_IDPROF6_UNIQUE'));
|
||||
break;
|
||||
default:
|
||||
$ret = false;
|
||||
@@ -4591,7 +4591,7 @@ class Societe extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
return (($obj->nb > 0) ? true : false);
|
||||
return ($obj->nb > 0);
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
return false;
|
||||
|
||||
@@ -66,7 +66,7 @@ if (empty($_SESSION["takeposterminal"])) {
|
||||
|
||||
if ($setterminal > 0) {
|
||||
$_SESSION["takeposterminal"] = $setterminal;
|
||||
setcookie("takeposterminal", (string) $setterminal, (time() + (86400 * 354)), '/', '', (empty($dolibarr_main_force_https) ? false : true), true); // Permanent takeposterminal var in a cookie
|
||||
setcookie("takeposterminal", (string) $setterminal, (time() + (86400 * 354)), '/', '', !empty($dolibarr_main_force_https), true); // Permanent takeposterminal var in a cookie
|
||||
}
|
||||
|
||||
if ($setcurrency != "") {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2008-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -119,7 +120,7 @@ if (empty($reshook)) {
|
||||
// Action to set a temporary password and send email for reset
|
||||
if ($action == 'buildnewpassword' && $username) {
|
||||
$sessionkey = 'dol_antispam_value';
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code'))));
|
||||
$ok = (array_key_exists($sessionkey, $_SESSION) && (strtolower($_SESSION[$sessionkey]) == strtolower(GETPOST('code'))));
|
||||
|
||||
// Verify code
|
||||
if (!$ok) {
|
||||
|
||||
@@ -95,8 +95,8 @@ class Target extends CommonObject
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
|
||||
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 4, 'noteditable' => 1, 'index' => 1, 'searchall' => 1, 'validate' => 1, 'comment' => "Reference of object"),
|
||||
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist'=>'tdoverflowmax150', 'showoncombobox' => 2, 'validate' => 1,),
|
||||
'trigger_codes' => array('type' => 'text', 'label' => 'TriggerCodes', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 1, 'help' => "TriggerCodeInfo", 'tdcss'=>'titlefieldmiddle', 'csslist'=>'tdoverflowmax200', 'css' => 'minwidth400', 'arrayofkeyval' => array('defined_in_constructor' => 'defined_from_c_action_trigger'), 'multiinput' => 1,),
|
||||
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150', 'showoncombobox' => 2, 'validate' => 1,),
|
||||
'trigger_codes' => array('type' => 'text', 'label' => 'TriggerCodes', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 1, 'help' => "TriggerCodeInfo", 'tdcss' => 'titlefieldmiddle', 'csslist' => 'tdoverflowmax200', 'css' => 'minwidth400', 'arrayofkeyval' => array('defined_in_constructor' => 'defined_from_c_action_trigger'), 'multiinput' => 1,),
|
||||
'url' => array('type' => 'url', 'label' => 'Url', 'enabled' => 1, 'position' => 55, 'notnull' => 1, 'visible' => 1,),
|
||||
'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 3, 'validate' => 1,),
|
||||
'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 61, 'notnull' => 0, 'visible' => 0, 'cssview' => 'wordbreak', 'validate' => 1,),
|
||||
@@ -923,7 +923,7 @@ class Target extends CommonObject
|
||||
$mybool = ((bool) @include_once $dir.$file) || $mybool;
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -617,7 +617,7 @@ class FormCardWebPortal
|
||||
$cardRight = true;
|
||||
}
|
||||
}
|
||||
if ($cardRight === true) {
|
||||
if ($cardRight) {
|
||||
$html .= '</div>';
|
||||
$html .= '<div class="card-right">';
|
||||
}
|
||||
|
||||
@@ -830,7 +830,7 @@ class FormWebPortal extends Form
|
||||
}
|
||||
}
|
||||
|
||||
if ($filter_categorie === false) {
|
||||
if (!$filter_categorie) {
|
||||
$fields_label = explode('|', $InfoFieldList[1]);
|
||||
if (is_array($fields_label)) {
|
||||
$keyList .= ', ';
|
||||
@@ -1163,7 +1163,7 @@ class FormWebPortal extends Form
|
||||
dol_syslog(__METHOD__ . ' type=sellist', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($filter_categorie === false) {
|
||||
if (!$filter_categorie) {
|
||||
$value = ''; // value was used, so now we reset it to use it to build final output
|
||||
$numrows = $this->db->num_rows($resql);
|
||||
if ($numrows) {
|
||||
@@ -1266,7 +1266,7 @@ class FormWebPortal extends Form
|
||||
dol_syslog(__METHOD__ . ' type=chkbxlst', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($filter_categorie === false) {
|
||||
if (!$filter_categorie) {
|
||||
$value = ''; // value was used, so now we reset it to use it to build final output
|
||||
$toprint = array();
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
|
||||
@@ -880,7 +880,7 @@ class Workstation extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if ($mybool === false) {
|
||||
if (!$mybool) {
|
||||
dol_print_error(null, "Failed to include file ".$file);
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user