PHP Class Infocom, glpi

Inheritance: extends CommonDBChild
Afficher le fichier Open project: glpi-project/glpi Class Usage Examples

Méthodes publiques

Свойство Type Description
$auto_message_on_action
$dohistory
$items_id
$itemtype From CommonDBChild
$logs_for_parent Link in message can't work'
$rightname

Méthodes publiques

Méthode Description
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

Method Details

Amort() static public méthode

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')
Résultat float or array

addPluginInfos() static public méthode

static public addPluginInfos ( CommonDBTM $item )
$item CommonDBTM

autofillDates() static public méthode

Automatically manage copying one date to another is necessary
static public autofillDates ( &$infocoms = [], $field = '', $action, $params = [] ) : nothing
Résultat nothing

canApplyOn() static public méthode

Check if given object can have InfoCom
static public canApplyOn ( $item ) : true
$item an object or a string
Résultat true if $object is an object that can have InfoCom

cleanDBonPurge() public méthode

public cleanDBonPurge ( )

cloneItem() static public méthode

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 méthode

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

cronInfo() static public méthode

static public cronInfo ( $name )
$name

cronInfocom() static public méthode

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 méthode

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

dropdownAlert() static public méthode

static public dropdownAlert ( $options )
$options array

dropdownAmortType() static public méthode

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() static public méthode

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)
Résultat array or string

getAmortTypeName() static public méthode

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

getAutoManagemendDatesFields() static public méthode

Return all infocom dates that could be automaticall filled
static public getAutoManagemendDatesFields ( ) : an
Résultat an array with all dates (configuration field & real field)

getFromDBforDevice() public méthode

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
Résultat true if succeed else false

getItemtypesThatCanHave() static public méthode

Get all the types that can have an infocom
static public getItemtypesThatCanHave ( ) : array
Résultat array of the itemtypes

getLogTypeID() public méthode

public getLogTypeID ( )

getMassiveActionsForItemtype() static public méthode

See also: CommonDBTM::getMassiveActionsForItemtype()
static public getMassiveActionsForItemtype ( array &$actions, $itemtype, $is_deleted, CommonDBTM $checkitem = NULL )
$actions array
$checkitem CommonDBTM

getSearchOptions() public méthode

public getSearchOptions ( )

getSearchOptionsToAdd() static public méthode

static public getSearchOptionsToAdd ( $itemtype )
$itemtype

getSpecificValueToDisplay() static public méthode

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

getSpecificValueToSelect() static public méthode

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

getTabNameForItem() public méthode

See also: CommonGLPI::getTabNameForItem()
public getTabNameForItem ( CommonGLPI $item, $withtemplate )
$item CommonGLPI

getTypeName() static public méthode

static public getTypeName ( $nb )

getWarrantyExpir() static public méthode

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)
Résultat expiration date string

manageDateOnStatusChange() static public méthode

Fill, if necessary, automatically some dates when status changes
static public manageDateOnStatusChange ( CommonDBTM $item, $action_add = true ) : nothing
$item CommonDBTM
Résultat nothing

post_getEmpty() public méthode

public post_getEmpty ( )

pre_updateInDB() public méthode

public pre_updateInDB ( )

prepareInputForAdd() public méthode

See also: CommonDBChild::prepareInputForAdd()
public prepareInputForAdd ( $input )

prepareInputForUpdate() public méthode

See also: CommonDBChild::prepareInputForUpdate()
public prepareInputForUpdate ( $input )

processMassiveActionsForOneItemtype() static public méthode

See also: CommonDBTM::processMassiveActionsForOneItemtype()
static public processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids )
$ma MassiveAction
$item CommonDBTM
$ids array

showDebug() public méthode

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

showForItem() static public méthode

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() static public méthode

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 '')
Résultat float

Property Details

$auto_message_on_action public_oe property

public $auto_message_on_action

$dohistory public_oe property

public $dohistory

$items_id public_oe static_oe property

public static $items_id

$itemtype public_oe static_oe property

From CommonDBChild
public static $itemtype

$logs_for_parent public_oe static_oe property

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

$rightname static_oe public_oe property

static public $rightname