Skip to content

Commit

Permalink
fix(issue): Show pending / accepted forms search results
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienClairembault authored and btry committed Jun 30, 2022
1 parent 6487611 commit 58ea066
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ function plugin_formcreator_addWhere($link, $nott, $itemtype, $ID, $val, $search
$tocheck = $item->getNewStatusArray();
break;

case Ticket::WAITING:
$tocheck = $item->getPendingStatusArray();
break;

case Ticket::CLOSED:
$tocheck = $item->getClosedStatusArray();
break;

case 'process' :
// getProcessStatusArray should be an abstract method of CommonITILObject
$tocheck = $item->getProcessStatusArray();
Expand Down
8 changes: 6 additions & 2 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -864,15 +864,19 @@ public static function giveItem($itemtype, $option_id, $data, $num) {
}

static function getClosedStatusArray() {
return Ticket::getClosedStatusArray();
return [...Ticket::getClosedStatusArray(), PluginFormcreatorFormAnswer::STATUS_ACCEPTED];
}

static function getSolvedStatusArray() {
return [...Ticket::getSolvedStatusArray(), PluginFormcreatorFormAnswer::STATUS_REFUSED];
}

static function getNewStatusArray() {
return [Ticket::INCOMING, PluginFormcreatorFormAnswer::STATUS_WAITING, PluginFormcreatorFormAnswer::STATUS_ACCEPTED];
return [Ticket::INCOMING];
}

static function getPendingStatusArray() {
return [Ticket::WAITING, PluginFormcreatorFormAnswer::STATUS_WAITING];
}

static function getProcessStatusArray() {
Expand Down

0 comments on commit 58ea066

Please sign in to comment.