diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 12716027f63..1562b4578fb 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -8,8 +8,8 @@ * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018-2025 Frédéric France - * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2019 Ferran Marcet + * Copyright (C) 2024-2025 MDW * * 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 @@ -1962,7 +1962,7 @@ if ($id > 0 && $action != 'create') { $object->datep = $datep; $object->datef = $datef; $object->percentage = $percentage; - $object->priority = GETPOST("priority", "alphanohtml"); + $object->priority = GETPOSTINT("priority"); $object->fulldayevent = GETPOST("fullday") ? 1 : 0; $object->location = GETPOST('location', "alphanohtml"); $object->socid = GETPOSTINT("socid"); diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php index 158fd504d0b..014501169ed 100644 --- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php @@ -1,8 +1,8 @@ - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2014 Marcos García - * Copyright (C) 2024 MDW +/* Copyright (C) 2010-2011 Regis Houssin + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2014 Marcos García + * Copyright (C) 2024 MDW * Copyright (C) 2025 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -38,13 +38,18 @@ global $user; $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; +/** + * @var Translate $langs + * @var CommonObject $object + */ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; // Load translation files required by the page $langs->load("propal"); $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 Propal[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) +/** @var Propal[] $linkedObjectBlock */ $total = 0; $ilink = 0; @@ -63,7 +68,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { } print ''; print ''.$objectlink->getNomUrl(1).''; - print ''.$objectlink->ref_client.''; + print ''.$objectlink->ref_customer.''; print ''.dol_print_date($objectlink->date, 'day').''; print ''; if ($user->hasRight('propal', 'lire')) { diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php index ad8e85c9095..769096e93cc 100644 --- a/htdocs/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php @@ -32,7 +32,10 @@ global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; -/** @var Translate $langs */ +/** + * @var Translate $langs + * @var CommonObject $object + */ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; /** @var Commande[] $linkedObjectBlock */ diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index ef2a8901a32..071c2520a74 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -2,7 +2,8 @@ /* Copyright (C) 2010-2011 Regis Houssin * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2014 Marcos García - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2025 MDW + * Copyright (C) 2025 Frédéric France * * 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,11 +32,14 @@ global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; + global $linkedObjectBlock; $langs->load("bills"); $linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1); +'@phan-var-force Facture[] $linkedObjectBlock'; +/** @var Facture[] $linkedObjectBlock */ $total = 0; $ilink = 0; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index d9e66b48161..845b338430f 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -447,7 +447,7 @@ if (empty($reshook)) { $object->phone_perso = (string) GETPOST("phone_perso", 'alpha'); $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); $object->fax = (string) GETPOST("fax", 'alpha'); - $object->priv = (string) GETPOSTINT("priv"); + $object->priv = GETPOSTINT("priv"); $object->note_public = (string) GETPOST("note_public", 'restricthtml'); $object->note_private = (string) GETPOST("note_private", 'restricthtml'); diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php index 329e1859caa..bcf62aa2380 100644 --- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php +++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2011 Regis Houssin * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2024 MDW + * Copyright (C) 2025 Frédéric France * * 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,7 +34,8 @@ global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; -'@phan-var-force CommonObject[] $linkedObjectBlock'; +'@phan-var-force Contrat[] $linkedObjectBlock'; +/** @var Contrat[] $linkedObjectBlock */ // Load translation files required by the page $langs->load("contracts"); diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index f5a087aec07..240d05242fb 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -34,7 +34,7 @@ * @var Conf $conf * @var Translate $langs * @var User $user - * @var CommonObject $object + * @var CommonObject|Societe $object * * @var string $action * @var int $id @@ -50,6 +50,7 @@ */ ' @phan-var-force ?array $moreparams +@phan-var-force CommonObject|Societe $object '; if (!empty($permissioncreate) && empty($permissiontoadd)) { @@ -87,7 +88,7 @@ if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc))) if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($object->thirdparty->default_lang)) { $newlang = $object->thirdparty->default_lang; // for proposal, order, invoice, ... } - if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($object->default_lang)) { + if (getDolGlobalInt('MAIN_MULTILANGS') && property_exists($object, 'default_lang') && empty($newlang) && isset($object->default_lang)) { $newlang = $object->default_lang; // for thirdparty } if (!empty($newlang)) { diff --git a/htdocs/core/actions_fetchobject.inc.php b/htdocs/core/actions_fetchobject.inc.php index 85573c4da5e..7e82d86d644 100644 --- a/htdocs/core/actions_fetchobject.inc.php +++ b/htdocs/core/actions_fetchobject.inc.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015-2024 Frédéric France +/* Copyright (C) 2014-2017 Laurent Destailleur + * Copyright (C) 2015-2025 Frédéric France * * 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 @@ -27,10 +27,18 @@ // $object must be defined (object is loaded in this file with fetch) // $cancel must be defined // $id or $ref must be defined (object is loaded in this file with fetch) +/** + * @var CommonObject $object + * @var string $action + * @var string $cancel + * @var string $ref + */ if (((!empty($id) && $id > 0) || (!empty($ref) && !in_array($action, array('create', 'createtask', 'add')))) && (empty($cancel) || $id > 0)) { if (($id > 0 && is_numeric($id)) || !empty($ref)) { // To discard case when id is list of ids like '1,2,3...' if ($object->element == 'usergroup') { + /** @var UserGroup $object */ + '@phan-var-force UserGroup $object'; $ret = $object->fetch($id, (empty($ref) ? '' : $ref), true); // to load $object->members } else { $ret = $object->fetch($id, (empty($ref) ? '' : $ref)); diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 571e3ae5900..d4f3501881d 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2687,7 +2687,7 @@ class ExtraFields * @param int $todefaultifmissing 1=Set value to the default value in database if value is mandatory and missing * @return int 1 if array_options set, 0 if no value, -1 if error (field required missing for example) */ - public function setOptionalsFromPost($extralabels, &$object, $onlykey = '', $todefaultifmissing = 0) + public function setOptionalsFromPost($extralabels, $object, $onlykey = '', $todefaultifmissing = 0) { global $langs; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index f9696217a38..ef18bab7f6f 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2015-2016 Marcos García - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2022 OpenDSI @@ -30,7 +30,7 @@ /** * @var Conf $conf - * @var CommonObject $this + * @var CommonObject|Facture $this * @var CommonObject $object * @var CommonObjectLine $line * @var ExtraFields $extrafields @@ -56,7 +56,7 @@ if (empty($object) || !is_object($object)) { } ' -@phan-var-force CommonObject $this +@phan-var-force CommonObject|Facture $this @phan-var-force CommonObject $object @phan-var-force Societe $buyer @phan-var-force Societe $seller @@ -159,7 +159,7 @@ if ($nolinesbefore) { trans('ReductionShort'); ?> situation_cycle_ref) && $this->situation_cycle_ref) { + if (property_exists($this, 'situation_cycle_ref') && isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { print ''.$langs->trans('Progress').''; if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { print ''; diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index bf34c7b2a30..c4e536b5194 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry - * Copyright (C) 2018-2025 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 OpenDSI * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 1f62e804b9b..6c5a1955f63 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -7,7 +7,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Juanjo Menent * Copyright (C) 2022 OpenDSI - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -36,7 +36,7 @@ */ /** - * @var CommonObject $this + * @var CommonObject|Facture $this * @var CommonObject $object * @var CommonObjectLine $line * @var Form $form @@ -52,7 +52,7 @@ if (empty($object) || !is_object($object)) { exit(1); } -'@phan-var-force CommonObject $this +'@phan-var-force CommonObject|Facture $this @phan-var-force CommonObject $object'; print "\n"; @@ -159,7 +159,7 @@ if (in_array($object->element, array('propal', 'commande', 'facture')) && $objec print ''; // Fields for situation invoice -if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { +if (property_exists($this, 'situation_cycle_ref') && isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { print ''.$langs->trans('CumulativeProgression').''; if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { print '' . $langs->trans('SituationInvoiceProgressCurrent') . ''; diff --git a/htdocs/core/tpl/subtotal_edit.tpl.php b/htdocs/core/tpl/subtotal_edit.tpl.php index 7664be611bd..eb26ae01eae 100644 --- a/htdocs/core/tpl/subtotal_edit.tpl.php +++ b/htdocs/core/tpl/subtotal_edit.tpl.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 diff --git a/htdocs/core/tpl/subtotal_view.tpl.php b/htdocs/core/tpl/subtotal_view.tpl.php index cf1fe6fd56e..f1015ebcba7 100644 --- a/htdocs/core/tpl/subtotal_view.tpl.php +++ b/htdocs/core/tpl/subtotal_view.tpl.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -19,9 +19,9 @@ */ /** - * @var CommonObject $object - * @var CommonObject $this - * @var CommonObjectLine $line + * @var Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal $object + * @var Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal $this + * @var CommonObjectLine|CommonInvoiceLine|CommonOrderLine|ExpeditionLigne|PropaleLigne $line * @var Conf $conf * @var Form $form * @var Societe $mysoc @@ -35,8 +35,8 @@ ' @phan-var-force CommonObjectLine|CommonInvoiceLine|CommonOrderLine|ExpeditionLigne|PropaleLigne $line -@phan-var-force CommonObject $this -@phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|FactureFournisseur|FactureFournisseur|SupplierProposal $object +@phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal $this +@phan-var-force Propal|Contrat|Commande|Facture|Expedition|Delivery|CommandeFournisseur|FactureFournisseur|SupplierProposal $object @phan-var-force int $num '; @@ -138,7 +138,7 @@ if ($line->qty > 0) { ?> situation_cycle_ref) && $this->situation_cycle_ref) { + if (property_exists($this, 'situation_cycle_ref') && isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { print ''; if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { print ''; @@ -167,7 +167,7 @@ if ($line->qty > 0) { ?> // Base colspan if there is no module activated to display line correctly $colspan = 3; - if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { + if (property_exists($this, 'situation_cycle_ref') && isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { $colspan += 2; if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { $colspan += 1; @@ -253,7 +253,7 @@ if ($this->status == 0) { echo ' '; // Move up-down picto - if ($num > 1 && $conf->browser->layout != 'phone' && ((property_exists($this, 'situation_counter') && $this->situation_counter == 1) || empty($this->situation_cycle_ref)) && empty($disablemove)) { + if ($num > 1 && $conf->browser->layout != 'phone' && ((property_exists($this, 'situation_counter') && $this->situation_counter == 1) || (property_exists($this, 'situation_cycle_ref') && empty($this->situation_cycle_ref))) && empty($disablemove)) { echo ' * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 Quentin VIAL--GOUTEYRON * * This program is free software: you can redistribute it and/or modify diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index 5bb559be948..c3340557fc2 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024 William Mead * Copyright (C) 2024 MDW * Copyright (C) 2025 Quentin VIAL--GOUTEYRON diff --git a/htdocs/don/tpl/linkedobjectblock.tpl.php b/htdocs/don/tpl/linkedobjectblock.tpl.php index 9bb0df0bd19..cd9c7c2c768 100644 --- a/htdocs/don/tpl/linkedobjectblock.tpl.php +++ b/htdocs/don/tpl/linkedobjectblock.tpl.php @@ -1,9 +1,10 @@ - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2014 Marcos García - * Copyright (C) 2017 Charlene Benke - * Copyright (C) 2024-2025 MDW +/* Copyright (C) 2010-2011 Regis Houssin + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2014 Marcos García + * Copyright (C) 2017 Charlene Benke + * Copyright (C) 2024-2025 MDW + * Copyright (C) 2025 Frédéric France * * 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,14 +27,18 @@ global $user; global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; +'@phan-var-force Translate $langs'; +/** @var Translate $langs */ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; - +'@phan-var-force Don[] $linkedObjectBlock'; +/** @var Don[] $linkedObjectBlock */ $langs->load("donations"); $total = 0; $ilink = 0; $lastObjectLink = null; foreach ($linkedObjectBlock as $key => $objectlink) { + '@phan-var-force Don $objectlink'; $ilink++; $trclass = 'oddeven'; @@ -43,7 +48,8 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print ''; print ''.$langs->trans("Donation").''; print ''.$objectlink->getNomUrl(1).''; - print ''.$objectlink->ref_client.''; + // print ''.$objectlink->ref_client.''; // ref_client doesn't exists + print ''; print ''.dol_print_date($objectlink->date, 'day').''; print ''; $total += $objectlink->total_ht; diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php index 0114fbb6dd1..566114ee755 100644 --- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php +++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php @@ -1,7 +1,8 @@ * Copyright (C) 2014 Marcos García - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Frédéric France * * 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,8 +32,10 @@ global $user; $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; +/** @var Translate $langs */ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; -'@phan-var-force CommonObject[] $linkedObjectBlock'; +'@phan-var-force Expedition[] $linkedObjectBlock'; +/** @var Expedition[] $linkedObjectBlock */ // Load translation files required by the page $langs->load("sendings"); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 3abb7913548..da5dad6bce5 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -298,9 +298,10 @@ class CommandeFournisseur extends CommonOrder public $line; /** - * @var CommonObject Add for supplier_proposal + * @var CommonObject|string|null Add for supplier_proposal */ public $origin; + /** * @var int */ diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 4b94de2eeef..b50586ff11a 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1340,10 +1340,11 @@ if (empty($reshook)) { } $object->origin = $origin; + $object->origin_type = $origin; $object->origin_id = $originid; // Possibility to add external linked objects with hooks - $object->linked_objects[$object->origin] = $object->origin_id; + $object->linked_objects[$object->origin_type] = $object->origin_id; $other_linked_objects = GETPOST('other_linked_objects', 'array'); if (!empty($other_linked_objects)) { $object->linked_objects = array_merge($object->linked_objects, $other_linked_objects); @@ -1355,7 +1356,7 @@ if (empty($reshook)) { $srcobject = new $classname($db); - dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines"); + dol_syslog("Try to find source object origin=".$object->origin_type." originid=".$object->origin_id." to add lines"); $result = $srcobject->fetch($object->origin_id); if ($result > 0) { $tmpdate = $srcobject->delivery_date; diff --git a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php index bcbcda04656..1f7c3df8bd4 100644 --- a/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/commande/tpl/linkedobjectblock.tpl.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010-2011 Regis Houssin * Copyright (C) 2014 Marcos García * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -35,8 +35,8 @@ $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; /** @var Translate $langs */ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; -'@phan-var-force CommonObject[] $linkedObjectBlock'; -/** @var CommonObject[] $linkedObjectBlock */ +'@phan-var-force CommandeFournisseur[] $linkedObjectBlock'; +/** @var CommandeFournisseur[] $linkedObjectBlock */ $langs->load("orders"); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 834fc395679..d7fe7c4e760 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1141,7 +1141,8 @@ if (empty($reshook)) { if ($element == 'project') { $element = 'projet'; } - $object->origin = GETPOST('origin', 'alpha'); + $object->origin_type = GETPOST('origin', 'alpha'); + $object->origin = $object->origin_type; $object->origin_id = GETPOSTINT('originid'); @@ -1154,12 +1155,12 @@ if (empty($reshook)) { $objectsrc->fetch($originid); $objectsrc->fetch_thirdparty(); - if (!empty($object->origin) && !empty($object->origin_id)) { - $object->linkedObjectsIds[$object->origin] = $object->origin_id; + if (!empty($object->origin_type) && !empty($object->origin_id)) { + $object->linkedObjectsIds[$object->origin_type] = $object->origin_id; } // Add also link with order if object is reception - if ($object->origin == 'reception') { + if ($object->origin_type == 'reception') { $objectsrc->fetchObjectLinked(); if (count($objectsrc->linkedObjectsIds['order_supplier']) > 0) { @@ -1285,7 +1286,7 @@ if (empty($reshook)) { 0, array(), // array_options null, - $object->origin, + $object->origin_type, 0, '', 0, // special_code diff --git a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php index 95ab5f22e01..3a2f27b6847 100644 --- a/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php @@ -1,9 +1,10 @@ - * Copyright (C) 2014 Marcos García - * Copyright (C) 2015 Charlie Benke - * Copyright (C) 2016 Laurent Destailleur - * Copyright (C) 2024 MDW +/* Copyright (C) 2010-2011 Regis Houssin + * Copyright (C) 2014 Marcos García + * Copyright (C) 2015 Charlie Benke + * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Frédéric France * * 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 @@ -35,9 +36,8 @@ global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; -' -@phan-var-force array $linkedObjectBlock -'; +'@phan-var-force FactureFournisseur[] $linkedObjectBlock'; +/** @var FactureFournisseur[] $linkedObjectBlock */ $langs->load("bills"); diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 87a5d8886ab..2eeb14b3141 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2017-2024 Alexandre Spangaro * Copyright (C) 2014-2017 Ferran Marcet - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2020-2021 Udo Tamm * Copyright (C) 2022 Anthony Berton * Copyright (C) 2024 Charlene Benke @@ -189,7 +189,7 @@ if (empty($reshook)) { $date_fin_gmt = GETPOSTDATE('date_fin_', '00:00:00', 1); $starthalfday = GETPOST('starthalfday'); $endhalfday = GETPOST('endhalfday'); - $type = GETPOST('type'); + $type = GETPOSTINT('type'); $halfday = 0; if ($starthalfday == 'afternoon' && $endhalfday == 'morning') { $halfday = 2; diff --git a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php index 009d9876cb2..b8120d6657f 100644 --- a/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php +++ b/htdocs/modulebuilder/template/core/tpl/linkedobjectblock_myobject.tpl.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) ---Replace with your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify @@ -19,8 +19,8 @@ */ /** + * @var ?Conf $conf * @var CommonObject $object - * @var Translate $langs * @var User $user */ // Protection to avoid direct call of template @@ -38,8 +38,10 @@ global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; +/** @var Translate $langs */ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; -'@phan-var-force array $linkedObjectBlock'; +'@phan-var-force MyObject[] $linkedObjectBlock'; +/** @var MyObject[] $linkedObjectBlock */ // Load translation files required by the page $langs->load("mymodule"); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index b2c5fb613b2..31837c787d3 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -16,7 +16,7 @@ * Copyright (C) 2016-2022 Charlene Benke * Copyright (C) 2016 Meziane Sof * Copyright (C) 2017 Josep Lluís Amador - * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2019-2025 Frédéric France * Copyright (C) 2019-2020 Thibault FOUCART * Copyright (C) 2020 Pierre Ardoin * Copyright (C) 2022 Vincent de Grandpré @@ -120,7 +120,7 @@ $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $socid = GETPOSTINT('socid'); -$duration_value = GETPOST('duration_value'); // duration value can be an empty string +$duration_value = GETPOST('duration_value') === '' ? null : GETPOSTINT('duration_value'); // duration value can be an empty string $duration_unit = GETPOST('duration_unit', 'alpha'); $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); @@ -151,6 +151,7 @@ if (substr($module, 0, 16) == 'mod_codeproduct_' && substr($module, -3) == 'php' $result = dol_include_once('/core/modules/product/'.$module.'.php'); if ($result > 0) { $modCodeProduct = new $module(); + /** @var ModeleProductCode $modCodeProduct */ } $object = new Product($db); @@ -549,11 +550,11 @@ if (empty($reshook)) { if (!$error) { $units = GETPOSTINT('units'); - $object->entity = $conf->entity; - $object->ref = (string) $ref; - $object->label = GETPOST('label', $label_security_check); - $object->price_base_type = GETPOST('price_base_type', 'aZ09'); - $object->mandatory_period = empty(GETPOST("mandatoryperiod", 'alpha')) ? 0 : 1; + $object->entity = $conf->entity; + $object->ref = (string) $ref; + $object->label = GETPOST('label', $label_security_check); + $object->price_base_type = GETPOST('price_base_type', 'aZ09'); + $object->mandatory_period = empty(GETPOST("mandatoryperiod", 'alpha')) ? 0 : 1; if ($object->price_base_type == 'TTC') { $object->price_ttc = GETPOSTFLOAT('price'); } else { @@ -606,8 +607,8 @@ if (empty($reshook)) { $object->localtax1_type = $localtax1_type; $object->localtax2_type = $localtax2_type; - $object->type = $type; - $object->status = GETPOSTINT('statut'); + $object->type = $type; + $object->status = GETPOSTINT('statut'); $object->status_buy = GETPOSTINT('statut_buy'); $object->status_batch = GETPOSTINT('status_batch'); $object->sell_or_eat_by_mandatory = GETPOSTINT('sell_or_eat_by_mandatory'); @@ -625,38 +626,38 @@ if (empty($reshook)) { $mesg = 'Failed to get bar code type information '; setEventMessages($mesg.$stdobject->error, $stdobject->errors, 'errors'); } - $object->barcode_type_code = $stdobject->barcode_type_code; - $object->barcode_type_coder = $stdobject->barcode_type_coder; - $object->barcode_type_label = $stdobject->barcode_type_label; + $object->barcode_type_code = $stdobject->barcode_type_code; + $object->barcode_type_coder = $stdobject->barcode_type_coder; + $object->barcode_type_label = $stdobject->barcode_type_label; - $object->description = dol_htmlcleanlastbr(GETPOST('desc', 'restricthtml')); + $object->description = dol_htmlcleanlastbr(GETPOST('desc', 'restricthtml')); $object->url = GETPOST('url'); - $object->note_private = dol_htmlcleanlastbr(GETPOST('note_private', 'restricthtml')); - $object->note = $object->note_private; // deprecated - $object->customcode = GETPOST('customcode', 'alphanohtml'); + $object->note_private = dol_htmlcleanlastbr(GETPOST('note_private', 'restricthtml')); + $object->note = $object->note_private; // deprecated + $object->customcode = GETPOST('customcode', 'alphanohtml'); $object->country_id = GETPOSTINT('country_id'); $object->state_id = GETPOSTINT('state_id'); - $object->lifetime = GETPOSTINT('lifetime'); - $object->qc_frequency = GETPOSTINT('qc_frequency'); - $object->duration_value = $duration_value; - $object->duration_unit = $duration_unit; - $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); - $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); - $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte') ? GETPOST('seuil_stock_alerte') : 0; - $object->desiredstock = GETPOST('desiredstock') ? GETPOST('desiredstock') : 0; - $object->canvas = GETPOST('canvas'); - $object->net_measure = GETPOST('net_measure'); - $object->net_measure_units = GETPOST('net_measure_units') === '' ? null : GETPOSTINT('net_measure_units'); // This is not the fk_unit but the power of unit - $object->weight = GETPOST('weight'); - $object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit - $object->length = GETPOST('size'); - $object->length_units = GETPOST('size_units'); // This is not the fk_unit but the power of unit + $object->lifetime = GETPOSTINT('lifetime'); + $object->qc_frequency = GETPOSTINT('qc_frequency'); + $object->duration_value = $duration_value; + $object->duration_unit = $duration_unit; + $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); + $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); + $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte') ? GETPOST('seuil_stock_alerte') : 0; + $object->desiredstock = GETPOST('desiredstock') ? GETPOST('desiredstock') : 0; + $object->canvas = GETPOST('canvas'); + $object->net_measure = GETPOST('net_measure'); + $object->net_measure_units = GETPOST('net_measure_units') === '' ? null : GETPOSTINT('net_measure_units'); // This is not the fk_unit but the power of unit + $object->weight = GETPOST('weight'); + $object->weight_units = GETPOST('weight_units') === '' ? null : GETPOSTINT('weight_units'); // This is not the fk_unit but the power of unit + $object->length = GETPOST('size'); + $object->length_units = GETPOST('size_units') === '' ? null : GETPOSTINT('size_units'); // This is not the fk_unit but the power of unit $object->width = GETPOST('sizewidth'); - $object->height = GETPOST('sizeheight'); - $object->surface = GETPOST('surface'); - $object->surface_units = GETPOST('surface_units'); // This is not the fk_unit but the power of unit - $object->volume = GETPOST('volume'); - $object->volume_units = GETPOST('volume_units'); // This is not the fk_unit but the power of unit + $object->height = GETPOST('sizeheight'); + $object->surface = GETPOST('surface'); + $object->surface_units = GETPOST('surface_units') === '' ? null : GETPOSTINT('surface_units'); // This is not the fk_unit but the power of unit + $object->volume = GETPOST('volume'); + $object->volume_units = GETPOST('volume_units') === '' ? null : GETPOSTINT('volume_units'); // This is not the fk_unit but the power of unit $finished = GETPOSTINT('finished'); if ($finished >= 0) { $object->finished = $finished; @@ -719,7 +720,7 @@ if (empty($reshook)) { $object->multiprices["$i"] = (float) price2num(GETPOST("price_".$i), 'MU'); $object->multiprices_base_type["$i"] = GETPOST("multiprices_base_type_".$i); } else { - $object->multiprices["$i"] = ""; + $object->multiprices["$i"] = 0; } } } @@ -733,6 +734,7 @@ if (empty($reshook)) { if (!$ref && getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) { // Generate ref... '@phan-var ModeleProductCode $modCodeProduct'; + /** @var ModeleProductCode $modCodeProduct */ $ref = $modCodeProduct->getNextValue($object, $type); } @@ -794,50 +796,50 @@ if (empty($reshook)) { if (!getDolGlobalString('PRODUCT_GENERATE_REF_AFTER_FORM')) { $object->ref = (string) $ref; } - $object->label = GETPOST('label', $label_security_check); + $object->label = GETPOST('label', $label_security_check); $desc = dol_htmlcleanlastbr(preg_replace('/ $/', '', GETPOST('desc', 'restricthtml'))); - $object->description = $desc; + $object->description = $desc; $object->url = GETPOST('url'); if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) { $object->note_private = dol_htmlcleanlastbr(GETPOST('note_private', 'restricthtml')); $object->note = $object->note_private; } - $object->customcode = GETPOST('customcode', 'alpha'); + $object->customcode = GETPOST('customcode', 'alpha'); $object->country_id = GETPOSTINT('country_id'); $object->state_id = GETPOSTINT('state_id'); - $object->lifetime = GETPOSTINT('lifetime'); - $object->qc_frequency = GETPOSTINT('qc_frequency'); - $object->status = GETPOSTINT('statut'); - $object->status_buy = GETPOSTINT('statut_buy'); + $object->lifetime = GETPOSTINT('lifetime'); + $object->qc_frequency = GETPOSTINT('qc_frequency'); + $object->status = GETPOSTINT('statut'); + $object->status_buy = GETPOSTINT('statut_buy'); $object->status_batch = GETPOSTINT('status_batch'); $object->sell_or_eat_by_mandatory = GETPOSTINT('sell_or_eat_by_mandatory'); $object->batch_mask = GETPOST('batch_mask', 'alpha'); - $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); - $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); + $object->fk_default_warehouse = GETPOSTINT('fk_default_warehouse'); + $object->fk_default_workstation = GETPOSTINT('fk_default_workstation'); // removed from update view so GETPOST always empty /* - $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte'); - $object->desiredstock = GETPOST('desiredstock'); + $object->seuil_stock_alerte = GETPOST('seuil_stock_alerte'); + $object->desiredstock = GETPOST('desiredstock'); */ - $object->duration_value = GETPOST('duration_value'); - $object->duration_unit = GETPOST('duration_unit', 'alpha'); + $object->duration_value = $duration_value; + $object->duration_unit = $duration_unit; - $object->canvas = GETPOST('canvas'); - $object->net_measure = GETPOST('net_measure'); - $object->net_measure_units = GETPOST('net_measure_units') === '' ? null : GETPOSTINT('net_measure_units'); // This is not the fk_unit but the power of unit - $object->weight = GETPOST('weight'); - $object->weight_units = GETPOST('weight_units'); // This is not the fk_unit but the power of unit - $object->length = GETPOST('size'); - $object->length_units = GETPOST('size_units'); // This is not the fk_unit but the power of unit + $object->canvas = GETPOST('canvas'); + $object->net_measure = GETPOST('net_measure'); + $object->net_measure_units = GETPOST('net_measure_units') === '' ? null : GETPOSTINT('net_measure_units'); // This is not the fk_unit but the power of unit + $object->weight = GETPOST('weight'); + $object->weight_units = GETPOST('weight_units') === '' ? null : GETPOSTINT('weight_units'); // This is not the fk_unit but the power of unit + $object->length = GETPOST('size'); + $object->length_units = GETPOST('size_units') === '' ? null : GETPOSTINT('size_units'); // This is not the fk_unit but the power of unit $object->width = GETPOST('sizewidth'); $object->height = GETPOST('sizeheight'); - $object->surface = GETPOST('surface'); - $object->surface_units = GETPOST('surface_units'); // This is not the fk_unit but the power of unit - $object->volume = GETPOST('volume'); - $object->volume_units = GETPOST('volume_units'); // This is not the fk_unit but the power of unit + $object->surface = GETPOST('surface'); + $object->surface_units = GETPOST('surface_units') === '' ? null : GETPOSTINT('surface_units'); // This is not the fk_unit but the power of unit + $object->volume = GETPOST('volume'); + $object->volume_units = GETPOST('volume_units') === '' ? null : GETPOSTINT('volume_units'); // This is not the fk_unit but the power of unit $finished = GETPOSTINT('finished'); if ($finished >= 0) { @@ -854,8 +856,8 @@ if (empty($reshook)) { } // managed_in_stock - $object->stockable_product = (int) GETPOSTISSET('stockable_product'); - if ($object->status_batch > 0 && $object->stockable_product == 0 && isModEnabled('stock') && isModEnabled('productbatch')) { + $object->stockable_product = (int) GETPOSTISSET('stockable_product'); + if ($object->status_batch > 0 && $object->stockable_product == 0 && isModEnabled('stock') && isModEnabled('productbatch')) { $object->stockable_product = 1; setEventMessages($langs->trans('ForceBatchesNeedStockManagement'), null, 'warnings'); } @@ -879,9 +881,9 @@ if (empty($reshook)) { $mesg = 'Failed to get bar code type information '; setEventMessages($mesg.$stdobject->error, $stdobject->errors, 'errors'); } - $object->barcode_type_code = $stdobject->barcode_type_code; - $object->barcode_type_coder = $stdobject->barcode_type_coder; - $object->barcode_type_label = $stdobject->barcode_type_label; + $object->barcode_type_code = $stdobject->barcode_type_code; + $object->barcode_type_coder = $stdobject->barcode_type_coder; + $object->barcode_type_label = $stdobject->barcode_type_label; $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); $accountancy_code_sell_intra = GETPOST('accountancy_code_sell_intra', 'alpha'); @@ -1457,6 +1459,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $result = dol_include_once('/core/modules/product/'.$module.'.php'); if ($result > 0) { $modCodeProduct = new $module(); + /** @var ModeleProductCode $modCodeProduct */ } dol_set_focus('input[name="ref"]'); @@ -1504,6 +1507,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''; $tmpcode = ''; if (!empty($modCodeProduct->code_auto)) { + /** @var ModeleProductCode $modCodeProduct */ $tmpcode = $modCodeProduct->getNextValue($object, $type); } print ''.$langs->trans("ProductRef").''; @@ -3027,6 +3031,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio $tmpcode = ''; if (!empty($modCodeProduct->code_auto)) { + /** @var ModeleProductCode $modCodeProduct */ $tmpcode = $modCodeProduct->getNextValue($object, $object->type); } diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index c4570804ad9..5a707ac4095 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2016 Francis Appels * Copyright (C) 2021 Noé Cendrier - * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2021-2025 Frédéric France * Copyright (C) 2022-2023 Charlene Benke * Copyright (C) 2023 Christian Foellmann * Copyright (C) 2024-2025 MDW @@ -216,15 +216,15 @@ if (empty($reshook)) { if ($action == 'update' && !$cancel && $user->hasRight('stock', 'creer')) { if ($object->fetch($id)) { $object->label = GETPOST("libelle"); - $object->fk_parent = GETPOST("fk_parent"); + $object->fk_parent = GETPOSTINT("fk_parent"); $object->fk_project = GETPOSTINT('projectid'); $object->description = GETPOST("desc", 'restricthtml'); - $object->statut = GETPOST("statut"); - $object->lieu = GETPOST("lieu"); - $object->address = GETPOST("address"); - $object->zip = GETPOST("zipcode"); - $object->town = GETPOST("town"); - $object->country_id = GETPOSTINT("country_id"); + $object->statut = GETPOSTINT("statut"); + $object->lieu = GETPOST("lieu"); + $object->address = GETPOST("address"); + $object->zip = GETPOST("zipcode"); + $object->town = GETPOST("town"); + $object->country_id = GETPOSTINT("country_id"); $object->phone = GETPOST("phone"); $object->fax = GETPOST("fax"); diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 7e524d39d3f..db3f4164bf6 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1983,7 +1983,7 @@ if ($action == 'create') { $htmltooltip .= '
'; } $reception_static->fetch($receptionline_var['reception_id']); - $htmltooltip .= $reception_static->getNomUrl(1, 0, 0, 0, 1); + $htmltooltip .= $reception_static->getNomUrl(1, '', 0, 0, 1); $htmltooltip .= ' - '.$receptionline_var['qty']; $htmltext = $langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($receptionline_var['date_valid'], 'dayhour')); diff --git a/htdocs/reception/tpl/linkedobjectblock.tpl.php b/htdocs/reception/tpl/linkedobjectblock.tpl.php index 47152bcea53..fd54ae21845 100644 --- a/htdocs/reception/tpl/linkedobjectblock.tpl.php +++ b/htdocs/reception/tpl/linkedobjectblock.tpl.php @@ -36,14 +36,20 @@ global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; +/** + * @var Translate $langs + * @var CommonObject $object + */ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; -'@phan-var-force CommonObject[] $linkedObjectBlock'; +'@phan-var-force Reception[] $linkedObjectBlock'; +/** @var Reception[] $linkedObjectBlock */ // Load translation files required by the page $langs->load("receptions"); $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 Reception[] $linkedObjectBlock'; // Repeat because type lost after dol_sort_array) +/** @var Reception[] $linkedObjectBlock */ $total = 0; $ilink = 0; diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index c6a0b16d98e..3647bde1f6a 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -1,8 +1,8 @@ - * Copyright (C) 2016 Gilles Poirier - * Copyright (C) 2019 Josep Lluís Amador - * Copyright (C) 2021-2024 Frédéric France +/* Copyright (C) 2013-2018 Jean-François Ferry + * Copyright (C) 2016 Gilles Poirier + * Copyright (C) 2019 Josep Lluís Amador + * Copyright (C) 2021-2025 Frédéric France * Copyright (C) 2023 William Mead * Copyright (C) 2024-2025 MDW * @@ -52,9 +52,9 @@ if (isModEnabled("product") || isModEnabled("service")) { $langs->loadLangs(array('resource', 'other', 'interventions')); /* -$sortorder = GETPOST('sortorder','alpha'); -$sortfield = GETPOST('sortfield','alpha'); -$page = GETPOST('page','int'); +$sortorder = GETPOST('sortorder','alpha'); +$sortfield = GETPOST('sortfield','alpha'); +$page = GETPOST('page','int'); */ $object = new Dolresource($db); @@ -145,7 +145,7 @@ if (empty($reshook)) { if ($isFullDayEvent) { $eventDateStartArr = dol_getdate($eventDateStart); $eventDateStart = dol_mktime(0, 0, 0, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); - $eventDateEnd = dol_mktime(23, 59, 59, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); + $eventDateEnd = dol_mktime(23, 59, 59, $eventDateStartArr['mon'], $eventDateStartArr['mday'], $eventDateStartArr['year']); } } diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php index cfd49012948..090dc40cb77 100644 --- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php +++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php @@ -1,8 +1,9 @@ - * Copyright (C) 2013 Juanjo Menent - * Copyright (C) 2014 Marcos García - * Copyright (C) 2024 MDW +/* Copyright (C) 2010-2011 Regis Houssin + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2014 Marcos García + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Frédéric France * * 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 @@ -29,11 +30,13 @@ print "\n"; global $user; - +/** @var User $user */ $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; +/** '@var Translate $langs */ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; -'@phan-var-force CommonObject[] $linkedObjectBlock'; +'@phan-var-force SupplierProposal[] $linkedObjectBlock'; +/** @var SupplierProposal[] $linkedObjectBlock */ $total = 0; $ilink = 0; @@ -48,7 +51,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) { trans("SupplierProposal"); ?> trans("ShowSupplierProposal"), "supplier_proposal").' '.$objectlink->ref; ?> - datec, 'day'); ?> + date_creation, 'day'); ?> hasRight('supplier_proposal', 'lire')) { $total += $objectlink->total_ht; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 486a02f4f99..80e89f1e902 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -4,7 +4,7 @@ * Copyright (C) 2021 Nicolas ZABOURI * Copyright (C) 2022-2023 Christophe Battarel * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -1666,7 +1666,7 @@ $( document ).ready(function() { $result = $adh->fetch(0, '', $invoice->socid); if ($result > 0) { $adh->ref = $adh->getFullName($langs); - if (empty($adh->statut) || $adh->statut == Adherent::STATUS_EXCLUDED) { + if (empty($adh->status) || $adh->status == Adherent::STATUS_EXCLUDED) { $s .= ""; } $s .= $adh->getFullName($langs); @@ -1678,11 +1678,11 @@ $( document ).ready(function() { } } else { $s .= '
'.$langs->trans("SubscriptionNotReceived"); - if ($adh->statut > 0) { + if ($adh->status > 0) { $s .= " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated } } - if (empty($adh->statut) || $adh->statut == Adherent::STATUS_EXCLUDED) { + if (empty($adh->status) || $adh->status == Adherent::STATUS_EXCLUDED) { $s .= "
"; } } else { @@ -1872,6 +1872,8 @@ if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { $catid = GETPOSTINT('catid'); $result = $object->fetch($catid); $prods = $object->getObjectsInCateg("product"); + /** @var Product[] $prods */ + '@phan-var-force Product[] $prods'; $htmlforlines = ''; foreach ($prods as $row) { if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { diff --git a/htdocs/takepos/public/menu.php b/htdocs/takepos/public/menu.php index b346b64e07b..a83f7fccc98 100644 --- a/htdocs/takepos/public/menu.php +++ b/htdocs/takepos/public/menu.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2020 Andreu Bisquerra Gaya + * Copyright (C) 2024-2025 Frédéric France * * 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 diff --git a/htdocs/ticket/tpl/linkedobjectblock.tpl.php b/htdocs/ticket/tpl/linkedobjectblock.tpl.php index 8ba2d58a586..c86c7bec5aa 100644 --- a/htdocs/ticket/tpl/linkedobjectblock.tpl.php +++ b/htdocs/ticket/tpl/linkedobjectblock.tpl.php @@ -1,7 +1,8 @@ - * Copyright (C) 2013 Jean-François FERRY - * Copyright (C) 2024 MDW +/* Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2013 Jean-François FERRY + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Frédéric France * * 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 @@ -30,8 +31,13 @@ global $noMoreLinkedObjectBlockAfter; $langs = $GLOBALS['langs']; '@phan-var-force Translate $langs'; +/** + * @var Translate $langs + * @var CommonObject $object + */ $linkedObjectBlock = $GLOBALS['linkedObjectBlock']; '@phan-var-force Ticket[] $linkedObjectBlock'; +/** @var Ticket[] $linkedObjectBlock */ // Load translation files required by the page $langs->load('ticket');