Works on Milestone module
This commit is contained in:
parent
f430b54cca
commit
156f60f549
@ -245,10 +245,10 @@ if ($_POST['action'] == 'addmilestone')
|
||||
{
|
||||
$milestone = new Milestone($db);
|
||||
|
||||
$milestone->label = $_POST['milestone_label'];
|
||||
$milestone->label = $_POST['milestone_label'];
|
||||
$milestone->description = $_POST['milestone_desc'];
|
||||
$milestone->elementtype = $propal->element;
|
||||
$milestone->fk_element = $propal->id;
|
||||
$milestone->elementid = $propal->id;
|
||||
|
||||
$ret = $milestone->create($user);
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user