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

This commit is contained in:
ldestailleur 2025-08-15 18:46:02 +02:00
commit e8d4ef4115
9 changed files with 44 additions and 48 deletions

View file

@ -11088,12 +11088,6 @@ parameters:
count: 2
path: ../../../htdocs/core/tpl/extrafields_view.tpl.php
-
message: '#^Variable \$hookmanager might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../../htdocs/core/tpl/extrafields_view.tpl.php
-
message: '#^Ternary operator condition is always true\.$#'
identifier: ternary.alwaysTrue
@ -11532,24 +11526,6 @@ parameters:
count: 1
path: ../../../htdocs/debugbar/class/autoloader.php
-
message: '#^Variable \$hidedesc might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/delivery/card.php
-
message: '#^Variable \$hidedetails might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/delivery/card.php
-
message: '#^Variable \$hideref might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/delivery/card.php
-
message: '#^Variable \$objectsrc might not be defined\.$#'
identifier: variable.undefined

View file

@ -3,6 +3,7 @@
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* 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
@ -31,13 +32,16 @@ global $noMoreLinkedObjectBlockAfter;
$langs = $GLOBALS['langs'];
'@phan-var-force Translate $langs';
/** @var Translate $langs */
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
/** @var Commande[] $linkedObjectBlock */
// Load translation files required by the page
$langs->load("orders");
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array)
'@phan-var-force Commande[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array)
/** @var Commande[] $linkedObjectBlock */
$total = 0;
$ilink = 0;

View file

