Qual: Fix french comments and improve detector (#39026)

* Qual: Generate phan specific changed php files list

# Qual: Generate phan specific changed php files list

Uses multiple parts of the Phan configuration to select and exclude files
for phan analysis.

* avoid catching special characters in regexes as indicators of french

* Qual: Translate french to english
This commit is contained in:
MDW 2026-07-01 12:26:51 +02:00 committed by GitHub
parent 0c50fd0223
commit ee3875eb4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 257 additions and 221 deletions

View file

@ -1,5 +1,7 @@
#!/bin/bash
# Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
# Copyright (C) 2025-2026 MDW <mdeweerd@users.noreply.github.com>
# shellcheck disable=2129,2128,2034,2016
set -euo pipefail
@ -41,22 +43,33 @@ repo="${GITHUB_REPOSITORY##*/}" # Extract text after the last '/'
page=1
per_page=100
changed_php_files=()
changed_phan_files=()
changed_lang_files=()
# Get phan path configuration
phan_directory_list=$(php -r '$config = require("dev/tools/phan/config.php"); echo "^".implode("|",$config["directory_list"]);')
phan_exclude_directory=$(php -r '$config = require("dev/tools/phan/config.php"); echo "^".implode("|",$config["exclude_analysis_directory_list"]);')
phan_exclude_file_regex=$(php -r '$config = require("dev/tools/phan/config.php"); echo $config["exclude_file_regex"];')
phan_exclude_file_regex=${phan_exclude_file_regex#@}
phan_exclude_file_regex=${phan_exclude_file_regex%@}
# Loop through all pages to gather changed files
while true; do
response=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
"https://api.github.com/repos/${owner}/${repo}/pulls/${pr_number}/files?per_page=${per_page}&page=${page}")
phan_exclude_file_regex=$(php -r '$config = require("dev/tools/phan/config.php"); echo $config["exclude_file_regex"];')
# Filter for files ending with .php and add them to the list
mapfile -t files < <(echo "$response" | jq -r '.[] | select((.filename | test("\\.php$")) and (.filename | test("^dev/") | not)) | .filename' | grep -vP "$phan_exclude_file_regex")
mapfile -t files < <(echo "$response" | jq -r '.[] | select((.filename | test("\\.php$")) and (.filename | test("^dev/") | not)) | .filename')
changed_php_files+=("${files[@]}")
mapfile -t files < <(echo "$response" | jq -r '.[] | select((.filename | test("\\.php$")) and (.filename | test("'"$phan_directory_list"'"))) | .filename' | grep -vP "$phan_exclude_file_regex")
changed_phan_files+=("${files[@]}")
mapfile -t files < <(echo "$response" | jq -r '.[] | select(.filename | test("\\.lang$")) | .filename')
changed_lang_files+=("${files[@]}")
changed_lang_files+=("${files[@]}")
# Check if we have reached the last page (less than per_page results)
count=$(echo "$response" | jq 'length')
@ -69,10 +82,12 @@ done
# Build a space-separated string of changed PHP and lang files
# This does not cope with files that have spaces.
# But such files do not exist in the project (at least not for the
# files we are filtering).
all_changed_files=$(IFS=" " ; echo "${changed_php_files[*]}")
all_changed_lang=$(IFS=" " ; echo "${changed_lang_files[*]}")
phan_changed_files=$(IFS=" " ; echo "${changed_phan_files[*]}")
forbidden_files=""
@ -85,21 +100,31 @@ forbidden_files=""
#fi
# Determine changed files flag
if [ -z "$all_changed_files" ]; then
# Determine changed files flags
if [ -z "${all_changed_files}" ]; then
any_changed="false"
else
any_changed="true"
fi
if [ -z "${phan_changed_files}" ]; then
phan_changed="false"
else
phan_changed="true"
fi
# Set outputs for GitHub Actions if GITHUB_OUTPUT is available
if [ -n "${GITHUB_OUTPUT:-}" ]; then
echo "any_changed=${any_changed}" >> "$GITHUB_OUTPUT"
echo "phan_changed=${phan_changed}" >> "$GITHUB_OUTPUT"
echo "all_changed_files=${all_changed_files}" >> "$GITHUB_OUTPUT"
echo "phan_changed_files=${phan_changed_files[*]}" >> "$GITHUB_OUTPUT"
echo "forbidden_files=${forbidden_files}" >> "$GITHUB_OUTPUT"
else
# Otherwise, print the outputs
echo "any_changed=${any_changed}"
echo "phan_changed=${phan_changed}"
echo "phan_changed_files=${phan_changed_files[*]}"
echo "all_changed_files=${all_changed_files}"
echo "forbidden_files=${forbidden_files}"
fi

View file

@ -61,9 +61,10 @@ jobs:
# - the merge from branch contains 'phan_full', or,
# - there are changes in PHP files.
# Note: --output-mode=github does not provide file:line, so using checkstyle and cs2pr
if: ${{ ! cancelled() && (github.ref_name == 'develop' || github.ref_name == 'refs/heads/develop' || endsWith(github.ref_name, '.0') || contains(github.head_ref, 'phan_full') || steps.changed-php.outputs.any_changed == 'true') }}
if: ${{ ! cancelled() && (github.ref_name == 'develop' || github.ref_name == 'refs/heads/develop' || endsWith(github.ref_name, '.0') || contains(github.head_ref, 'phan_full') || steps.changed-php.outputs.phan_changed == 'true') }}
env:
ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }}
PHAN_CHANGED_FILES: ${{ steps.changed-php.outputs.phan_changed_files }}
# shellcheck disable=2086
FILE_CHANGED_LIST: /tmp/phan-changed.lst
run: |
@ -73,7 +74,7 @@ jobs:
phan $PHAN_QUICK -k "$PHAN_CONFIG" -B "$PHAN_BASELINE" --analyze-twice --minimum-target-php-version "$PHAN_MIN_PHP" --output-mode=checkstyle -o _phan.xml
else
echo -n "" > "$FILE_CHANGED_LIST"
for f in $ALL_CHANGED_FILES; do echo "$f" >> "$FILE_CHANGED_LIST"; done
for f in $PHAN_CHANGED_FILES; do echo "$f" >> "$FILE_CHANGED_LIST"; done
# Must exclude same files as in phan configuration
grep -v -E '^htdocs/(custom/|.*/canvas/.*/tpl/.*.tpl.php|admin/tools/ui/|includes/(nusoap/|restler/|stripe/)|conf/conf.php)$' "$FILE_CHANGED_LIST"> "$FILE_CHANGED_LIST".tmp || true
mv "$FILE_CHANGED_LIST".tmp "$FILE_CHANGED_LIST"

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 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,7 +26,7 @@ use PHP_CodeSniffer\Files\File;
*/
class CheckIsModEnabledArgumentSniff implements Sniff
{
// Nom de la fonction cible
// Target function name
protected $targetFunction = 'ismodenabled';
protected $deprecatedModulesNames = [
@ -87,7 +88,7 @@ class CheckIsModEnabledArgumentSniff implements Sniff
return;
}
// check value of argument
// Check argument value
$argContent = str_replace(["'", '"'], '', $tokens[$firstArgTokenPtr]['content']);
$argCode = $tokens[$firstArgTokenPtr]['code'];

View file

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2025-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 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
@ -14,6 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace codesniffer\Sniffs\Dolibarr;
use PHP_CodeSniffer\Sniffs\Sniff;
@ -108,7 +110,9 @@ class LanguageOfCommentsSniff implements Sniff
return;
}
if (strpos($content, 'Copyright') === false && preg_match('/[àâäéèêëîïôùûüçœÀÂÄÉÈÊËÎÏÔÙÛÜÇŒ]/u', $content)) {
// Avoid matching special characters directly preceded or followed with []'"
// Avoid matching special characters in a "word/identifier" like string with '_'.
if (strpos($content, 'Copyright') === false && preg_match('/(?<!_\w{0,20})(?<![<>\/\'"\[])[àâäéèêëîïôùûüçœÀÂÄÉÈÊËÎÏÔÙÛÜÇŒ]+(?![\'"\[]\/)(?![<>\/\'"\[])(?!\w*_)/u', $content)) {
$error = "The comment appears to be in French (accent detected in: '%s'). Please write in English.";
$data = [trim($content)];
$phpcsFile->addWarning($error, $stackPtr, 'FrenchDetected', $data);

View file

@ -1,4 +1,6 @@
<?php
/* Copyright (C) 2026 MDW <mdeweerd@users.noreply.github.com>
*/
namespace Dolibarr\Rector\Renaming;
@ -230,7 +232,7 @@ class GlobalToFunction extends AbstractRector
// If a && b and a or b is conf->global, we replace a or/and b
if ($node instanceof BooleanAnd) {
// Transformation sur le nœud gauche
// Transformation on the left node
$changedone = 0;
if ($this->isGlobalVar($node->left)) {
$constName = $this->getConstName($node->left);

View file

@ -27,7 +27,7 @@
/**
* \file htdocs/admin/external_rss.php
* \ingroup external_rss
* \brief Page to setupe module ExternalRss
* \brief Page to setup the ExternalRss module
*/
// Load Dolibarr environment
@ -89,7 +89,7 @@ if ($action == 'add' || GETPOST("modify")) {
$db->begin();
if (GETPOST("modify")) {
// Supprime boite box_external_rss de definition des boites
// Remove box_external_rss from the definition of boxes
/* $sql = "UPDATE ".MAIN_DB_PREFIX."boxes_def";
$sql.= " SET name = '".$db->escape($boxlabel)."'";
$sql.= " WHERE file ='box_external_rss.php' AND note LIKE '".$db->escape(GETPOST("norss"))." %'";
@ -102,7 +102,7 @@ if ($action == 'add' || GETPOST("modify")) {
}
*/
} else {
// Ajoute boite box_external_rss dans definition des boites
// Add box_external_rss to the definition of boxes
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)";
$sql .= " VALUES ('box_external_rss.php', '".$db->escape(GETPOSTINT("norss")." (".GETPOST($external_rss_title)).")')";
if (!$db->query($sql)) {
@ -203,7 +203,7 @@ $linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore
print load_fiche_titre($langs->trans("ExternalRSSSetup"), $linkback, 'title_setup');
print '<br>';
// Formulaire ajout
// From to add
print '<form name="externalrssconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -358,7 +358,7 @@ llxFooter();
$db->close();
/**
* Check if the given RSS feed if inside the list of boxes/widgets
* Check if the given RSS feed is inside the list of boxes/widgets
*
* @param int $idrss The id of the RSS feed
* @param ModeleBoxes[] $boxlist A list with boxes/widgets

View file

@ -4,7 +4,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025-2026 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
@ -22,7 +22,7 @@
/**
* \file htdocs/admin/mails.php
* \brief Page to setup emails sending
* \brief Email setup page
*/
// Load Dolibarr environment
@ -798,7 +798,7 @@ if ($action == 'edit') {
print dol_get_fiche_head(array(), '', '', -1);
// Cree l'objet formulaire mail
// Create the mail form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");

View file

@ -4,7 +4,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025-2026 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
@ -849,7 +849,7 @@ if ($action == 'edit') {
print dol_get_fiche_head(array(), '', '', -1);
// Cree l'objet formulaire mail
// Create the email form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : getDolGlobalString('MAIN_MAIL_EMAIL_FROM'));

View file

@ -4,7 +4,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025-2026 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
@ -794,7 +794,7 @@ if ($action == 'edit') {
print dol_get_fiche_head(array(), '', '', -1);
// Cree l'objet formulaire mail
// Create the mail form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : getDolGlobalString('MAIN_MAIL_EMAIL_FROM'));

View file

@ -3,6 +3,7 @@
* Copyright (C) 2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2020-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 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
@ -20,7 +21,7 @@
/**
* \file htdocs/admin/sms.php
* \brief Page to setup emails sending
* \brief Page to set up SMS sending
*/
// Load Dolibarr environment
@ -267,12 +268,12 @@ if ($action == 'edit') {
print '</div>';
// Affichage formulaire de TEST simple
// Display simple test form
if ($action == 'test') {
print '<br>';
print load_fiche_titre($langs->trans("DoTestSend"));
// Cree l'objet formulaire mail
// Create SMS form object
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formsms.class.php';
$formsms = new FormSms($db);
$formsms->fromtype = 'user';

View file

@ -149,7 +149,7 @@ if ($object->id) {
dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'label', $morehtmlref, '&type='.$type, 0, '', '', 1);
/*
* Confirmation deletion of picture
* Confirm photo deletion
*/
if ($action == 'delete') {
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.urlencode($type).'&file='.urlencode(GETPOST("file")), $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
@ -204,15 +204,15 @@ if ($object->id) {
print '</div>'."\n";
/*
* Ajouter une photo
* Add a photo
*/
if ($action == 'ajout_photo' && $user->hasRight('categorie', 'creer') && getDolGlobalString('MAIN_UPLOAD_DOC')) {
// Affiche formulaire upload
// Display upload form
$formfile = new FormFile($db);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;type='.$type, $langs->trans("AddPhoto"), 1, 0, $user->hasRight('categorie', 'creer'), 50, $object, '', 0, '', 0);
}
// Affiche photos
// Display photos
if ($action != 'ajout_photo') {
$nbphoto = 0;
$nbbyrow = 5;
@ -262,7 +262,7 @@ if ($object->id) {
print '<br>'.$viewfilename;
print '<br>';
// On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites
// Suggest generation of the thumbnail if it doesn't exist and if the size exceeds the limits
if (!$obj['photo_vignette'] && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i', $obj['photo']) && ($object->imgWidth > $maxWidth || $object->imgHeight > $maxHeight)) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=addthumb&type='.$type.'&file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'), 'refresh').'&nbsp;&nbsp;</a>';
}

View file

@ -1910,7 +1910,7 @@ class Commande extends CommonOrder
* @param int|'' $date_end End date of the line
* @return void
*
* TODO Remplacer les appels a cette fonction par generation object Ligne
* TODO Replace calls to this function by generation of the `Ligne` (line) object
*/
public function add_product($idproduct, $qty, $remise_percent = 0.0, $date_start = '', $date_end = '')
{

View file

@ -122,7 +122,7 @@ llxHeader();
$titre = ($year ? $langs->trans("PaymentsReportsForYear", $year) : $langs->trans("PaymentsReports"));
print load_fiche_titre($titre, '', 'bill');
// Formulaire de generation
// Generation form
print '<form method="post" action="rapport.php?year='.$year.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="builddoc">';

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -158,7 +158,7 @@ llxHeader();
$form = new Form($db);
// Formulaire de creation d'un paiement de charge
// Payment charge payment form
if ($action == 'create') {
$tva = new Tva($db);

View file

@ -267,8 +267,8 @@ if ($modecompta == 'CREANCES-DETTES') {
}
} elseif ($modecompta == "RECETTES-DEPENSES") {
/*
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
* List of payments (old payments are not seen by this query because, on old
* versions, they were not linked via paiement_facture. We add them later)
*/
$sql = "SELECT date_format(p.datep, '%Y-%m') as dm, sum(pf.amount) as amount_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
@ -733,7 +733,7 @@ print '</div>';
$i++;
}
print "<tr class="oddeven"><td class=\"right\" colspan=\"5\"><i>Invoice a encaisser : </i></td><td class=\"right\"><i>".price($total_ttc_Rac)."</i></td><td colspan=\"5\"><-- bug ici car n'exclut pas le deja réglé des invoices partiellement réglées</td></tr>";
print "<tr class=\"oddeven\"><td class=\"right\" colspan=\"5\"><i>Invoices to collect: </i></td><td class=\"right\"><i>".price($total_ttc_Rac)."</i></td><td colspan=\"5\"><-- bug here because it does not exclude already paid partially settled invoices</td></tr>";
}
$db->free($resql);
}
@ -745,7 +745,7 @@ print '</div>';
/*
*
* Propales signees, et non facturees
* Signed but not invoiced proposals
*
*/
@ -782,7 +782,7 @@ print '</div>';
$i++;
}
print "<tr class="oddeven"><td class=\"right\" colspan=\"5\"><i>Signe et non facture:</i></td><td class=\"right\"><i>".price($total_pr)."</i></td><td colspan=\"5\"><-- bug ici, ca devrait exclure le deja facture</td></tr>";
print "<tr class="oddeven"><td class=\"right\" colspan=\"5\"><i>Signe et non facture:</i></td><td class=\"right\"><i>".price($total_pr)."</i></td><td colspan=\"5\"><-- g here, it should exclude already invoiced amount></tr>";
}
$db->free($resql);
}
@ -790,7 +790,7 @@ print '</div>';
{
dol_print_error($db);
}
print "<tr class="oddeven"><td class=\"right\" colspan=\"5\"><i>Total CA previsionnel : </i></td><td class=\"right\"><i>".price($total_CA)."</i></td><td colspan=\"3\"><-- bug ici car bug sur les 2 precedents</td></tr>";
print "<tr class="oddeven"><td class=\"right\" colspan=\"5\"><i>Total CA previsionnel : </i></td><td class=\"right\"><i>".price($total_CA)."</i></td><td colspan=\"3\"><-- bug here because bug on two previous</td></tr>";
}
print "</table>";

View file

@ -6810,7 +6810,7 @@ abstract class CommonObject
if (empty($extrafields->attributes[$this->table_element]['type'][$name]) || (!in_array($extrafields->attributes[$this->table_element]['type'][$name], ['separate', 'point', 'multipts', 'linestrg','polygon']))) {
$sql .= ", ".$this->db->sanitize($name);
}
// use geo sql fonction to read as text
// use geo sql function to read as text
if (!empty($extrafields->attributes[$this->table_element]['type'][$name]) && in_array($extrafields->attributes[$this->table_element]['type'][$name], array('point', 'multipts', 'linestrg', 'polygon'))) {
// TODO Add an abstraction method in the database driver
$sql .= ", ST_AsWKT(".$name.") as ".$this->db->sanitize($name);

View file

@ -4878,11 +4878,11 @@ class Form
// Example of var_dump $outarray
// array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp"
// ["label"]=>string(76) "ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)"
// ["label"]=>string(76) "ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/unit (20,00 Euros/unit)"
// ["qty"]=>string(1) "1" ["discount"]=>string(1) "0" ["disabled"]=>bool(false)
//}
//var_dump($outval); var_dump(utf8_check($outval)); var_dump(json_encode($outval));
//$outval=array('label'=>'ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/ Unité (20,00 Euros/unité)');
//$outval=array('label'=>'ppp (<strong>f</strong>ff2) - ppp - 20,00 Euros/ Unit (20,00 Euros/unit)');
//var_dump($outval); var_dump(utf8_check($outval)); var_dump(json_encode($outval));
$i++;

View file

@ -185,7 +185,7 @@ class FormBarCode
*
* @param string $page Page
* @param int $selected Id condition preselected
* @param string $htmlname Nom du formulaire select
* @param string $htmlname Name of the select form
* @return void
* @deprecated
*/
@ -200,7 +200,7 @@ class FormBarCode
*
* @param string $page Page
* @param int $selected Id condition preselected
* @param string $htmlname Nom du formulaire select
* @param string $htmlname Name of the select form
* @return string
*/
public function formBarcodeType($page, $selected = 0, $htmlname = 'barcodetype_id')

View file

@ -153,11 +153,11 @@ class FormCompany extends Form
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Affiche formulaire de selection des modes de reglement
* Displays form for selecting settlement methods
*
* @param string $page Page
* @param int $selected Id or code preselected
* @param string $htmlname Nom du formulaire select
* @param string $htmlname Name of the select form
* @param int $empty Add empty value in list
* @return void
*/
@ -414,10 +414,10 @@ class FormCompany extends Form
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Provides the dropdown of the active regions including the actif country.
* Provides the dropdown of the active regions including the active country.
* The key of the list is the code (there may be more than one entry for a
* code but in that case the fields country and language are different).
* un code donnee mais dans ce cas, le champ pays et lang differe).
* a given code but in this case, the country and language field differs).
* This way the links with the regions are made independent of its name.
*
* @param string $selected Preselected value
@ -1186,7 +1186,7 @@ class FormCompany extends Form
* @param Contact|Client|null $prospectstatic Prospect object
* @param int $statusprospect status of prospect
* @param int $idprospect id of prospect
* @param 'html'|'js' $mode select if we want activate de html part or js
* @param 'html'|'js' $mode select whether to activate the HTML part or JS
* @return void
*/
public function selectProspectStatus($htmlname, $prospectstatic, $statusprospect, $idprospect, $mode = "html")

View file

@ -27,10 +27,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
/**
* Class permettant la generation du formulaire d'envoi de Sms
* Class for generating the SMS sending form
* Usage: $formsms = new FormSms($db)
* $formsms->proprietes=1 or string or table of values
* $formsms->show_form() affiche le formulaire
* $formsms->show_form() displays the form
*/
class FormSms
{

View file

@ -3,7 +3,7 @@
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This file is a modified version of datepicker.php from phpBSM to fix some
@ -144,7 +144,7 @@ if ($qualified) {
print '</body></html>'."\n";
/**
* Convert date to timestamp
* Convert date string to a Unix timestamp
*
* @param string $mysqldate Date YYYMMDD
* @return integer Timestamp
@ -160,7 +160,7 @@ function xyzToUnixTimestamp($mysqldate)
}
/**
* Show box
* Displays the date picker box
*
* @param string $selectedDate Date YYYYMMDD
* @param int $month Month
@ -274,7 +274,7 @@ function displayBox($selectedDate, $month, $year)
exit;
}
// Sur click dans calendrier, appelle fonction dpClickDay
// Upon a click in the calendar, call dpClickDay function
echo "<td class=\"".$dayclass."\"";
echo " onMouseOver=\"dpHighlightDay(".$mydate["year"].",parseInt('".dol_print_date($thedate, "%m")."',10),".$mydate["mday"].",tradMonths)\"";
echo " onClick=\"dpClickDay(".$mydate["year"].",parseInt('".dol_print_date($thedate, "%m")."',10),".$mydate["mday"].",'".$langs->trans("FormatDateShortJavaInput")."')\"";

View file

@ -227,7 +227,7 @@ class DoliDBMysqli extends DoliDB
* Select a database
*
* @param string $database Name of database
* @return boolean true if OK, false if KO
* @return boolean true if OK, false if failed
*/
public function select_db($database)
{
@ -365,7 +365,7 @@ class DoliDBMysqli extends DoliDB
}
if (!preg_match("/^COMMIT/i", $query) && !preg_match("/^ROLLBACK/i", $query)) {
// Si requete utilisateur, on la sauvegarde ainsi que son resultset
// If user query, we save it along with its resultset
if (!$ret) {
$this->lastqueryerror = $query;
$this->lasterror = $this->error();
@ -412,7 +412,7 @@ class DoliDBMysqli extends DoliDB
/**
* Returns the current line (as an object) for the resultset cursor
*
* @param mysqli_result $resultset Curseur de la requete voulue
* @param mysqli_result $resultset Cursor of the desired query
* @return object|null Object result line or null if KO or end of cursor
*/
public function fetch_object($resultset)
@ -469,8 +469,8 @@ class DoliDBMysqli extends DoliDB
/**
* Return number of lines for result of a SELECT
*
* @param mysqli_result $resultset Resulset of requests
* @return int Nb of lines
* @param mysqli_result $resultset Resultset of requests
* @return int Number of lines
* @see affected_rows()
*/
public function num_rows($resultset)
@ -487,7 +487,7 @@ class DoliDBMysqli extends DoliDB
/**
* Return the number of lines in the result of a request INSERT, DELETE or UPDATE
*
* @param mysqli_result $resultset Curseur de la requete voulue
* @param mysqli_result $resultset Cursor of the desired query
* @return int Number of lines
* @see num_rows()
*/
@ -498,8 +498,7 @@ class DoliDBMysqli extends DoliDB
if (!is_object($resultset)) {
$resultset = $this->_results;
}
// mysql necessite un link de base pour cette fonction contrairement
// a pqsql qui prend un resultset
// mysql require a db link, not like pqsql that takes a resultset
return $this->db->affected_rows;
}
@ -515,7 +514,7 @@ class DoliDBMysqli extends DoliDB
if (!is_object($resultset)) {
$resultset = $this->_results;
}
// Si resultset en est un, on libere la memoire
// Si resultset is provided, free memory
if (is_object($resultset)) {
$resultset->free_result();
}
@ -604,7 +603,7 @@ class DoliDBMysqli extends DoliDB
public function error()
{
if (!$this->connected) {
// Si il y a eu echec de connection, $this->db n'est pas valide pour mysqli_error.
// When there is a connection failure, $this->db is invalid for to get mysqli_error.
return 'Not connected. Check setup parameters in conf/conf.php file and your mysql client and server versions';
} else {
return $this->db->error;
@ -837,12 +836,12 @@ class DoliDBMysqli extends DoliDB
* Create a table into database
*
* @param string $table Name of table
* @param array<string,array{type:string,label?:string,enabled?:int<0,2>|string,position?:int,notnull?:int,visible?:int<-2,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array<int,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>}> $fields Tableau associatif [nom champ][tableau des descriptions]
* @param string $primary_key Nom du champ qui sera la clef primaire
* @param string $type Type de la table
* @param ?array<string,mixed> $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param string[] $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param array<string,mixed> $keys Tableau des champs cles noms => valeur
* @param array<string,array{type:string,label?:string,enabled?:int<0,2>|string,position?:int,notnull?:int,visible?:int<-2,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array<int,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>}> $fields Associative table [field name][table of descriptions]
* @param string $primary_key Name of the field that will be the primary key
* @param string $type Table type
* @param ?array<string,mixed> $unique_keys Associative table: key=field, value=field value
* @param string[] $fulltext_keys Table of fields that will be indexed as fulltext
* @param array<string,mixed> $keys Table of fields names => value
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null)
@ -955,7 +954,7 @@ class DoliDBMysqli extends DoliDB
* Return a pointer of line with description of a table or field
*
* @param string $table Name of table
* @param string $field Optionnel : Name of field if we want description of field
* @param string $field Optional: Name of field if we want description of field
* @return bool|mysqli_result Resultset x (x->Field, x->Type, ...)
*/
public function DDLDescTable($table, $field = "")
@ -1106,7 +1105,7 @@ class DoliDBMysqli extends DoliDB
* Create a user and privileges to connect to database (even if database does not exists yet)
*
* @param string $dolibarr_main_db_host Ip server or '%'
* @param string $dolibarr_main_db_user Nom new user
* @param string $dolibarr_main_db_user Name of new user
* @param string $dolibarr_main_db_pass Password for the new user
* @param string $dolibarr_main_db_name Database name where user must be granted
* @return int Return integer <0 if KO, >=0 if OK

View file

@ -27,7 +27,7 @@
/**
* \file htdocs/core/db/pgsql.class.php
* \brief Fichier de la class permettant de gerer une base pgsql
* \brief Class file for managing a pgsql database
*/
require_once DOL_DOCUMENT_ROOT.'/core/db/DoliDB.class.php';
@ -46,7 +46,7 @@ class DoliDBPgsql extends DoliDB
//! Charset
public $forcecharset = 'UTF8'; // Can't be static as it may be forced with a dynamic value
//! Collate used to force collate when creating database
//! Collation used to force collate when creating database
public $forcecollate = ''; // Can't be static as it may be forced with a dynamic value
//! Version min database
@ -71,13 +71,13 @@ class DoliDBPgsql extends DoliDB
/**
* Constructor.
* This create an opened connection to a database server and eventually to a database
* This creates an opened connection to a database server and eventually to a database
*
* @param string $type Type of database (mysql, pgsql...). Not used.
* @param string $host Address of database server
* @param string $user Nom de l'utilisateur autorise
* @param string $user Authorized user name
* @param string $pass Password
* @param string $name Nom de la database
* @param string $name Database name
* @param int $port Port of database server
*/
public function __construct($type, $host, $user, $pass, $name = '', $port = 0) // @phpstan-ignore constructor.unusedParameter
@ -112,11 +112,11 @@ class DoliDBPgsql extends DoliDB
$this->connected = false;
$this->ok = false;
$this->error = $langs->trans("ErrorWrongHostParameter");
dol_syslog(get_class($this)."::DoliDBPgsql : Erreur Connect, wrong host parameters", LOG_ERR);
dol_syslog(get_class($this)."::DoliDBPgsql : Connection Error, wrong host parameters", LOG_ERR);
return;
}
// Essai connection serveur
// Try server connection
//print "$host, $user, $pass, $name, $port";
$this->db = $this->connect($host, $user, $pass, $name, $port);
@ -128,10 +128,10 @@ class DoliDBPgsql extends DoliDB
$this->connected = false;
$this->ok = false;
$this->error = 'Host, login or password incorrect';
dol_syslog(get_class($this)."::DoliDBPgsql : Erreur Connect ".$this->error.'. Failed to connect to host='.$host.' port='.$port.' user='.$user, LOG_ERR);
dol_syslog(get_class($this)."::DoliDBPgsql : Connection Error ".$this->error.'. Failed to connect to host='.$host.' port='.$port.' user='.$user, LOG_ERR);
}
// If server connection serveur ok and DB connection is requested, try to connect to DB
// If server connection ok and DB connection is requested, try to connect to DB
if ($this->connected && $name) {
if ($this->select_db($name)) {
$this->database_selected = true;
@ -142,10 +142,10 @@ class DoliDBPgsql extends DoliDB
$this->database_name = '';
$this->ok = false;
$this->error = $this->error();
dol_syslog(get_class($this)."::DoliDBPgsql : Erreur Select_db ".$this->error, LOG_ERR);
dol_syslog(get_class($this)."::DoliDBPgsql : Select_db Error ".$this->error, LOG_ERR);
}
} else {
// Pas de selection de base demandee, ok ou ko
// No database selection requested, ok or ko
$this->database_selected = false;
}
}
@ -592,7 +592,7 @@ class DoliDBPgsql extends DoliDB
/**
* Returns the current line (as an object) for the resultset cursor
*
* @param resource $resultset Curseur de la requete voulue
* @param resource $resultset Cursor of the db request
* @return false|object Object result line or false if KO or end of cursor
*/
public function fetch_object($resultset)
@ -607,7 +607,7 @@ class DoliDBPgsql extends DoliDB
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return datas as an array
* Return data as an array
*
* @param resource $resultset Resultset of request
* @return array<int|string,mixed>|null|false Array or null if KO or end of cursor
@ -633,7 +633,7 @@ class DoliDBPgsql extends DoliDB
public function fetch_row($resultset)
{
// phpcs:enable
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connection
// If resultset not provided, we take the last used by connection
if (!is_resource($resultset) && !is_object($resultset)) {
$resultset = $this->_results;
}
@ -668,10 +668,10 @@ class DoliDBPgsql extends DoliDB
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return the number of lines in the result of a request INSERT, DELETE or UPDATE
* Return the number of rows in the result of a request INSERT, DELETE or UPDATE
*
* @param resource $resultset Result set of request
* @return int Nb of lines
* @return int Number of lines
* @see num_rows()
*/
public function affected_rows($resultset)
@ -681,8 +681,8 @@ class DoliDBPgsql extends DoliDB
if (!is_resource($resultset) && !is_object($resultset)) {
$resultset = $this->_results;
}
// pgsql necessite un resultset pour cette fonction contrairement
// a mysql qui prend un link de base
// pgsql requires a resultset for this function contrary to
// mysql that requires a database link
return pg_affected_rows($resultset);
}
@ -699,7 +699,7 @@ class DoliDBPgsql extends DoliDB
if (!is_resource($resultset) && !is_object($resultset)) {
$resultset = $this->_results;
}
// Si resultset en est un, on libere la memoire
// If it is a resource, we free the memory
if (is_resource($resultset) || is_object($resultset)) {
pg_free_result($resultset);
}
@ -1071,13 +1071,13 @@ class DoliDBPgsql extends DoliDB
/**
* Create a table into database
*
* @param string $table Nom de la table
* @param array<string,array{type:string,label?:string,enabled?:int<0,2>|string,position?:int,notnull?:int,visible?:int<-2,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array<int,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>}> $fields Tableau associatif [nom champ][tableau des descriptions]
* @param string $primary_key Nom du champ qui sera la clef primaire
* @param string $table Table name
* @param array<string,array{type:string,label?:string,enabled?:int<0,2>|string,position?:int,notnull?:int,visible?:int<-2,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,2>,disabled?:int<0,1>,arrayofkeyval?:array<int,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>}> $fields Associative table [field name][table of descrioptions]
* @param string $primary_key Name of the field that will be the primary key
* @param string $type Type de la table
* @param ?array<string,mixed> $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param string[] $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param array<string,mixed> $keys Tableau des champs cles noms => valeur
* @param ?array<string,mixed> $unique_keys Associative table - name of fields that will be unique key => value
* @param string[] $fulltext_keys Tableau des Name of fields that will be indexed in fulltext
* @param array<string,mixed> $keys Table of key fields - names => value
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null)
@ -1445,7 +1445,7 @@ class DoliDBPgsql extends DoliDB
if (file_exists('/usr/bin/pg_dump')) {
$fullpathofdump = '/usr/bin/pg_dump';
} else {
// TODO L'utilisateur de la base doit etre un superadmin pour lancer cette commande
// TODO The database user must be a superadmin to run this command
$resql = $this->query('SHOW data_directory');
if ($resql) {
$liste = $this->fetch_array($resql);
@ -1458,9 +1458,9 @@ class DoliDBPgsql extends DoliDB
}
/**
* Return full path of restore program
* Return full path of restore program
*
* @return string Full path of restore program
* @return string Full path of restore program
*/
public function getPathOfRestore()
{

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -123,7 +123,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Tâche 1 heure
SUMMARY:Task 1 hour
TRANSP:OPAQUE
END:VEVENT
@ -139,7 +139,7 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile)
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Tâche 1 jour
SUMMARY:Task 1 day
TRANSP:TRANSPARENT
END:VEVENT
*/

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2021 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -28,7 +28,7 @@
/**
* Check validity of user/password/entity
* If test is ko, reason must be filled into $_SESSION["dol_loginmesg"]
* If the test fails, the reason must be filled into $_SESSION["dol_loginmesg"]
*
* @param string $usertotest Login
* @param string $passwordtotest Password
@ -68,7 +68,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
if ($usertotest) {
dol_syslog("functions_ldap::check_user_password_ldap usertotest=".$usertotest." passwordtotest=".preg_replace('/./', '*', $passwordtotest)." entitytotest=".$entitytotest);
// If test username/password asked, we define $test=false and $login var if ok, set $_SESSION["dol_loginmesg"] if ko
// If testing user/password is requested, we define $test=false and $login var if successful, and set $_SESSION["dol_loginmesg"] if failed.
$ldaphost = $dolibarr_main_auth_ldap_host;
$ldapport = $dolibarr_main_auth_ldap_port;
$ldapversion = $dolibarr_main_auth_ldap_version;
@ -141,7 +141,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
// If LDAP need a dn with login like "uid=jbloggs,ou=People,dc=foo,dc=com", default dn may work even if previous code with
// admin login no executed.
$ldap->searchUser = $ldapuserattr."=".$usertotest.",".$ldapdn; // Default dn (will work if LDAP accept a dn with login value inside)
// But if LDAP need a dn with name like "cn=Jhon Bloggs,ou=People,dc=foo,dc=com", previous part must have been executed to have
// However, if LDAP requires a DN with a name like "cn=Jhon Bloggs,ou=People,dc=foo,dc=com", the previous part must have been executed to have
// dn detected into ldapUserDN.
if ($resultFetchLdapUser && !empty($ldap->ldapUserDN)) {
$ldap->searchUser = $ldap->ldapUserDN;
@ -166,11 +166,11 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
// Note: Test on date validity is done later natively with isNotIntoValidityDateRange() by core after calling checkLoginPassEntity() that call this method
// ldap2dolibarr synchronisation
// ldap2dolibarr synchronization
if ($login && isModEnabled('ldap') && getDolGlobalInt('LDAP_SYNCHRO_ACTIVE') == Ldap::SYNCHRO_LDAP_TO_DOLIBARR) { // ldap2dolibarr synchronization
dol_syslog("functions_ldap::check_user_password_ldap Sync ldap2dolibarr");
// On charge les attributes du user ldap
// We fetch the LDAP user attributes
if ($ldapdebug) {
print "DEBUG: login ldap = ".$login."<br>\n";
}
@ -186,7 +186,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
print "DEBUG: badPasswordTime = ".dol_print_date($ldap->badpwdtime, 'day')."<br>\n";
}
// On recherche le user dolibarr en fonction de son SID ldap (only for Active Directory)
// We search for the Dolibarr user based on its LDAP SID (only for Active Directory)
$sid = null;
if (getDolGlobalString('LDAP_SERVER_TYPE') == "activedirectory") {
$sid = $ldap->getObjectSid($login);

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -125,9 +125,9 @@ class mailing_contacts1 extends MailingTargets
/**
* Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
* Show filter form that appears in a page to select the recipients of mailings
*
* @return string Retourne zone select
* @return string HTML for selection filter.
*/
public function formFilter()
{

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -22,7 +22,7 @@
/**
* \file htdocs/core/modules/mailings/fraise.modules.php
* \ingroup mailing
* \brief File of class to generate target according to rule Fraise
* \brief Class file to generate targets according to the Fraise rule
*/
include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
@ -30,7 +30,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
/**
* Class to generate target according to rule Fraise
* Class to generate targets according to the Fraise rule
*/
class mailing_fraise extends MailingTargets
{
@ -71,9 +71,9 @@ class mailing_fraise extends MailingTargets
/**
* On the main mailing area, there is a box with statistics.
* If you want to add a line in this report you must provide an
* array of SQL request that returns two field:
* In the main mailing area, there is a box with statistics.
* If you want to add a line in this report, you must provide an
* array of SQL requests that return two fields:
* One called "label", One called "nb".
*
* @return string[] Array with SQL requests
@ -95,12 +95,12 @@ class mailing_fraise extends MailingTargets
/**
* Return here number of distinct emails returned by your selector.
* Returns the number of distinct emails returned by your selector.
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param string $sql Requete sql de comptage
* @return int|string Nb of recipient, or <0 if error, or '' if NA
* @param string $sql SQL query for counting
* @return int|string Number of recipients, or <0 if error, or '' if N/A
*/
public function getNbOfRecipients($sql = '')
{
@ -118,9 +118,9 @@ class mailing_fraise extends MailingTargets
/**
* Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
* Displays the filter form that appears on the mailing recipient selection page
*
* @return string Retourne zone select
* @return string Returns the select area
*/
public function formFilter()
{
@ -222,7 +222,7 @@ class mailing_fraise extends MailingTargets
/**
* Provide the URL to the car of the source information of the recipient for the mailing
* Provides the URL to the card of the source information of the recipient for the mailing
*
* @param int $id ID
* @return string URL link
@ -235,10 +235,10 @@ class mailing_fraise extends MailingTargets
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Ajoute destinataires dans table des cibles
* Adds recipients to the targets table
*
* @param int $mailing_id Id of emailing
* @return int Return integer < 0 si erreur, nb ajout si ok
* @return int Returns integer < 0 if error, number added if successful
*/
public function add_to_target($mailing_id)
{

View file

@ -149,10 +149,9 @@ class MailingTargets // This can't be abstract as it is used for some method
}
/**
* Affiche formulaire de filtre qui apparait dans page de selection
* des destinataires de mailings
* Displays filter form that appears on the mailing recipient selection page
*
* @return string Retourne zone select
* @return string Returns select area
*/
public function formFilter()
{
@ -244,20 +243,20 @@ class MailingTargets // This can't be abstract as it is used for some method
dol_syslog(__METHOD__.": mailing ".$j." targets added");
/*
//Update the status to show thirdparty mail that don't want to be contacted anymore'
//Update the status to show third-party emails that no longer wish to be contacted'
$sql = "UPDATE ".$this->db->prefix()."mailing_cibles";
$sql .= " SET statut=3";
$sql .= " WHERE fk_mailing = ".((int) $mailing_id)." AND email in (SELECT email FROM ".$this->db->prefix()."societe where fk_stcomm=-1)";
$sql .= " AND source_type='thirdparty'";
dol_syslog(__METHOD__.": mailing update status to display thirdparty mail that do not want to be contacted");
dol_syslog(__METHOD__.": mailing update status to display third-party emails that no longer wish to be contacted");
$result=$this->db->query($sql);
//Update the status to show contact mail that don't want to be contacted anymore'
//Update the status to show contact emails that no longer wish to be contacted'
$sql = "UPDATE ".$this->db->prefix()."mailing_cibles";
$sql .= " SET statut=3";
$sql .= " WHERE fk_mailing = ".((int) $mailing_id)." AND source_type='contact' AND (email in (SELECT sc.email FROM ".$this->db->prefix()."socpeople AS sc ";
$sql .= " INNER JOIN ".$this->db->prefix()."societe s ON s.rowid=sc.fk_soc WHERE s.fk_stcomm=-1 OR no_email=1))";
dol_syslog(__METHOD__.": mailing update status to display contact mail that do not want to be contacted",LOG_DEBUG);
dol_syslog(__METHOD__.": mailing update status to display contact emails that no longer wish to be contacted",LOG_DEBUG);
$result=$this->db->query($sql);
*/
@ -284,7 +283,7 @@ class MailingTargets // This can't be abstract as it is used for some method
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Supprime tous les destinataires de la table des cibles
* Deletes all recipients from the targets table
*
* @param int $mailing_id Id of emailing
* @return void

View file

@ -5,7 +5,7 @@
* Copyright (C) 2012 Charles-Fr BENKE <charles.fr@benke.fr>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 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
@ -24,7 +24,7 @@
/**
* \file htdocs/exports/export.php
* \ingroup export
* \brief Pages of export Wizard
* \brief Export Wizard pages
*/
require_once '../main.inc.php';
@ -185,7 +185,7 @@ $result = restrictedArea($user, 'export');
* Actions
*/
if ($action == 'selectfield' && $user->hasRight('export', 'creer')) { // Selection of field at step 2
if ($action == 'selectfield' && $user->hasRight('export', 'creer')) { // Select field at step 2
$fieldsarray = $objexport->array_export_fields[0];
$fieldsentitiesarray = $objexport->array_export_entities[0];
$fieldsdependenciesarray = $objexport->array_export_dependencies[0];
@ -209,7 +209,7 @@ if ($action == 'selectfield' && $user->hasRight('export', 'creer')) { // Sel
var_dump($fieldsdependenciesarray);*/
$listofdependencies = array();
if (!empty($fieldsentitiesarray[$field]) && !empty($fieldsdependenciesarray[$fieldsentitiesarray[$field]])) {
// We found a dependency on the type of field
// Found a dependency on the field type
$tmp = $fieldsdependenciesarray[$fieldsentitiesarray[$field]]; // $fieldsdependenciesarray=array('element'=>'fd.rowid') or array('element'=>array('fd.rowid','ab.rowid'))
if (is_array($tmp)) {
$listofdependencies = $tmp;
@ -217,7 +217,7 @@ if ($action == 'selectfield' && $user->hasRight('export', 'creer')) { // Sel
$listofdependencies = array($tmp);
}
} elseif (!empty($field) && !empty($fieldsdependenciesarray[$field])) {
// We found a dependency on a dedicated field
// Found a dependency on a specific field
$tmp = $fieldsdependenciesarray[$field]; // $fieldsdependenciesarray=array('fd.fieldx'=>'fd.rowid') or array('fd.fieldx'=>array('fd.rowid','ab.rowid'))
if (is_array($tmp)) {
$listofdependencies = $tmp;
@ -434,7 +434,7 @@ if ($step == 4 && $action == 'submitFormField' && $user->hasRight('export', 'lir
accessforbidden();
}
// on boucle sur les champs selectionne pour recuperer la valeur
// loop over selected fields to retrieve the value
if (is_array($objexport->array_export_TypeFields[0])) {
$_SESSION["export_filtered_fields"] = array();
foreach ($objexport->array_export_TypeFields[0] as $code => $type) { // $code: s.fieldname $value: Text|Boolean|List:ccc
@ -566,7 +566,7 @@ if ($step == 2 && $datatoexport) {
print $objexport->array_export_module[0]->getName();
print '</td></tr>';
// Lot de donnees a exporter
// Dataset to export
print '<tr><td>'.$langs->trans("DatasetToExport").'</td>';
print '<td>';
$entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
@ -829,7 +829,7 @@ if ($step == 3 && $datatoexport) {
print '<span class="opacitymedium">'.$langs->trans("SelectFilterFields").'...</span><br><br>';
// un formulaire en plus pour recuperer les filtres
// An extra form to get the filters
print '<form action="'.$_SERVER["PHP_SELF"].'?step=4&action=submitFormField&datatoexport='.$datatoexport.'" name="FilterField" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -989,7 +989,7 @@ if ($step == 4 && $datatoexport) {
print dolPrintHTML($titleofmodule);
print '</td></tr>';
// Lot de donnees a exporter
// Dataset to export
print '<tr><td>'.$langs->trans("DatasetToExport").'</td>';
print '<td>';
$entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
@ -1264,7 +1264,7 @@ if ($step == 5 && $datatoexport) {
$head[$h][1] = $langs->trans("Step")." 2";
$h++;
// si le filtrage est parameter pour l'export ou pas
// whether filtering is a parameter for the export or not
if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
$head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=3&datatoexport='.$datatoexport;
$head[$h][1] = $langs->trans("Step")." 3";

View file

@ -129,7 +129,7 @@ llxHeader('', $titre, '', '', 0, 0, '', '', '', 'mod-fourn-facture page-rapport'
print load_fiche_titre($titre, '', 'supplier_invoice');
// Formulaire de generation
// Generation form
print '<form method="post" action="rapport.php?year='.$year.'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="builddoc">';

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025-2026 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
@ -180,7 +180,7 @@ print '<br>';
if (!function_exists('ftp_connect')) {
print $langs->trans("FTPFeatureNotSupportedByYourPHP");
} else {
// Formulaire ajout
// Add form
print '<form name="ftpconfig" action="ftpclient.php" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';

View file

@ -1421,7 +1421,7 @@ if ($ok && GETPOST('clean_perm_table', 'alpha')) {
$obj = $db->fetch_object($resql);
if ($obj->id > 0) {
print '<tr><td>Found line with id '.$obj->id.', label "'.$obj->label.'" of module "'.$obj->module.'" to delete';
if (GETPOST('clean_perm_table', 'alpha') == 'confirmed') {
if (GETPOST('clean_perm_table', 'alpha') == 'confirmed') { // If confirmed, proceed with deletion
$sqldelete = "DELETE FROM ".MAIN_DB_PREFIX."rights_def WHERE id = ".((int) $obj->id);
$resqldelete = $db->query($sqldelete);
if (!$resqldelete) {
@ -1464,7 +1464,7 @@ if ($ok && GETPOST('clean_ecm_files_table', 'alpha')) {
$obj = $db->fetch_object($resql);
if ($obj->rowid > 0) {
$filetocheck = DOL_DATA_ROOT.'/'.$obj->filepath.'/'.$obj->filename;
$nbfile++;
$nbfile++; // Count of files analyzed
if (!dol_is_file($filetocheck) && !dol_is_file($filetocheck.'.noexe')) {
$nbfiletodelete++;
if ($nbfiletodelete <= $MAXTODELETE) {
@ -2057,7 +2057,7 @@ if ($ok && GETPOST('recalculateinvoicetotal') == 'confirmed') {
fd.fk_facture = $obj->rowid";
$ressql_calculs = $db->query($sql_calculs);
while ($obj_calcul = $db->fetch_object($ressql_calculs)) {
// Calcul de la somme des paiements reçus
// Calculate the sum of received payments
$sql_paiements = "SELECT SUM(amount) as somme from ".MAIN_DB_PREFIX."paiement_facture WHERE fk_facture = $obj->rowid";
$montantPaiements = $db->fetch_object($db->query($sql_paiements))->somme;
$totHt = ($obj_calcul->total_ht ? price2num($obj_calcul->total_ht, 'MT') : 0);

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) ---Put here your own copyright and developer email---
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 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
@ -28,7 +29,7 @@
* Terms
*
* DEB = Declaration d'Exchanges de Biens (FR) = Declaration of Exchange of Goods (EN)
* DES = Déclaration Européenne de Services (FR) = European Declaration of Services (EN)
* DES = Declaration Europeenne de Services (FR) = European Declaration of Services (EN)
*
* INTRACOMM: Douanes françaises (FR) = french customs (EN) - https://www.douane.gouv.fr/professionnels/commerce-international/import-export
*

View file

@ -360,7 +360,7 @@ class IntracommReport extends CommonObject
$declaration_des = $e->addChild('declaration_des');
$declaration_des->addChild('num_des', self::getDeclarationNumber($this->numero_declaration));
$declaration_des->addChild('num_tvaFr', $mysoc->tva_intra ?? ''); // /^FR[a-Z0-9]{2}[0-9]{9}$/ // Doit faire 13 caractères
$declaration_des->addChild('num_tvaFr', $mysoc->tva_intra ?? ''); // /^FR[a-Z0-9]{2}[0-9]{9}$/ // Must be 13 characters
$declaration_des->addChild('mois_des', (string) $period_month);
$declaration_des->addChild('an_des', (string) $period_year);

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -161,8 +161,8 @@ function issetAndNoEmpty($name, $tableau = null)
/**
* Function for generating URLs for surveys.
*
* @param string $id L'identifiant du sondage
* @param bool $admin True pour générer une URL pour l'administration d'un sondage, False pour un URL publique
* @param string $id Survey ID
* @param bool $admin True to generate a URL for survey administration, False for a public URL
* @return string The url of the survey
*/
function getUrlSondage($id, $admin = false)

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Cedric Ancelin <icedo.anc@gmail.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 William Mead <william@m34d.com>
* Copyright (C) 2025 Charlene Benke <charlene@patas-monkey.com>
*
@ -91,7 +91,7 @@ class Products extends DolibarrApi
*/
public function get($id, $includestockdata = 0, $includesubproducts = false, $includeparentid = false, $includetrans = false)
{
if ($id < 1 ) {
if ($id < 1) {
throw new RestException(400, 'No Product with id<1 can exist');
}
return $this->_fetch($id, '', '', '', $includestockdata, $includesubproducts, $includeparentid, false, $includetrans);
@ -399,7 +399,7 @@ class Products extends DolibarrApi
*/
public function put($id, $request_data = null)
{
if ($id < 1 ) {
if ($id < 1) {
throw new RestException(400, 'No Product with id<1 can exist');
}
@ -570,7 +570,7 @@ class Products extends DolibarrApi
*/
public function delete($id)
{
if ($id < 1 ) {
if ($id < 1) {
throw new RestException(400, 'No Product with id<1 can exist');
}
if (!DolibarrApiAccess::$user->hasRight('produit', 'supprimer')) {
@ -2260,7 +2260,7 @@ class Products extends DolibarrApi
throw new RestException(403, 'Access not allowed for login ' . DolibarrApiAccess::$user->login);
}
// Récupérer les contacts externes et internes
// Retrieve external and internal contacts
$contacts = $this->product->liste_contact(-1, 'external', 0, $type);
$socpeoples = $this->product->liste_contact(-1, 'internal', 0, $type);

View file

@ -3302,7 +3302,7 @@ class Product extends CommonObject
/*
$this->prices_by_qty[$i]=$result["price_by_qty"];
$this->prices_by_qty_id[$i]=$result["rowid"];
// Récuperation de la liste des prix selon qty si flag positionné
// Get the pricelist according to the qty if flag is set
if ($this->prices_by_qty[$i] == 1)
{
$sql = "SELECT rowid, price, unitprice, quantity, remise_percent, remise, price_base_type";
@ -3357,7 +3357,7 @@ class Product extends CommonObject
// Price by quantity
$this->prices_by_qty[0] = $result["price_by_qty"];
$this->prices_by_qty_id[0] = $result["rowid"];
// Récuperation de la liste des prix selon qty si flag positionné
// Get the pricelist according to the qty if flag is set
if ($this->prices_by_qty[0] == 1) {
$sql = "SELECT rowid,price, unitprice, quantity, remise_percent, remise, remise, price_base_type";
$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
@ -3419,7 +3419,7 @@ class Product extends CommonObject
// Price by quantity
$this->prices_by_qty[$i] = (!empty($result["price_by_qty"]) ? $result["price_by_qty"] : 0);
$this->prices_by_qty_id[$i] = (!empty($result["rowid"]) ? $result["rowid"] : 0);
// Récuperation de la liste des prix selon qty si flag positionné
// Get the pricelist according to the qty if flag is set
if ($this->prices_by_qty[$i] == 1) {
$sql = "SELECT rowid, price, unitprice, quantity, remise_percent, remise, price_base_type";
$sql .= " FROM ".$this->db->prefix()."product_price_by_qty";
@ -4034,7 +4034,7 @@ class Product extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Charge tableau des stats réception fournisseur pour le produit/service
* Loads supplier reception statistics table for given product or service
*
* @param int $socid Id thirdparty to filter on a thirdparty
* @param string $filtrestatut Id status to filter on a status
@ -4486,7 +4486,7 @@ class Product extends CommonObject
/**
* Load array of statistics for recurring supplier invoice for product/service
*
* @param int $socid Id societe
* @param int $socid Supplier ID
* @return int Array of stats in $this->stats_facturefournrec, <0 if ko or >0 if ok
*/
public function load_stats_facturefournrec($socid = 0)

View file

@ -13,7 +13,7 @@
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 Mélina Joum <melina.joum@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -622,7 +622,7 @@ if (empty($reshook)) {
// Add or update price by quantity
if ($action == 'update_price_by_qty' && $permissiontoadd) {
// Récupération des variables
// Get the variables
$rowid = GETPOSTINT('rowid');
$priceid = GETPOSTINT('priceid');
$newprice = price2num(GETPOST("price"), 'MU', 2);
@ -648,7 +648,7 @@ if (empty($reshook)) {
$price = price2num($newprice, 'MU');
$unitPrice = price2num((float) $price / (float) $quantity, 'MU');
// Ajout / mise à jour
// Update or add
if ($rowid > 0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."product_price_by_qty SET";
$sql .= " price=".((float) $price).",";

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 William Mead <william@m34d.com>
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
*
@ -129,7 +129,7 @@ class Productlots extends DolibarrApi
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot_extrafields AS ple ON ple.fk_object = pl.rowid";
$sql .= " WHERE 1=1";
// Filtres universels
// Global filters
if ($sqlfilters) {
$errormessage = '';
$sql .= forgeSQLFromUniversalSearchCriteria($sqlfilters, $errormessage);
@ -138,7 +138,7 @@ class Productlots extends DolibarrApi
}
}
// Clone pour total (avant ORDER/LIMIT)
// Clone for total (before ORDER/LIMIT)
$sqlTotals = preg_replace('/^\s*SELECT\s+pl\.rowid/i', 'SELECT COUNT(pl.rowid) AS total', $sql);
// ORDER BY
@ -180,7 +180,7 @@ class Productlots extends DolibarrApi
if ($row && isset($row->total)) $total = (int) $row->total;
}
// Evite division par zéro
// Avoid division by zero
$safeLimit = ($limit > 0) ? (int) $limit : max(1, count($obj_ret));
$pageCount = (int) ceil($total / $safeLimit);

View file

@ -4,7 +4,7 @@
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025-2026 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
@ -252,7 +252,7 @@ if (empty($reshook)) {
if ($action == 'setqc_frequency' && $permissiontoadd && ! GETPOST('cancel', 'alpha')) {
$result = $object->setValueFrom('qc_frequency', GETPOST('qc_frequency'), '', null, 'int', '', $user, 'PRODUCT_MODIFY');
if ($result < 0) { // Prévoir un test de format de durée
if ($result < 0) { // To provide a duration format test
setEventMessages($object->error, null, 'errors');
$action = 'editqc_frequency';
} else {

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025-2026 Pierre Ardoin <developpeur@lesmetiersdubatiment.fr>
*
@ -148,7 +148,7 @@ if (empty($reshook)) {
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
// On remet cette lecture de permission ici car nécessaire d'avoir le nouveau statut de l'objet après toute action exécutée dessus (après incrémentation par example, le bouton supprimer doit disparaître)
// We put this permission read here because it is necessary to have the new status of the object after any executed action on it (for example, the delete button must disappear after incrementation)
$permissiontodelete = $user->rights->stocktransfer->stocktransfer->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
// Actions when linking object each other
@ -313,7 +313,7 @@ if (empty($reshook)) {
}
}
// Annulation décrémentation
// Cancel Decrementation
if ($action == 'confirm_destockcancel' && $confirm == 'yes' && $object->status == $object::STATUS_TRANSFERED && $permissiontoadd) {
$lines = $object->getLinesArray();
if (!empty($lines)) {
@ -340,7 +340,7 @@ if (empty($reshook)) {
}
}
// Incrémentation
// Incrementing
if ($action == 'confirm_addstock' && $confirm == 'yes' && $object->status == $object::STATUS_TRANSFERED && $permissiontoadd) {
$lines = $object->getLinesArray();
if (!empty($lines)) {
@ -372,7 +372,7 @@ if (empty($reshook)) {
}
}
// Annulation incrémentation
// Cancel Incrementing
if ($action == 'confirm_addstockcancel' && $confirm == 'yes' && $object->status == $object::STATUS_CLOSED && $permissiontoadd) {
$lines = $object->getLinesArray();
if (!empty($lines)) {
@ -427,7 +427,7 @@ $help_url = '';
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-stock-stocktransfer_stocktransfer_card');
// Example : Adding jquery code
// Example: Adding jQuery code
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {';
@ -942,9 +942,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</td>';
}
$formproduct->loadWarehouses(); // Pour charger la totalité des entrepôts
$formproduct->loadWarehouses(); // To load all warehouses
// Define a list of warehouse to not show on the list
// Define a list of warehouses to exclude from the selection
$TExcludedWarehouseSource = array();
if (!empty($object->fk_warehouse_source)) {
$source_ent = new Entrepot($db);
@ -956,7 +956,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
// Define a list of warehouse to not show on the list
// Define a list of warehouses to exclude from the selection
$TExcludedWarehouseDestination = array();
if (!empty($object->fk_warehouse_destination)) {
$dest_ent = new Entrepot($db);
@ -988,7 +988,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// PMP
print '<td></td>';
if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
// Unité
// Unit
print '<td></td>';
}

View file

@ -1115,13 +1115,13 @@ class Projects extends DolibarrApi
throw new RestException(500, 'Error : ' . $this->project->error . 'result :' . $result);
}
// Si demandé, ajouter le contact aux tâches
// If requested, add the contact to tasks
if ($affect_to_tasks !== null) {
$this->project->getLinesArray(DolibarrApiAccess::$user);
foreach ($this->project->lines as $task) {
// Si $affect_to_tasks est vide, on affecte à toutes les tâches
// Sinon, on vérifie si la tâche est dans la liste
// If $affect_to_tasks is empty, assign to all tasks
// Otherwise, check if the task is in the list
if (empty($affect_to_tasks) || in_array($task->id, $affect_to_tasks)) {
$task->add_contact($fk_socpeople, $type_contact, $source, $notrigger);
}

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2008-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 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
@ -178,7 +179,7 @@ if ($reshook < 0) {
}
}
// Define filename with prefix on filters predica (each predica set must have on cache file)
// Define filename with prefix based on filter criteria (each criterion set must have a corresponding cache file)
$shortfilename = 'dolibarrcalendar';
$filename = $shortfilename;
// Complete long filename
@ -380,10 +381,10 @@ print '</body></html>';
function build_exportfile($format, $type, $cachedelay, $filename, $filters)
{
// quelques filtres possible au nivau du tableau $filters
// logina : user login who is create interventional (author)
// logini : user login who make the intenventional
// loginr : user login who is responsible of interventional
// some filters possible in the $filters array
// logina : user login who creates intervention (author)
// logini : user login who performs the intervention
// loginr : user login who is responsible for intervention
global $hookmanager;
global $db;
@ -441,9 +442,9 @@ function build_exportfile($format, $type, $cachedelay, $filename, $filters)
$eventarray = array();
$sql = "SELECT f.rowid,";
$sql .= " fd.date,"; // on récupère la date et la durée sur le détail d'inter pour avoir aussi l'heure
$sql .= " f.datee,"; // End ne sera pas utilisée
$sql .= " fd.duree,"; // durée de l'intervention
$sql .= " fd.date,"; // We get the date and the duration from the detail of the interventaion as well as the hour
$sql .= " f.datee,"; // End will not be used
$sql .= " fd.duree,"; // Duration of the intervention
$sql .= " f.datec, f.tms as datem,";
$sql .= " f.ref, f.ref_client, fd.description, f.note_private, f.note_public,";
$sql .= " f.fk_soc,";
@ -633,7 +634,7 @@ function build_exportfile($format, $type, $cachedelay, $filename, $filters)
// $event['event_paid'] = $this->event_paid;
$event['status'] = $obj->fk_statut;
// // TODO: find a way to call "$this->fetch_userassigned();" without override "$this" properties
// // TODO: find a way to call "$this->fetch_userassigned();" without overriding "$this" properties
// $this->id = $obj->rowid;
// $this->fetch_userassigned(false);
@ -699,7 +700,7 @@ function build_exportfile($format, $type, $cachedelay, $filename, $filters)
}
// Create temp file
// Temporary file (allow call of function by different threads
// Temporary file (allows calling the function by different threads
$outputfiletmp = tempnam($conf->fichinter->dir_temp, 'tmp');
dolChmod($outputfiletmp);

View file

@ -4,7 +4,7 @@
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025-2026 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
@ -189,7 +189,7 @@ if ($result) {
print '<tr class="public_liste_titre">';
print '<th class="left"><a href="'.$_SERVER["PHP_SELF"].'?page='.$page.'&sortorder=ASC&sortfield=firstname">'.dolGetFirstLastname($langs->trans("Firstname"), $langs->trans("Lastname")).'</a></th>';
print '<th class="left"><a href="'.$_SERVER["PHP_SELF"].'?page='.$page.'&sortorder=ASC&sortfield=societe">'.$langs->trans("Company").'</a></th>'."\n";
//print_liste_field_titre("DateOfBirth", $_SERVER["PHP_SELF"],"birth",'',$param,$sortfield,$sortorder); // est-ce nécessaire ??
//print_liste_field_titre("DateOfBirth", $_SERVER["PHP_SELF"],"birth",'',$param,$sortfield,$sortorder); // Is this necessary??
print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "email", '', $param, '', $sortfield, $sortorder, 'left public_');
print_liste_field_titre("Zip", $_SERVER["PHP_SELF"], "zip", "", $param, '', $sortfield, $sortorder, 'left public_');
print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "town", "", $param, '', $sortfield, $sortorder, 'left public_');

View file

@ -148,7 +148,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo
httponly_accessforbidden('ErrorForbidden');
}
//Si le nom est bien entré
// If the name is entered correctly
if (GETPOST('nom', 'alphanohtml')) {
$nouveauchoix = '';
for ($i = 0; $i < $nbcolonnes; $i++) {
@ -413,8 +413,7 @@ if ($object->format == "D") {
//display of months
$colspan = 1;
for ($i = 0; $i < $nbofsujet; $i++) {
$cur = intval($toutsujet[$i]); // intval() est utiliser pour supprimer le suffixe @* qui déplaît logiquement à strftime()
$cur = intval($toutsujet[$i]); // intval() is used to remove the @* suffix which logically belongs to strftime()
if (!isset($toutsujet[$i + 1])) {
$next = false;
} else {

View file

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2016 Jean-François FERRY <jfefe@aternatik.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -155,7 +155,7 @@ if ($action == "view_ticketlist") {
$ret = $object->fetch(0, '', $track_id);
if ($ret && $object->id > 0) {
// vérifie si l'adresse email est bien dans les contacts du ticket
// checks if the email address is in the ticket contacts
$contacts = $object->liste_contact(-1, 'external');
foreach ($contacts as $contact) {
if (strtolower($contact['email']) == $email) {
@ -381,7 +381,8 @@ if ($action == "view_ticketlist") {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as ua ON ua.rowid = t.fk_user_assign";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact as ec ON ec.element_id = t.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc ON ec.fk_c_type_contact = tc.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople sp ON ec.fk_socpeople = sp.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople sp ON ec.fk_socpeople = sp.rowid"; // email found in an external contact
// Add fields for extrafields
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."ticket_extrafields as ef on (t.rowid = ef.fk_object)";
}
@ -395,7 +396,7 @@ if ($action == "view_ticketlist") {
// Manage filter
if (!empty($filter)) {
foreach ($filter as $key => $value) {
if (strpos($key, 'date')) { // To allow $filter['YEAR(s.dated)']=>$year
if (strpos($key, 'date')) { // Allows filtering by date fields like $filter['YEAR(s.dated)']=>$year
$sql .= " AND ".$db->sanitize($key)." = '".$db->escape($value)."'";
} elseif (($key == 't.fk_user_assign') || ($key == 't.type_code') || ($key == 't.category_code') || ($key == 't.severity_code')) {
$sql .= " AND ".$db->sanitize($key)." = '".$db->escape($value)."'";
@ -408,9 +409,9 @@ if ($action == "view_ticketlist") {
} else {
$sql .= " AND ".$db->sanitize($key)." LIKE '%".$db->escape($value)."%'";
}
}
} // End of filter loop
}
//$sql .= " GROUP BY t.track_id";
// $sql .= " GROUP BY t.track_id";
$sql .= $db->order($sortfield, $sortorder);
$resql = $db->query($sql);

View file

@ -1229,7 +1229,7 @@ class Memo extends CommonObject
}
/**
* Vérifie si une couleur est un code hex valide
* Checks if a color is a valid hex code
*
* @param mixed $color the color to check
* @return bool
@ -1243,7 +1243,7 @@ class Memo extends CommonObject
// Remove spaces at the beginning/end
$color = trim($color);
// Vérifie #fff ou #ffffff
// Checks for #fff or #ffffff
return preg_match('/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/', $color) === 1;
}

View file

@ -2,6 +2,7 @@
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 John BOTELLA
* Copyright (C) 2026 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
@ -226,7 +227,7 @@ if (empty($reshook)) {
if (!empty($toselect)) {
$countUnarchived = 0;
foreach ($toselect as $idMemo) {
// TODO Récupérer le mémo attention à ne pas récupérer un model ils ne peuvent pas étre rcupr c'est des models
// TODO Recover the memo - be careful to not recover a model - models can not be recovered.
$selectdModel = new Memo($db);
if ($selectdModel->fetch($idMemo) <= 0) {
$idMemo = (int) $idMemo; // sanitize

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 JF FERRY <jfefe@aternatik.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -92,7 +92,7 @@ $server->wsdl->addComplexType(
);
/*
* Une catégorie
* A category
*/
$server->wsdl->addComplexType(
'categorie',
@ -167,7 +167,7 @@ $server->wsdl->addComplexType(
);
/*
* Retour
* Return
*/
$server->wsdl->addComplexType(
'result',

View file

@ -3,6 +3,7 @@
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2026 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
@ -59,7 +60,7 @@ if (getDolGlobalString('MAIN_ROUNDING_RULE_TOT')) {
class PricesTest extends CommonClassTest
{
/**
* Test function calcul_price_total
* Test function for calculating price total
*
* @return boolean
* @see http://wiki.dolibarr.org/index.php/Draft:VAT_calculation_and_rounding#Standard_usage
@ -203,7 +204,7 @@ class PricesTest extends CommonClassTest
/*
* Country Côte d'Ivoire
* Country Ivory Coast
*/
// 10 * 10 HT - 0% discount with 18% vat, seller using localtax1 type 2, not localtax2 (method we provide value)