';
$coldisplay++;
- if (!empty($product_static->accountancy_code_buy) ||
- !empty($product_static->accountancy_code_buy_intra) ||
- !empty($product_static->accountancy_code_buy_export)
+ if (
+ $product_static !== null
+ &&
+ (
+ !empty($product_static->accountancy_code_buy) ||
+ !empty($product_static->accountancy_code_buy_intra) ||
+ !empty($product_static->accountancy_code_buy_export)
+ )
) {
$accountancy_category_asset = getDolGlobalString('ASSET_ACCOUNTANCY_CATEGORY');
$filters = array();
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index f0d32aba003..386cbb9b8ef 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -1,15 +1,14 @@
+/* Copyright (C) 2005-2017 Laurent Destailleur
* Copyright (C) 2009-2017 Regis Houssin
* Copyright (C) 2011-2014 Juanjo Menent
- * Copyright (C) 2013 Cedric GROSS
+ * Copyright (C) 2013 Cedric GROSS
* Copyright (C) 2014 Marcos García
- * Copyright (C) 2015 Bahfir Abbes
- * Copyright (C) 2022 Ferran Marcet
- * Copyright (C) 2023 William Mead
- * Copyright (C) 2023 Christian Foellmann
- * Copyright (C) 2024 William Mead
- * Copyright (C) 2024 MDW
+ * Copyright (C) 2015 Bahfir Abbes
+ * Copyright (C) 2022 Ferran Marcet
+ * Copyright (C) 2023-2024 William Mead
+ * Copyright (C) 2023 Christian Foellmann
+ * Copyright (C) 2024 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
@@ -105,6 +104,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Actions
if ($action == 'COMPANY_CREATE') {
+ '@phan-var-force Societe $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "companies"));
@@ -122,6 +122,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
$object->socid = $object->id;
} elseif ($action == 'COMPANY_MODIFY') {
+ '@phan-var-force Societe $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "companies"));
@@ -144,6 +145,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
$object->socid = $object->id;
} elseif ($action == 'COMPANY_SENTBYMAIL') {
+ '@phan-var-force Societe $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@@ -158,6 +160,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'CONTACT_CREATE') {
+ '@phan-var-force Contact $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "companies"));
@@ -175,6 +178,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array($object->id => $object->id);
// $object->socid = $object->socid;
} elseif ($action == 'CONTACT_MODIFY') {
+ '@phan-var-force Contrat $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "companies"));
@@ -192,6 +196,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array($object->id => $object->id);
// $object->socid = $object->socid;
} elseif ($action == 'CONTRACT_VALIDATE') {
+ '@phan-var-force Contrat $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "contracts"));
@@ -208,6 +213,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'CONTRACT_SENTBYMAIL') {
+ '@phan-var-force Contrat $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "contracts"));
@@ -225,6 +231,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'PROPAL_VALIDATE') {
+ '@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@@ -241,6 +248,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPAL_MODIFY') {
+ '@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@@ -257,6 +265,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPAL_SENTBYMAIL') {
+ '@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@@ -274,6 +283,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'PROPAL_CLOSE_SIGNED') {
+ '@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@@ -290,6 +300,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPAL_CLASSIFY_BILLED') {
+ '@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@@ -306,6 +317,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPAL_CLOSE_REFUSED') {
+ '@phan-var-force Propal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@@ -322,6 +334,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_VALIDATE') {
+ '@phan-var-force Commande $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "orders"));
@@ -338,6 +351,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_CLOSE') {
+ '@phan-var-force Commande $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@@ -354,6 +368,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_CLASSIFY_BILLED') {
+ '@phan-var-force Commande $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@@ -370,6 +385,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_CANCEL') {
+ '@phan-var-force Commande $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@@ -386,6 +402,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_SENTBYMAIL') {
+ '@phan-var-force Commande $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@@ -403,6 +420,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'BILL_VALIDATE') {
+ '@phan-var-force Facture $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@@ -419,6 +437,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_UNVALIDATE') {
+ '@phan-var-force Facture $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@@ -435,6 +454,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_SENTBYMAIL') {
+ '@phan-var-force Facture $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@@ -452,6 +472,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'BILL_PAYED') {
+ '@phan-var-force Facture $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@@ -469,6 +490,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_CANCEL') {
+ '@phan-var-force Facture $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@@ -485,6 +507,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'FICHINTER_CREATE') {
+ '@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@@ -503,6 +526,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->fk_element = 0;
$object->elementtype = '';
} elseif ($action == 'FICHINTER_VALIDATE') {
+ '@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@@ -521,6 +545,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->fk_element = 0;
$object->elementtype = '';
} elseif ($action == 'FICHINTER_MODIFY') {
+ '@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@@ -539,6 +564,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->fk_element = 0;
$object->elementtype = '';
} elseif ($action == 'FICHINTER_SENTBYMAIL') {
+ '@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@@ -556,6 +582,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'FICHINTER_CLASSIFY_BILLED') {
+ '@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@@ -572,6 +599,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'FICHINTER_CLASSIFY_UNBILLED') {
+ '@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@@ -588,6 +616,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'FICHINTER_CLOSE') {
+ '@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@@ -606,6 +635,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->fk_element = 0;
$object->elementtype = '';
} elseif ($action == 'FICHINTER_DELETE') {
+ '@phan-var-force Fichinter $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "interventions"));
@@ -624,6 +654,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->fk_element = 0;
$object->elementtype = '';
} elseif ($action == 'SHIPPING_VALIDATE') {
+ '@phan-var-force Expedition $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "sendings"));
@@ -641,6 +672,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'SHIPPING_SENTBYMAIL') {
+ '@phan-var-force Expedition $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "sendings"));
@@ -658,6 +690,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'RECEPTION_VALIDATE') {
+ '@phan-var-force Reception $object';
$langs->load("agenda");
$langs->load("other");
$langs->load("receptions");
@@ -676,6 +709,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'RECEPTION_SENTBYMAIL') {
+ '@phan-var-force Reception $object';
$langs->load("agenda");
$langs->load("other");
$langs->load("receptions");
@@ -694,6 +728,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'PROPOSAL_SUPPLIER_VALIDATE') {
+ '@phan-var-force SupplierProposal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@@ -710,6 +745,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPOSAL_SUPPLIER_SENTBYMAIL') {
+ '@phan-var-force SupplierProposal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@@ -727,6 +763,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'PROPOSAL_SUPPLIER_CLOSE_SIGNED') {
+ '@phan-var-force SupplierProposal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@@ -743,6 +780,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROPOSAL_SUPPLIER_CLOSE_REFUSED') {
+ '@phan-var-force SupplierProposal $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "propal"));
@@ -776,6 +814,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_SUPPLIER_VALIDATE') {
+ '@phan-var-force CommandeFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@@ -853,6 +892,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'ORDER_SUPPLIER_SUBMIT') {
+ '@phan-var-force CommandeFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders"));
@@ -943,6 +983,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_SUPPLIER_VALIDATE') {
+ '@phan-var-force FactureFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@@ -959,6 +1000,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_SUPPLIER_UNVALIDATE') {
+ '@phan-var-force FactureFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@@ -975,6 +1017,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'BILL_SUPPLIER_SENTBYMAIL') {
+ '@phan-var-force FactureFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills", "orders"));
@@ -992,6 +1035,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'BILL_SUPPLIER_PAYED') {
+ '@phan-var-force FactureFournisseur $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "bills"));
@@ -1024,6 +1068,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'MEMBER_VALIDATE') {
+ '@phan-var-force Adherent $object';
// Members
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@@ -1043,6 +1088,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'MEMBER_MODIFY') {
+ '@phan-var-force Adherent $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@@ -1061,6 +1107,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'MEMBER_SUBSCRIPTION_CREATE') {
+ '@phan-var-force Subscription $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@@ -1092,6 +1139,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->socid = $object->fk_soc;
}
} elseif ($action == 'MEMBER_SUBSCRIPTION_MODIFY') {
+ '@phan-var-force Subscription $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@@ -1122,6 +1170,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->socid = $object->fk_soc;
}
} elseif ($action == 'MEMBER_SUBSCRIPTION_DELETE') {
+ '@phan-var-force Subscription $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@@ -1153,6 +1202,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->socid = $object->fk_soc;
}
} elseif ($action == 'MEMBER_RESILIATE') {
+ '@phan-var-force Adherent $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@@ -1171,6 +1221,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'MEMBER_DELETE') {
+ '@phan-var-force Adherent $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@@ -1189,6 +1240,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'MEMBER_EXCLUDE') {
+ '@phan-var-force Adherent $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "members"));
@@ -1207,6 +1259,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROJECT_CREATE') {
+ '@phan-var-force Project $object';
// Projects
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@@ -1225,6 +1278,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROJECT_VALIDATE') {
+ '@phan-var-force Project $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@@ -1242,6 +1296,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROJECT_MODIFY') {
+ '@phan-var-force Project $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@@ -1263,6 +1318,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'PROJECT_SENTBYMAIL') {
+ '@phan-var-force Project $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@@ -1280,6 +1336,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Parameters $object->sendtoid defined by caller
//$object->sendtoid = array();
} elseif ($action == 'PROJECT_DELETE') {
+ '@phan-var-force Project $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@@ -1306,6 +1363,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'TASK_CREATE') {
+ '@phan-var-force Task $object';
// Project tasks
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@@ -1324,6 +1382,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'TASK_MODIFY') {
+ '@phan-var-force Task $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@@ -1341,6 +1400,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'TASK_DELETE') {
+ '@phan-var-force Task $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@@ -1358,6 +1418,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid = array();
} elseif ($action == 'TICKET_ASSIGNED') {
+ '@phan-var-force Ticket $object';
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "projects"));
@@ -1509,7 +1570,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$contactforactionid = reset($object->sendtoid);
}
} else {
- if ($object->sendtoid > 0) {
+ if ($object->sendtoid > 0) { // @phan-suppress-current-line PhanTypeComparisonFromArray
$contactforactionid = $object->sendtoid;
}
}
@@ -1524,6 +1585,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$projectid = isset($object->fk_project) ? $object->fk_project : 0;
if ($object->element == 'project') {
+ '@phan-var-force Project $object';
$projectid = $object->id;
}
@@ -1531,6 +1593,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$elementtype = $object->element;
$elementmodule = (empty($object->module) ? '' : $object->module);
if ($object->element == 'subscription') {
+ '@phan-var-force Subscription $object';
$elementid = $object->fk_adherent;
$elementtype = 'member';
}
@@ -1552,8 +1615,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->contact_id = $contactforactionid; // deprecated, now managed by setting $actioncomm->socpeopleassigned later
$actioncomm->authorid = $user->id; // User saving action
$actioncomm->userownerid = $user->id; // Owner of action
- // Fields defined when action is an email (content should be into object->actionmsg to be added into event note, subject should be into object->actionms2 to be added into event label)
+ // Fields defined when action is an email (content should be into object->actionmsg to be added into event note, subject should be into object->actionmsg2 to be added into event label)
if (!property_exists($object, 'email_fields_no_propagate_in_actioncomm') || empty($object->email_fields_no_propagate_in_actioncomm)) {
+ '@phan-var-force ActionComm $object'; // TODO: Non of the dolibarr classes has all the fields, check class type or properties (email_date)
$actioncomm->datep = empty($object->email_date) ? $now : $object->email_date;
$actioncomm->datef = empty($object->email_date) ? $now : $object->email_date;
$actioncomm->email_msgid = empty($object->email_msgid) ? null : $object->email_msgid;
@@ -1573,13 +1637,19 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->elementtype = $elementtype.($elementmodule ? '@'.$elementmodule : '');
}
+ // @phan-suppress-next-line PhanUndeclaredProperty
if (property_exists($object, 'attachedfiles') && is_array($object->attachedfiles) && count($object->attachedfiles) > 0) {
+ // @phan-suppress-next-line PhanUndeclaredProperty
$actioncomm->attachedfiles = $object->attachedfiles;
}
+ // @phan-suppress-next-line PhanUndeclaredProperty
if (property_exists($object, 'sendtouserid') && is_array($object->sendtouserid) && count($object->sendtouserid) > 0) {
+ // @phan-suppress-next-line PhanUndeclaredProperty
$actioncomm->userassigned = $object->sendtouserid;
}
+ // @phan-suppress-next-line PhanUndeclaredProperty
if (property_exists($object, 'sendtoid') && is_array($object->sendtoid) && count($object->sendtoid) > 0) {
+ // @phan-suppress-next-line PhanUndeclaredProperty
foreach ($object->sendtoid as $val) {
$actioncomm->socpeopleassigned[$val] = $val;
}
@@ -1588,13 +1658,17 @@ class InterfaceActionsAuto extends DolibarrTriggers
$ret = $actioncomm->create($user); // User creating action
if ($ret > 0 && getDolGlobalString('MAIN_COPY_FILE_IN_EVENT_AUTO')) {
+ // @phan-suppress-next-line PhanUndeclaredProperty
if (property_exists($object, 'attachedfiles') && is_array($object->attachedfiles) && array_key_exists('paths', $object->attachedfiles) && count($object->attachedfiles['paths']) > 0) {
+ // Note: None of the dolibarr classes seem to have an attachedfiles property
// Get directory of object
$tmpelems = getElementProperties($object->element.($object->module ? '@'.$object->module : ''));
$destdir = $tmpelems['dir_output'].'/'.$ret;
+ // @phan-suppress-next-line PhanUndeclaredProperty
foreach ($object->attachedfiles['paths'] as $key => $filespath) {
$srcfile = $filespath;
+ // @phan-suppress-next-line PhanUndeclaredProperty
$destfile = $destdir.'/'.$object->attachedfiles['names'][$key];
if (dol_mkdir($destdir) >= 0) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php
index 6dedf4f6ebd..dcc64cb67db 100644
--- a/htdocs/delivery/class/delivery.class.php
+++ b/htdocs/delivery/class/delivery.class.php
@@ -273,7 +273,7 @@ class Delivery extends CommonObject
* Create a line
*
* @param int $origin_id Id of order
- * @param string $qty Quantity
+ * @param float $qty Quantity
* @param int $fk_product Id of predefined product
* @param string $description Description
* @param array $array_options Array options
@@ -637,8 +637,6 @@ class Delivery extends CommonObject
*/
public function addline($origin_id, $qty, $array_options = [])
{
- global $conf;
-
$num = count($this->lines);
$line = new DeliveryLine($this->db);
@@ -763,8 +761,8 @@ class Delivery extends CommonObject
$datas = [];
- $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("ShowReceiving").': ';
- $datas['picto'] .= ''.$langs->trans("Status").': '.$this->ref;
+ $datas['picto'] = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly').' '.$langs->trans("ShowReceiving").': ';
+ $datas['ref'] = ''.$langs->trans("Ref").': '.$this->ref;
return $datas;
}
diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php
index f29fd4d2c86..a34c5dddc83 100644
--- a/htdocs/expedition/dispatch.php
+++ b/htdocs/expedition/dispatch.php
@@ -9,6 +9,7 @@
* Copyright (C) 2017-2022 Ferran Marcet
* Copyright (C) 2018-2022 Frédéric France
* Copyright (C) 2019-2020 Christophe Battarel
+ * Copyright (C) 2024 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
@@ -675,7 +676,7 @@ if ($object->id > 0 || !empty($object->ref)) {
print "\n";
}
- $nbfreeproduct = 0; // Nb of lins of free products/services
+ $nbfreeproduct = 0; // Nb of lines of free products/services
$nbproduct = 0; // Nb of predefined product lines to dispatch (already done or not) if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is off (default)
// or nb of line that remain to dispatch if SUPPLIER_ORDER_DISABLE_STOCK_DISPATCH_WHEN_TOTAL_REACHED is on.
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 7a7b0f1fc54..29f442313ec 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -61,7 +61,7 @@ class Fichinter extends CommonObject
'dateo' => array('type' => 'date', 'label' => 'Dateo', 'enabled' => 1, 'visible' => -1, 'position' => 85),
'datee' => array('type' => 'date', 'label' => 'Datee', 'enabled' => 1, 'visible' => -1, 'position' => 90),
'datet' => array('type' => 'date', 'label' => 'Datet', 'enabled' => 1, 'visible' => -1, 'position' => 95),
- 'duree' => array('type' => 'double', 'label' => 'Duree', 'enabled' => 1, 'visible' => -1, 'position' => 100),
+ 'duree' => array('type' => 'integer', 'label' => 'Duree', 'enabled' => 1, 'visible' => -1, 'position' => 100),
'signed_status' => array('type' => 'smallint(6)', 'label' => 'SignedStatus', 'enabled' => 1, 'visible' => -1, 'position' => 101, 'arrayofkeyval' => array(0 => 'NoSignature', 1 => 'SignedSender', 2 => 'SignedReceiver', 3 => 'SignedReceiverOnline', 9 => 'SignedAll')),
'description' => array('type' => 'html', 'label' => 'Description', 'enabled' => 1, 'visible' => -1, 'position' => 105, 'showoncombobox' => 2),
'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110),
@@ -83,11 +83,6 @@ class Fichinter extends CommonObject
*/
public $table_element = 'fichinter';
- /**
- * @var string Field with ID of parent key if this field has a parent
- */
- public $fk_element = 'fk_fichinter';
-
/**
* @var string Name of subtable line
*/
@@ -139,7 +134,7 @@ class Fichinter extends CommonObject
/**
* Date modification record (tms)
*
- * @var integer
+ * @var int
*/
public $datem;
@@ -1122,7 +1117,7 @@ class Fichinter extends CommonObject
if (!$error) {
$main = MAIN_DB_PREFIX.'fichinterdet';
$ef = $main."_extrafields";
- $sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_fichinter = ".((int) $this->id).")";
+ $sql = "DELETE FROM ".$this->db->sanitize($ef)." WHERE fk_object IN (SELECT rowid FROM ".$this->db->sanitize($main)." WHERE fk_fichinter = ".((int) $this->id).")";
$resql = $this->db->query($sql);
if (!$resql) {
diff --git a/htdocs/fichinter/class/fichinterligne.class.php b/htdocs/fichinter/class/fichinterligne.class.php
index 32e05c7a418..6b87b1a9c73 100644
--- a/htdocs/fichinter/class/fichinterligne.class.php
+++ b/htdocs/fichinter/class/fichinterligne.class.php
@@ -47,8 +47,7 @@ class FichinterLigne extends CommonObjectLine
public $error = '';
/**
- * From llx_fichinterdet
- * @var int ID
+ * @var int ID of intervention (field from llx_fichinterdet)
*/
public $fk_fichinter;
diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php
index 8b75dd0fcc3..c8fae403ec2 100644
--- a/htdocs/fichinter/class/fichinterrec.class.php
+++ b/htdocs/fichinter/class/fichinterrec.class.php
@@ -45,11 +45,6 @@ class FichinterRec extends Fichinter
public $table_element = 'fichinter_rec';
public $table_element_line = 'fichinterdet_rec';
- /**
- * @var string Fieldname with ID of parent key if this field has a parent
- */
- public $fk_element = 'fk_fichinter';
-
/**
* {@inheritdoc}
*/
diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php
index 8e5b56d0ce7..1dafc2f7679 100644
--- a/htdocs/hrm/class/skill.class.php
+++ b/htdocs/hrm/class/skill.class.php
@@ -294,7 +294,7 @@ class Skill extends CommonObject
if (!$error) {
$this->db->commit();
- setEventMessage($langs->trans('SkillCreated', $i));
+ setEventMessage($langs->trans('SkillCreated', $i - 1));
return 1;
} else {
$this->db->rollback();
diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php
index 9f837d65270..affd6b8a40b 100644
--- a/htdocs/hrm/evaluation_list.php
+++ b/htdocs/hrm/evaluation_list.php
@@ -706,7 +706,7 @@ while ($i < $imaxinloop) {
} elseif ($key == 'rowid') {
print $object->showOutputField($val, $key, $object->id, '');
} elseif ($key == 'label') {
- print $object->getNomUrl(1);
+ print $object->showOutputField($val, $key, $object->label, '');
} else {
print $object->showOutputField($val, $key, $object->$key, '');
}
diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php
index 1cd35d8a8cd..036f52e55ba 100644
--- a/htdocs/hrm/skill_card.php
+++ b/htdocs/hrm/skill_card.php
@@ -128,13 +128,34 @@ if (empty($reshook)) {
$triggermodname = 'HRM_SKILL_MODIFY'; // Name of trigger action code to execute when we modify record
+ // action update on Skilldet must be done before real update action in core/actions_addupdatedelete.inc.php
+ $skilldetArray = GETPOST("descriptionline", "array:alphanohtml");
+ if (!$error) {
+ if (is_array($skilldetArray) && count($skilldetArray) > 0) {
+ if ($action == 'update' && $permissiontoadd) {
+ foreach ($skilldetArray as $key => $SkValueToUpdate) {
+ $skilldetObj = new Skilldet($object->db);
+ $res = $skilldetObj->fetch($key);
+ if ($res > 0) {
+ $skilldetObj->description = $SkValueToUpdate;
+ $resupd = $skilldetObj->update($user);
+ if ($resupd <= 0) {
+ setEventMessage($langs->trans('errorUpdateSkilldet'), 'errors');
+ $error++;
+ }
+ }
+ }
+ }
+ }
+ }
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
$noback = 1;
- include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
+ if (in_array($action, array("confirm_delete", "update"))) {
+ $noback = 0;
+ }
- // action update on Skilldet
- $skilldetArray = GETPOST("descriptionline", "array:alphanohtml");
+ include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
if (!$error) {
if (is_array($skilldetArray) && count($skilldetArray) > 0) {
@@ -153,19 +174,8 @@ if (empty($reshook)) {
}
$index++;
}
- }
- if ($action == 'update' && $permissiontoadd) {
- foreach ($skilldetArray as $key => $SkValueToUpdate) {
- $skilldetObj = new Skilldet($object->db);
- $res = $skilldetObj->fetch($key);
- if ($res > 0) {
- $skilldetObj->description = $SkValueToUpdate;
- $resupd = $skilldetObj->update($user);
- if ($resupd <= 0) {
- setEventMessage($langs->trans('errorUpdateSkilldet'), 'errors');
- }
- }
- }
+ header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
+ exit;
}
}
}
diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php
index 14af4528708..f2e059652de 100644
--- a/htdocs/hrm/skill_tab.php
+++ b/htdocs/hrm/skill_tab.php
@@ -444,7 +444,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if ($objecttype != 'user' && $permissiontoadd) {
print '
';
print '
';
- print 'fk_object . '&objecttype=' . $objecttype . '&action=ask_deleteskill&lineid=' . $skillElement->rowid . '">';
+ print 'fk_object . '&objecttype=' . $objecttype . '&action=ask_deleteskill&lineid=' . $skillElement->rowid . '&token='.newToken().'">';
print img_delete();
print '';
}
diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang
index c8b257eefcc..ee2449ce74c 100644
--- a/htdocs/langs/en_US/ticket.lang
+++ b/htdocs/langs/en_US/ticket.lang
@@ -113,7 +113,7 @@ TicketsLimitViewAssignedOnlyHelp=Only tickets assigned to the current user will
TicketsActivatePublicInterface=Activate public interface
TicketsActivatePublicInterfaceHelp=Public interface allow any visitors to create tickets.
TicketsAutoAssignTicket=Automatically assign the user who created the ticket
-TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automatically assigned to the ticket.
+TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automatically assigned to the ticket(Examples: 0=Never automatically assigned to the ticket, 1=Automatically assigned to the ticket if no one is assigned, 2=Automatically assigned to the ticket even if someone was defined).
TicketAutoChangeStatusOnAnswer=Automatically assign a status when answering a ticket
TicketAutoChangeStatusOnAnswerHelp=When a user answers to a ticket, the status will automatically be applied to the ticket
TicketNumberingModules=Tickets numbering module
diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
index fa752615ad2..ab99b57ec2c 100644
--- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
+++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
@@ -221,7 +221,7 @@ class modMyModule extends DolibarrModules
/* Example:
$this->dictionaries=array(
'langs' => 'mymodule@mymodule',
- // List of tables we want to see into dictonnary editor
+ // List of tables we want to see into dictionary editor
'tabname' => array("table1", "table2", "table3"),
// Label of tables
'tablib' => array("Table1", "Table2", "Table3"),
diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php
index 8b45888d3ea..98051f76b42 100644
--- a/htdocs/product/class/html.formproduct.class.php
+++ b/htdocs/product/class/html.formproduct.class.php
@@ -298,7 +298,7 @@ class FormProduct
dol_syslog(get_class($this)."::selectWarehouses " . (is_array($selected) ? 'selected is array' : $selected) . ", $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss", LOG_DEBUG);
$out = '';
- if (!getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
+ if ((!getDolGlobalString('ENTREPOT_EXTRA_STATUS')) && ($filterstatus==="warehouseinternal")) {
$filterstatus = '';
}
if (!empty($fk_product) && $fk_product > 0) {
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 14384709182..50b78c18ae6 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -68,8 +68,8 @@ $resultboxes = FormOther::getBoxesArea($user, "4");
if (GETPOST('addbox')) {
// Add box (when submit is done from a form when ajax disabled)
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
- $zone = GETPOST('areacode', 'int');
- $userid = GETPOST('userid', 'int');
+ $zone = GETPOSTINT('areacode');
+ $userid = GETPOSTINT('userid');
$boxorder = GETPOST('boxorder', 'aZ09');
$boxorder .= GETPOST('boxcombo', 'aZ09');
$result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid);
diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php
index 801e300fc2c..b368d21aab8 100644
--- a/htdocs/projet/activity/permonth.php
+++ b/htdocs/projet/activity/permonth.php
@@ -632,7 +632,7 @@ if (!empty($arrayfields['timeconsumed']['checked'])) {
print '