Constants

MSG_INFO

MSG_INFO

Define the number for the message information constant

MSG_WARNING

MSG_WARNING

Define the number for the message warning constant

MSG_ERROR

MSG_ERROR

Define the number for the message error constant

Properties

$base_urls

$base_urls : array

Define default value for the base URLs

Type

array

$rightname

$rightname : string

The right name for this class

Type

string

Methods

__construct()

__construct() 

__construct function

getTabNameForItem()

getTabNameForItem(object  $item, integer  $withtemplate) : string

Get the tab name used for item

Parameters

object $item

the item object

integer $withtemplate

1 if is a template form

Returns

string —

name of the tab

displayTabContentForItem()

displayTabContentForItem(object  $item, integer  $tabnum = 1, integer  $withtemplate) : boolean

Display the content of the tab

Parameters

object $item
integer $tabnum

number of the tab to display

integer $withtemplate

1 if is a template form

Returns

boolean

ajaxLoadItem()

ajaxLoadItem(array  $options) : integer

Ajax load item

Parameters

array $options

Returns

integer

ajaxGetForm()

ajaxGetForm(array  $options) 

Get form in ajax

Parameters

array $options

showListHeader()

showListHeader(integer  $task_id, boolean  $deletion_activated) 

Display list header

Parameters

integer $task_id
boolean $deletion_activated

getItemsList()

getItemsList(string  $module_type) : string

Get items list

Parameters

string $module_type

Returns

string

getItemDisplay()

getItemDisplay(string  $module_type, string  $itemtype, integer  $items_id) : string

Get the html code for item to display

Parameters

string $module_type
string $itemtype
integer $items_id

Returns

string

showListForTask()

showListForTask(integer  $task_id) 

Show jobs list for task

Parameters

integer $task_id

getTaskjobs()

getTaskjobs(integer  $task_id) : array

Get task jobs

Parameters

integer $task_id

Returns

array

showTaskjobSummary()

showTaskjobSummary(array  $taskjob_data) 

Show task job summary

Parameters

array $taskjob_data

ajaxModuleTypesDropdown()

ajaxModuleTypesDropdown(array  $options) 

Display dropdown module types called in ajax

Parameters

array $options

ajaxModuleItemsDropdown()

ajaxModuleItemsDropdown(array  $options) 

Display dropdown module items called in ajax

Parameters

array $options

getAddItemtypeButton()

getAddItemtypeButton(string  $title, string  $itemtype, string  $method) : string

Get html code for itemtype plus button

Parameters

string $title
string $itemtype
string $method

Returns

string

showForm()

showForm(integer  $id, array  $options = array()) : true

Display form for taskjob

Parameters

integer $id

id of the taskjob

array $options

Returns

true

submitForm()

submitForm(array  $postvars) 

Manage actions when submit a form (add, update, purge.

..)

Parameters

array $postvars

getBaseUrlFor()

getBaseUrlFor(string  $name) : string

Get a specific url root by type name

Parameters

string $name

the type of url requested (can be used for ajax call or pictures location)

Returns

string —

the requested url if found otherwise empty string

showList()

showList() 

Show Search list for this itemtype

showTextField()

showTextField(string  $title, string  $varname) 

Display input form element

Parameters

string $title
string $varname

showIntegerField()

showIntegerField(string  $title, string  $varname, array  $options = array()) 

Display input form element only with numbers

Parameters

string $title
string $varname
array $options

showCheckboxField()

showCheckboxField(string  $title, string  $varname, array  $options = array()) 

Display checkbox form element

Parameters

string $title
string $varname
array $options

showDropdownForItemtype()

showDropdownForItemtype(string  $title, string  $itemtype, array  $options = array()) : string

Display dropdown form element for itemtype

Parameters

string $title
string $itemtype

a glpi/plugin itemtype

array $options

Returns

string —

the rand number can be used with ajax to update something

showDropdownFromArray()

showDropdownFromArray(string  $title, string  $varname, array  $values = array(), array  $options = array()) : string

Display dropdown form element with array data

Parameters

string $title
string $varname
array $values
array $options

Returns

string —

the rand number can be used with ajax to update something

showDateTimeField()

showDateTimeField(string  $title, string  $varname, array  $options = array()) 

Display date time select form element

Parameters

string $title
string $varname
array $options

showTextArea()

showTextArea(string  $title, string  $varname) 

Display a text area form element

Parameters

string $title
string $varname

getMessage()

getMessage(string  $msg, integer  $type = self::MSG_INFO) : string

Get a HTML message

Parameters

string $msg
integer $type

Returns

string

getTypeName()

getTypeName(integer  $nb) : string

Get name of this type by language of the user connected

Parameters

integer $nb

number of elements

Returns

string —

name of this type

canCreate()

canCreate() : boolean

Check if can create an item

Returns

boolean

getJoinQuery()

getJoinQuery() : array

Get join query in SQL

Returns

array

getSearchOptions()

getSearchOptions() : array

Get search function for the class

Returns

array

getTask()

getTask() : object

get task of this tasl job

Returns

object —

PluginFusioninventoryTask instance

manageDefinitionsActions()

manageDefinitionsActions(integer  $id, string  $type) 

Manage definitions

Parameters

integer $id

id of the taskjob

string $type

type (definition or action)

dropdownType()

dropdownType(string  $myname, string  $method, integer  $value, integer  $taskjobs_id, string  $entity_restrict = '') : string

Display definitions type dropdown

Parameters

