From 252c8eefd5b9a46e1f00b020092667f8621aa38c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 9 Apr 2011 20:54:02 +0000 Subject: [PATCH] Fix: add picto for child line --- htdocs/core/class/commonobject.class.php | 17 ++++++++++------- htdocs/core/tpl/originproductline.tpl.php | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index cc5b5769fa2..39c0366816d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1570,9 +1570,9 @@ class CommonObject { $var=!$var; - if ($line->product_type == 9 && ! empty($line->special_code)) + if (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)) { - $object->hooks[$line->special_code]->printOriginObjectLine($line,$i); + if (empty($line->fk_parent_line)) $object->hooks[$line->special_code]->printOriginObjectLine($this,$line,$i); } else { @@ -1598,12 +1598,15 @@ class CommonObject if ($line->date_debut_reel) $date_start=$line->date_debut_reel; $date_end=$line->date_fin_prevue; if ($line->date_fin_reel) $date_end=$line->date_fin_reel; - + + $this->tpl['label'] = ''; + if (! empty($line->fk_parent_line)) $this->tpl['label'].= img_picto('', 'rightarrow'); + if (($line->info_bits & 2) == 2) { $discount=new DiscountAbsolute($db); $discount->fk_soc = $this->socid; - $this->tpl['label'] = $discount->getNomUrl(0,'discount'); + $this->tpl['label'].= $discount->getNomUrl(0,'discount'); } else if ($line->fk_product) { @@ -1611,7 +1614,7 @@ class CommonObject $productstatic->id = $line->fk_product; $productstatic->ref = $line->ref; $productstatic->type = $line->fk_product_type; - $this->tpl['label'] = $productstatic->getNomUrl(1); + $this->tpl['label'].= $productstatic->getNomUrl(1); $this->tpl['label'].= $line->label?' - '.$line->label:''; // Dates if ($date_start || $date_end) @@ -1621,7 +1624,7 @@ class CommonObject } else { - $this->tpl['label'] = ($line->product_type == -1 ? ' ' : ($line->product_type == 1 ? img_object($langs->trans(''),'service') : img_object($langs->trans(''),'product'))); + $this->tpl['label'].= ($line->product_type == -1 ? ' ' : ($line->product_type == 1 ? img_object($langs->trans(''),'service') : img_object($langs->trans(''),'product'))); $this->tpl['label'].= ($line->label ? ' '.$line->label : ''); // Dates if ($date_start || $date_end) @@ -1658,7 +1661,7 @@ class CommonObject $this->tpl['price'] = price($line->subprice); $this->tpl['qty'] = (($line->info_bits & 2) != 2) ? $line->qty : ' '; $this->tpl['remise_percent'] = (($line->info_bits & 2) != 2) ? $line->remise_percent.'%' : ' '; - + include(DOL_DOCUMENT_ROOT.'/core/tpl/originproductline.tpl.php'); } } diff --git a/htdocs/core/tpl/originproductline.tpl.php b/htdocs/core/tpl/originproductline.tpl.php index 6848900cbde..db2136bbde1 100644 --- a/htdocs/core/tpl/originproductline.tpl.php +++ b/htdocs/core/tpl/originproductline.tpl.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2011 Regis Houssin * * 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