PHP Class Cartridge, glpi

See also: CartridgeItem
Author: Julien Dombre
Inheritance: extends CommonDBChild
Mostrar archivo Open project: glpi-project/glpi Class Usage Examples

Public Properties

Property Type Description
$dohistory
$items_id
$itemtype From CommonDBChild
$no_form_page

Protected Properties

Property Type Description
$forward_entity_to From CommonDBTM

Public Methods

Method Description
backToStock ( array $input, $history = 1 ) send back to stock
countForCartridgeItem ( CartridgeItem $item )
countForPrinter ( Printer $item )
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
getCount ( $tID, $alarm_threshold, $nohtml ) : string Print the cartridge count HTML array for the cartridge item $tID
getCountForPrinter ( $pID, $nohtml ) : string Print the cartridge count HTML array for the printer $pID
getForbiddenStandardMassiveAction ( )
getNameField ( )
getNotificationParameters ( $entity ) Get notification parameters by entity
getOldNumber ( $tID ) : integer count how many old cartbridge for the cartridge item $tID
getOldNumberForPrinter ( $pID ) : integer count how many old cartbridge for theprinter $pID
getPreAdditionalInfosForName ( )
getRights ( $interface = 'central' )
getStatus ( $date_use, $date_out ) : string Get the dict value for the status of a cartridge
getTabNameForItem ( CommonGLPI $item, $withtemplate )
getTotalNumber ( $tID ) : integer count how many cartbridge for the cartridge item $tID
getTotalNumberForPrinter ( $pID ) : integer count how many cartbridge for the printer $pID
getTypeName ( $nb )
getUnusedNumber ( $tID ) : integer count how many cartbridge unused for the cartridge item $tID
getUsedNumber ( $tID ) : integer count how many cartridge used for the cartridge item $tID
getUsedNumberForPrinter ( $pID ) : integer count how many cartridge used for the printer $pID
install ( $pID, $tID ) : boolean Link a cartridge to a printer.
post_addItem ( )
post_updateItem ( $history = 1 )
prepareInputForAdd ( $input )
processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids )
showAddForm ( CartridgeItem $cartitem ) : Nothing Print out a link to add directly a new cartridge from a cartridge item.
showForCartridgeItem ( CartridgeItem $cartitem, $show_old ) : Nothing Print out the cartridges of a defined type
showForPrinter ( Printer $printer, $old ) : nothing Show installed cartridges
showForm ( $ID, $options = [] ) form for Cartridge
showMassiveActionsSubForm ( MassiveAction $ma )
uninstall ( $ID ) : boolean UnLink a cartridge linked to a printer

Method Details

backToStock() public method

send back to stock
public backToStock ( array $input, $history = 1 )
$input array

countForCartridgeItem() static public method

static public countForCartridgeItem ( CartridgeItem $item )
$item CartridgeItem

countForPrinter() static public method

static public countForPrinter ( Printer $item )
$item Printer Printer object

displayTabContentForItem() static public method

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

getCount() static public method

Print the cartridge count HTML array for the cartridge item $tID
static public getCount ( $tID, $alarm_threshold, $nohtml ) : string
$tID integer: cartridge item identifier.
$alarm_threshold integer: threshold alarm value.
$nohtml integer: Return value without HTML tags (default 0)
return string to display

getCountForPrinter() static public method

Print the cartridge count HTML array for the printer $pID
static public getCountForPrinter ( $pID, $nohtml ) : string
$pID integer: printer identifier.
$nohtml integer: Return value without HTML tags (default 0)
return string to display

getForbiddenStandardMassiveAction() public method

getNameField() static public method

See also: CommonDBTM::getNameField()
static public getNameField ( )

getNotificationParameters() static public method

Get notification parameters by entity
static public getNotificationParameters ( $entity )

getOldNumber() static public method

count how many old cartbridge for the cartridge item $tID
static public getOldNumber ( $tID ) : integer
$tID integer: cartridge item identifier.
return integer : number of old cartridge counted.

