PHP Класс Infocom, glpi

Наследование: extends CommonDBChild
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$auto_message_on_action
$dohistory
$items_id
$itemtype From CommonDBChild
$logs_for_parent Link in message can't work'
$rightname

Открытые методы

Метод Описание
Amort ( $type_amort, $va, $duree, $coef, $date_achat, $date_use, $date_tax, $view = "n" ) : float Calculate amortissement for an item
addPluginInfos ( CommonDBTM $item )
autofillDates ( &$infocoms = [], $field = '', $action, $params = [] ) : nothing Automatically manage copying one date to another is necessary
canApplyOn ( $item ) : true Check if given object can have InfoCom
cleanDBonPurge ( )
cloneItem ( $itemtype, $oldid, $newid, $newitemtype = '' ) Duplicate infocoms from an item template to its clone
countForSupplier ( Supplier $item )
cronInfo ( $name )
cronInfocom ( $task = NULL ) Cron action on infocom : alert on expired warranty
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
dropdownAlert ( $options )
dropdownAmortType ( $name, $value, $display = true ) Dropdown of amortissement type for infocoms
getAlertName ( $val = NULL ) : array Get the possible value for infocom alert
getAmortTypeName ( $value ) Get amortissement type name for infocoms
getAutoManagemendDatesFields ( ) : an Return all infocom dates that could be automaticall filled
getFromDBforDevice ( $itemtype, $ID ) : true Retrieve an item from the database for a device
getItemtypesThatCanHave ( ) : array Get all the types that can have an infocom
getLogTypeID ( )
getMassiveActionsForItemtype ( array &$actions, $itemtype, $is_deleted, CommonDBTM $checkitem = NULL )
getSearchOptions ( )
getSearchOptionsToAdd ( $itemtype )
getSpecificValueToDisplay ( $field, $values, array $options = [] )
getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] )
getTabNameForItem ( CommonGLPI $item, $withtemplate )
getTypeName ( $nb )
getWarrantyExpir ( $from, $addwarranty, $deletenotice, $color = false ) : expiration Get date using a begin date and a period in month
manageDateOnStatusChange ( CommonDBTM $item, $action_add = true ) : nothing Fill, if necessary, automatically some dates when status changes
post_getEmpty ( )
pre_updateInDB ( )
prepareInputForAdd ( $input )
prepareInputForUpdate ( $input )
processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids )
showDebug ( ) Display debug information for infocom of current object
showDisplayLink ( $itemtype, $device_id ) : float Show infocom link to display modal
showForItem ( CommonDBTM $item, $withtemplate = '' ) Show Infocom form for an item (not a standard showForm)
showTco ( $ticket_tco, $value, $date_achat = "" ) : float Calculate TCO and TCO by month for an item

Описание методов

Amort() статический публичный Метод

Calculate amortissement for an item
static public Amort ( $type_amort, $va, $duree, $coef, $date_achat, $date_use, $date_tax, $view = "n" ) : float
$type_amort type d'amortisssment "lineaire=2" ou "degressif=1"
$va valeur d'acquisition
$duree duree d'amortissement
$coef coefficient d'amortissement
$date_achat Date d'achat
$date_use Date d'utilisation
$date_tax date du debut de l'annee fiscale
$view "n" pour l'annee en cours ou "all" pour le tableau complet (default 'n')
Результат float or array

addPluginInfos() статический публичный Метод

static public addPluginInfos ( CommonDBTM $item )
$item CommonDBTM

autofillDates() статический публичный Метод

Automatically manage copying one date to another is necessary
static public autofillDates ( &$infocoms = [], $field = '', $action, $params = [] ) : nothing
Результат nothing

canApplyOn() статический публичный Метод

Check if given object can have InfoCom
static public canApplyOn ( $item ) : true
$item an object or a string
Результат true if $object is an object that can have InfoCom

cleanDBonPurge() публичный Метод

public cleanDBonPurge ( )

cloneItem() статический публичный Метод

Duplicate infocoms from an item template to its clone
static public cloneItem ( $itemtype, $oldid, $newid, $newitemtype = '' )
$itemtype itemtype of the item
$oldid ID of the item to clone
$newid ID of the item cloned
$newitemtype itemtype of the new item (= $itemtype if empty) (default '')

countForSupplier() статический публичный Метод

static public countForSupplier ( Supplier $item )
$item Supplier Supplier object

cronInfo() статический публичный Метод

static public cronInfo ( $name )
$name

cronInfocom() статический публичный Метод

Cron action on infocom : alert on expired warranty
static public cronInfocom ( $task = NULL )
$task to log, if NULL use display (default NULL)

displayTabContentForItem() статический публичный Метод

