Fix: possibility to defined rang with an external module
This commit is contained in:
parent
6cdd20496a
commit
1373336e94
@ -732,15 +732,8 @@ class CommonObject
|
||||
{
|
||||
$this->line_order();
|
||||
|
||||
/* Lecture du rang de la ligne */
|
||||
$sql = 'SELECT rang FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||
$sql.= ' WHERE rowid ='.$rowid;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
$rang = $row[0];
|
||||
}
|
||||
// Get rang of line
|
||||
$rang = $this->getRangOfLine($rowid);
|
||||
|
||||
if ($rang > 1 )
|
||||
{
|
||||
@ -767,15 +760,8 @@ class CommonObject
|
||||
{
|
||||
$this->line_order();
|
||||
|
||||
/* Lecture du rang de la ligne */
|
||||
$sql = 'SELECT rang FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||
$sql.= ' WHERE rowid ='.$rowid;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
$rang = $row[0];
|
||||
}
|
||||
// Get rang of line
|
||||
$rang = $this->getRangOfLine($rowid);
|
||||
|
||||
// Get max value for rang
|
||||
$max = $this->line_max();
|
||||
@ -800,6 +786,22 @@ class CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get position of line (rang)
|
||||
* @result int Value of rang in table of lines
|
||||
*/
|
||||
function getRangOfLine($rowid)
|
||||
{
|
||||
$sql = 'SELECT rang FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||
$sql.= ' WHERE rowid ='.$rowid;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
return $row[0];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get max value used for position of line (rang)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user