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

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