PHP Class Computer_Item, glpi

Inheritance: extends CommonDBRelation
Show file Open project: glpi-project/glpi Class Usage Examples

Public Properties

Property Type Description
$checkItem_2_Rights
$items_id_1
$items_id_2
$itemtype_1 From CommonDBRelation
$itemtype_2

Public Methods

Method Description
cleanDBonPurge ( ) : nothing Actions done when item is deleted from the database Overloaded to manage autoupdate feature
cloneComputer ( $oldid, $newid ) Duplicate connected items to computer from an item template to its clone
cloneItem ( $itemtype, $oldid, $newid ) Duplicate connected items to item from an item template to its clone
countForAll ( Computer $comp, CommonDBTM $item ) : integer: Count connection for a Computer and an itemtype
countForComputer ( Computer $comp ) : integer: Count connection for a Computer
countForItem ( CommonDBTM $item ) : integer: Count connection for an item
disconnectForItem ( CommonDBTM $item ) : boolean Disconnect an item to its computer
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
dropdownAllConnect ( $fromtype, $myname, $entity_restrict, $onlyglobal, $used = [] ) : nothing Make a select box for connections
dropdownConnect ( $itemtype, $fromtype, $myname, $entity_restrict, $onlyglobal, $used = [] ) : nothing Make a select box for connections
getForbiddenStandardMassiveAction ( )
getMassiveActionsForItemtype ( array &$actions, $itemtype, $is_deleted, CommonDBTM $checkitem = NULL )
getRelationMassiveActionsSpecificities ( )
getTabNameForItem ( CommonGLPI $item, $withtemplate )
prepareInputForAdd ( $input ) : the Prepare input datas for adding the relation
showForComputer ( Computer $comp, $withtemplate = '' ) : Nothing Print the form for computers or templates connections to printers, screens or peripherals
showForItem ( CommonDBTM $item, $withtemplate = '' ) : nothing Prints a direct connection to a computer
unglobalizeItem ( CommonDBTM $item ) Unglobalize an item : duplicate item and connections

Method Details

cleanDBonPurge() public method

Actions done when item is deleted from the database Overloaded to manage autoupdate feature
public cleanDBonPurge ( ) : nothing
return nothing

cloneComputer() static public method

Duplicate connected items to computer from an item template to its clone
static public cloneComputer ( $oldid, $newid )
$oldid ID of the item to clone
$newid ID of the item cloned

cloneItem() static public method

Duplicate connected items to item from an item template to its clone
static public cloneItem ( $itemtype, $oldid, $newid )
$itemtype type of the item to clone
$oldid ID of the item to clone
$newid ID of the item cloned

countForAll() static public method

Count connection for a Computer and an itemtype
static public countForAll ( Computer $comp, CommonDBTM $item ) : integer:
$comp Computer Computer object
$item CommonDBTM CommonDBTM object
return integer:

countForComputer() static public method

Count connection for a Computer
static public countForComputer ( Computer $comp ) : integer:
$comp Computer Computer object
return integer:

countForItem() static public method

Count connection for an item
static public countForItem ( CommonDBTM $item ) : integer:
$item CommonDBTM CommonDBTM object
return integer:

disconnectForItem() public method

Disconnect an item to its computer
public disconnectForItem ( CommonDBTM $item ) : boolean
$item CommonDBTM CommonDBTM object: the Monitor/Phone/Peripheral/Printer
return boolean : action succeeded

displayTabContentForItem() static public method

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

dropdownAllConnect() static public method

Make a select box for connections
static public dropdownAllConnect ( $fromtype, $myname, $entity_restrict, $onlyglobal, $used = [] ) : nothing
$fromtype from where the connection is
$myname select name
$entity_restrict Restrict to a defined entity (default = -1)
$onlyglobal display only global devices (used for templates) (default 0)
$used array Already used items ID: not to display in dropdown
return nothing (print out an HTML select box)

dropdownConnect() static public method

Make a select box for connections
static public dropdownConnect ( $itemtype, $fromtype, $myname, $entity_restrict, $onlyglobal, $used = [] ) : nothing
$itemtype type to connect
$fromtype from where the connection is
$myname select name
$entity_restrict Restrict to a defined entity (default = -1)
$onlyglobal display only global devices (used for templates) (default 0)
$used array Already used items ID: not to display in dropdown
return nothing (print out an HTML select box)

getForbiddenStandardMassiveAction() public method

getMassiveActionsForItemtype() static public method

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

getRelationMassiveActionsSpecificities() static public method

See also: CommonDBRelation::getRelationMassiveActionsSpecificities()

getTabNameForItem() public method

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

prepareInputForAdd() public method

Overloaded to check is Disconnect needed (during OCS sync) and to manage autoupdate feature
public prepareInputForAdd ( $input ) : the
$input array of datas used to add the item
return the modified $input array

showForComputer() static public method

Print the form for computers or templates connections to printers, screens or peripherals
static public showForComputer ( Computer $comp, $withtemplate = '' ) : Nothing
$comp Computer Computer object
$withtemplate boolean Template or basic item (default '')
return Nothing (call to classes members)

showForItem() static public method

Prints a direct connection to a computer
static public showForItem ( CommonDBTM $item, $withtemplate = '' ) : nothing
$item CommonDBTM CommonDBTM object: the Monitor/Phone/Peripheral/Printer
$withtemplate integer withtemplate param (default '')
return nothing (print out a table)

unglobalizeItem() static public method

Unglobalize an item : duplicate item and connections
static public unglobalizeItem ( CommonDBTM $item )
$item CommonDBTM CommonDBTM object to unglobalize

Property Details

$checkItem_2_Rights public static property

public static $checkItem_2_Rights

$items_id_1 public static property

public static $items_id_1

$items_id_2 public static property

public static $items_id_2

$itemtype_1 public static property

From CommonDBRelation
public static $itemtype_1

$itemtype_2 public static property

public static $itemtype_2