@ -8,7 +8,7 @@
* Copyright (C) 2013-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
@ -251,6 +251,7 @@ if (empty($reshook)) {
$object->note_private = (string) GETPOST("note_private", 'restricthtml');
$object->roles = GETPOST("roles", 'array');
$object->status = 1; //Default status to Actif
$object->statut = 1; //Default status to Actif
// Note: Correct date should be completed with location to have exact GM time of birth.
@ -1546,11 +1547,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Activer
if ($object->statut == 0 && $user->hasRight('societe', 'contact', 'creer')) {
if ($object->status == 0 && $user->hasRight('societe', 'contact', 'creer')) {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken().'">'.$langs->trans("Reactivate").'</a>';
}
// Desactiver
if ($object->statut == 1 && $user->hasRight('societe', 'contact', 'creer')) {
if ($object->status == 1 && $user->hasRight('societe', 'contact', 'creer')) {
print '<a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("DisableUser").'</a>';
}

View file

@ -220,6 +220,7 @@ class Contact extends CommonObject
/**
* @var int Status 0=inactive, 1=active
* @deprecated Use $status
*/
public $statut;
@ -378,6 +379,7 @@ class Contact extends CommonObject
{
$this->db = $db;
$this->statut = 1; // By default, status is enabled
$this->status = 1; // By default, status is enabled
$this->ismultientitymanaged = 1;
$this->isextrafieldmanaged = 1;
@ -498,7 +500,11 @@ class Contact extends CommonObject
if (empty($this->priv)) {
$this->priv = 0;
}
if (empty($this->statut)) {
if (!empty($this->statut) && empty($this->status)) {
$this->status = 1;
}
if (empty($this->status)) {
$this->status = 0; // This is to convert '' into '0' to avoid bad sql request
$this->statut = 0; // This is to convert '' into '0' to avoid bad sql request
}
@ -533,7 +539,7 @@ class Contact extends CommonObject
$sql .= " ".($user->id > 0 ? ((int) $user->id) : "null").",";
$sql .= " ".((int) $this->priv).",";
$sql .= " 0,";
$sql .= " ".((int) $this->statut).",";
$sql .= " ".((int) $this->status).",";
$sql .= " ".(!empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'" : "null").",";
$sql .= " ".((int) $this->entity).",";
$sql .= "'".$this->db->escape($this->ref_ext)."',";
@ -627,7 +633,11 @@ class Contact extends CommonObject
$this->zip = (empty($this->zip) ? '' : trim($this->zip));
$this->town = (empty($this->town) ? '' : trim($this->town));
$this->country_id = (empty($this->country_id) || $this->country_id < 0) ? 0 : $this->country_id;
if (empty($this->statut)) {
if (!empty($this->statut) && empty($this->status)) {
$this->status = 1;
}
if (empty($this->status)) {
$this->status = 0;
$this->statut = 0;
}
if (empty($this->civility_code) && !is_numeric($this->civility_id)) {
@ -669,7 +679,7 @@ class Contact extends CommonObject
if (isset($this->stcomm_id)) {
$sql .= ", fk_stcommcontact = ".($this->stcomm_id > 0 || $this->stcomm_id == -1 ? $this->stcomm_id : "0");
}
$sql .= ", statut = ".((int) $this->statut);
$sql .= ", statut = ".((int) $this->status);
$sql .= ", fk_user_modif=".($user->id > 0 ? "'".$this->db->escape((string) $user->id)."'" : "NULL");
$sql .= ", default_lang=".($this->default_lang ? "'".$this->db->escape($this->default_lang)."'" : "NULL");
$sql .= ", entity = ".((int) $this->entity);
@ -1093,6 +1103,7 @@ class Contact extends CommonObject
$this->socid = $obj->fk_soc; // Both fk_soc and socid are used
$this->socname = $obj->socname;
$this->poste = $obj->poste;
$this->status = $obj->statut;
$this->statut = $obj->statut;
$this->fk_prospectlevel = $obj->fk_prospectlevel;
@ -1645,7 +1656,7 @@ class Contact extends CommonObject
*/
public function getLibStatut($mode)
{
return $this->LibStatut($this->statut, $mode);
return $this->LibStatut($this->status, $mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -1752,7 +1763,7 @@ class Contact extends CommonObject
$this->note_private = 'This is a comment (private)';
$this->socid = $socid;
$this->statut = 1;
$this->status = 1;
return 1;
}
@ -1770,9 +1781,13 @@ class Contact extends CommonObject
$error = 0;
// Check parameters
if ($this->statut == $status) {
if (!empty($this->statut) && empty($this->status)) {
$this->status = 1;
}
if ($this->status == $status) {
return 0;
} else {
$this->status = $status;
$this->statut = $status;
}
@ -1780,7 +1795,7 @@ class Contact extends CommonObject
// User disable
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople";
$sql .= " SET statut = ".((int) $this->statut);
$sql .= " SET statut = ".((int) $this->status);
$sql .= ", fk_user_modif = ".((int) $user->id);
$sql .= " WHERE rowid = ".((int) $this->id);
$result = $this->db->query($sql);

View file

@ -9,7 +9,7 @@
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
* 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) 2019 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
@ -1436,6 +1436,7 @@ while ($i < $imaxinloop) {
$contactstatic->ref_ext = $obj->ref_ext;
$contactstatic->lastname = $obj->lastname;
$contactstatic->firstname = $obj->firstname;
$contactstatic->status = $obj->statut;
$contactstatic->statut = $obj->statut;
$contactstatic->poste = $obj->poste;
$contactstatic->email = $obj->email;

View file

@ -17,12 +17,12 @@
*/
/**
* \file htdocs/core/class/commonobject.class.php
* \file htdocs/core/class/objectlink.class.php
* \ingroup core
* \brief File of parent class of all other business classes (invoices, contracts, proposals, orders, ...)
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/doldeprecationhandler.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
/**
* Parent class of all other business classes (invoices, contracts, proposals, orders, ...)

View file

@ -7,7 +7,7 @@
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <contact@altairis.fr>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2015-2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018-2024 Ferran Marcet <fmarcet@2byte.es>
@ -1583,6 +1583,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$contactstatic->id = $obj->rowid;
$contactstatic->ref = $obj->rowid;
$contactstatic->status = $obj->statut;
$contactstatic->statut = $obj->statut;
$contactstatic->lastname = $obj->lastname;
$contactstatic->firstname = $obj->firstname;

View file

@ -716,7 +716,7 @@ if (empty($reshook)) {
$produit_multiprices_limit = getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT');
for ($i = 2; $i <= $produit_multiprices_limit; $i++) {
if (GETPOSTISSET("price_".$i)) {
$object->multiprices["$i"] = price2num(GETPOST("price_".$i), 'MU');
$object->multiprices["$i"] = (float) price2num(GETPOST("price_".$i), 'MU');
$object->multiprices_base_type["$i"] = GETPOST("multiprices_base_type_".$i);
} else {
$object->multiprices["$i"] = "";
@ -792,7 +792,7 @@ if (empty($reshook)) {
$object->oldcopy = dol_clone($object, 1); // @phan-suppress-current-line PhanTypeMismatchProperty
if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) {
$object->ref = (string) $ref;
$object->ref = (string) $ref;
}
$object->label = GETPOST('label', $label_security_check);

View file

@ -31,13 +31,14 @@ global $noMoreLinkedObjectBlockAfter;
$langs = $GLOBALS['langs'];
'@phan-var-force Translate $langs';
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
'@phan-var-force CommonObject[] $linkedObjectBlock';
'@phan-var-force Ticket[] $linkedObjectBlock';
// Load translation files required by the page
$langs->load('ticket');
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'datec', 'desc', 0, 0, 1);
'@phan-var-force CommonObject[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array)
'@phan-var-force Ticket[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array)
/** @var Ticket[] $linkedObjectBlock */
$total = 0;
$ilink = 0;
@ -50,12 +51,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
} ?>
<tr class="<?php echo $trclass; ?>" >
<td class="linkedcol-element tdoverflowmax100"><?php echo $langs->trans("Ticket"); ?>
<?php if (!empty($showImportButton) && getDolGlobalString('MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES')) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
} ?>
</td>
<td class="linkedcol-name tdoverflowmax150"><?php echo $objectlink->getNomUrl(1); ?></td>
<td class="linkedcol-ref center"><?php echo $objectlink->ref_client; ?></td>
<td class="linkedcol-ref center"><?php echo $objectlink->track_id; ?></td>
<td class="linkedcol-date center"><?php echo dol_print_date($objectlink->datec, 'day'); ?></td>
<?php
//$objectlink->socid = $objectlink->fk_soc;