getOldNumberForPrinter() static public method

count how many old cartbridge for theprinter $pID
static public getOldNumberForPrinter ( $pID ) : integer
$pID integer: printer identifier.
return integer : number of old cartridge counted.

getPreAdditionalInfosForName() public method

See also: CommonDBTM::getPreAdditionalInfosForName

getRights() public method

public getRights ( $interface = 'central' )

getStatus() static public method

Get the dict value for the status of a cartridge
static public getStatus ( $date_use, $date_out ) : string
$date_use date : date of use
$date_out date : date of delete
return string : dict value for the cartridge status.

getTabNameForItem() public method

public getTabNameForItem ( CommonGLPI $item, $withtemplate )
$item CommonGLPI

getTotalNumber() static public method

count how many cartbridge for the cartridge item $tID
static public getTotalNumber ( $tID ) : integer
$tID integer: cartridge item identifier.
return integer : number of cartridge counted.

getTotalNumberForPrinter() static public method

count how many cartbridge for the printer $pID
static public getTotalNumberForPrinter ( $pID ) : integer
$pID integer: printer identifier.
return integer : number of cartridge counted.

getTypeName() static public method

static public getTypeName ( $nb )

getUnusedNumber() static public method

count how many cartbridge unused for the cartridge item $tID
static public getUnusedNumber ( $tID ) : integer
$tID integer: cartridge item identifier.
return integer : number of cartridge unused counted.

getUsedNumber() static public method

count how many cartridge used for the cartridge item $tID
static public getUsedNumber ( $tID ) : integer
$tID integer: cartridge item identifier.
return integer : number of cartridge used counted.

getUsedNumberForPrinter() static public method

count how many cartridge used for the printer $pID
static public getUsedNumberForPrinter ( $pID ) : integer
$pID integer: printer identifier.
return integer : number of cartridge used counted.

install() public method

Link the first unused cartridge of type $Tid to the printer $pID
public install ( $pID, $tID ) : boolean
$pID : printer identifier
$tID : cartridge type identifier
return boolean : true for success

post_addItem() public method

public post_addItem ( )

post_updateItem() public method

public post_updateItem ( $history = 1 )

prepareInputForAdd() public method

public prepareInputForAdd ( $input )

processMassiveActionsForOneItemtype() static public method

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

showAddForm() static public method

Print out a link to add directly a new cartridge from a cartridge item.
static public showAddForm ( CartridgeItem $cartitem ) : Nothing
$cartitem CartridgeItem CartridgeItem object
return Nothing (displays)

showForCartridgeItem() static public method

Print out the cartridges of a defined type
static public showForCartridgeItem ( CartridgeItem $cartitem, $show_old ) : Nothing
$cartitem CartridgeItem object of CartridgeItem class
$show_old boolean show old cartridges or not (default 0)
return Nothing (displays)

showForPrinter() static public method

Show installed cartridges
static public showForPrinter ( Printer $printer, $old ) : nothing
$printer Printer Printer object
$old boolean old cartridges or not ? (default 0)
return nothing (display)

showForm() public method

form for Cartridge
public showForm ( $ID, $options = [] )
$ID integer Id of the cartridge
$options array of possible options: - parent Object : the printers where the cartridge is used

showMassiveActionsSubForm() static public method

See also: CommonDBTM::showMassiveActionsSubForm()
static public showMassiveActionsSubForm ( MassiveAction $ma )
$ma MassiveAction

uninstall() public method

UnLink the cartridge identified by $ID
public uninstall ( $ID ) : boolean
$ID : cartridge identifier
return boolean

Property Details

$dohistory public_oe property

public $dohistory

$forward_entity_to protected_oe static_oe property

From CommonDBTM
protected static $forward_entity_to

$items_id public_oe static_oe property

public static $items_id

$itemtype public_oe static_oe property

From CommonDBChild
public static $itemtype

$no_form_page public_oe property

public $no_form_page