Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
ldestailleur
2025-10-04 00:51:06 +02:00
16 changed files with 94 additions and 85 deletions

View File

@@ -11994,12 +11994,6 @@ parameters:
count: 1
path: ../../../htdocs/modulebuilder/template/js/mymodule.js.php
-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
count: 4
path: ../../../htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
@@ -12174,12 +12168,6 @@ parameters:
count: 8
path: ../../../htdocs/mrp/class/api_mos.class.php
-
message: '#^Property MoLine\:\:\$fk_warehouse \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 2
path: ../../../htdocs/mrp/class/api_mos.class.php
-
message: '#^Result of && is always false\.$#'
identifier: booleanAnd.alwaysFalse
@@ -12228,12 +12216,6 @@ parameters:
count: 1
path: ../../../htdocs/mrp/class/mo.class.php
-
message: '#^Property Mo\:\:\$fk_warehouse \(int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
count: 1
path: ../../../htdocs/mrp/class/mo.class.php
-
message: '#^Property Mo\:\:\$label \(string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
@@ -14322,12 +14304,6 @@ parameters:
count: 1
path: ../../../htdocs/projet/tasks/contact.php
-
message: '#^Call to function method_exists\(\) with Task and ''fetchComments'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/projet/tasks/contact.php
-
message: '#^Property Project\:\:\$budget_amount \(float\|string\) in isset\(\) is not nullable\.$#'
identifier: isset.property
@@ -14346,12 +14322,6 @@ parameters:
count: 1
path: ../../../htdocs/projet/tasks/document.php
-
message: '#^Call to function method_exists\(\) with Task and ''fetchComments'' will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
count: 1
path: ../../../htdocs/projet/tasks/document.php
-
message: '#^Property Project\:\:\$budget_amount \(float\|string\) in isset\(\) is not nullable\.$#'
identifier: isset.property

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -26,10 +26,6 @@
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
/**
* @var Conf $conf
* @var DoliDB $db
@@ -38,6 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
* @var User $user
*/
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
// Load translation files required by the page
$langs->loadLangs(array("users", "admin", "other"));
@@ -134,8 +134,13 @@ print dol_get_fiche_head($head, 'captcha', '', -1);
print '<br>';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Captcha").'</td>';
print '<td class="right" width="100">'.$langs->trans("Status").'</td>';
print '</tr>';
print $langs->trans("UseCaptchaCode").' - Login';
print '<tr class="oddeven"><td>' . $langs->trans("UseCaptchaCode").' - Login</td><td class="right" width="100">';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA', array(), null, 0, 0, 1);
} else {
@@ -145,10 +150,10 @@ if (!empty($conf->use_javascript_ajax)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_MAIN_SECURITY_ENABLECAPTCHA&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
}
}
print '</td></tr>';
if (isModEnabled('societe')) {
print '<br>';
print $langs->trans("UseCaptchaCode").' - Thirdparty public contact form';
print '<tr class="oddeven"><td>' . $langs->trans("UseCaptchaCode").' - Thirdparty public contact form</td><td class="right" width="100">';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_THIRDPARTY', array(), null, 0, 0, 1);
} else {
@@ -159,10 +164,10 @@ if (isModEnabled('societe')) {
}
}
}
print '</td></tr>';
if (isModEnabled('ticket')) {
print '<br>';
print $langs->trans("UseCaptchaCode").' - Public ticket creation';
print '<tr class="oddeven"><td>' . $langs->trans("UseCaptchaCode").' - Public ticket creation</td><td class="right" width="100">';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_TICKET', array(), null, 0, 0, 1);
} else {
@@ -173,10 +178,10 @@ if (isModEnabled('ticket')) {
}
}
}
print '</td></tr>';
if (isModEnabled('member')) {
print '<br>';
print $langs->trans("UseCaptchaCode").' - Membership public subcription';
print '<tr class="oddeven"><td>' . $langs->trans("UseCaptchaCode").' - Membership public subscription</td><td class="right" width="100">';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_MEMBER', array(), null, 0, 0, 1);
} else {
@@ -187,10 +192,10 @@ if (isModEnabled('member')) {
}
}
}
print '</td></tr>';
if (isModEnabled('don')) {
print '<br>';
print $langs->trans("UseCaptchaCode").' - Donation public form';
print '<tr class="oddeven"><td>' . $langs->trans("UseCaptchaCode").' - Donation public form</td><td class="right" width="100">';
if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA_DONATION', array(), null, 0, 0, 1);
} else {
@@ -201,7 +206,9 @@ if (isModEnabled('don')) {
}
}
}
print '</td></tr>';
print '</table>';
// Set if a captcha is used on at least one place
$showavailablecaptcha = 0;
if (getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA')) {

View File

@@ -174,12 +174,12 @@ class BOM extends CommonObject
public $fk_user_modif;
/**
* @var int Id User modifying
* @var int Id User validating
*/
public $fk_user_valid;
/**
* @var int Id User modifying
* @var ?int Id of warehouse
*/
public $fk_warehouse;

View File

@@ -622,12 +622,12 @@ if ($object->id > 0) {
print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $permissiontoadd);
print '</td><td>';
if ($action == 'editwarehouse') {
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_warehouse, 'fk_warehouse', 1);
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, (int) $object->fk_warehouse, 'fk_warehouse', 1);
} else {
if ($object->fk_warehouse > 0) {
print img_picto('', 'stock', 'class="paddingrightonly"');
}
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_warehouse, 'none');
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, (int) $object->fk_warehouse, 'none');
}
print '</td>';
print '</tr>';

