forked from Wavyzz/dolibarr
Works on Milestone module
This commit is contained in:
@@ -783,15 +783,8 @@ class CommonObject
|
||||
$rang = $row[0];
|
||||
}
|
||||
|
||||
/* Lecture du rang max de la facture */
|
||||
$sql = 'SELECT max(rang) FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||
$sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
$max = $row[0];
|
||||
}
|
||||
// Get max value for rang
|
||||
$max = $this->line_max();
|
||||
|
||||
if ($rang < $max)
|
||||
{
|
||||
@@ -813,6 +806,21 @@ class CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Get max value for rang
|
||||
*/
|
||||
function line_max()
|
||||
{
|
||||
$sql = 'SELECT max(rang) FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
||||
$sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$row = $this->db->fetch_row($resql);
|
||||
return $row[0];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Update private note of element
|
||||
|
||||
Reference in New Issue
Block a user