string $myname
string $method
integer $value
integer $taskjobs_id
string $entity_restrict

Returns

string —

unique id of html element

getTypesForModule()

getTypesForModule(string  $method, string  $moduletype) : array

Get Itemtypes list for the selected method

Parameters

string $method
string $moduletype

Returns

array

dropdownvalue()

dropdownvalue(string  $myname, string  $definitiontype, string  $method, string  $deftypeid, integer  $taskjobs_id, integer  $value, string  $entity_restrict = '', integer  $title) : string

Display definitions value with preselection of definition type

Parameters

string $myname

name of dropdown

string $definitiontype

name of the definition type selected

string $method

name of the method selected

string $deftypeid

dropdown name of definition type

integer $taskjobs_id
integer $value

name of the definition (used for edit taskjob)

string $entity_restrict

restriction of entity if required

integer $title

Returns

string —

unique id of html element

dropdownActionType()

dropdownActionType(string  $myname, string  $method, integer  $value, string  $entity_restrict = '') : string

Display actions type (itemtypes)

Parameters

string $myname

name of dropdown

string $method

name of the method selected

integer $value

name of the definition type (used for edit taskjob)

string $entity_restrict

restriction of entity if required

Returns

string —

unique id of html element

dropdownAction()

dropdownAction(string  $myname, string  $actiontype, string  $method, string  $actiontypeid, integer  $value, string  $entity_restrict = '') : string

Display actions value with preselection of action type

Parameters

string $myname

name of dropdown

string $actiontype

name of the action type selected

string $method

name of the method selected

string $actiontypeid

dropdown name of action type

integer $value

name of the definition (used for edit taskjob)

string $entity_restrict

restriction of entity if required

Returns

string —

unique id of html element

getAgents()

getAgents(string  $module) : array

Get all agents allowed to a module (task method)

Parameters

string $module

name of dropdown

Returns

array —

[id integed agent id] => $name value agent name

reinitializeTaskjobs()

reinitializeTaskjobs(integer  $tasks_id, integer  $disableTimeVerification) : boolean

re initialize all taskjob of a taskjob

Parameters

integer $tasks_id

id of the task

integer $disableTimeVerification

Returns

boolean —

TRUE if all taskjob are ready (so finished from old runnning job)

forceRunningTask()

forceRunningTask(integer  $tasks_id) : string

Force running a task

Parameters

integer $tasks_id

id of the task

Returns

string —

unique id

periodicityToTimestamp()

periodicityToTimestamp(string  $periodicity_type, integer  $periodicity_count) : integer

Get period in secondes by type and count time

Parameters

string $periodicity_type

type of time (minutes, hours...)

integer $periodicity_count

number of type time

Returns

integer —

in seconds

showActions()

showActions(integer  $items_id, string  $itemtype) 

Display actions possible in device

Parameters

integer $items_id
string $itemtype

redirectTask()

redirectTask(integer  $taskjobs_id) 

Redirect url to task and right taskjob tab

Parameters

integer $taskjobs_id

id of the taskjob

manageTasksByObject()

manageTasksByObject(string  $itemtype = '', integer  $items_id) 

Display task informations for an object

Parameters

string $itemtype

itemtype of object

integer $items_id

id of the object

CronCheckRunnningJobs()

CronCheckRunnningJobs() 

Cron task: finish task if have some problem or started for so long time

checkConfiguration()

checkConfiguration() : boolean

Check for configuration consistency.

Remove items targets or actors that have been deleted.

Returns

boolean —

( What does this return value mean ? -- Kevin Roy kiniou@gmail.com )

purgeTaskjob()

purgeTaskjob(object  $parm) 

Purge taskjoblog/state when delete taskjob

Parameters

object $parm

PluginFusioninventoryTaskjob instance

forceEnd()

forceEnd() 

Force end task

quickList()

quickList(string  $method) 

Display static list of taskjob

Parameters

string $method

method name of taskjob to display

additemtodefatc()

additemtodefatc(string  $type, string  $itemtype, integer  $items_id, integer  $taskjobs_id) 

Function used to add item in definition or action of a taskjob and hide add form and refresh type list

Parameters

string $type
string $itemtype
integer $items_id
integer $taskjobs_id

deleteitemtodefatc()

deleteitemtodefatc(string  $type,   $a_items_id, integer  $taskjobs_id) 

Function used to delete item in definition or action of a taskjob and hide add form and refresh type list

Parameters

string $type
$a_items_id
integer $taskjobs_id

plusButton()

plusButton(string  $name) 

Display + button to add definition or action

Parameters

string $name

name of the action (here definition or action)

prepareRunTaskjob()

prepareRunTaskjob(array  $a_taskjob) : string

Prepare task job

Parameters

array $a_taskjob

Returns

string —

uniqid

updateMethod()

updateMethod(string  $method, integer  $taskjobs_id) 

Update method

Parameters

string $method
integer $taskjobs_id

displayList()

displayList(integer  $tasks_id) 

Update list of definition and actions

Parameters

integer $tasks_id

getSpecificMassiveActions()

getSpecificMassiveActions(object|null  $checkitem = NULL) : array

Get the massive actions for this object

Parameters

object|null $checkitem

Returns

array —

list of actions

processMassiveActionsForOneItemtype()

processMassiveActionsForOneItemtype(object  $ma, object  $item, array  $ids) 

Execution code for massive action

Parameters

object $ma

MassiveAction instance

object $item

item on which execute the code

array $ids

list of ID on which execute the code