static public displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
$item CommonGLPI CommonGLPI object
$tabnum (default 1)
$withtemplate (default 0)

dropdownAlert() статический публичный Метод

static public dropdownAlert ( $options )
$options array

dropdownAmortType() статический публичный Метод

Dropdown of amortissement type for infocoms
static public dropdownAmortType ( $name, $value, $display = true )
$name select name
$value default value (default 0)
$display display or get string (true by default)

getAlertName() статический публичный Метод

Get the possible value for infocom alert
static public getAlertName ( $val = NULL ) : array
$val if not set, ask for all values, else for 1 value (default NULL)
Результат array or string

getAmortTypeName() статический публичный Метод

Get amortissement type name for infocoms
static public getAmortTypeName ( $value )
$value status ID

getAutoManagemendDatesFields() статический публичный Метод

Return all infocom dates that could be automaticall filled
static public getAutoManagemendDatesFields ( ) : an
Результат an array with all dates (configuration field & real field)

getFromDBforDevice() публичный Метод

Retrieve an item from the database for a device
public getFromDBforDevice ( $itemtype, $ID ) : true
$itemtype type of the device to retrieve infocom
$ID ID of the device to retrieve infocom
Результат true if succeed else false

getItemtypesThatCanHave() статический публичный Метод

Get all the types that can have an infocom
static public getItemtypesThatCanHave ( ) : array
Результат array of the itemtypes

getLogTypeID() публичный Метод

public getLogTypeID ( )

getMassiveActionsForItemtype() статический публичный Метод

См. также: CommonDBTM::getMassiveActionsForItemtype()
static public getMassiveActionsForItemtype ( array &$actions, $itemtype, $is_deleted, CommonDBTM $checkitem = NULL )
$actions array
$checkitem CommonDBTM

getSearchOptions() публичный Метод

public getSearchOptions ( )

getSearchOptionsToAdd() статический публичный Метод

static public getSearchOptionsToAdd ( $itemtype )
$itemtype

getSpecificValueToDisplay() статический публичный Метод

static public getSpecificValueToDisplay ( $field, $values, array $options = [] )
$options array

getSpecificValueToSelect() статический публичный Метод

static public getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] )
$field
$name (default '')
$values (default '')
$options array array

getTabNameForItem() публичный Метод

См. также: CommonGLPI::getTabNameForItem()
public getTabNameForItem ( CommonGLPI $item, $withtemplate )
$item CommonGLPI

getTypeName() статический публичный Метод

static public getTypeName ( $nb )

getWarrantyExpir() статический публичный Метод

Get date using a begin date and a period in month
static public getWarrantyExpir ( $from, $addwarranty, $deletenotice, $color = false ) : expiration
$from date begin date
$addwarranty integer period in months
$deletenotice integer period in months of notice (default 0)
$color boolean if show expire date in red color (false by default)
Результат expiration date string

manageDateOnStatusChange() статический публичный Метод

Fill, if necessary, automatically some dates when status changes
static public manageDateOnStatusChange ( CommonDBTM $item, $action_add = true ) : nothing
$item CommonDBTM
Результат nothing

post_getEmpty() публичный Метод

public post_getEmpty ( )

pre_updateInDB() публичный Метод

public pre_updateInDB ( )

prepareInputForAdd() публичный Метод

См. также: CommonDBChild::prepareInputForAdd()
public prepareInputForAdd ( $input )

prepareInputForUpdate() публичный Метод

См. также: CommonDBChild::prepareInputForUpdate()
public prepareInputForUpdate ( $input )

processMassiveActionsForOneItemtype() статический публичный Метод

См. также: CommonDBTM::processMassiveActionsForOneItemtype()
static public processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids )
$ma MassiveAction
$item CommonDBTM
$ids array

showDebug() публичный Метод

Display debug information for infocom of current object
public showDebug ( )

showForItem() статический публичный Метод

Show Infocom form for an item (not a standard showForm)
static public showForItem ( CommonDBTM $item, $withtemplate = '' )
$item CommonDBTM CommonDBTM object
$withtemplate integer template or basic item (default '')

showTco() статический публичный Метод

Calculate TCO and TCO by month for an item
static public showTco ( $ticket_tco, $value, $date_achat = "" ) : float
$ticket_tco Tco part of tickets
$value
$date_achat (default '')
Результат float

Описание свойств

$auto_message_on_action публичное свойство

public $auto_message_on_action

$dohistory публичное свойство

public $dohistory

$items_id публичное статическое свойство

public static $items_id

$itemtype публичное статическое свойство

From CommonDBChild
public static $itemtype

$logs_for_parent публичное статическое свойство

Link in message can't work'
public static $logs_for_parent

$rightname статическое публичное свойство

static public $rightname