From 8be15e8e27dc8c51dacb510febf64db34f4bf851 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?This=20Charl=C3=A8ne?=
<1179011+defrance@users.noreply.github.com>
Date: Mon, 11 Jul 2022 07:11:45 +0200
Subject: [PATCH 1/3] php v8 fix warning
missing and bad name variables
---
htdocs/commande/card.php | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 22505f6b921..c407d80c727 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1609,7 +1609,7 @@ if ($action == 'create' && $usercancreate) {
$fk_account = $soc->fk_account;
$availability_id = 0;
$shipping_method_id = $soc->shipping_method_id;
- $warehouse_id = $soc->warehouse_id;
+ $warehouse_id = $soc->fk_warehouse;
$demand_reason_id = $soc->demand_reason_id;
$remise_percent = $soc->remise_percent;
$remise_absolue = 0;
@@ -1722,7 +1722,7 @@ if ($action == 'create' && $usercancreate) {
// Date delivery planned
print '
| '.$langs->trans("DateDeliveryPlanned").' | ';
print '';
- $date_delivery = ($date_delivery ? $date_delivery : $object->date_delivery);
+ $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date);
print $form->selectDate($date_delivery ? $date_delivery : -1, 'liv_', 1, 1, 1);
print " | \n";
print '
';
@@ -1803,7 +1803,10 @@ if ($action == 'create' && $usercancreate) {
}
// Other attributes
- $parameters = array('objectsrc' => $objectsrc, 'socid'=>$socid);
+ if (!empty($origin) && !empty($originid) && is_object($objectsrc))
+ $parameters['objectsrc'] = $objectsrc;
+ $parameters['socid'] = $socid;
+
// Note that $action and $object may be modified by hook
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
print $hookmanager->resPrint;
From 796f718012be642b8812ddcd15eaf251904e0412 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?This=20Charl=C3=A8ne?=
<1179011+defrance@users.noreply.github.com>
Date: Mon, 11 Jul 2022 07:14:46 +0200
Subject: [PATCH 2/3] Update card.php
---
htdocs/commande/card.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index c407d80c727..5f90927860d 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1698,7 +1698,7 @@ if ($action == 'create' && $usercancreate) {
// Contacts (ask contact only if thirdparty already defined).
print "| ".$langs->trans("DefaultContact").' | ';
print img_picto('', 'contact', 'class="pictofixedwidth"');
- print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, $srccontactslist, '', 1, 'maxwidth200 widthcentpercentminusx');
+ print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, !empty($srccontactslist)?$srccontactslist:"", '', 1, 'maxwidth200 widthcentpercentminusx');
print ' |
';
// Ligne info remises tiers
From 204bf2e61878376e82d92f3cbf850ea466aa0895 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur
Date: Mon, 11 Jul 2022 10:54:23 +0200
Subject: [PATCH 3/3] Update card.php
---
htdocs/commande/card.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 5f90927860d..1e6a33e8ae8 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1803,8 +1803,10 @@ if ($action == 'create' && $usercancreate) {
}
// Other attributes
- if (!empty($origin) && !empty($originid) && is_object($objectsrc))
+ $parameters = array();
+ if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
$parameters['objectsrc'] = $objectsrc;
+ }
$parameters['socid'] = $socid;
// Note that $action and $object may be modified by hook