PHP Class Cartridge, glpi

See also: CartridgeItem
Author: Julien Dombre
Inheritance: extends CommonDBChild
Afficher le fichier Open project: glpi-project/glpi Class Usage Examples

Méthodes publiques

Свойство Type Description
$dohistory
$items_id
$itemtype From CommonDBChild
$no_form_page

Protected Properties

Свойство Type Description
$forward_entity_to From CommonDBTM

Méthodes publiques

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

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

countForCartridgeItem() static public méthode

static public countForCartridgeItem ( CartridgeItem $item )
$item CartridgeItem

countForPrinter() static public méthode

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

displayTabContentForItem() static public méthode

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

getCount() static public méthode

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)
Résultat string to display

getCountForPrinter() static public méthode

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)
Résultat string to display

getForbiddenStandardMassiveAction() public méthode

getNameField() static public méthode

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

getNotificationParameters() static public méthode

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

getOldNumber() static public méthode

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

getOldNumberForPrinter() static public méthode

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

getPreAdditionalInfosForName() public méthode

See also: CommonDBTM::getPreAdditionalInfosForName

getRights() public méthode

public getRights ( $interface = 'central' )

getStatus() static public méthode

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
Résultat string : dict value for the cartridge status.

getTabNameForItem() public méthode

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

getTotalNumber() static public méthode

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

getTotalNumberForPrinter() static public méthode

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

getTypeName() static public méthode

static public getTypeName ( $nb )

getUnusedNumber() static public méthode

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

getUsedNumber() static public méthode

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

getUsedNumberForPrinter() static public méthode

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

install() public méthode

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

post_addItem() public méthode

public post_addItem ( )

post_updateItem() public méthode

public post_updateItem ( $history = 1 )

prepareInputForAdd() public méthode

public prepareInputForAdd ( $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

showAddForm() static public méthode

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

showForCartridgeItem() static public méthode

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)
Résultat Nothing (displays)

showForPrinter() static public méthode

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

showForm() public méthode

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

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

uninstall() public méthode

UnLink the cartridge identified by $ID
public uninstall ( $ID ) : boolean
$ID : cartridge identifier
Résultat 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