PHP Class Infocom, glpi

Inheritance: extends CommonDBChild
Datei anzeigen Open project: glpi-project/glpi Class Usage Examples

Public Properties

Property Type Description
$auto_message_on_action
$dohistory
$items_id
$itemtype From CommonDBChild
$logs_for_parent Link in message can't work'
$rightname

Public Methods

Method 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 method

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')
return float or array

addPluginInfos() static public method

static public addPluginInfos ( CommonDBTM $item )
$item CommonDBTM

autofillDates() static public method

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

canApplyOn() static public method

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

cleanDBonPurge() public method

public cleanDBonPurge ( )

cloneItem() static public method

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 method

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

cronInfo() static public method

static public cronInfo ( $name )
$name

cronInfocom() static public method

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 method

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

dropdownAlert() static public method

static public dropdownAlert ( $options )
$options array

dropdownAmortType() static public method

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 method

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)
return array or string

getAmortTypeName() static public method

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

getAutoManagemendDatesFields() static public method

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

getFromDBforDevice() public method

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
return true if succeed else false

getItemtypesThatCanHave() static public method

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

getLogTypeID() public method

public getLogTypeID ( )

getMassiveActionsForItemtype() static public method

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

getSearchOptions() public method

public getSearchOptions ( )

getSearchOptionsToAdd() static public method

static public getSearchOptionsToAdd ( $itemtype )
$itemtype

getSpecificValueToDisplay() static public method

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

getSpecificValueToSelect() static public method

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

getTabNameForItem() public method

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

getTypeName() static public method

static public getTypeName ( $nb )

getWarrantyExpir() static public method

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)
return expiration date string

manageDateOnStatusChange() static public method

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

post_getEmpty() public method

public post_getEmpty ( )

pre_updateInDB() public method

public pre_updateInDB ( )

prepareInputForAdd() public method

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

prepareInputForUpdate() public method

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

processMassiveActionsForOneItemtype() static public method

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

showDebug() public method

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

showForItem() static public method

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 method

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 '')
return 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