PHP Class Consumable, glpi

This file is part of Print Master. Print Master is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Print Master is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Print Master. If not, see .
Inheritance: extends fActiveRecord
Show file Open project: glpi-project/glpi Class Usage Examples

Public Properties

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

Protected Properties

Property Type Description
$forward_entity_to From CommonDBTM

Public Methods

Method Description
backToStock ( array $input, $history = 1 ) send back to stock
cleanDBonPurge ( )
countForConsumableItem ( ConsumableItem $item )
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
getCount ( $tID, $alarm_threshold, $nohtml ) : string Get the consumable count HTML array for a defined consumable type
getForbiddenStandardMassiveAction ( )
getNameField ( ) since version 0.84
getOldNumber ( $tID ) : integer count how many old consumable for the consumable item $tID
getPreAdditionalInfosForName ( )
getRights ( $interface = 'central' )
getStatus ( $cID ) : string Get the localized string for the status of a consumable
getTabNameForItem ( CommonGLPI $item, $withtemplate )
getTotalNumber ( $tID ) : integer count how many consumable for the consumable item $tID
getTypeName ( $nb )
getUnusedNumber ( $tID ) : integer count how many consumable unused for the consumable item $tID
isNew ( $cID ) Check if a Consumable is New (not used, in stock)
isOld ( $cID ) Check if a consumable is Old (used, not in stock)
out ( $ID, $itemtype = '', $items_id ) : boolean UnLink a consumable linked to a printer
post_addItem ( )
prepareInputForAdd ( $input )
processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids )
showAddForm ( ConsumableItem $consitem ) : Nothing Print out a link to add directly a new consumable from a consumable item.
showForConsumableItem ( ConsumableItem $consitem, $show_old ) : Nothing Print out the consumables of a defined type
showMassiveActionsSubForm ( MassiveAction $ma )
showSummary ( ) Show the usage summary of consumables by user

Method Details

backToStock() public method

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

cleanDBonPurge() public method

public cleanDBonPurge ( )

countForConsumableItem() static public method

static public countForConsumableItem ( ConsumableItem $item )
$item ConsumableItem string ConsumableItem object

displayTabContentForItem() static public method

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

getCount() static public method

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

getForbiddenStandardMassiveAction() public method

getNameField() static public method

since version 0.84
See also: CommonDBTM::getNameField()
static public getNameField ( )

getOldNumber() static public method

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

getPreAdditionalInfosForName() public method

See also: CommonDBTM::getPreAdditionalInfosForName

getRights() public method

public getRights ( $interface = 'central' )

getStatus() static public method

Get the localized string for the status of a consumable
static public getStatus ( $cID ) : string
$cID integer consumable ID.
return string : dict value for the consumable status.

getTabNameForItem() public method

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

getTotalNumber() static public method

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

getTypeName() static public method

static public getTypeName ( $nb )

getUnusedNumber() static public method

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

isNew() static public method

Check if a Consumable is New (not used, in stock)
static public isNew ( $cID )
$cID integer consumable ID.

isOld() static public method

Check if a consumable is Old (used, not in stock)
static public isOld ( $cID )
$cID integer consumable ID.

out() public method

UnLink the consumable identified by $ID
public out ( $ID, $itemtype = '', $items_id ) : boolean
$ID consumable identifier
$itemtype itemtype of who we give the consumable (default '')
$items_id ID of the item giving the consumable (default 0)
return boolean

post_addItem() public method

public post_addItem ( )

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 consumable from a consumable item.
static public showAddForm ( ConsumableItem $consitem ) : Nothing
$consitem ConsumableItem ConsumableItem object
return Nothing (displays)

showForConsumableItem() static public method

Print out the consumables of a defined type
static public showForConsumableItem ( ConsumableItem $consitem, $show_old ) : Nothing
$consitem ConsumableItem ConsumableItem object
$show_old boolean show old consumables or not. (default 0)
return Nothing (displays)

showMassiveActionsSubForm() static public method

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

showSummary() static public method

Show the usage summary of consumables by user
static public showSummary ( )

Property Details

$forward_entity_to protected static property

From CommonDBTM
protected static $forward_entity_to

$items_id public static property

public static $items_id

$itemtype public static property

From CommonDBChild
public static $itemtype

$no_form_page public property

public $no_form_page

$rightname static public property

static public $rightname