Skip to content

Commit

Permalink
automatic status - fixed #5281
Browse files Browse the repository at this point in the history
  • Loading branch information
yllen committed Apr 20, 2015
1 parent f142a2e commit ab7ec71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions inc/commonitilactor.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ function post_addItem() {
// Check object status and update it if needed
if (!isset($this->input['_from_object'])) {
if ($item->getFromDB($this->fields[static::getItilObjectForeignKey()])) {
if ($item->fields["status"] == CommonITILObject::INCOMING
&& in_array(CommonITILObject::ASSIGNED, $item->getAllStatusArray())) {
if (($item->fields["status"] == CommonITILObject::INCOMING)
&& in_array(CommonITILObject::ASSIGNED, array_keys($item->getAllStatusArray()))) {
$item->update(array('id' => $item->getID(),
'status' => CommonITILObject::ASSIGNED));
}
Expand Down
6 changes: 3 additions & 3 deletions inc/commonitilobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ function prepareInputForUpdate($input) {
&& in_array($this->fields['status'], $this->getNewStatusArray()))
|| (isset($input['status'])
&& in_array($input['status'], $this->getNewStatusArray()))) {
if (in_array(self::ASSIGNED, $this->getAllStatusArray())) {
if (in_array(self::ASSIGNED, array_keys($this->getAllStatusArray()))) {
$input['status'] = self::ASSIGNED;
}
}
Expand All @@ -745,7 +745,7 @@ function prepareInputForUpdate($input) {
&& (in_array($this->fields['status'], $this->getNewStatusArray())))
|| (isset($input['status'])
&& (in_array($input['status'], $this->getNewStatusArray())))) {
if (in_array(self::ASSIGNED, $this->getAllStatusArray())) {
if (in_array(self::ASSIGNED, array_keys($this->getAllStatusArray()))) {
$input['status'] = self::ASSIGNED;
}
}
Expand All @@ -766,7 +766,7 @@ function prepareInputForUpdate($input) {
&& (in_array($this->fields['status'], $this->getNewStatusArray())))
|| (isset($input['status'])
&& (in_array($input['status'], $this->getNewStatusArray())))) {
if (in_array(self::ASSIGNED, $this->getAllStatusArray())) {
if (in_array(self::ASSIGNED, array_keys($this->getAllStatusArray()))) {
$input['status'] = self::ASSIGNED;
}

Expand Down

0 comments on commit ab7ec71

Please sign in to comment.