forked from Wavyzz/dolibarr
fix set project for actioncomm (#35543)
This commit is contained in:
@@ -2631,21 +2631,21 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".$this->db->prefix().$this->table_element;
|
||||
// @phan-suppress-next-line PhanTypeMismatchProperty
|
||||
if (!empty($this->fields['fk_project'])) { // Common case
|
||||
if ($projectid) {
|
||||
$sql .= " SET fk_project = ".((int) $projectid);
|
||||
} else {
|
||||
$sql .= " SET fk_project = NULL";
|
||||
}
|
||||
$sql .= ' WHERE rowid = '.((int) $this->id);
|
||||
} elseif ($this->table_element == 'actioncomm') { // Special case for actioncomm
|
||||
if ($this->table_element == 'actioncomm') { // Special case for actioncomm
|
||||
if ($projectid) {
|
||||
$sql .= " SET fk_project = ".((int) $projectid);
|
||||
} else {
|
||||
$sql .= " SET fk_project = NULL";
|
||||
}
|
||||
$sql .= ' WHERE id = '.((int) $this->id);
|
||||
// @phan-suppress-next-line PhanTypeMismatchProperty
|
||||
} elseif (!empty($this->fields['fk_project'])) { // Common case
|
||||
if ($projectid) {
|
||||
$sql .= " SET fk_project = ".((int) $projectid);
|
||||
} else {
|
||||
$sql .= " SET fk_project = NULL";
|
||||
}
|
||||
$sql .= ' WHERE rowid = '.((int) $this->id);
|
||||
} else { // Special case for old architecture objects
|
||||
if ($projectid) {
|
||||
$sql .= ' SET fk_projet = '.((int) $projectid);
|
||||
|
||||
Reference in New Issue
Block a user