From 472665c03875b50398d4659feb0333812a367128 Mon Sep 17 00:00:00 2001 From: minimexat Date: Mon, 23 Feb 2026 20:05:26 +0100 Subject: [PATCH 1/6] fix(adherents): show cotisation create form for members with existing subscriptions (#37312) Co-authored-by: f-hoedl Co-authored-by: Laurent Destailleur --- htdocs/adherents/subscription.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index af357257351..ef829fe6268 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -151,7 +151,7 @@ if (empty($reshook) && $action == 'confirm_create_thirdparty' && $confirm == 'ye } else { $object->socid = $result; - $action = 'addsubscription'; + $action = 'createsubscription'; } } else { setEventMessages($object->error, $object->errors, 'errors'); @@ -250,14 +250,14 @@ if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $ac $langs->load("errors"); $errmsg = $langs->trans("ErrorBadDateFormat", $langs->transnoentitiesnoconv("DateSubscription")); setEventMessages($errmsg, null, 'errors'); - $action = 'addsubscription'; + $action = 'createsubscription'; } if (GETPOST('end') && !$datesubend) { $error++; $langs->load("errors"); $errmsg = $langs->trans("ErrorBadDateFormat", $langs->transnoentitiesnoconv("DateEndSubscription")); setEventMessages($errmsg, null, 'errors'); - $action = 'addsubscription'; + $action = 'createsubscription'; } if (!$datesubend) { $datesubend = dol_time_plus_duree(dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit), -1, 'd'); @@ -266,7 +266,7 @@ if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $ac $error++; $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment")); setEventMessages($errmsg, null, 'errors'); - $action = 'addsubscription'; + $action = 'createsubscription'; } // Check if a payment is mandatory or not @@ -276,7 +276,7 @@ if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $ac $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); setEventMessages($errmsg, null, 'errors'); $error++; - $action = 'addsubscription'; + $action = 'createsubscription'; } else { // If an amount has been provided, we check also fields that becomes mandatory when amount is not null. if (isModEnabled('bank') && GETPOST("paymentsave") != 'none') { @@ -285,26 +285,26 @@ if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $ac $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")); setEventMessages($errmsg, null, 'errors'); $error++; - $action = 'addsubscription'; + $action = 'createsubscription'; } if (GETPOST("paymentsave") != 'invoiceonly' && !GETPOST("operation")) { $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); setEventMessages($errmsg, null, 'errors'); $error++; - $action = 'addsubscription'; + $action = 'createsubscription'; } if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOSTINT("accountid") > 0)) { $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount")); setEventMessages($errmsg, null, 'errors'); $error++; - $action = 'addsubscription'; + $action = 'createsubscription'; } } else { if (GETPOSTINT("accountid")) { $errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount"); setEventMessages($errmsg, null, 'errors'); $error++; - $action = 'addsubscription'; + $action = 'createsubscription'; } } } @@ -337,7 +337,7 @@ if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $ac $db->commit(); } else { $db->rollback(); - $action = 'addsubscription'; + $action = 'createsubscription'; } if (!$error) { @@ -697,11 +697,11 @@ print dol_get_fiche_end(); // Button to create a new subscription if member no draft (-1) neither resiliated (0) neither excluded (-2) if ($user->hasRight('adherent', 'cotisation', 'creer')) { - if ($action != 'addsubscription' && $action != 'create_thirdparty') { + if ($action != 'createsubscription' && $action != 'create_thirdparty') { print '
'; if ($object->status > 0) { - print '"; + print '"; } else { print ''; } @@ -713,7 +713,7 @@ if ($user->hasRight('adherent', 'cotisation', 'creer')) { /* * List of subscriptions */ -if ($action != 'addsubscription' && $action != 'create_thirdparty') { +if ($action != 'createsubscription' && $action != 'create_thirdparty') { $sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe, d.fk_adherent_type as type,"; $sql .= " c.rowid as crowid, c.subscription,"; $sql .= " c.datec, c.fk_type as cfk_type,"; @@ -822,7 +822,7 @@ if ($action != 'addsubscription' && $action != 'create_thirdparty') { } -if (($action != 'addsubscription' && $action != 'create_thirdparty')) { +if (($action != 'createsubscription' && $action != 'create_thirdparty')) { // Show online payment link // The list can be complete by the hook 'doValidatePayment' executed inside getValidOnlinePaymentMethods() include_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; @@ -841,7 +841,7 @@ if (($action != 'addsubscription' && $action != 'create_thirdparty')) { /* * Add new subscription form */ -if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->hasRight('adherent', 'cotisation', 'creer')) { +if (($action == 'createsubscription' || $action == 'create_thirdparty') && $user->hasRight('adherent', 'cotisation', 'creer')) { print '
'; print load_fiche_titre($langs->trans("NewCotisation")); From c8111f972656a4d555ed59b112af502f39bbeb0f Mon Sep 17 00:00:00 2001 From: William Mead Date: Mon, 23 Feb 2026 20:07:15 +0100 Subject: [PATCH 2/6] QUAL updated projects API PHPDoc (#37275) * Debug savedemo * Fix mention * Fix pdf font for CZ * Added project API class and methods since tag --------- Co-authored-by: Laurent Destailleur --- htdocs/projet/class/api_projects.class.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index b55ebbc9770..ec19295a425 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -28,6 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; /** * API class for projects * + * @since 5.0.0 Initial implementation * @access protected * @class DolibarrApiAccess {@requires user,external} */ @@ -68,6 +69,7 @@ class Projects extends DolibarrApi * * Return an array with project information * + * @since 5.0.0 Initial implementation * @param int $id ID of project * @return Object Object with cleaned properties * @@ -97,6 +99,7 @@ class Projects extends DolibarrApi * * Return an array with project information * + * @since 20.0.0 Initial implementation * @param string $ref Ref of project * @return Object Object with cleaned properties * @@ -128,6 +131,7 @@ class Projects extends DolibarrApi * * Return an array with project information * + * @since 20.0.0 Initial implementation * @param string $ref_ext Ref_Ext of project * @return Object Object with cleaned properties * @@ -159,6 +163,7 @@ class Projects extends DolibarrApi * * Return an array with project information * + * @since 20.0.0 Initial implementation * @param string $email_msgid Email msgid of project * @return Object Object with cleaned properties * @@ -190,6 +195,7 @@ class Projects extends DolibarrApi * * Get a list of projects * + * @since 5.0.0 Initial implementation * @param string $sortfield Sort field * @param string $sortorder Sort order * @param int $limit Limit for list @@ -307,6 +313,7 @@ class Projects extends DolibarrApi /** * Create project object * + * @since 5.0.0 Initial implementation * @param array $request_data Request data * @phan-param array $request_data * @phpstan-param array $request_data @@ -390,6 +397,7 @@ class Projects extends DolibarrApi /** * Adds a contact to an project * + * @since 23.0.0 Initial implementation * @param int $id project ID * @param int $fk_socpeople Id of thirdparty contact (if source = 'external') or id of user (if source = 'internal') to link * @param string $type_contact Type of contact (code). Must a code found into table llx_c_type_contact. For example: BILLING @@ -431,6 +439,7 @@ class Projects extends DolibarrApi /** * Delete a contact type of given project * + * @since 23.0.0 Initial implementation * @param int $id Id of project to update * @param int $contactid Row key of the contact in the array contact_ids. * @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER). @@ -475,6 +484,7 @@ class Projects extends DolibarrApi * Get tasks of a project. * See also API /tasks * + * @since 5.0.0 Initial implementation * @param int $id Id of project * @param int $includetimespent 0=Return only list of tasks. 1=Include a summary of time spent, 2=Include details of time spent lines * @return array @@ -515,6 +525,7 @@ class Projects extends DolibarrApi /** * Get roles a user is assigned to a project with * + * @since 5.0.0 Initial implementation * @param int $id Id of project * @param int $userid Id of user (0 = connected user) * @return array @@ -693,6 +704,7 @@ class Projects extends DolibarrApi /** * Update project general fields (won't touch lines of project) * + * @since 5.0.0 Initial implementation * @param int $id Id of project to update * @param array $request_data Datas * @phan-param ?array $request_data @@ -744,6 +756,7 @@ class Projects extends DolibarrApi /** * Delete project * + * @since 5.0.0 Initial implementation * @param int $id Project ID * * @return array @@ -781,6 +794,7 @@ class Projects extends DolibarrApi * You can test this API with the following input message * { "notrigger": 0 } * + * @since 5.0.0 Initial implementation * @param int $id Project ID * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @phan-param int<0,1> $notrigger @@ -831,6 +845,7 @@ class Projects extends DolibarrApi /** * Get all timespent * + * @since 23.0.0 Initial implementation * @param string $sortfield Sort field * @param string $sortorder Sort order * @param int $limit Limit for list @@ -1027,6 +1042,7 @@ class Projects extends DolibarrApi * * Return an array with contact information * + * @since 23.0.0 Initial implementation * @param int $id ID of project * @param string $type Type of the contact * @return array Array with cleaned properties @@ -1061,6 +1077,7 @@ class Projects extends DolibarrApi /** * Adds a contact to a project * + * @since 23.0.0 Initial implementation * @param int $id Project ID * @param int $fk_socpeople Id of thirdparty contact (if source = 'external') or id of user (if source = 'internal') to link * @param string $type_contact Type of contact (code). Must a code found into table llx_c_type_contact. For example: BILLING @@ -1121,6 +1138,7 @@ class Projects extends DolibarrApi /** * Delete a contact type of given project * + * @since 23.0.0 Initial implementation * @param int $id Id of project to update * @param int $contactid Row key of the contact in the array contact_ids. * @param string $type Type of the contact (BILLING, SHIPPING, CUSTOMER). @@ -1167,6 +1185,7 @@ class Projects extends DolibarrApi /** * Get timespent of a project (from all its tasks) * + * @since 23.0.0 Initial implementation * @param int $id ID of project * @return array Array of timespent objects * From f919a837213251ea8a69e6da55ef74cb0f2a9d22 Mon Sep 17 00:00:00 2001 From: splohmer <113967431+splohmer@users.noreply.github.com> Date: Mon, 23 Feb 2026 20:08:30 +0100 Subject: [PATCH 3/6] FIX upload of files with multiple spaces via drag'n'drop flow (#37271) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Debug savedemo * Fix mention * FIX upload of files with multiple spaces via drag'n'drop flow Currently there are two ways to upload files to products, orders, etc. via the "old" way and the document tab and the "new" flow via drag'n'drop on the main tab of the object. Both ways triggering completely different code paths. In the end the new way uses dol_sanitzieFileName to sanitize the name of the file and the old way uses dol_string_nohtmltag (both from functions.lib.php). One of the main difference between the two mentioned functions is that in the old way multiple spaces behind each other are replaced by a single space. E.g. "A␠␠B␠␠␠C␠␠D" is tranformed to "A␠B␠C␠D". This is needed to make sure that the files are properly uploaded and can be later also downloaded correctly. How to reproduce? Upload a file like "test␠␠test.txt" via the drag'n'drop flow and try to download it from the document tab. This is not working. You can see the file but cannot download it. The same flow via the input field of the document tab is working correctly. * typo in comment * FIX Phan warnings (unrelated to feature) * FIX Phan warnings (unrelated to feature) * FIX Phan warnings (unrelated to feature) --------- Co-authored-by: Laurent Destailleur --- htdocs/core/class/fileupload.class.php | 11 +++++++---- htdocs/takepos/send.php | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 1354894cf41..47e4ab90c02 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -100,11 +100,13 @@ class FileUpload dol_include_once('/'.$parentElement.'/class/'.$parentObject.'.class.php'); $parent = new $parentClass($db); - $parent->fetch($object->$parentForeignKey); - if (!empty($parent->socid)) { - $parent->fetch_thirdparty(); + if ($object->$parentForeignKey !== null) { + $parent->fetch((int) $object->$parentForeignKey); + if (!empty($parent->socid)) { + $parent->fetch_thirdparty(); + } + $object->$parentObject = clone $parent; } - $object->$parentObject = clone $parent; $object_ref = dol_sanitizeFileName($object->project->ref).'/'.$object_ref; } @@ -396,6 +398,7 @@ class FileUpload // Remove path information and dots around the filename, to prevent uploading // into different directories or replacing hidden system files. $file_name = basename(dol_sanitizeFileName($name)); + $file_name = preg_replace('/ {2,}/', ' ', $file_name); // replaces multiple spaces into one space like the upload flow via input field // Add missing file extension for known image types: $matches = array(); if (strpos($file_name, '.') === false && preg_match('/^image\/(gif|jpe?g|png)/', $type, $matches)) { diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 6d40cb76bbd..044700c89ef 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -144,7 +144,6 @@ if ($action == "send" && $user->hasRight('takepos', 'run')) { $object->context['email_msgid'] = $mail->msgid; // Same code as in actions_sendmail.inc.php - // if ($triggersendname === 'BILL_SENTBYMAIL' && $object instanceof Facture) { // Always true ($triggersendname is set above, and $object = $invoice = Facture object // If sending email for invoice, we increase the counter of invoices sent by email $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET email_sent_counter = email_sent_counter + 1"; $sql .= " WHERE rowid = ".((int) $object->id); From 6041233c4bce2483daeb8bd87c5d6212076271e3 Mon Sep 17 00:00:00 2001 From: Lucky <93642903+LuckyRoussel98@users.noreply.github.com> Date: Mon, 23 Feb 2026 22:09:42 +0300 Subject: [PATCH 4/6] Fix_massaction_withdraw_control (#37237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CI * CI * CI * CI * Clean code. File not used. * CSS * CSS * Fix phpunit * More legal info * CI * Fix CI * Fix: IRPF tax not applied when creating invoice from project times (#37077) * Remove 'supplier_invoice' from old path array * Update module path in arrayforoldpath Sorry Eldy, I was confused. You are absolutely right, it is already corrected. * Replace localtax2 assignment with get_localtax function Error when creating an invoice with personal income tax from project times. The rate does not apply * Refactor localtax1 calculation using get_localtax --------- Co-authored-by: Laurent Destailleur * Fix: IRPF tax not applied when creating invoice from project times (#37077) * Remove 'supplier_invoice' from old path array * Update module path in arrayforoldpath Sorry Eldy, I was confused. You are absolutely right, it is already corrected. * Replace localtax2 assignment with get_localtax function Error when creating an invoice with personal income tax from project times. The rate does not apply * Refactor localtax1 calculation using get_localtax --------- Co-authored-by: Laurent Destailleur * Protect module * Add currency * CSS * WIP LNE * Fix navigation * cs * Debug registration process * Debug setup navigation * CI * CI * Factorize code * Fix CI * Fix CI * Fix CI * CI * CI * CI * CI * Disable phan on v23 * CI * CI * FIX: missing include for blockedlog lib (#37165) * Debug CI * fix ternary always true (#37161) * fix ternary always true * Update requests.php * Update registration.php --------- Co-authored-by: Laurent Destailleur * CI * FIX: missing include for blockedlog lib (#37165) * FIX #37134 Use json_encode for IMAP search logging in EmailCollector (#37135) var_export() produces multiline output that breaks log aggregators (Loki, Splunk, Elasticsearch) as each line becomes a separate log entry. Using json_encode() produces single-line structured output that works correctly with all log aggregation tools. Co-authored-by: Laurent Destailleur * Populate syslog with placeholder (#37163) Co-authored-by: Laurent Destailleur * Doc * datamodel for user change password next time (#37155) * Qual: Update phan baseline (#37172) * Fix typo in file path (#37160) Co-authored-by: Laurent Destailleur * Fix phpunit * Complete call to setStatus so we have a trigy as 4th parameter (help to fix the #37129) * FIX Product - Warning on admin (#37157) Co-authored-by: Laurent Destailleur * FIX Product - Warning on admin + CSS (#37158) * FIX Product - Warning on admin * CSS --------- Co-authored-by: Laurent Destailleur * CI * CI * CI * Avoid error if include fails * More functions in blacklist (even if nw we use the whitelist by default) * #37166 [SQL] add: email template for ticket admin creation (#37182) * Replace var_export with new function formatLogObject (#37178) * FIX BOM - Class product missing, column offset and information recording (form/input overlap) in admin (#37177) * FIX BOM - Class product missing in admin * Fix column offset and information recording (form/input overlap) * ci * ci * FIX Intracommreport - Warning & link problem on tab (#37176) * FIX Bank transfer admin - Warning & save 0 on constant PAYMENTBYBANKTRANSFER_ADDDAYS (#37175) * Look and feel v24 * Update default time handling in index.php (#37150) Co-authored-by: Laurent Destailleur * Fix file path comment in supplier invoice module (#37133) Co-authored-by: Laurent Destailleur * Fix file path comment in supplier invoice module (#37133) Co-authored-by: Laurent Destailleur * Fix CI * Add template in migration * fix phpdoc comment (#37184) * fix phpdoc comment * fix phpdoc comment --------- Co-authored-by: Laurent Destailleur * CI * Fix phpstan * Replace var_export by formatLogObject (continued) (#37188) Co-authored-by: Laurent Destailleur * Debug amount suggested on membership public form * Issue 36923 Fix session title handling in survey creation (#37105) * Issue 36923 Fix session title handling in survey creation * Change input field to use id attribute for title --------- Co-authored-by: Laurent Destailleur * fix phpstan errors blocking action baseline (#37189) * fix phpstan errors blocking action baseline * fix phpstan errors blocking action baseline * fix phpstan errors blocking action baseline * fix phpstan errors blocking action baseline * fix phpstan errors blocking action baseline * refresh baseline * QUAL Replace var_export() with json_encode() in dol_syslog() calls (#37138) var_export() produces multiline output that breaks log aggregators (Loki, Splunk, Elasticsearch, Graylog) as each line becomes a separate log entry. json_encode() produces single-line structured output that works correctly with all log aggregation tools. This pattern is already used elsewhere in Dolibarr (accountancy, install modules). Files changed: - core/class/commoninvoice.class.php (payment intent logging) - core/class/commonobject.class.php (payment terms logging) - core/modules/mailings/advthirdparties.modules.php (mailing targets) - core/modules/oauth/google_oauthcallback.php (userinfo logging) - core/modules/oauth/generic_oauthcallback.php (userinfo logging) - public/payment/newpayment.php (GET/POST debug logging) - public/payment/paymentok.php (payment tag logging) - public/stripe/ipn.php (Stripe event data logging) - paypal/lib/paypal.lib.php (PayPal response logging) - api/index.php (API debug logging) - stripe/class/stripe.class.php (payment/setup intent logging) Co-authored-by: f-hoedl Co-authored-by: Laurent Destailleur * Fix CI * CI * Check if upload_max_filesize is not empty * clean code * Debug v23 * CI * Fix #33521 VAT total false (#36990) * - Fix #33521 VAT total false - Fix some warnings - Fix : delete $this->vat_rate * - Fix #33521 VAT total false - Fix some warnings - Fix :delete $this->tva array (replaced by $this->tva_array) * - Fix #33521 VAT total false - Fix some warnings - Fix :delete $this->tva array (replaced by $this->tva_array) * Update pdf_octopus.modules.php * Update pdf_octopus.modules.php * Update pdf_octopus.modules.php * Update pdf_octopus.modules.php * Update pdf_octopus.modules.php --------- Co-authored-by: vmaury Co-authored-by: Laurent Destailleur * NEW #25829 Automatically send the invoice generated from a template (#36967) * Update DB * ADD email template * Ajout d'une clé de trad * Ajout des traductions * Suppression des traductions, sauf en_US * Add flag auto send * Modif form + cron auto send * Suppression auto_send * correction loopError * ajout du selected au model de mail * Prise en compte default model * Fix pre-commit * ménage * precommit * Correction Phan * Correction Phan * Correction, double cal du trigger --------- Co-authored-by: Laurent Destailleur * Develop force user change pass userclass (#37174) * datamodel for user change password next time * add force_pass_change in user object * Initialize force_pass_change to 0 --------- Co-authored-by: Laurent Destailleur * Another step for #37171 * Qual: Partial phan run on PR's, complete run on integration branches (#37186) * Qual: Partial phan run on PR's, complete on main # Qual: Partial phan run on PR's, complete on main The selection is based on the branch name. To run a complete phan run in a PR, the branch name of the PR must include phan_full. This can help to fix remaining phan issue before re-integrating to the develop branch. * qual: Update workflow and pre-commit configurations - Enable phan workflow by uncommenting the relevant lines - Update actionlint version to v1.7.10 - Add manual stage to actionlint hook in pre-commit-config.yaml * qual: Update Phan analysis conditions The conditions for running Phan analysis have been updated to include an additional check for branches containing 'phan_full'. * qual: Update Phan workflow - Replace github.event.ref with github.ref_name - Add FILE_CHANGE_LIST environment variable for better file handling - Update file list creation and usage in the workflow * qual: Update Phan workflow conditions Fix the branch reference (head_ref in PR, ref_name otherwise) * Add step for debug information * Remove debug step * Fix: Missing initialisations members/new.php Following a suppression of assignments, the variables disabledphy and disabledmor were undefined. * fix: Update budget selection dropdown arguments in member creation form Correct the arguments in the member creation form. * qual: Add cs2pr to phan workflow - Add cs2pr to the tools list in the phan workflow - Change the output mode of phan to checkstyle - Add a step to add results to PR as Github notices - Add a step to provide phan log as artifact * qual: Update Phan workflow to use environment variable for file list The change fixes the Phan workflow to use the environment variable `$FILE_CHANGED_LIST` to clear the file --------- Co-authored-by: Laurent Destailleur * Fix phan * Fix phan * Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 * Doc * Qual: Fix ambigious redirect error on Phan workflow (#37200) # Qual: Fix ambigious redirect error on Phan workflow Rewrote the shell command that is supposed to suppress a file contents but is flagged by the environment. * PHPStan > Update baseline (#37197) Co-authored-by: Dolibot * Typo fix (#37195) * Debug v23 - filters on agenda pages * css * css * css * qual: Update PHPStan workflow to run on all files in integration (#37207) The PHPStan workflow has been updated to run on all files in integration branches. * Fix CI * Add hook in isEditable() * Debug v23 * CLOSE #37190 ODT Templates for thirdparties - Birthday is returned in epoch format (#37198) Co-authored-by: Laurent Destailleur * fix: Remove HTML from accounting menu tooltips in eldy theme (#37203) Co-authored-by: Laurent Destailleur * Qual: Update spelling (#37199) * Qual: Update spelling for pre-select variants # Qual: Update spelling for pre-select variants In English, preselect is without the hyphen. Update text and made some translations related to preselect. * Qual: Update composant to component and/or adequate translation. # Qual: Update composant to component and/or adequate translation. "Composant(s)" was mostly referenced in french file/class comments. Updated * Qual: Fix misspellings related to "criteria" # Qual: Fix misspellings related to "criteria" * Qual: Fix produt misspellings # Qual: Fix produt misspellings Change 'produt' to 'product'. * Qual: Update French comments with "composants" #Qual: Update French comments with "composants" - Translating French comments to English (avoid codespell notice) * Qual: Fixed typo 'bad practive' to 'bad practice' # Qual: Fixed typo 'bad practive' to 'bad practice' * Qual: Update phan.yml to exclude specific files from analysis - Added file exclusion pattern to match phan configuration - Added check for empty file list to avoid unnecessary phan execution * Qual: Update file filtering in phan.yml workflow The change updates the file filtering process in the phan.yml workflow to correctly redirect the output of the grep command to a temporary file. * Qual: Ignore $systemfunction always exists --------- Co-authored-by: Laurent Destailleur * Error handling methods for commonobject (#37201) * Error handling methods for commonobject (#37201) * NEW Can request and force user to change its password (#37196) * force user to change password : redirect to user card on login * force user to change password : redirect to user card on login * redirect to a dedicated page * bad old idea : self change passwd on user card + edit mode and rights: it makes a hole on security check * only apply on dolibarr auth mode context * only on dolibarr auth mode context * Fix force_pass_change SQL assignment logic --------- Co-authored-by: Laurent Destailleur * Doc * Setup easier to understand between INVOICE_CHECK_POSTERIOR_DATE and FAC_FORCE_DATE_VALIDATION * Setup easier to understand between INVOICE_CHECK_POSTERIOR_DATE and FAC_FORCE_DATE_VALIDATION * Prepare 23.0 * Qual: Ignore exit code from `grep -v` in phan flow (#37213) # Qual: Ignore exit code from `grep -v` in phan flow `grep -v` returns 1 when the resulting filtered list is empty and would stop the execution. This is fixed with `|| true` to have a final exit code that is 0. * WIP LNE * Debug v23 * Debug v23 * WIP LNE * FIX Bad header name * Fix CSP for ping * Compatibility with multicompany * Debug * Fix include * Fix_massaction_withdraw_control Include pending transfer receipt amounts in bank transfer request validation This code ensures that when creating a new bank transfer request for a supplier invoice, the system also checks for amounts that are already in generated but unprocessed transfer receipts. Summary: The second query ($sqlPending2) retrieves pending amounts from the prelevement_lignes table where the transfer receipt has been created but not yet executed (status = 0 or NULL). This prevents users from requesting a bank transfer that would exceed the invoice total by accounting for: Pending requests not yet included in any transfer receipt Amounts already included in transfer receipts waiting to be processed * FIX phpdoc on createFixedAmountDiscount() (#37212) * FIX phpdoc on createFixedAmountDiscount * FIX phpdoc --------- Co-authored-by: Laurent Destailleur * Fix in card css modal display (#36569) * Fix display of cards in a modal * fix php stan * fix php stan * Try a change to force CI --------- Co-authored-by: Laurent Destailleur * More complete data on pings. * Debug v23 * Debug initdemo * Debug initdemo * Debug initdemo * Debug v23 * Update initdemo * Update initdemo * Cleaner GET call * Add id of perm in url * Init demo for v24 * Fix translation of "various payment" (not english, not pro) with the term used in english to mean "Opérations diverses (OD)" * Sync transifex * CSS * Trans * Doc * Trans * Debug v23 * Debug v23 * Trans * Debug v24 * Debug v23 * Debug v23 * WIP * Debug v23 * Debug v23 * Debug v24 * Work on LNE * WIP LNE * Debug v24 * Doc * Translation * Sync transifex * Debug * Debug * Debug * Responsive * Dev control archive integrity * Debug * Update supplier_proposal.lang (#37238) * add company name on dropdown contract list (#37245) * Clean dump file * Fix CI * FIX #37246 Modifying resteapayer calculation for credit note (#37247) * Add 'type' parameter to completeTabsHead hook (#37235) * #37257 FIX for piesemicircle (#37258) * Fix #37227 Fix #37233 * Fix #37227 Fix #37233 * QUAL French comment in English (#37225) * Edit label of $fields * QUAL French comment in English * Bump actions/upload-artifact from 4 to 6 (#37250) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Laurent Destailleur * UI/UX : Transfert feedback css from experimental to core (#37226) * Transfert feedback css from experimental to core * fix php phan * Fix phan * Fix phan * Fix phan * Missing label * Debug * traduction for massaction withdrawal control * Add method to chech if invoice can be replaced * Fix return * Debug v24 * Fix CI * fix commoninvoice.class.php (#37267) * fix commoninvoice.class.php * Update commoninvoice.class.php * CI * CI * Debug v23 * CI * Fix CI * Debug v23 * clean code pdf.lib.php (#37265) * clean code pdf.lib.php * Update pdf.lib.php * Update pdf.lib.php --------- Co-authored-by: Laurent Destailleur * FixCI * FIX: linktoref should be able to receive more than 255 chars (#37262) Co-authored-by: Laurent Destailleur * NEW Increase satement decription to 12 on card payment, 22 on sepa * CI * Restore deleted file * Add $dolibarr_main_restrict_eval_methods to install step1.php (#37268) Since this variable has a significant impact in future versions of Dolibarr, it is preferable that it be directly included in the conf.php file created during installation. Co-authored-by: Laurent Destailleur --------- Signed-off-by: dependabot[bot] Co-authored-by: Laurent Destailleur Co-authored-by: Laurent Destailleur Co-authored-by: Yamil Esteban Garcia <120027058+developmentOYR@users.noreply.github.com> Co-authored-by: Noé Cendrier <81741011+altairis-noe@users.noreply.github.com> Co-authored-by: Frédéric FRANCE Co-authored-by: minimexat Co-authored-by: hansemschnokeloch Co-authored-by: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Co-authored-by: MDW Co-authored-by: Alexandre SPANGARO Co-authored-by: evarisk-kilyan Co-authored-by: Vanyo Co-authored-by: jeremydassaud <49372108+jeremydassaud@users.noreply.github.com> Co-authored-by: f-hoedl Co-authored-by: Vincent Maury Co-authored-by: vmaury Co-authored-by: Vincent Penel Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dolibot Co-authored-by: Joris Le Blansch Co-authored-by: intelliking Co-authored-by: Benjamin Falière <121813548+BenjaminFlr@users.noreply.github.com> Co-authored-by: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Co-authored-by: Charlène Benke <1179011+defrance@users.noreply.github.com> Co-authored-by: demiton Co-authored-by: Jyhere Co-authored-by: Delthair <41671350+Delthair@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- htdocs/fourn/facture/list.php | 34 ++++++++++++++++++++++++++++++++-- htdocs/langs/en_US/bills.lang | 1 + htdocs/langs/fr_FR/bills.lang | 1 + 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 3a4e100a982..e094ec390a3 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -420,9 +420,39 @@ if (empty($reshook)) { $numprlv = $db->num_rows($result_sql); } - if ($numprlv > 0) { + // Calculate pending amount to check if more requests can be made + $pending = 0; + // Get pending requests open with no transfer receipt yet + $sqlPending1 = "SELECT SUM(pfd.amount) as amount"; + $sqlPending1 .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; + $sqlPending1 .= " WHERE pfd.fk_facture_fourn = ".((int) $objecttmp->id); + $sqlPending1 .= " AND pfd.traite = 0"; + $resPending1 = $db->query($sqlPending1); + if ($resPending1) { + $objPending1 = $db->fetch_object($resPending1); + if ($objPending1) { + $pending += (float) $objPending1->amount; + } + } + $db->free($resPending1); + // Get pending request with a transfer receipt generated but not yet processed + $sqlPending2 = "SELECT SUM(pl.amount) as amount"; + $sqlPending2 .= " FROM ".$db->prefix()."prelevement_lignes as pl"; + $sqlPending2 .= " INNER JOIN ".$db->prefix()."prelevement as p ON p.fk_prelevement_lignes = pl.rowid"; + $sqlPending2 .= " WHERE p.fk_facture_fourn = ".((int) $objecttmp->id); + $sqlPending2 .= " AND (pl.statut IS NULL OR pl.statut = 0)"; + $resPending2 = $db->query($sqlPending2); + if ($resPending2) { + if ($objPending2 = $db->fetch_object($resPending2)) { + $pending += (float) $objPending2->amount; + } + } + $db->free($resPending2); + $remaintopaylesspendingdebit = $objecttmp->resteapayer - $pending; + // Check remaining amount (allows multiple partial requests as long as total doesn't exceed invoice amount) + if ($remaintopaylesspendingdebit <= 0) { $error++; - setEventMessages($objecttmp->ref.' '.$langs->trans("RequestAlreadyDone"), $objecttmp->errors, 'warnings'); + setEventMessages($objecttmp->ref.' '.$langs->trans("AmountRequestedAlreadyReachesTotal"), $objecttmp->errors, 'warnings'); } elseif (!empty($objecttmp->mode_reglement_code) && $objecttmp->mode_reglement_code != 'VIR') { $langs->load("errors"); $error++; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 352802d3b02..cf36e105bfd 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -721,3 +721,4 @@ InvoiceSentFromTemplate=Invoice %s sent from recurring invoice template %s InvoiceSentFromTemplateError=Failed to send invoice %s from recurring invoice template %s : %s BillStatusValidatedWithSendind=Validated (needs to be paid) and sending sendAutoEmailInvoiceKO=Failed to send email from %s to %s +AmountRequestedAlreadyReachesTotal=The amount requested already reaches the total of the invoice diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index a2f91b13861..6973f03e94e 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -715,6 +715,7 @@ DisputeWon=Victoire en litige DisputeClosed=Litige clos Dispute=Différend Sales=Ventes +AmountRequestedAlreadyReachesTotal=Le montant demandé atteint déjà le total de la facture AutoSendEmail=Envoi automatique d'e-mails EmailTemplateForAutoSend=Modèle d'e-mail pour l'envoi automatique InvoiceSentFromTemplate=facture %s envoyé depuis le modèle récurrent facture %s From 3d88e03c88c4301fa1cc4ff18e90217298c56bc8 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Mon, 23 Feb 2026 20:11:39 +0100 Subject: [PATCH 5/6] UIUX : Dolibarr js context from experimental to core (#37228) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * NEW Use the js lib into htdocs/public/includes instead of htdocs/includes * New LNE Collect of buisness informations (#37084) * Working LNE ping * remove GPDA * Add of other informations * remove testing var * fix Ci * fix Ci * fix ci * fix CI * Fix Ci * fix Ci --------- Co-authored-by: Lucas Marcouiller * CI * CI * CI * CI * Clean code. File not used. * CSS * CSS * Fix phpunit * More legal info * CI * Fix CI * Fix: IRPF tax not applied when creating invoice from project times (#37077) * Remove 'supplier_invoice' from old path array * Update module path in arrayforoldpath Sorry Eldy, I was confused. You are absolutely right, it is already corrected. * Replace localtax2 assignment with get_localtax function Error when creating an invoice with personal income tax from project times. The rate does not apply * Refactor localtax1 calculation using get_localtax --------- Co-authored-by: Laurent Destailleur * Fix: IRPF tax not applied when creating invoice from project times (#37077) * Remove 'supplier_invoice' from old path array * Update module path in arrayforoldpath Sorry Eldy, I was confused. You are absolutely right, it is already corrected. * Replace localtax2 assignment with get_localtax function Error when creating an invoice with personal income tax from project times. The rate does not apply * Refactor localtax1 calculation using get_localtax --------- Co-authored-by: Laurent Destailleur * Protect module * Add currency * CSS * WIP LNE * Fix navigation * cs * Debug registration process * Debug setup navigation * CI * CI * Factorize code * Fix CI * Fix CI * Fix CI * CI * CI * CI * CI * Disable phan on v23 * CI * CI * FIX: missing include for blockedlog lib (#37165) * Debug CI * fix ternary always true (#37161) * fix ternary always true * Update requests.php * Update registration.php --------- Co-authored-by: Laurent Destailleur * CI * FIX: missing include for blockedlog lib (#37165) * FIX #37134 Use json_encode for IMAP search logging in EmailCollector (#37135) var_export() produces multiline output that breaks log aggregators (Loki, Splunk, Elasticsearch) as each line becomes a separate log entry. Using json_encode() produces single-line structured output that works correctly with all log aggregation tools. Co-authored-by: Laurent Destailleur * Populate syslog with placeholder (#37163) Co-authored-by: Laurent Destailleur * Doc * datamodel for user change password next time (#37155) * Qual: Update phan baseline (#37172) * Fix typo in file path (#37160) Co-authored-by: Laurent Destailleur * Fix phpunit * Complete call to setStatus so we have a trigy as 4th parameter (help to fix the #37129) * FIX Product - Warning on admin (#37157) Co-authored-by: Laurent Destailleur * FIX Product - Warning on admin + CSS (#37158) * FIX Product - Warning on admin * CSS --------- Co-authored-by: Laurent Destailleur * CI * CI * CI * Avoid error if include fails * More functions in blacklist (even if nw we use the whitelist by default) * #37166 [SQL] add: email template for ticket admin creation (#37182) * Replace var_export with new function formatLogObject (#37178) * FIX BOM - Class product missing, column offset and information recording (form/input overlap) in admin (#37177) * FIX BOM - Class product missing in admin * Fix column offset and information recording (form/input overlap) * ci * ci * FIX Intracommreport - Warning & link problem on tab (#37176) * FIX Bank transfer admin - Warning & save 0 on constant PAYMENTBYBANKTRANSFER_ADDDAYS (#37175) * Look and feel v24 * Update default time handling in index.php (#37150) Co-authored-by: Laurent Destailleur * Fix file path comment in supplier invoice module (#37133) Co-authored-by: Laurent Destailleur * Fix file path comment in supplier invoice module (#37133) Co-authored-by: Laurent Destailleur * Fix CI * Add template in migration * fix phpdoc comment (#37184) * fix phpdoc comment * fix phpdoc comment --------- Co-authored-by: Laurent Destailleur * CI * Fix phpstan * Replace var_export by formatLogObject (continued) (#37188) Co-authored-by: Laurent Destailleur * Debug amount suggested on membership public form * Issue 36923 Fix session title handling in survey creation (#37105) * Issue 36923 Fix session title handling in survey creation * Change input field to use id attribute for title --------- Co-authored-by: Laurent Destailleur * fix phpstan errors blocking action baseline (#37189) * fix phpstan errors blocking action baseline * fix phpstan errors blocking action baseline * fix phpstan errors blocking action baseline * fix phpstan errors blocking action baseline * fix phpstan errors blocking action baseline * refresh baseline * QUAL Replace var_export() with json_encode() in dol_syslog() calls (#37138) var_export() produces multiline output that breaks log aggregators (Loki, Splunk, Elasticsearch, Graylog) as each line becomes a separate log entry. json_encode() produces single-line structured output that works correctly with all log aggregation tools. This pattern is already used elsewhere in Dolibarr (accountancy, install modules). Files changed: - core/class/commoninvoice.class.php (payment intent logging) - core/class/commonobject.class.php (payment terms logging) - core/modules/mailings/advthirdparties.modules.php (mailing targets) - core/modules/oauth/google_oauthcallback.php (userinfo logging) - core/modules/oauth/generic_oauthcallback.php (userinfo logging) - public/payment/newpayment.php (GET/POST debug logging) - public/payment/paymentok.php (payment tag logging) - public/stripe/ipn.php (Stripe event data logging) - paypal/lib/paypal.lib.php (PayPal response logging) - api/index.php (API debug logging) - stripe/class/stripe.class.php (payment/setup intent logging) Co-authored-by: f-hoedl Co-authored-by: Laurent Destailleur * Fix CI * CI * Check if upload_max_filesize is not empty * clean code * Debug v23 * CI * Fix #33521 VAT total false (#36990) * - Fix #33521 VAT total false - Fix some warnings - Fix : delete $this->vat_rate * - Fix #33521 VAT total false - Fix some warnings - Fix :delete $this->tva array (replaced by $this->tva_array) * - Fix #33521 VAT total false - Fix some warnings - Fix :delete $this->tva array (replaced by $this->tva_array) * Update pdf_octopus.modules.php * Update pdf_octopus.modules.php * Update pdf_octopus.modules.php * Update pdf_octopus.modules.php * Update pdf_octopus.modules.php --------- Co-authored-by: vmaury Co-authored-by: Laurent Destailleur * NEW #25829 Automatically send the invoice generated from a template (#36967) * Update DB * ADD email template * Ajout d'une clé de trad * Ajout des traductions * Suppression des traductions, sauf en_US * Add flag auto send * Modif form + cron auto send * Suppression auto_send * correction loopError * ajout du selected au model de mail * Prise en compte default model * Fix pre-commit * ménage * precommit * Correction Phan * Correction Phan * Correction, double cal du trigger --------- Co-authored-by: Laurent Destailleur * Develop force user change pass userclass (#37174) * datamodel for user change password next time * add force_pass_change in user object * Initialize force_pass_change to 0 --------- Co-authored-by: Laurent Destailleur * Another step for #37171 * Qual: Partial phan run on PR's, complete run on integration branches (#37186) * Qual: Partial phan run on PR's, complete on main # Qual: Partial phan run on PR's, complete on main The selection is based on the branch name. To run a complete phan run in a PR, the branch name of the PR must include phan_full. This can help to fix remaining phan issue before re-integrating to the develop branch. * qual: Update workflow and pre-commit configurations - Enable phan workflow by uncommenting the relevant lines - Update actionlint version to v1.7.10 - Add manual stage to actionlint hook in pre-commit-config.yaml * qual: Update Phan analysis conditions The conditions for running Phan analysis have been updated to include an additional check for branches containing 'phan_full'. * qual: Update Phan workflow - Replace github.event.ref with github.ref_name - Add FILE_CHANGE_LIST environment variable for better file handling - Update file list creation and usage in the workflow * qual: Update Phan workflow conditions Fix the branch reference (head_ref in PR, ref_name otherwise) * Add step for debug information * Remove debug step * Fix: Missing initialisations members/new.php Following a suppression of assignments, the variables disabledphy and disabledmor were undefined. * fix: Update budget selection dropdown arguments in member creation form Correct the arguments in the member creation form. * qual: Add cs2pr to phan workflow - Add cs2pr to the tools list in the phan workflow - Change the output mode of phan to checkstyle - Add a step to add results to PR as Github notices - Add a step to provide phan log as artifact * qual: Update Phan workflow to use environment variable for file list The change fixes the Phan workflow to use the environment variable `$FILE_CHANGED_LIST` to clear the file --------- Co-authored-by: Laurent Destailleur * Fix phan * Fix phan * Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 * Doc * Qual: Fix ambigious redirect error on Phan workflow (#37200) # Qual: Fix ambigious redirect error on Phan workflow Rewrote the shell command that is supposed to suppress a file contents but is flagged by the environment. * PHPStan > Update baseline (#37197) Co-authored-by: Dolibot * Typo fix (#37195) * Debug v23 - filters on agenda pages * css * css * css * qual: Update PHPStan workflow to run on all files in integration (#37207) The PHPStan workflow has been updated to run on all files in integration branches. * Fix CI * Add hook in isEditable() * Debug v23 * CLOSE #37190 ODT Templates for thirdparties - Birthday is returned in epoch format (#37198) Co-authored-by: Laurent Destailleur * fix: Remove HTML from accounting menu tooltips in eldy theme (#37203) Co-authored-by: Laurent Destailleur * Qual: Update spelling (#37199) * Qual: Update spelling for pre-select variants # Qual: Update spelling for pre-select variants In English, preselect is without the hyphen. Update text and made some translations related to preselect. * Qual: Update composant to component and/or adequate translation. # Qual: Update composant to component and/or adequate translation. "Composant(s)" was mostly referenced in french file/class comments. Updated * Qual: Fix misspellings related to "criteria" # Qual: Fix misspellings related to "criteria" * Qual: Fix produt misspellings # Qual: Fix produt misspellings Change 'produt' to 'product'. * Qual: Update French comments with "composants" #Qual: Update French comments with "composants" - Translating French comments to English (avoid codespell notice) * Qual: Fixed typo 'bad practive' to 'bad practice' # Qual: Fixed typo 'bad practive' to 'bad practice' * Qual: Update phan.yml to exclude specific files from analysis - Added file exclusion pattern to match phan configuration - Added check for empty file list to avoid unnecessary phan execution * Qual: Update file filtering in phan.yml workflow The change updates the file filtering process in the phan.yml workflow to correctly redirect the output of the grep command to a temporary file. * Qual: Ignore $systemfunction always exists --------- Co-authored-by: Laurent Destailleur * Error handling methods for commonobject (#37201) * Error handling methods for commonobject (#37201) * NEW Can request and force user to change its password (#37196) * force user to change password : redirect to user card on login * force user to change password : redirect to user card on login * redirect to a dedicated page * bad old idea : self change passwd on user card + edit mode and rights: it makes a hole on security check * only apply on dolibarr auth mode context * only on dolibarr auth mode context * Fix force_pass_change SQL assignment logic --------- Co-authored-by: Laurent Destailleur * Doc * Setup easier to understand between INVOICE_CHECK_POSTERIOR_DATE and FAC_FORCE_DATE_VALIDATION * Setup easier to understand between INVOICE_CHECK_POSTERIOR_DATE and FAC_FORCE_DATE_VALIDATION * Prepare 23.0 * Qual: Ignore exit code from `grep -v` in phan flow (#37213) # Qual: Ignore exit code from `grep -v` in phan flow `grep -v` returns 1 when the resulting filtered list is empty and would stop the execution. This is fixed with `|| true` to have a final exit code that is 0. * WIP LNE * Debug v23 * Debug v23 * WIP LNE * FIX Bad header name * Fix CSP for ping * Compatibility with multicompany * Debug * Fix include * Transfert feedback css from experimental to core * Dolibarr JS context Tools from experiemntal to Core * Fix lang public mode * fix php phan * Fix phan * Fix phan * Fix phan * Fix phan * Fix phan * Fix phan * Fix phan * Fix phan * Fix phan * Fix phan * Fix phan * Fix multi instance of Dolibarr on same Domain * remove french comment * FIX phpdoc on createFixedAmountDiscount() (#37212) * FIX phpdoc on createFixedAmountDiscount * FIX phpdoc --------- Co-authored-by: Laurent Destailleur * Fix path * Fix in card css modal display (#36569) * Fix display of cards in a modal * fix php stan * fix php stan * Try a change to force CI --------- Co-authored-by: Laurent Destailleur * More complete data on pings. * Debug v23 * Debug initdemo * Debug initdemo * Debug initdemo * Debug v23 * Update initdemo * Update initdemo * Cleaner GET call * Add id of perm in url * Init demo for v24 * Fix translation of "various payment" (not english, not pro) with the term used in english to mean "Opérations diverses (OD)" * Sync transifex * CSS * Trans * Doc * Trans * Debug v23 * Debug v23 * Trans * Debug v24 * Debug v23 * Debug v23 * WIP * Debug v23 * Debug v23 * Debug v24 * Work on LNE * WIP LNE * Debug v24 * Doc * Translation * Sync transifex * Debug * Debug * Debug * Responsive * Dev control archive integrity * Debug * Update supplier_proposal.lang (#37238) * add company name on dropdown contract list (#37245) * Clean dump file * Fix CI * FIX #37246 Modifying resteapayer calculation for credit note (#37247) * Add 'type' parameter to completeTabsHead hook (#37235) * #37257 FIX for piesemicircle (#37258) * Fix #37227 Fix #37233 * Fix #37227 Fix #37233 * QUAL French comment in English (#37225) * Edit label of $fields * QUAL French comment in English * Bump actions/upload-artifact from 4 to 6 (#37250) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Laurent Destailleur * UI/UX : Transfert feedback css from experimental to core (#37226) * Transfert feedback css from experimental to core * fix php phan * Fix phan * Fix phan * Fix phan * Missing label * Debug * Debug savedemo * Fix mention --------- Signed-off-by: dependabot[bot] Co-authored-by: Laurent Destailleur Co-authored-by: Lucas Marcouiller <45882981+Hystepik@users.noreply.github.com> Co-authored-by: Lucas Marcouiller Co-authored-by: Laurent Destailleur Co-authored-by: Yamil Esteban Garcia <120027058+developmentOYR@users.noreply.github.com> Co-authored-by: Noé Cendrier <81741011+altairis-noe@users.noreply.github.com> Co-authored-by: Frédéric FRANCE Co-authored-by: minimexat Co-authored-by: hansemschnokeloch Co-authored-by: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Co-authored-by: MDW Co-authored-by: Alexandre SPANGARO Co-authored-by: evarisk-kilyan Co-authored-by: Vanyo Co-authored-by: jeremydassaud <49372108+jeremydassaud@users.noreply.github.com> Co-authored-by: f-hoedl Co-authored-by: Vincent Maury Co-authored-by: vmaury Co-authored-by: Vincent Penel Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dolibot Co-authored-by: Joris Le Blansch Co-authored-by: intelliking Co-authored-by: Benjamin Falière <121813548+BenjaminFlr@users.noreply.github.com> Co-authored-by: Charlène Benke <1179011+defrance@users.noreply.github.com> Co-authored-by: demiton Co-authored-by: Jyhere Co-authored-by: Delthair <41671350+Delthair@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../tools/ui/class/documentation.class.php | 57 +++++++++---------- .../dolibarr-context/index.php | 29 +++++----- .../dolibarr-context/langs-tool.php | 23 +++----- htdocs/main.inc.php | 38 ++++++++++++- .../dolibarr-context.mock.js | 0 .../dolibarr-context.umd.js | 0 .../dolibarr-tool.langs.js | 24 +++++++- .../dolibarr-tool.seteventmessage.js | 0 .../langs}/langs-tool-interface.php | 8 +-- 9 files changed, 112 insertions(+), 67 deletions(-) rename htdocs/admin/tools/ui/{experimental/experiments => }/dolibarr-context/index.php (96%) rename htdocs/admin/tools/ui/{experimental/experiments => }/dolibarr-context/langs-tool.php (87%) rename htdocs/{admin/tools/ui/experimental/experiments/dolibarr-context/assets => public/includes/dolibarr-js-context}/dolibarr-context.mock.js (100%) rename htdocs/{admin/tools/ui/experimental/experiments/dolibarr-context/assets => public/includes/dolibarr-js-context}/dolibarr-context.umd.js (100%) rename htdocs/{admin/tools/ui/experimental/experiments/dolibarr-context/assets => public/includes/dolibarr-js-context}/dolibarr-tool.langs.js (89%) rename htdocs/{admin/tools/ui/experimental/experiments/dolibarr-context/assets => public/includes/dolibarr-js-context}/dolibarr-tool.seteventmessage.js (100%) rename htdocs/{admin/tools/ui/experimental/experiments/dolibarr-context => public/langs}/langs-tool-interface.php (89%) diff --git a/htdocs/admin/tools/ui/class/documentation.class.php b/htdocs/admin/tools/ui/class/documentation.class.php index aabc27c4724..e79cd369afc 100644 --- a/htdocs/admin/tools/ui/class/documentation.class.php +++ b/htdocs/admin/tools/ui/class/documentation.class.php @@ -236,7 +236,34 @@ class Documentation ) ); - + // Elements + $this->menu['UxDolibarrContext'] = array( + 'url' => dol_buildpath($this->baseUrl.'/dolibarr-context/index.php', 1), + 'icon' => 'fab fa-fort-awesome', + 'submenu' => array( + 'UxDolibarrContextHowItWork' => array( + 'url' => dol_buildpath($this->baseUrl.'/dolibarr-context/index.php', 1), + 'icon' => 'fab fa-fort-awesome', + 'submenu' => array(), + 'summary' => array( + 'Introduction' => '#titlesection-basicusage', + 'ConsoleHelp' => '#titlesection-console-help', + 'JSDolibarrhooks' => '#titlesection-hooks', + 'JSDolibarrhooksReadyVsInit' => '#titlesection-event-init-vs-ready', + 'JSDolibarrAwaitHooks' => '#titlesection-await-hooks', + 'ExampleOfCreatingNewContextTool' => '#titlesection-create-tool-example', + 'SetEventMessageTool' => '#titlesection-tool-seteventmessage', + 'SetAndUseContextVars' => '#titlesection-contextvars', + ), + ), + 'UxDolibarrContextLangsTool' => array( + 'url' => dol_buildpath($this->baseUrl.'/dolibarr-context/langs-tool.php', 1), + 'icon' => 'far fa-flag', + 'submenu' => array(), + 'summary' => array(), + ), + ) + ); // Elements $this->menu['ExperimentalUx'] = array( @@ -253,34 +280,6 @@ class Documentation 'ExperimentalUxContributionTitle' => '#experimental-ux-contribution', ), ), - 'UxDolibarrContext' => array( - 'url' => dol_buildpath($this->baseUrl.'/experimental/experiments/dolibarr-context/index.php', 1), - 'icon' => 'fas fa-flask', - 'submenu' => array( - 'UxDolibarrContextHowItWork' => array( - 'url' => dol_buildpath($this->baseUrl.'/experimental/experiments/dolibarr-context/index.php', 1), - 'icon' => 'fas fa-flask', - 'submenu' => array(), - 'summary' => array( - 'Introduction' => '#titlesection-basicusage', - 'ConsoleHelp' => '#titlesection-console-help', - 'JSDolibarrhooks' => '#titlesection-hooks', - 'JSDolibarrhooksReadyVsInit' => '#titlesection-event-init-vs-ready', - 'JSDolibarrAwaitHooks' => '#titlesection-await-hooks', - 'ExampleOfCreatingNewContextTool' => '#titlesection-create-tool-example', - 'SetEventMessageTool' => '#titlesection-tool-seteventmessage', - 'SetAndUseContextVars' => '#titlesection-contextvars', - ), - ), - 'UxDolibarrContextLangsTool' => array( - 'url' => dol_buildpath($this->baseUrl.'/experimental/experiments/dolibarr-context/langs-tool.php', 1), - 'icon' => 'fas fa-flask', - 'submenu' => array(), - 'summary' => array(), - ), - ), - 'summary' => array(), - ), ) ); diff --git a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/index.php b/htdocs/admin/tools/ui/dolibarr-context/index.php similarity index 96% rename from htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/index.php rename to htdocs/admin/tools/ui/dolibarr-context/index.php index 2dc299f64ab..c52afe96474 100644 --- a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/index.php +++ b/htdocs/admin/tools/ui/dolibarr-context/index.php @@ -18,7 +18,7 @@ */ // Load Dolibarr environment -require '../../../../../../main.inc.php'; +require '../../../../main.inc.php'; /** * @var DoliDB $db @@ -43,13 +43,10 @@ $documentation = new Documentation($db); $group = 'ExperimentalUx'; $experimentName = 'UxDolibarrContext'; -$experimentAssetsPath = $documentation->baseUrl . '/experimental/experiments/dolibarr-context/assets/'; $js = [ '/includes/ace/src/ace.js', '/includes/ace/src/ext-statusbar.js', '/includes/ace/src/ext-language_tools.js', - $experimentAssetsPath . '/dolibarr-context.umd.js', - $experimentAssetsPath . '/dolibarr-tool.seteventmessage.js', ]; $css = []; @@ -154,7 +151,7 @@ $documentation->showSidebar(); ?> ' Dolibarr.debugMode(false);', '', ); - echo $documentation->showCode($lines, 'php'); + $documentation->showCode($lines, 'php'); ?>
@@ -205,7 +202,7 @@ $documentation->showSidebar(); ?> ' });', '', ); - echo $documentation->showCode($lines, 'php'); ?> + $documentation->showCode($lines, 'php'); ?>

Practical usage

@@ -247,7 +244,7 @@ $documentation->showSidebar(); ?> ' });', '', ); - echo $documentation->showCode($lines, 'php'); ?> + $documentation->showCode($lines, 'php'); ?> Open your console F12 and click on ', ); - echo $documentation->showCode($lines, 'php'); ?> + $documentation->showCode($lines, 'php'); ?>

