From 4bd806ea65b24ddda8cf8bee9a2a571e014cc567 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 27 Jul 2019 18:13:44 +0200 Subject: [PATCH] Move $selectedlines to parameter --- htdocs/commande/card.php | 2 +- htdocs/core/class/commonobject.class.php | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f398fe49713..28dbb52a965 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1880,7 +1880,7 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; - $objectsrc->printOriginLinesList(); + $objectsrc->printOriginLinesList('', $selectedLines); print '
'; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 43ba2499680..8881cffe659 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4142,9 +4142,10 @@ abstract class CommonObject * But for the moment we don't know if it's possible, so we keep the method available on overloaded objects. * * @param string $restrictlist ''=All lines, 'services'=Restrict to services only + * @param array $selectedLines Array of lines id for selected lines * @return void */ - public function printOriginLinesList($restrictlist = '') + public function printOriginLinesList($restrictlist = '', $selectedLines = array()) { global $langs, $hookmanager, $conf, $form; @@ -4180,7 +4181,7 @@ abstract class CommonObject } else { - $this->printOriginLine($line, $var, $restrictlist); + $this->printOriginLine($line, $var, $restrictlist, '/core/tpl', $selectedLines); } $i++; @@ -4198,11 +4199,12 @@ abstract class CommonObject * @param string $var Var * @param string $restrictlist ''=All lines, 'services'=Restrict to services only (strike line if not) * @param string $defaulttpldir Directory where to find the template + * @param array $selectedLines Array of lines id for selected lines * @return void */ - public function printOriginLine($line, $var, $restrictlist = '', $defaulttpldir = '/core/tpl') + public function printOriginLine($line, $var, $restrictlist = '', $defaulttpldir = '/core/tpl', $selectedLines = array()) { - global $langs, $conf, $selectedLines; + global $langs, $conf; //var_dump($line); if (!empty($line->date_start)) @@ -5030,7 +5032,7 @@ abstract class CommonObject //dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG); //dol_syslog("attributeType=".$attributeType, LOG_DEBUG); - + if (!empty($attrfieldcomputed)) { if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS))