Skip to content
Snippets Groups Projects
Commit 066ef177 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: Do not use GET here, but put information into parameter of function

parent e7b76331
No related branches found
No related tags found
No related merge requests found
......@@ -1429,7 +1429,7 @@ if ($id > 0 || ! empty($ref))
print '<table id="tablelines" class="noborder" width="100%">';
// Show object lines
if (! empty($object->lines)) $object->printObjectLines($mysoc,$soc,GETPOST('lineid'));
if (! empty($object->lines)) $object->printObjectLines(GETPOST('action'),$mysoc,$soc,GETPOST('lineid'));
//print '<table id="tablelines" class="noborder" width="100%">';
......
......@@ -1819,7 +1819,7 @@ else
print '<table id="tablelines" class="noborder" width="100%">';
// Show object lines
if (! empty($object->lines)) $object->printObjectLines($mysoc,$soc,GETPOST('lineid'),1);
if (! empty($object->lines)) $object->printObjectLines(GETPOST('action'),$mysoc,$soc,GETPOST('lineid'),1);
/*
* Form to add new line
......
......@@ -2534,7 +2534,7 @@ else
print '<table id="tablelines" class="noborder" width="100%">';
// Show object lines
if (! empty($object->lines)) $object->printObjectLines($mysoc,$soc,GETPOST('lineid'),1);
if (! empty($object->lines)) $object->printObjectLines(GETPOST('action'),$mysoc,$soc,GETPOST('lineid'),1);
/*
* Form to add new line
......
......@@ -1464,7 +1464,7 @@ class CommonObject
* @param $selected Object line selected
* @param $dateSelector 1=Show also date range input fields
*/
function printObjectLines($seller,$buyer,$selected=0,$dateSelector=0)
function printObjectLines($action='viewline',$seller,$buyer,$selected=0,$dateSelector=0)
{
global $conf,$langs;
......@@ -1509,11 +1509,11 @@ class CommonObject
if (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))
{
if (empty($line->fk_parent_line)) $this->hooks[$line->special_code]->printObjectLine($this,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected);
if (empty($line->fk_parent_line)) $this->hooks[$line->special_code]->printObjectLine($action,$this,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected);
}
else
{
$this->printLine($line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected);
$this->printLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected);
}
$i++;
......@@ -1527,6 +1527,7 @@ class CommonObject
* TODO Move this into an output 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 as we keep a method available on overloaded objects.
* @param $action GET/POST action
* @param $line Selected object line to output
* @param $var Is it a an odd line
* @param $num Number of line
......@@ -1536,7 +1537,7 @@ class CommonObject
* @param $buyer Object of buyer third party
* @param $selected Object line selected
*/
function printLine($line,$var=true,$num=0,$i=0,$dateSelector=0,$seller,$buyer,$selected=0)
function printLine($action='viewline',$line,$var=true,$num=0,$i=0,$dateSelector=0,$seller,$buyer,$selected=0)
{
global $conf,$langs,$user;
global $html,$bc,$bcdd;
......@@ -1552,8 +1553,7 @@ class CommonObject
if (! empty($line->date_end)) $type=1;
// Ligne en mode visu
// TODO Do not use GET here, but put information into parameter of function
if ($_GET['action'] != 'editline' || $selected != $line->id)
if ($action != 'editline' || $selected != $line->id)
{
// Produit
if ($line->fk_product > 0)
......@@ -1580,7 +1580,7 @@ class CommonObject
}
// Ligne en mode update
if ($this->statut == 0 && $_GET["action"] == 'editline' && $selected == $line->id)
if ($this->statut == 0 && $action == 'editline' && $selected == $line->id)
{
if ($line->fk_product > 0)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment