Constants

TASK_STARTED

TASK_STARTED

Define state task started

TASK_OK

TASK_OK

Define state task OK / successful

TASK_ERROR_OR_REPLANNED

TASK_ERROR_OR_REPLANNED

Define state task in error or replanned

TASK_ERROR

TASK_ERROR

Define state task in error

TASK_INFO

TASK_INFO

Define state task information

TASK_RUNNING

TASK_RUNNING

Define state task running

TASK_PREPARED

TASK_PREPARED

Define state task prepared, so wait agent contact the server to get this task

Methods

dropdownStateValues()

dropdownStateValues() : array

return array with state mapping name

Returns

array —

with all elements

getStateName()

getStateName(integer  $state = -1) : string

Get state name

Parameters

integer $state

Returns

string

getStateCSSName()

getStateCSSName(integer  $state = -1) : string

Get css for state

Parameters

integer $state

Returns

string

getState()

getState(integer  $states_id) : string

Return name of state

Parameters

integer $states_id

Returns

string —

name of state number

getStateItemtype()

getStateItemtype(integer  $taskjoblogs_id) : string

Get itemtype of task job state

Parameters

integer $taskjoblogs_id

Returns

string

getSearchOptions()

getSearchOptions() : array

Get search function for the class

Returns

array

javascriptHistory()

javascriptHistory() 

Display javascript functions for history

showHistoryLines()

showHistoryLines(integer  $taskjobstates_id, integer  $displayprocess = 1, integer  $displaytaskjob, integer  $nb_td = 5) 

Display each history line

Parameters

integer $taskjobstates_id
integer $displayprocess
integer $displaytaskjob
integer $nb_td

showHistoryInDetail()

showHistoryInDetail(integer  $agents_id, integer  $uniqid, integer  $width = 950) : string

Get the html display detail of each history line

Parameters

integer $agents_id

id of the agent

integer $uniqid

uniq id of each taskjobs runing

integer $width

how large in pixel display array

Returns

string

displayHistoryDetail()

displayHistoryDetail(array  $datas, integer  $comment = 1) : array

Display high detail of each history line

Parameters

array $datas

data of history

integer $comment

0/1 display comment or not

Returns

array —
  • boolean 0/1 if this log = finish
    • text to display

addTaskjoblog()

addTaskjoblog(integer  $taskjobstates_id, integer  $items_id, string  $itemtype, string  $state, string  $comment) 

Add a new line of log for a taskjob status

Parameters

integer $taskjobstates_id

id of the taskjobstate

integer $items_id

id of the item associated with taskjob status

string $itemtype

type name of the item associated with taskjob status

string $state

state of this taskjobstate

string $comment

the comment of this insertion

graphFinish()

graphFinish(integer  $taskjobs_id) 

Display the graph of finished tasks

Parameters

integer $taskjobs_id

id of the taskjob

getByUniqID()

getByUniqID(string  $uuid) : array

Get taskjobstate by uniqid

Parameters

string $uuid

value uniqid

Returns

array —

with data of table glpi_plugin_fusioninventory_taskjobstates

displayShortLogs()

displayShortLogs(integer  $taskjobs_id, integer  $veryshort) 

Display short logs

Parameters

integer $taskjobs_id

id of taskjob

integer $veryshort

activation to have very very short display

getDivState()

getDivState(integer  $state, string  $type = 'div') : string

Get div with text/color depend on state

Parameters

integer $state

state number

string $type

div / td

Returns

string —

complete node (openned and closed)

convertComment()

convertComment(string  $comment) : string

Convert comment by replace formated message by translated message

Parameters

string $comment

Returns

string

listTasks()

listTasks() 

LIst tasks

showLine()

showLine(string  $module, string  $name, string  $text, integer  $percent, \integr  $state, integer  $begintable, integer  $endtable) 

Show monitoring/log line

Parameters

string $module
string $name
string $text
integer $percent
\integr $state
integer $begintable
integer $endtable