'; // No width to allow autodim
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index 330f8ef8a33..6f79f7640df 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -97,12 +97,12 @@ $coldisplay++;
echo $line->disable_stock_change ? yn($line->disable_stock_change) : ''; // Yes, it is a quantity, not a price, but we just want the formating role of function price
print '';
-print '
';
$coldisplay++;
if (($line->info_bits & 2) == 2 || ! empty($disableedit)) {
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 127e12f919e..140d41c9a62 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -4018,7 +4018,7 @@ abstract class CommonObject
public function formAddObjectLine($dateSelector, $seller, $buyer, $defaulttpldir = '/core/tpl')
{
global $conf,$user,$langs,$object,$hookmanager,$extrafields;
- global $form,$bcnd,$var;
+ global $form;
// Line extrafield
if (! is_object($extrafields))
@@ -4116,7 +4116,6 @@ abstract class CommonObject
}
}
- $var = true;
$i = 0;
print "
\n";
@@ -4130,18 +4129,18 @@ abstract class CommonObject
{
if (empty($line->fk_parent_line))
{
- $parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'table_element_line'=>$line->table_element);
+ $parameters = array('line'=>$line, 'num'=>$num, 'i'=>$i, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer, 'selected'=>$selected, 'table_element_line'=>$line->table_element);
$reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
}
else
{
- $parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected, 'table_element_line'=>$line->table_element, 'fk_parent_line'=>$line->fk_parent_line);
+ $parameters = array('line'=>$line, 'num'=>$num, 'i'=>$i, 'dateSelector'=>$dateSelector, 'seller'=>$seller, 'buyer'=>$buyer, 'selected'=>$selected, 'table_element_line'=>$line->table_element, 'fk_parent_line'=>$line->fk_parent_line);
$reshook = $hookmanager->executeHooks('printObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
}
}
if (empty($reshook))
{
- $this->printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected, $extrafields, $defaulttpldir);
+ $this->printObjectLine($action, $line, '', $num, $i, $dateSelector, $seller, $buyer, $selected, $extrafields, $defaulttpldir);
}
$i++;
@@ -4153,23 +4152,23 @@ abstract class CommonObject
* Return HTML content of a detail line
* TODO Move this into an output class file (htmlline.class.php)
*
- * @param string $action GET/POST action
- * @param CommonObjectLine $line Selected object line to output
- * @param string $var Is it a an odd line (true)
- * @param int $num Number of line (0)
- * @param int $i I
- * @param int $dateSelector 1=Show also date range input fields
- * @param string $seller Object of seller third party
- * @param string $buyer Object of buyer third party
- * @param int $selected Object line selected
- * @param Extrafields $extrafields Object of extrafields
- * @param string $defaulttpldir Directory where to find the template
+ * @param string $action GET/POST action
+ * @param CommonObjectLine $line Selected object line to output
+ * @param string $var Is it a an odd line (true)
+ * @param int $num Number of line (0)
+ * @param int $i I
+ * @param int $dateSelector 1=Show also date range input fields
+ * @param string $seller Object of seller third party
+ * @param string $buyer Object of buyer third party
+ * @param int $selected Object line selected
+ * @param Extrafields $extrafields Object of extrafields
+ * @param string $defaulttpldir Directory where to find the template
* @return void
*/
public function printObjectLine($action, $line, $var, $num, $i, $dateSelector, $seller, $buyer, $selected = 0, $extrafields = null, $defaulttpldir = '/core/tpl')
{
global $conf,$langs,$user,$object,$hookmanager;
- global $form,$bc,$bcdd;
+ global $form;
global $object_rights, $disableedit, $disablemove, $disableremove; // TODO We should not use global var for this !
$object_rights = $this->getRights();
@@ -4319,7 +4318,6 @@ abstract class CommonObject
print '
';
print '';
- $var = true;
$i = 0;
if (! empty($this->lines))
@@ -4330,14 +4328,14 @@ abstract class CommonObject
{
if (empty($line->fk_parent_line))
{
- $parameters=array('line'=>$line,'var'=>$var,'i'=>$i);
+ $parameters=array('line'=>$line, 'i'=>$i);
$action='';
$hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
}
}
else
{
- $this->printOriginLine($line, $var, $restrictlist, '/core/tpl', $selectedLines);
+ $this->printOriginLine($line, '', $restrictlist, '/core/tpl', $selectedLines);
}
$i++;
diff --git a/htdocs/core/tpl/originproductline.tpl.php b/htdocs/core/tpl/originproductline.tpl.php
index 2fd33c25cc5..bfc1456e005 100644
--- a/htdocs/core/tpl/originproductline.tpl.php
+++ b/htdocs/core/tpl/originproductline.tpl.php
@@ -43,7 +43,9 @@ print '
'.$this->tpl['remise_percent'].'
';
$selected=1;
if (!empty($selectedLines) && !in_array($this->tpl['id'], $selectedLines)) $selected=0;
-print '
';
+print '
';
+print '';
+print '
';
print ''."\n";
?>
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index 96cb662fe0b..c4f0b6d4e83 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -730,6 +730,96 @@ class Mo extends CommonObject
return $error;
}
+
+ /**
+ * Return HTML table table of source object lines
+ * TODO Move this and previous function into output html class file (htmlline.class.php).
+ * If lines are into a template, title must also be into a template
+ * 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 = '', $selectedLines = array())
+ {
+ global $langs, $hookmanager, $conf, $form;
+
+ print '
';
+
print '';
}
diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php
new file mode 100644
index 00000000000..67032eea7fe
--- /dev/null
+++ b/htdocs/mrp/tpl/originproductline.tpl.php
@@ -0,0 +1,44 @@
+
+/* Copyright (C) 2017 Charlie Benke
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+// Protection to avoid direct call of template
+if (empty($conf) || ! is_object($conf))
+{
+ print "Error, template page can't be called as URL";
+ exit;
+}
+
+?>
+
+
+tpl['strike'])?'':' strikefordisabled').'">';
+print '