From 9270b2c54cf1aced928acbf6d473524b17909419 Mon Sep 17 00:00:00 2001 From: Ion Date: Fri, 20 Jan 2017 10:57:41 +0100 Subject: [PATCH 1/2] Add supplier order/invoice to elementproperties --- htdocs/core/lib/functions2.lib.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index bb34806965a..a13a9d9ee85 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1923,10 +1923,6 @@ function getElementProperties($element_type) $subelement = $regs[2]; } - $classfile = strtolower($subelement); - $classname = ucfirst($subelement); - $classpath = $module.'/class'; - // For compat if($element_type == "action") { $classpath = 'comm/action/class'; @@ -1991,8 +1987,22 @@ function getElementProperties($element_type) $module='propal'; $subelement='propaleligne'; } - $classfile = strtolower($subelement); - $classname = ucfirst($subelement); + if ($element_type == 'order_supplier') { + $classpath = 'fourn/class'; + $module='fournisseur'; + $subelement='commandefournisseur'; + $classfile='fournisseur.commande'; + } + if ($element_type == 'invoice_supplier') { + $classpath = 'fourn/class'; + $module='fournisseur'; + $subelement='facturefournisseur'; + $classfile='fournisseur.facture'; + } + + if (!isset($classfile)) $classfile = strtolower($subelement); + if (!isset($classname)) $classname = ucfirst($subelement); + if (!isset($classpath)) $classpath = $module.'/class'; $element_properties = array( 'module' => $module, From e73a132ed963679fd405a1770df0b6e18f8f33ed Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Wed, 25 Jan 2017 16:24:12 +0100 Subject: [PATCH 2/2] PHP7 warning error on $page not affected --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 4f1f97cef8a..8b8d2cb18b1 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -65,7 +65,7 @@ $optioncss = GETPOST('optioncss','alpha'); $limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit; $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$page = (GETPOST("page",'int')?GETPOST("page", 'int'):0); if ($page == -1) { $page = 0; } $offset = $limit * $page; $pageprev = $page - 1;