From 82102998959cf922fd6fc161af3f512d89311e76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Oct 2010 14:54:09 +0000 Subject: [PATCH] Fix: Date range was lost in edit mode. --- htdocs/commande/fiche.php | 4 ++-- htdocs/compta/facture.php | 2 +- htdocs/core/class/commonobject.class.php | 6 +++++- htdocs/core/tpl/freeproductline_create.tpl.php | 7 +++++++ htdocs/core/tpl/freeproductline_edit.tpl.php | 9 +++++++-- htdocs/core/tpl/predefinedproductline_create.tpl.php | 7 +++++++ htdocs/core/tpl/predefinedproductline_edit.tpl.php | 11 +++++++++-- 7 files changed, 38 insertions(+), 8 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 32d934f4835..3a3062d09b7 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -521,7 +521,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS $date_end=''; $date_start=dol_mktime(0, 0, 0, $_POST['date_start'.$suffixe.'month'], $_POST['date_start'.$suffixe.'day'], $_POST['date_start'.$suffixe.'year']); $date_end=dol_mktime(0, 0, 0, $_POST['date_end'.$suffixe.'month'], $_POST['date_end'.$suffixe.'day'], $_POST['date_end'.$suffixe.'year']); - $description=dol_htmlcleanlastbr($_POST['eldesc']); + $description=dol_htmlcleanlastbr($_POST['desc']); // Define info_bits $info_bits=0; @@ -1664,7 +1664,7 @@ else if (!empty($object->lines)) { $object->print_title_list(); - $object->printLinesList(0,$mysoc,$soc); + $object->printLinesList(1,$mysoc,$soc); } $numlines=sizeof($object->lines); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index e5adb3a9105..adee547db8a 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2655,7 +2655,7 @@ else if (!empty($object->lines)) { $object->print_title_list(); - $object->printLinesList(0,$mysoc,$soc); + $object->printLinesList(1,$mysoc,$soc); } /* diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0e0029a1a33..c3565de4a9f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1383,7 +1383,11 @@ class CommonObject } /** - * Return HTML with object lines list + * Return HTML with object lines list. + * Array $this->lines must be defined. + * @param $dateSelector Show date input fields (if service) + * @param $seller Object of seller third party + * @param uyer Object of buyer third party * FIXME This must be moved into a html.class file instead of a business class. */ function printLinesList($dateSelector=0,$seller,$buyer) diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index 33029073f01..00fa589a710 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -17,6 +17,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ + * + * Need to have following variables defined: + * $conf + * $langs + * $dateSelector + * $this (invoice, order, ...) + * $line defined */ ?> diff --git a/htdocs/core/tpl/freeproductline_edit.tpl.php b/htdocs/core/tpl/freeproductline_edit.tpl.php index c5f2af84aaa..2cf7d0d8bd2 100644 --- a/htdocs/core/tpl/freeproductline_edit.tpl.php +++ b/htdocs/core/tpl/freeproductline_edit.tpl.php @@ -18,7 +18,12 @@ * * $Id$ * - * Need to have object $this (invoice, order, ...) and $line defined + * Need to have following variables defined: + * $conf + * $langs + * $dateSelector + * $this (invoice, order, ...) + * $line defined */ ?> @@ -67,7 +72,7 @@
"> -service->enabled && $dateSelector) { ?> +service->enabled && $dateSelector && $line->product_type == 1) { ?> > trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> diff --git a/htdocs/core/tpl/predefinedproductline_edit.tpl.php b/htdocs/core/tpl/predefinedproductline_edit.tpl.php index 5e5dc526faf..07fa0e91456 100644 --- a/htdocs/core/tpl/predefinedproductline_edit.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_edit.tpl.php @@ -17,6 +17,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ + * + * Need to have following variables defined: + * $conf + * $langs + * $dateSelector + * $this (invoice, order, ...) + * $line defined */ ?> @@ -34,7 +41,7 @@ fk_product_type==1) echo img_object($langs->trans('ShowService'),'service'); + if ($line->product_type==1) echo img_object($langs->trans('ShowService'),'service'); else print img_object($langs->trans('ShowProduct'),'product'); echo ' '.$line->ref.''; echo ' - '.nl2br($line->product_label); @@ -73,7 +80,7 @@
"> -service->enabled && $dateSelector) { ?> +service->enabled && $dateSelector && $line->product_type == 1) { ?> > trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>