diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index 5d17645bba9..dcbd8fe4d30 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -3066,18 +3066,6 @@ parameters: count: 8 path: ../../htdocs/bom/tpl/objectline_view.tpl.php - - - message: '#^If condition is always false\.$#' - identifier: if.alwaysFalse - count: 1 - path: ../../htdocs/bookcal/availabilities_agenda.php - - - - message: '#^Negated boolean expression is always false\.$#' - identifier: booleanNot.alwaysFalse - count: 1 - path: ../../htdocs/bookcal/availabilities_agenda.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index f013fa5ede5..b7cfa4033c0 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -55,7 +55,7 @@ preg_match('/:([!<>=\s]+|in|notin|like|notlike):/', $tmpcrit, $reg); print ''.$langs->trans("TransferStock").''; print ''.$langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers")).''; - print ''.dol_print_date($db->jdate($obj->periode), 'day').''; + print ''.dol_print_date($db->jdate($obj->period), 'day').''; "sme", $action = 'transfert'; $cle_rib = strtolower(checkES($rib, $CCC)); @@ -71,7 +71,7 @@ $reday = GETPOSTINT('reday'); $sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; - $sql .= ", '".$this->db->idate($this->periode)."'"; + $sql .= ", '".$this->db->idate($this->period)."'"; $sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode as period, cs.import_key"; $sql .= ", periode = '".$this->db->idate($this->period ? $this->period : $this->periode)."'"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, fk_user, date_creation)"; @@ -83,14 +83,12 @@ $title = $langs->trans('Product')." ".$shortlabel." - ".$langs->trans('Referers'); $title = $langs->trans('Service')." ".$shortlabel." - ".$langs->trans('Referers'); $title = $langs->transnoentities("Balance")." - ".$langs->transnoentities("AllTime"); - // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire if (!empty($arrayfields['cs.periode']['checked'])) { if ($newamount == 0 || empty($this->date_ech) || (empty($this->period) && empty($this->periode))) { if ($user->hasRight('stock', 'mouvement', 'creer')) { if (GETPOSTISSET("reday") && GETPOSTISSET("remonth") && GETPOSTISSET("reyear")) { if (empty($reyear) || empty($remonth) || empty($reday)) { * @param float|string $selectedrate Force preselected vat rate. Can be '8.5' or '8.5 (NOO)' for example. Use '' for no forcing. - $date = $obj->periode; $datepaid = dol_mktime(12, 0, 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); $datepaid = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); @@ -128,7 +126,6 @@ print ''; print ''; $sql = "SELECT c.id, c.libelle as type_label,"; -$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,"; +$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total, cs.paye,"; $sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,"; $sql .= " pct.code as payment_code,"; $sql .= " u.rowid as uid, u.lastname, u.firstname, u.email, u.login, u.admin, u.statut,"; @@ -175,8 +175,8 @@ if ($search_sc_type > 0) { } if ($year > 0) { $sql .= " AND ("; - // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, - // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire + // If period defined, we use it as a date criteria, elsewe use the dure date, + // so we are compatible with case where period is not mandatory. $sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= ")"; @@ -296,9 +296,9 @@ while ($i < min($num, $limit)) { print $socialcontrib->getNomUrl(1, ''); print ''; // Type - print ''.$obj->type_label.''; + print ''.dolPrintHTML($obj->type_label).''; // Date - $date = $obj->periode; + $date = $obj->period; if (empty($date)) { $date = $obj->date_ech; } diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 9384a292aff..48fa39fce67 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -204,8 +204,8 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { $sql .= " AND tva.entity = " . $conf->entity; if ($year > 0) { $sql .= " AND ("; - // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, - // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire + // We'll use the specified period as the date filter, unless it's missing, in which case we'll use the due date. + // This is to handle situations where the period was optional. $sql .= " (tva.datev IS NOT NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')"; $sql .= " OR (tva.datev IS NULL AND tva.datev between '" . $db->idate(dol_get_first_day($year)) . "' AND '" . $db->idate(dol_get_last_day($year)) . "')"; $sql .= ")"; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 268de88d57f..d3f124a39a1 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1960,11 +1960,14 @@ class CMailFile // Check response from Server if ($_retVal = $this->server_parse($socket, "220")) { $_retVal = $socket; + } else { + $this->error = ($this->error ? $this->error." - " : "")."Succeed in opening socket but answer 220 not received"; } } else { $this->error = utf8_check('Error '.$errno.' - '.$errstr) ? 'Error '.$errno.' - '.$errstr : mb_convert_encoding('Error '.$errno.' - '.$errstr, 'UTF-8', 'ISO-8859-1'); } } + return $_retVal; } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index d7e687c590b..ecb4ada7f88 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1500,9 +1500,9 @@ class ExtraFields $sqlwhere .= ' AND entity = '.((int) $conf->entity); } $sql .= $sqlwhere; - //print $sql; $sql .= $this->db->order(implode(',', $fields_label)); + //print $sql; dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index f24bc7d9d9a..2fe1ac92ddd 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -309,7 +309,7 @@ if (empty($reshook)) { } if (!$error && !getDolGlobalString('EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS')) { - $overlappingExpenseReportID = $object->periode_existe($fuser, $object->date_debut, $object->date_fin); + $overlappingExpenseReportID = $object->periodExists($fuser, $object->date_debut, $object->date_fin); if ($overlappingExpenseReportID > 0) { $error++; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 01827248462..f9757c4f779 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2378,26 +2378,24 @@ class ExpenseReport extends CommonObject return 1; } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * periode_existe + * periodExists * * @param User $fuser User * @param integer $date_debut Start date * @param integer $date_fin End date * @return int Return integer <0 if KO, >0 if OK */ - public function periode_existe($fuser, $date_debut, $date_fin) + public function periodExists($fuser, $date_debut, $date_fin) { global $conf; - // phpcs:enable $sql = "SELECT rowid, date_debut, date_fin"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE entity = ".((int) $conf->entity); // not shared, only for the current entity $sql .= " AND fk_user_author = ".((int) $fuser->id); - dol_syslog(get_class($this)."::periode_existe sql=".$sql); + dol_syslog(get_class($this)."::periodExists sql=".$sql); $result = $this->db->query($sql); if ($result) { $num_rows = $this->db->num_rows($result); @@ -2426,7 +2424,7 @@ class ExpenseReport extends CommonObject } } else { $this->error = $this->db->lasterror(); - dol_syslog(get_class($this)."::periode_existe Error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::periodExists Error ".$this->error, LOG_ERR); return -1; } } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index af9fd02c678..15558ad11d7 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2359,6 +2359,9 @@ td.showDragHandle { .bodyforlist #id-right { padding-bottom: 4px; } +.page-modulehelp div#id-right { + display: flex; +} /* DOL_XXX For having horizontal scroll into array (like with smartphone) */ @@ -2577,6 +2580,9 @@ div.fiche { print 'margin-bottom: 12px;'."\n"; } ?> } +.page-modulehelp div.fiche { + width: 100%; +} body.onlinepaymentbody div.fiche { /* For online payment page */ margin: 20px !important; } @@ -5418,7 +5424,7 @@ div.info { background: #eff8fc; color: #558; } -div.fiche div.info { +div.fiche div.info, div.fiche div.warning { box-shadow: 4px 4px 12px #e4e4e4; margin: 1em 0em 1.2em 0em; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 2de3f335e82..fcdc79aeb95 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5397,7 +5397,7 @@ div.info { background: #eff8fc; color: #558; } -div.fiche div.info { +div.fiche div.info, div.fiche div.warning { box-shadow: 4px 4px 12px #e4e4e4; margin: 1em 0em 1.2em 0em; }