@@ -403,7 +400,7 @@ $documentation->showSidebar(); ?> ' });', '', ); - echo $documentation->showCode($lines, 'php'); ?> + $documentation->showCode($lines, 'php'); ?> Open your console F12 and click on @@ -469,7 +466,7 @@ $documentation->showSidebar(); ?> '});', '', ); - echo $documentation->showCode($lines, 'php'); ?> + $documentation->showCode($lines, 'php'); ?>

Protected Tools

@@ -488,7 +485,7 @@ $documentation->showSidebar(); ?> ' }', '', ); - echo $documentation->showCode($lines, 'php'); ?> + $documentation->showCode($lines, 'php'); ?>

Reading Tools

@@ -504,7 +501,7 @@ $documentation->showSidebar(); ?> ' if(Dolibarr.checkToolExist(\'Tool name to check\')){/* ... */}else{/* ... */}; ', '', ); - echo $documentation->showCode($lines, 'php'); ?> + $documentation->showCode($lines, 'php'); ?> @@ -551,7 +548,7 @@ $documentation->showSidebar(); ?> ' });', '', ); - echo $documentation->showCode($lines, 'php'); ?> + $documentation->showCode($lines, 'php'); ?> ', ); - echo $documentation->showCode($lines, 'php'); + $documentation->showCode($lines, 'php'); ?> @@ -645,7 +642,7 @@ $documentation->showSidebar(); ?> ' });', '', ); - echo $documentation->showCode($lines, 'php'); + $documentation->showCode($lines, 'php'); ?> @@ -660,7 +657,7 @@ $documentation->showSidebar(); ?> ' });', '', ); - echo $documentation->showCode($lines, 'php'); + $documentation->showCode($lines, 'php'); ?> diff --git a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/langs-tool.php b/htdocs/admin/tools/ui/dolibarr-context/langs-tool.php similarity index 87% rename from htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/langs-tool.php rename to htdocs/admin/tools/ui/dolibarr-context/langs-tool.php index 696ed2e48a6..d8e571983d6 100644 --- a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/langs-tool.php +++ b/htdocs/admin/tools/ui/dolibarr-context/langs-tool.php @@ -18,7 +18,7 @@ */ // Load Dolibarr environment -require '../../../../../../main.inc.php'; +require '../../../../main.inc.php'; /** * @var DoliDB $db @@ -43,14 +43,11 @@ $documentation = new Documentation($db); $group = 'ExperimentalUx'; $experimentName = 'UxDolibarrContextLangsTool'; -$experimentAssetsPath = $documentation->baseUrl . '/experimental/experiments/dolibarr-context/assets/'; +$experimentAssetsPath = dolBuildUrl('/public/includes/dolibarr-js-context'); $js = [ '/includes/ace/src/ace.js', '/includes/ace/src/ext-statusbar.js', - '/includes/ace/src/ext-language_tools.js', - $experimentAssetsPath . '/dolibarr-context.umd.js', - $experimentAssetsPath . '/dolibarr-tool.langs.js', - $experimentAssetsPath . '/dolibarr-tool.seteventmessage.js', + '/includes/ace/src/ext-language_tools.js' ]; $css = []; @@ -62,13 +59,7 @@ $documentation->view = [$group, 'UxDolibarrContext', $experimentName]; // Output sidebar $documentation->showSidebar(); ?> - +
showBreadCrumb(); ?> @@ -107,11 +98,11 @@ $documentation->showSidebar(); ?> 'Dolibarr.setContextVars( DOL_VERSION,', ' \'MAIN_LANG_DEFAULT\' => $langs->getDefaultLang(),', - ' \'DOL_LANG_INTERFACE_URL\' => dol_buildpath(\'admin/tools/ui/experimental/experiments/dolibarr-context/langs-tool-interface.php\',1),', + ' \'DOL_LANG_INTERFACE_URL\' => dol_buildpath(\'public/langs/langs-tool-interface.php\', 1),', ']) ?>);', '', ); - echo $documentation->showCode($lines, 'php'); + $documentation->showCode($lines, 'php'); ?>
@@ -171,7 +162,7 @@ $documentation->showSidebar(); ?> '});', '', ); - echo $documentation->showCode($lines, 'php'); + $documentation->showCode($lines, 'php'); print implode("\n", $lines); ?> diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 3189c8246ea..8a57776ff94 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -45,7 +45,7 @@ // For optional tuning. Enabled if environment variable MAIN_SHOW_TUNING_INFO is defined. $micro_start_time = 0; // Used as global var into printCommonFooter() if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) { - list($usec, $sec) = explode(" ", microtime()); + [$usec, $sec] = explode(" ", microtime()); $micro_start_time = ((float) $usec + (float) $sec); // Add Xdebug code coverage //define('XDEBUGCOVERAGE',1); @@ -1814,6 +1814,42 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr $themeparam .= '&THEME_SATURATE_RATIO='.GETPOSTINT('THEME_SATURATE_RATIO'); } + + /** + * ==================================== + * DEFINE DOLIBARR JS CONTEXT AND TOOLS + * ==================================== + * see Documentation at admin/tools/ui/dolibarr-context/index.php + */ + $jsContextVars = [ + 'DOL_VERSION' => DOL_VERSION, + 'DOL_URL_ROOT' => DOL_URL_ROOT, + ]; + + $jsContextPathUrl = DOL_URL_ROOT . '/public/includes/dolibarr-js-context'; + $jsContextFiles = [ + 'dolibarr-context.umd.js', // The js Dolibarr context definition + 'dolibarr-tool.seteventmessage.js' // The first tools to help dev for easy event in js + ]; + + if (! defined('NOREQUIRETRAN')) { + // Langs tool see Documentation at admin/tools/ui/dolibarr-context/index.php + $jsContextFiles[] = 'dolibarr-tool.langs.js'; + $jsContextVars['MAIN_LANG_DEFAULT'] = $langs->getDefaultLang();// For langs tool + $jsContextVars['DOL_LANG_INTERFACE_URL'] = dol_buildpath('public/langs/langs-tool-interface.php', 1);// For langs tool + } + + // Load context and all js tools + foreach ($jsContextFiles as $jsContextFile) { + print ''."\n"; + } + + // DEFINE FIRST NEEDED JS CONTEXT VARS + print ''."\n"; + + // -- END OF DEFINITION OF DOLIBARR JS CONTEXT AND TOOLS + + if (getDolGlobalString('MAIN_ENABLE_FONT_ROBOTO')) { print ''."\n"; print ''."\n"; diff --git a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/assets/dolibarr-context.mock.js b/htdocs/public/includes/dolibarr-js-context/dolibarr-context.mock.js similarity index 100% rename from htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/assets/dolibarr-context.mock.js rename to htdocs/public/includes/dolibarr-js-context/dolibarr-context.mock.js diff --git a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/assets/dolibarr-context.umd.js b/htdocs/public/includes/dolibarr-js-context/dolibarr-context.umd.js similarity index 100% rename from htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/assets/dolibarr-context.umd.js rename to htdocs/public/includes/dolibarr-js-context/dolibarr-context.umd.js diff --git a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/assets/dolibarr-tool.langs.js b/htdocs/public/includes/dolibarr-js-context/dolibarr-tool.langs.js similarity index 89% rename from htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/assets/dolibarr-tool.langs.js rename to htdocs/public/includes/dolibarr-js-context/dolibarr-tool.langs.js index adeefc27ddb..becfdff5f32 100644 --- a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/assets/dolibarr-tool.langs.js +++ b/htdocs/public/includes/dolibarr-js-context/dolibarr-tool.langs.js @@ -24,8 +24,14 @@ document.addEventListener('Dolibarr:Init', function(e) { * @returns {Promise} */ async function openDB() { + + // Generate a unique name per instance + const path = Dolibarr.getContextVar('DOL_URL_ROOT'); // or a unique Dolibarr identifier if available + const hashedPath = await hashString(path); + const dbName = `DolibarrLangs_${hashedPath}`; + return new Promise((resolve, reject) => { - const request = indexedDB.open('DolibarrLangs', 1); + const request = indexedDB.open(dbName, 1); request.onupgradeneeded = e => { const db = e.target.result; if (!db.objectStoreNames.contains('langs')) db.createObjectStore('langs'); @@ -35,6 +41,22 @@ document.addEventListener('Dolibarr:Init', function(e) { }); } + // Create a secure DB name + async function getSafeDbName() { + const path = window.location.pathname; + const hashedPath = await hashString(path); + return `DolibarrLangs_${hashedPath}`; + } + + // Simple function to generate a hash from a string + async function hashString(str) { + const encoder = new TextEncoder(); + const data = encoder.encode(str); + const hashBuffer = await crypto.subtle.digest('SHA-1', data); + const hashArray = Array.from(new Uint8Array(hashBuffer)); + return hashArray.map(b => b.toString(16).padStart(2, '0')).join(''); + } + /** * Get cached translation for a domain + locale * @param {string} domain diff --git a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/assets/dolibarr-tool.seteventmessage.js b/htdocs/public/includes/dolibarr-js-context/dolibarr-tool.seteventmessage.js similarity index 100% rename from htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/assets/dolibarr-tool.seteventmessage.js rename to htdocs/public/includes/dolibarr-js-context/dolibarr-tool.seteventmessage.js diff --git a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/langs-tool-interface.php b/htdocs/public/langs/langs-tool-interface.php similarity index 89% rename from htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/langs-tool-interface.php rename to htdocs/public/langs/langs-tool-interface.php index 2404220fc31..179c9f04fc2 100644 --- a/htdocs/admin/tools/ui/experimental/experiments/dolibarr-context/langs-tool-interface.php +++ b/htdocs/public/langs/langs-tool-interface.php @@ -17,17 +17,17 @@ */ //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user +if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu //if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php //if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. +if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. //if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip //if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value //if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler @@ -36,7 +36,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // I // Load Dolibarr environment -require '../../../../../../main.inc.php'; +require '../../main.inc.php'; /** From ff146c471323122ff2b97c7f549971b749cbe7e3 Mon Sep 17 00:00:00 2001 From: Eric - CAP-REL <1468823+rycks@users.noreply.github.com> Date: Mon, 23 Feb 2026 20:12:44 +0100 Subject: [PATCH 6/6] handle race condition user with no right - prevent infinite loop (#37220) --- htdocs/langs/en_US/errors.lang | 1 + htdocs/user/card.php | 31 ++++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index e6b74e2d5bd..14ac4a79e3f 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -467,3 +467,4 @@ SomeShipmentExists=Error, there is some shipment linked to the order. Deletion r WarningEvaluationEmptyValidate=Can't validate evaluation, levels on skills not defined ErrorBadParametersForDirectDebitFileCreate=Can't create bank transfer file: expected format parameter is not provided. ErrorBadParametersForDirectDebitFileCreateDids=Can't create bank transfer file: IDs of existing payment requests are not provided. +UserDoesNotHaveRightsToChangeHisPassword=That user doesn't have the rights to change his own password diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 56cbebb1175..4078819a665 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1222,7 +1222,12 @@ if ($action == 'create' || $action == 'adduserldap') { if ($_SESSION["dol_authmode"] == 'dolibarr') { print ''.$langs->trans("ForcePasswordChange").''; print ''; - print ''; + if ($object->hasRight('user', 'self', 'password')) { + print ''; + } else { + print ''; + print $langs->trans("UserDoesNotHaveRightsToChangeHisPassword"); + } print ''; print "\n"; } @@ -2025,10 +2030,15 @@ if ($action == 'create' || $action == 'adduserldap') { if ($_SESSION["dol_authmode"] == 'dolibarr') { print ''.$langs->trans("ForcePasswordChange").''; print ''; - if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) { - print 'force_pass_change ? ' checked="checked"' : '').'>'; + if ($object->hasRight('user', 'self', 'password')) { + if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') < 2) { + print 'force_pass_change ? ' checked="checked"' : '').'>'; + } else { + print yn($object->force_pass_change); + } } else { - print yn($object->force_pass_change); + print ''; + print $langs->trans("UserDoesNotHaveRightsToChangeHisPassword"); } print ''; print "\n"; @@ -2714,11 +2724,18 @@ if ($action == 'create' || $action == 'adduserldap') { if ($_SESSION["dol_authmode"] == 'dolibarr') { print ''; print ''.$form->editfieldkey('ForcePasswordChange', 'forcepasswordchange', '', $object, 0).''; - if ($permissiontoedit) { - print 'force_pass_change ? ' checked="checked"' : '').'>'; + + if ($object->hasRight('user', 'self', 'password')) { + if ($permissiontoedit) { + print 'force_pass_change ? ' checked="checked"' : '').'>'; + } else { + print 'force_pass_change ? ' checked="checked"' : '').'>'; + } } else { - print 'force_pass_change ? ' checked="checked"' : '').'>'; + print ''; + print $langs->trans("UserDoesNotHaveRightsToChangeHisPassword"); } + print ''; }