Works on Milestone module
This commit is contained in:
parent
f430b54cca
commit
156f60f549
@ -248,7 +248,7 @@ if ($_POST['action'] == 'addmilestone')
|
|||||||
$milestone->label = $_POST['milestone_label'];
|
$milestone->label = $_POST['milestone_label'];
|
||||||
$milestone->description = $_POST['milestone_desc'];
|
$milestone->description = $_POST['milestone_desc'];
|
||||||
$milestone->elementtype = $propal->element;
|
$milestone->elementtype = $propal->element;
|
||||||
$milestone->fk_element = $propal->id;
|
$milestone->elementid = $propal->id;
|
||||||
|
|
||||||
$ret = $milestone->create($user);
|
$ret = $milestone->create($user);
|
||||||
|
|
||||||
|
|||||||
@ -783,15 +783,8 @@ class CommonObject
|
|||||||
$rang = $row[0];
|
$rang = $row[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lecture du rang max de la facture */
|
// Get max value for rang
|
||||||
$sql = 'SELECT max(rang) FROM '.MAIN_DB_PREFIX.$this->table_element_line;
|
$max = $this->line_max();
|
||||||
$sql.= ' WHERE '.$this->fk_element.' = '.$this->id;
|
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$row = $this->db->fetch_row($resql);
|
|
||||||
$max = $row[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($rang < $max)
|
if ($rang < $max)
|
||||||
{
|
{
|
||||||
@ -814,6 +807,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
|
* \brief Update private note of element
|
||||||
* \param note New value for note
|
* \param note New value for note
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user