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

Methods

__construct()

__construct() 

__contruct function where initialize base URLs

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

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

defineTabs()

defineTabs(array  $options = array()) : array

Define tabs to display on form page

Parameters

array $options

Returns

array —

containing the tabs name

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

showJobLogs()

showJobLogs() 

Show job logs

ajaxGetJobLogs()

ajaxGetJobLogs(integer  $task_id) 

Ajax called to get job logs

Parameters

integer $task_id

getCounterTypeName()

getCounterTypeName(string  $type = "") : string

Get translated name of counter type

Parameters

string $type

Returns

string

getAgentsLogs()

getAgentsLogs(array  $agents = array(), array  $counters = array(), string  $target_id = "") : array

Get agents logs

Parameters

array $agents
array $counters
string $target_id

Returns

array

getRunLogs()

getRunLogs(array  $run = array()) : array

Get run logs

Parameters

array $run

Returns

array

showForm()

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

Display form for task configuration

Parameters

integer $id

ID of the task

$options

array

Returns

boolean —

TRUE if form is ok

submitForm()

submitForm(array  $postvars) 

Manage the different actions in when submit form (add, update,purge.

..)

Parameters

array $postvars

getEmpty()

getEmpty() 

Define reprepare_if_successful field when get empty item