View File

@@ -329,3 +329,5 @@ ALTER TABLE llx_blockedlog ADD COLUMN debuginfo mediumtext;
ALTER TABLE llx_webhook_history ADD COLUMN trigger_code text NOT NULL;
ALTER TABLE llx_webhook_history ADD COLUMN error_message text;
ALTER TABLE llx_webhook_history MODIFY COLUMN url varchar(255);
-- end of migration

View File

@@ -179,14 +179,19 @@ ALTER TABLE llx_element_contact ADD mandatory_signature TINYINT AFTER element_id
-- default deposit % if payment term needs it on supplier
ALTER TABLE llx_supplier_proposal ADD COLUMN deposit_percent varchar(63) DEFAULT NULL AFTER fk_cond_reglement;
ALTER TABLE llx_commande_fournisseur ADD COLUMN deposit_percent varchar(63) DEFAULT NULL AFTER fk_cond_reglement;
create table llx_categorie_propal
CREATE TABLE llx_categorie_propal
(
fk_categorie integer NOT NULL,
fk_propal integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;
--noqa:disable=PRS
ALTER TABLE llx_categorie_propal ADD PRIMARY KEY pk_categorie_propal (fk_categorie, fk_propal);
--noqa:enable=PRS
ALTER TABLE llx_categorie_propal ADD INDEX idx_categorie_propal_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_propal ADD INDEX idx_categorie_propal_fk_propal (fk_propal);
ALTER TABLE llx_categorie_propal ADD CONSTRAINT fk_categorie_propal_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_propal ADD CONSTRAINT fk_categorie_propal_fk_propal_rowid FOREIGN KEY (fk_propal) REFERENCES llx_propal (rowid);
create table llx_categorie_supplier_proposal
(

View File

@@ -0,0 +1,24 @@
-- ============================================================================
--
--
-- 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- ============================================================================
ALTER TABLE llx_categorie_propal ADD PRIMARY KEY pk_categorie_propal (fk_categorie, fk_propal);
ALTER TABLE llx_categorie_propal ADD INDEX idx_categorie_propal_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_propal ADD INDEX idx_categorie_propal_fk_propal (fk_propal);
ALTER TABLE llx_categorie_propal ADD CONSTRAINT fk_categorie_propal_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_propal ADD CONSTRAINT fk_categorie_propal_fk_propal_rowid FOREIGN KEY (fk_propal) REFERENCES llx_propal (rowid);

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) ---Replace with your own copyright and developer email---
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -33,10 +34,10 @@ function myobjectPrepareHead($object)
$langs->load("mymodule@mymodule");
$showtabofpagecontact = 1;
$showtabofpagenote = 1;
$showtabofpagedocument = 1;
$showtabofpageagenda = 1;
$showtabofpagecontact = getDolGlobalInt('MAIN_MYMODULE_SHOW_PAGE_OF_CONTACT');
$showtabofpagenote = getDolGlobalInt('MAIN_MYMODULE_SHOW_PAGE_OF_NOTE');
$showtabofpagedocument = getDolGlobalInt('MAIN_MYMODULE_SHOW_PAGE_OF_DOCUMENT');
$showtabofpageagenda = getDolGlobalInt('MAIN_MYMODULE_SHOW_PAGE_OF_AGENDA');
$h = 0;
$head = array();

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 Maxime Kohlhaas <maxime@atm-consulting.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
*
* 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
@@ -434,7 +434,7 @@ class Mos extends DolibarrApi
$moline->fk_mo = $this->mo->id;
$moline->position = $pos;
$moline->fk_product = $value["objectid"];
$moline->fk_warehouse = $value["fk_warehouse"];
$moline->fk_warehouse = (int) $value["fk_warehouse"];
$moline->qty = $qtytoprocess;
$moline->batch = (string) $tmpproduct->status_batch;
$moline->role = 'toproduce';
@@ -535,9 +535,9 @@ class Mos extends DolibarrApi
$stockmove->origin_type = 'mo';
$stockmove->origin_id = $this->mo->id;
if ($qtytoprocess >= 0) {
$idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', (string) $tmpproduct->status_batch, $id_product_batch, $codemovement);
$idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, (int) $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', (string) $tmpproduct->status_batch, $id_product_batch, $codemovement);
} else {
$idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, '', '', (string) $tmpproduct->status_batch, dol_now(), $id_product_batch, $codemovement);
$idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $line->fk_product, (int) $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, '', '', (string) $tmpproduct->status_batch, dol_now(), $id_product_batch, $codemovement);
}
if ($idstockmove < 0) {
$error++;
@@ -595,9 +595,9 @@ class Mos extends DolibarrApi
$stockmove->origin_type = 'mo';
$stockmove->origin_id = $this->mo->id;
if ($qtytoprocess >= 0) {
$idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, '', '', (string) $tmpproduct->status_batch, dol_now(), $id_product_batch, $codemovement);
$idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $line->fk_product, (int) $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, '', '', (string) $tmpproduct->status_batch, dol_now(), $id_product_batch, $codemovement);
} else {
$idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', (string) $tmpproduct->status_batch, $id_product_batch, $codemovement);
$idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, (int) $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', (string) $tmpproduct->status_batch, $id_product_batch, $codemovement);
}
if ($idstockmove < 0) {
$error++;

View File

@@ -135,7 +135,7 @@ class Mo extends CommonObject
*/
public $qty;
/**
* @var int
* @var ?int
*/
public $fk_warehouse;
/**

View File

@@ -141,7 +141,7 @@ class MoLine extends CommonObjectLine
*/
public $fk_product;
/**
* @var int
* @var ?int
*/
public $fk_warehouse;

View File

@@ -557,8 +557,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$res = $object->fetch_optionals();
if (getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE') && $object->fk_warehouse > 0) {
$tmpwarehouse->fetch($object->fk_warehouse);
$fk_default_warehouse = $object->fk_warehouse;
$tmpwarehouse->fetch((int) $object->fk_warehouse);
$fk_default_warehouse = (int) $object->fk_warehouse;
}
$head = moPrepareHead($object);

View File

@@ -4,7 +4,7 @@
* Copyright (C) 2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2019-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021 Antonin MARCHAL <antonin@letempledujeu.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
@@ -87,7 +87,7 @@ while ($tmpobj = $db->fetch_object($resWar)) {
$listofqualifiedwarehousesid .= ",";
}
$listofqualifiedwarehousesid .= $tmpobj->rowid;
$lastWarehouseID = $tmpobj->rowid;
$lastWarehouseID = (int) $tmpobj->rowid;
$count++;
}
@@ -654,7 +654,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
}
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE')) {
print '<div class="inline-block valignmiddle" style="padding-right: 20px;">';
print $langs->trans('Warehouse') . ' ' . $formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1);
print $langs->trans('Warehouse') . ' ' . $formproduct->selectWarehouses((int) $fk_entrepot, 'fk_entrepot', '', 1);
print '</div>';
}
print '<div class="inline-block valignmiddle" style="padding-right: 20px;">';
@@ -884,12 +884,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
$stock = $prod->stock_theorique;
//if conf active, stock virtual by warehouse is calculated
if (getDolGlobalString('STOCK_ALLOW_VIRTUAL_STOCK_PER_WAREHOUSE')) {
$stockwarehouse = $prod->stock_warehouse[$fk_entrepot]->virtual;
$stockwarehouse = $prod->stock_warehouse[(int) $fk_entrepot]->virtual;
}
} else {
$stock = $prod->stock_reel;
if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) {
$stockwarehouse = $prod->stock_warehouse[$fk_entrepot]->real;
$stockwarehouse = $prod->stock_warehouse[(int) $fk_entrepot]->real;
}
}

View File

@@ -3167,12 +3167,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $user->hasRight('societe', 'creer'));
print '</td><td>';
if ($action == 'editwarehouse') {
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_warehouse, 'fk_warehouse', 1);
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, (int) $object->fk_warehouse, 'fk_warehouse', 1);
} else {
if ($object->fk_warehouse > 0) {
print img_picto('', 'stock', 'class="paddingrightonly"');
}
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_warehouse, 'none');
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, (int) $object->fk_warehouse, 'none');
}
print '</td>';
print '</tr>';

View File

@@ -872,7 +872,7 @@ class Societe extends CommonObject
// Warehouse
/**
* @var int ID
* @var ?int ID
*/
public $fk_warehouse;

View File

@@ -452,7 +452,7 @@ class User extends CommonObject
public $default_range;
/**
*@var int id of warehouse
*@var ?int id of warehouse
*/
public $fk_warehouse;