PHP Class Contract, glpi

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

Public Properties

Property Type Description
$dohistory From CommonDBTM
$rightname

Protected Properties

Property Type Description
$forward_entity_to
$usenotepad

Public Methods

Method Description
cleanDBonPurge ( )
cronContract ( $task = NULL ) Cron action on contracts : alert depending of the config : on notice and expire
cronInfo ( $name )
defineTabs ( $options = [] )
dropdown ( $options = [] ) : Nothing Print a select with contracts
dropdownAlert ( array $options )
dropdownContractRenewal ( $name, $value, $display = true ) : Nothing Print a select with contract renewal
getAlertName ( $val = NULL ) : array Get the possible value for contract alert
getContractRenewalIDByName ( $value ) : the Get renewal ID by name
getContractRenewalName ( $value ) : string Get the renewal type name
getMassiveActionsForItemtype ( array &$actions, $itemtype, $is_deleted, CommonDBTM $checkitem = NULL )
getSearchOptions ( )
getSearchOptionsToAdd ( )
getSpecificMassiveActions ( $checkitem = NULL )
getSpecificValueToDisplay ( $field, $values, array $options = [] )
getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] )
getSuppliersNames ( ) : string Get the entreprise name for the contract
getTypeName ( $nb )
getUnallowedFieldsForUnicity ( )
post_addItem ( )
post_getEmpty ( )
pre_updateInDB ( )
prepareInputForAdd ( $input )
showCentral ( ) : Nothing Show central contract resume HTML array
showDebug ( ) Display debug information for current object
showForm ( $ID, $options = [] ) : boolean Print the contract form

Method Details

cleanDBonPurge() public method

public cleanDBonPurge ( )

cronContract() static public method

Cron action on contracts : alert depending of the config : on notice and expire
static public cronContract ( $task = NULL )
$task for log, if NULL display (default NULL)

cronInfo() static public method

static public cronInfo ( $name )

defineTabs() public method

public defineTabs ( $options = [] )

dropdown() static public method

Print a select named $name with contracts options and selected value $value
static public dropdown ( $options = [] ) : Nothing
$options array of possible options: - name : string / name of the select (default is contracts_id) - value : integer / preselected value (default 0) - entity : integer or array / restrict to a defined entity or array of entities (default -1 : no restriction) - rand : (defauolt mt_rand) - entity_sons : boolean / if entity restrict specified auto select its sons only available if entity is a single value not an array (default false) - used : array / Already used items ID: not to display in dropdown (default empty) - nochecklimit : boolean / disable limit for nomber of device (for supplier, default false) - on_change : string / value to transmit to "onChange" - display : boolean / display or return string (default true) - expired : boolean / display expired contract (default false)
return Nothing (display)

dropdownAlert() static public method

static public dropdownAlert ( array $options )
$options array array

dropdownContractRenewal() static public method

Print a select named $name with contract renewal options and selected value $value
static public dropdownContractRenewal ( $name, $value, $display = true ) : Nothing
$name string HTML select name
$value integer HTML select selected value (default = 0)
$display boolean get or display string ? (true by default)
return Nothing (display)

getAlertName() static public method

Get the possible value for contract alert
static public getAlertName ( $val = NULL ) : array
$val if not set, ask for all values, else for 1 value (default NULL)
return array or string

getContractRenewalIDByName() static public method

Get renewal ID by name
static public getContractRenewalIDByName ( $value ) : the
$value the name of the renewal
return the ID of the renewal

getContractRenewalName() static public method

Get the renewal type name
static public getContractRenewalName ( $value ) : string
$value integer HTML select selected value
return string

getMassiveActionsForItemtype() static public method

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

getSearchOptions() public method

public getSearchOptions ( )

getSearchOptionsToAdd() static public method

static public getSearchOptionsToAdd ( )

getSpecificMassiveActions() public method

See also: CommonDBTM::getSpecificMassiveActions()
public getSpecificMassiveActions ( $checkitem = NULL )

getSpecificValueToDisplay() static public method

static public getSpecificValueToDisplay ( $field, $values, array $options = [] )
$field
$values
$options array array

getSpecificValueToSelect() static public method

static public getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] )
$field
$name (default '')
$values (default '')
$options array array

getSuppliersNames() public method

Get the entreprise name for the contract
public getSuppliersNames ( ) : string
return string of names (HTML)

getTypeName() static public method

static public getTypeName ( $nb )

getUnallowedFieldsForUnicity() public method

post_addItem() public method

public post_addItem ( )

post_getEmpty() public method

public post_getEmpty ( )

pre_updateInDB() public method

public pre_updateInDB ( )

prepareInputForAdd() public method

See also: CommonDBTM::prepareInputForAdd()
public prepareInputForAdd ( $input )

showCentral() static public method

Show central contract resume HTML array
static public showCentral ( ) : Nothing
return Nothing (display)

showDebug() public method

Display debug information for current object
public showDebug ( )

showForm() public method

Print the contract form
public showForm ( $ID, $options = [] ) : boolean
$ID integer ID of the item
$options array - target filename : where to go when done. - withtemplate boolean : template or basic item
return boolean item found

Property Details

$dohistory public property

From CommonDBTM
public $dohistory

$forward_entity_to protected static property

protected static $forward_entity_to

$rightname static public property

static public $rightname

$usenotepad protected property

protected $usenotepad