Fix: Date range was lost in edit mode.

This commit is contained in:
Laurent Destailleur 2010-10-16 14:54:09 +00:00
parent f30061ca0c
commit 8210299895
7 changed files with 38 additions and 8 deletions

View File

@ -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);

View File

@ -2655,7 +2655,7 @@ else
if (!empty($object->lines))
{
$object->print_title_list();
$object->printLinesList(0,$mysoc,$soc);
$object->printLinesList(1,$mysoc,$soc);
}
/*

View File

@ -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)

View File

@ -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
*/
?>

View File

@ -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 @@
<br><input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"></td>
</tr>
<?php if ($conf->service->enabled && $dateSelector) { ?>
<?php if ($conf->service->enabled && $dateSelector && $line->product_type == 1) { ?>
<tr <?php echo $bc[$var]; ?>>
<td colspan="9"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
<?php

View File

@ -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
*/
?>

View File

@ -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 @@
<input type="hidden" name="productid" value="<?php echo $line->fk_product; ?>">
<a href="<?php echo DOL_URL_ROOT.'/product/fiche.php?id='.$line->fk_product; ?>">
<?php
if ($line->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.'</a>';
echo ' - '.nl2br($line->product_label);
@ -73,7 +80,7 @@
<br><input type="submit" class="button" name="cancel" value="<?php echo $langs->trans("Cancel"); ?>"></td>
</tr>
<?php if ($conf->service->enabled && $dateSelector) { ?>
<?php if ($conf->service->enabled && $dateSelector && $line->product_type == 1) { ?>
<tr <?php echo $bc[$var]; ?>>
<td colspan="9"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
<?php