PHP Класс 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 .
Наследование: extends fActiveRecord
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$items_id
$itemtype From CommonDBChild
$no_form_page
$rightname

Защищенные свойства (Protected)

Свойство Тип Описание
$forward_entity_to From CommonDBTM

Открытые методы

Метод Описание
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

Описание методов

backToStock() публичный Метод

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

cleanDBonPurge() публичный Метод

public cleanDBonPurge ( )

countForConsumableItem() статический публичный Метод

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

displayTabContentForItem() статический публичный Метод

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

getCount() статический публичный Метод

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)
Результат string to display

getForbiddenStandardMassiveAction() публичный Метод

getNameField() статический публичный Метод

since version 0.84
См. также: CommonDBTM::getNameField()
static public getNameField ( )

getOldNumber() статический публичный Метод

count how many old consumable for the consumable item $tID
static public getOldNumber ( $tID ) : integer
$tID integer consumable item identifier.
Результат integer : number of old consumable counted.

getPreAdditionalInfosForName() публичный Метод

См. также: CommonDBTM::getPreAdditionalInfosForName

getRights() публичный Метод

public getRights ( $interface = 'central' )

getStatus() статический публичный Метод

Get the localized string for the status of a consumable
static public getStatus ( $cID ) : string
$cID integer consumable ID.
Результат string : dict value for the consumable status.

getTabNameForItem() публичный Метод

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

getTotalNumber() статический публичный Метод

count how many consumable for the consumable item $tID
static public getTotalNumber ( $tID ) : integer
$tID integer consumable item identifier.
Результат integer : number of consumable counted.

getTypeName() статический публичный Метод

static public getTypeName ( $nb )

getUnusedNumber() статический публичный Метод

count how many consumable unused for the consumable item $tID
static public getUnusedNumber ( $tID ) : integer
$tID integer consumable item identifier.
Результат integer : number of consumable unused counted.

isNew() статический публичный Метод

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

isOld() статический публичный Метод

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

out() публичный Метод

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)
Результат boolean

post_addItem() публичный Метод

public post_addItem ( )

prepareInputForAdd() публичный Метод

public prepareInputForAdd ( $input )

processMassiveActionsForOneItemtype() статический публичный Метод

См. также: CommonDBTM::processMassiveActionsForOneItemtype()
static public processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids )
$ma MassiveAction
$item CommonDBTM
$ids array

showAddForm() статический публичный Метод

Print out a link to add directly a new consumable from a consumable item.
static public showAddForm ( ConsumableItem $consitem ) : Nothing
$consitem ConsumableItem ConsumableItem object
Результат Nothing (displays)

showForConsumableItem() статический публичный Метод

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)
Результат Nothing (displays)

showMassiveActionsSubForm() статический публичный Метод

См. также: CommonDBTM::showMassiveActionsSubForm()
static public showMassiveActionsSubForm ( MassiveAction $ma )
$ma MassiveAction

showSummary() статический публичный Метод

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

Описание свойств

$forward_entity_to защищенное статическое свойство

From CommonDBTM
protected static $forward_entity_to

$items_id публичное статическое свойство

public static $items_id

$itemtype публичное статическое свойство

From CommonDBChild
public static $itemtype

$no_form_page публичное свойство

public $no_form_page

$rightname статическое публичное свойство

static public $rightname