diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index f8e2bf4b496..449c6c6ad22 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -1425,12 +1425,9 @@ if ($id > 0 || ! empty($ref))
}
print '
';
-
- if (!empty($object->lines))
- {
- $object->print_title_list();
- $object->printLinesList(0,$mysoc,$soc);
- }
+
+ // Show object lines
+ if (! empty($object->lines)) $object->printObjectLines(0,$mysoc,$soc);
/*
* Form to add new line
@@ -1442,13 +1439,13 @@ if ($id > 0 || ! empty($ref))
$var=true;
// Add free products/services
- $object->showAddFreeProductForm(0,$mysoc,$soc);
+ $object->formAddFreeProduct(0,$mysoc,$soc);
// Add predefined products/services
if ($conf->product->enabled || $conf->service->enabled)
{
$var=!$var;
- $object->showAddPredefinedProductForm(0,$mysoc,$soc);
+ $object->formAddPredefinedProduct(0,$mysoc,$soc);
}
// Hook of thirdparty module
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 9b007d28c4b..fced62b1979 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -1377,8 +1377,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
print_titre($title);
print '';
-
- $objectsrc->printOriginTitleList();
+
$objectsrc->printOriginLinesList($object);
print '
';
@@ -1783,13 +1782,8 @@ else
print '';
- if (!empty($object->lines))
- {
- $object->print_title_list();
- $object->printLinesList(1,$mysoc,$soc);
- }
-
- $numlines=sizeof($object->lines);
+ // Show object lines
+ if (! empty($object->lines)) $object->printObjectLines(0,$mysoc,$soc);
/*
* Form to add new line
@@ -1800,13 +1794,13 @@ else
{
$var=true;
- $object->showAddFreeProductForm(1,$mysoc,$soc);
+ $object->formAddFreeProduct(1,$mysoc,$soc);
// Add predefined products/services
if ($conf->product->enabled || $conf->service->enabled)
{
$var=!$var;
- $object->showAddPredefinedProductForm(1,$mysoc,$soc);
+ $object->formAddPredefinedProduct(1,$mysoc,$soc);
}
// Hook of thirdparty module
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 9a1d340c65e..a1ac40d7a62 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1816,7 +1816,6 @@ if ($_GET['action'] == 'create')
print '';
- $objectsrc->printOriginTitleList();
$objectsrc->printOriginLinesList($object);
print '
';
@@ -2534,11 +2533,8 @@ else
print '';
- if (!empty($object->lines))
- {
- $object->print_title_list();
- $object->printLinesList(1,$mysoc,$soc);
- }
+ // Show object lines
+ if (! empty($object->lines)) $object->printObjectLines(0,$mysoc,$soc);
/*
* Form to add new line
@@ -2547,13 +2543,13 @@ else
{
$var=true;
- $object->showAddFreeProductForm(1,$mysoc,$soc);
+ $object->formAddFreeProduct(1,$mysoc,$soc);
// Add predefined products/services
if ($conf->product->enabled || $conf->service->enabled)
{
$var=!$var;
- $object->showAddPredefinedProductForm(1,$mysoc,$soc);
+ $object->formAddPredefinedProduct(1,$mysoc,$soc);
}
// Hook of thirdparty module
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 2db3fba3896..9074ec5ff18 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1328,7 +1328,7 @@ class CommonObject
* But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
* @param $dateSelector 1=Show also date range input fields
*/
- function showAddPredefinedProductForm($dateSelector,$seller,$buyer)
+ function formAddPredefinedProduct($dateSelector,$seller,$buyer)
{
global $conf,$langs,$object;
global $html,$bcnd,$var;
@@ -1343,7 +1343,7 @@ class CommonObject
* But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
* @param $dateSelector 1=Show also date range input fields
*/
- function showAddFreeProductForm($dateSelector,$seller,$buyer)
+ function formAddFreeProduct($dateSelector,$seller,$buyer)
{
global $conf,$langs,$object;
global $html,$bcnd,$var;
@@ -1403,14 +1403,17 @@ class CommonObject
}
/**
- * Return HTML table with title 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
* TODO Move this into page (into a lib.php file if mutualized. No code for output must be present into a business class).
- * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
*/
- function print_title_list()
+ function printObjectLines($dateSelector=0,$seller,$buyer)
{
global $conf,$langs;
-
+
print '';
print '| '.$langs->trans('Description').' | ';
if ($conf->global->PRODUIT_USE_MARKUP) print ''.$langs->trans('Markup').' | ';
@@ -1423,18 +1426,7 @@ class CommonObject
print ' | ';
print ' | '; // No width to allow autodim
print "
\n";
- }
-
- /**
- * 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
- * TODO Move this into page (into a lib.php file if mutualized. No code for output must be present into a business class).
- */
- function printLinesList($dateSelector=0,$seller,$buyer)
- {
+
$num = count($this->lines);
$var = true;
$i = 0;
@@ -1527,12 +1519,12 @@ class CommonObject
}
/**
- * Return HTML table with origin title list
+ * Return HTML with list of origin lines
*/
- function printOriginTitleList()
+ function printOriginLinesList($object)
{
global $langs;
-
+
print '';
print '| '.$langs->trans('Ref').' | ';
print ''.$langs->trans('Description').' | ';
@@ -1540,13 +1532,7 @@ class CommonObject
print ''.$langs->trans('PriceUHT').' | ';
print ''.$langs->trans('Qty').' | ';
print ''.$langs->trans('ReductionShort').' |
';
- }
-
- /**
- * Return HTML with list of origin lines
- */
- function printOriginLinesList($object)
- {
+
$num = count($this->lines);
$var = true;
$i = 0;