Skip to content

Commit

Permalink
Fix actiontime by task searchoption
Browse files Browse the repository at this point in the history
  • Loading branch information
xacobofg committed Aug 3, 2022
1 parent cc597cd commit ada4646
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 19 deletions.
28 changes: 28 additions & 0 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,34 @@ function plugin_actualtime_getAddSearchOptionsNew($itemtype){
$tab = array_merge($tab, PluginActualtimeTask::rawSearchOptionsToAdd());
}
break;
case 'TicketTask':
$config = new PluginActualtimeConfig;
if ((Session::getCurrentInterface() == "central") || $config->showInHelpdesk()) {
$tab[] = [
'id' => 'actualtime',
'name' => 'ActualTime'
];

$tab[]=[
'id'=>'7003',
'table'=>PluginActualtimeTask::getTable(),
'field'=>'actual_actiontime',
'name'=>__('Task duration'),
'datatype' => 'specific',
'joinparams'=>[
'beforejoin'=>[
'table'=>'glpi_tickettasks',
'joinparams' => [
'jointype' => 'child'
]
],
'jointype' => 'child',
'linkfield'=>'tasks_id'
],
'type'=>'task'
];
}
break;
}

return $tab;
Expand Down
24 changes: 5 additions & 19 deletions inc/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ static function getTypeName($nb = 0) {

static public function rawSearchOptionsToAdd(){

$tab[] = [
'id' => 'actualtime',
'name' => 'ActualTime'
];

$tab[]=[
'id'=>'7000',
'table'=>self::getTable(),
Expand Down Expand Up @@ -104,25 +109,6 @@ static public function rawSearchOptionsToAdd(){
'type'=>'diff%'
];

$tab[]=[
'id'=>'7003',
'table'=>self::getTable(),
'field'=>'actual_actiontime',
'name'=>__('Task duration'),
'datatype' => 'specific',
'joinparams'=>[
'beforejoin'=>[
'table'=>'glpi_tickettasks',
'joinparams' => [
'jointype' => 'child'
]
],
'jointype' => 'child',
'linkfield'=>'tasks_id'
],
'type'=>'task'
];

return $tab;
}

Expand Down

0 comments on commit ada4646

Please sign in to comment.