PHP Class CommonITILObject, glpi

Inheritance: extends CommonDBTM
Exibir arquivo Open project: glpi-project/glpi Class Usage Examples

Public Properties

Property Type Description
$grouplinkclass
$mailqueueonaction From CommonDBTM
$supplierlinkclass
$userlinkclass

Protected Properties

Property Type Description
$groups Groups by type
$suppliers Suppliers by type
$userentity_oncreate Use user entity to select entity of the object
$users Users by type

Public Methods

Method Description
addFiles ( $donotif = 1, $disablenotif ) : array add files (from $this->input['_filename']) to an ITIL object create document if needed create link from document to ITIL object
canAdminActors ( )
canAssign ( )
cleanDBonPurge ( )
commonListHeader ( $output_type = Search::HTML_OUTPUT, $mass_id = '' )
computeCloseDelayStat ( ) Compute close delay stat of the current ticket
computeDefaultValuesForAdd ( $input ) : string Compute default values for Add (to be passed in prepareInputForAdd before and after rules if needed)
computePriority ( $urgency, $impact ) : integer Compute Priority
computeSolveDelayStat ( ) Compute solve delay stat of the current ticket
countActiveObjectsForSupplier ( $suppliers_id ) : integer Count active ITIL Objects assigned to a supplier
countActiveObjectsForTech ( $users_id ) : integer Count active ITIL Objects assigned to a user
countActiveObjectsForTechGroup ( $groups_id ) : integer Count active ITIL Objects assigned to a group
countActiveObjectsForUser ( $users_id ) : integer Count active ITIL Objects requested by a user
countGroups ( $type ) : integer count groups linked to object by type or global
countSuppliers ( $type ) : integer count suppliers linked to object by type or global
countUsers ( $type ) : integer count users linked to object by type or global
dropdownImpact ( array $options = [] ) : string Dropdown of ITIL object Impact
dropdownPriority ( array $options = [] ) : string Dropdown of ITIL object priority
dropdownStatus ( array $options = [] ) : nothing Dropdown of object status
dropdownUrgency ( array $options = [] ) : string Dropdown of ITIL object Urgency
getActionTime ( $actiontime )
getActorFieldNameType ( $type ) : get get field part name corresponding to actor type
getActorIcon ( $user_group, $type ) : nothing show Icon for Actor
getAdditionalDatas ( )
getAllStatusArray ( $withmetaforsearch = false ) : an Get the ITIL object status list
getAllTypesForHelpdesk ( ) Get all available types to which an ITIL object can be assigned
getAllUsers ( $type ) : array get users linked to an object including groups ones
getAllowedStatusArray ( $current ) : an Get the ITIL object status allowed for a current status
getAssignName ( $ID, $itemtype, $link )
getCalendar ( ) Get correct Calendar: Entity or Sla
getClosedStatusArray ( ) : an Get the ITIL object closed status list
getDefaultActor ( $type ) : boolean Get Default actor when creating the object
getDefaultActorRightSearch ( $type ) : boolean Get Default actor when creating the object
getFromDBwithData ( $ID, $purecontent ) : true Retrieve an item from the database with datas associated (hardwares)
getGroups ( $type ) : array get groups linked to a object
getImpactName ( $value ) Get ITIL object Impact Name
getNewStatusArray ( ) : an Get the ITIL object new status list
getPriorityName ( $value ) Get ITIL object priority Name
getProcessStatus ( ) : an Get the ITIL object process status list
getSearchOptionsActors ( )
getSearchOptionsMain ( )
getSearchOptionsSolution ( )
getSearchOptionsStats ( )
getSolvedStatusArray ( ) : an Get the ITIL object solved status list
getSpecificValueToDisplay ( $field, $values, array $options = [] ) : a display a value according to a field
getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] )
getStatus ( $value ) Get ITIL object status Name
getStatusIconURL ( $status ) : icon Get status icon URL
getSuppliers ( $type ) : array get suppliers linked to a object
getUrgencyName ( $value ) Get ITIL object Urgency Name
getUsedAssignGroupBetween ( $date1 = '', $date2 = '' ) : array Get groups assigned to itil object between 2 dates
getUsedAuthorBetween ( $date1 = '', $date2 = '' ) : array Get users_ids of itil object between 2 dates
getUsedGroupBetween ( $date1 = '', $date2 = '' ) : array Get groups which have itil object between 2 dates
getUsedImpactBetween ( $date1 = '', $date2 = '' ) : array Get impacts of itil object between 2 dates
getUsedPriorityBetween ( $date1 = '', $date2 = '' ) : array Get priorities of itil object between 2 dates
getUsedRecipientBetween ( $date1 = '', $date2 = '' ) : array Get recipient of itil object between 2 dates
getUsedRequestTypeBetween ( $date1 = '', $date2 = '' ) : array Get request types of itil object between 2 dates
getUsedSolutionTypeBetween ( $date1 = '', $date2 = '' ) : array Get solution types of itil object between 2 dates
getUsedSupplierBetween ( $date1 = '', $date2 = '' ) : array Get enterprises which have itil object assigned to between 2 dates
getUsedTechBetween ( $date1 = '', $date2 = '' ) : array Get users which have intervention assigned to between 2 dates
getUsedTechTaskBetween ( $date1 = '', $date2 = '' ) : array Get users which have followup assigned to between 2 dates
getUsedUrgencyBetween ( $date1 = '', $date2 = '' ) : array Get urgencies of itil object between 2 dates
getUsedUserTitleOrTypeBetween ( $date1 = '', $date2 = '', $title = true ) : array Get recipient of itil object between 2 dates
getUsers ( $type ) : array get users linked to a object
haveAGroup ( $type, array $groups ) : boolean Is one of groups linked to the object ?
isAllowedStatus ( $old, $new ) : boolean check is the user can change from / to a status
isGroup ( $type, $groups_id ) : boolean Is a group linked to the object ?
isPossibleToAssignType ( $itemtype ) : true Check if it's possible to assign ITIL object to a type (core or plugin)
isStatusExists ( $status ) : boolean Is the ITIL object status exists for the object
isSupplier ( $type, $suppliers_id ) : boolean Is a supplier linked to the object ?
isUser ( $type, $users_id ) : boolean Is a user linked to the object ?
loadActors ( )
post_addItem ( )
post_getFromDB ( ) qualification
pre_updateInDB ( )
prepareInputForAdd ( $input )
prepareInputForUpdate ( $input )
processMassiveActionsForOneItemtype ( MassiveAction $ma, CommonDBTM $item, array $ids )
showActorAddForm ( $type, $rand_type, $entities_id, $is_hidden = [], $withgroup = true, $withsupplier = false, $inobject = true ) : nothing show actor add div
showActorAddFormOnCreate ( $type, array $options ) : nothing show user add div on creation
showActorsPartForm ( $ID, array $options ) : nothing show actor part in ITIL object form
showGroupsAssociated ( $type, $canedit, array $options = [] ) : nothing show groups asociated
showMassiveActionsSubForm ( MassiveAction $ma )
showMassiveSolutionForm ( $entities_id ) Form to add a solution to an ITIL object
showShort ( $id, $options = [] ) Display a line for an object
showSolutionForm ( $knowbase_id_toload ) Form to add a solution to an ITIL object
showStats ( )
showSupplierAddFormOnCreate ( array $options ) : nothing show supplier add div on creation
showSuppliersAssociated ( $type, $canedit, array $options = [] ) : nothing show suppliers associated
showUsersAssociated ( $type, $canedit, array $options = [] ) : nothing show tooltip for user notification information
updateActionTime ( $ID ) : boolean Update actiontime of the object based on actiontime of the tasks
updateDateMod ( $ID, $no_stat_computation = false, $users_id_lastupdater ) Update date mod of the ITIL object

Private Methods

Method Description
addAdditionalActors ( $input )

Method Details

addFiles() public method

add files (from $this->input['_filename']) to an ITIL object create document if needed create link from document to ITIL object
public addFiles ( $donotif = 1, $disablenotif ) : array
$donotif Boolean if we want to raise notification (default 1)
$disablenotif (default 0)
return array of doc added name

canAdminActors() public method

public canAdminActors ( )

canAssign() public method

public canAssign ( )

cleanDBonPurge() public method

public cleanDBonPurge ( )

commonListHeader() static public method

static public commonListHeader ( $output_type = Search::HTML_OUTPUT, $mass_id = '' )
$output_type (default 'Search::HTML_OUTPUT')
$mass_id id of the form to check all (default '')

computeCloseDelayStat() public method

Compute close delay stat of the current ticket

computeDefaultValuesForAdd() public method

Compute default values for Add (to be passed in prepareInputForAdd before and after rules if needed)
public computeDefaultValuesForAdd ( $input ) : string
$input
return string

computePriority() static public method

Compute Priority
static public computePriority ( $urgency, $impact ) : integer
$urgency integer from 1 to 5
$impact integer from 1 to 5
return integer from 1 to 5 (priority)

computeSolveDelayStat() public method

Compute solve delay stat of the current ticket

countActiveObjectsForSupplier() public method

Count active ITIL Objects assigned to a supplier
public countActiveObjectsForSupplier ( $suppliers_id ) : integer
$suppliers_id integer ID of the Supplier
return integer

countActiveObjectsForTech() public method

Count active ITIL Objects assigned to a user
public countActiveObjectsForTech ( $users_id ) : integer
$users_id integer ID of the User
return integer

countActiveObjectsForTechGroup() public method

Count active ITIL Objects assigned to a group
public countActiveObjectsForTechGroup ( $groups_id ) : integer
$groups_id integer ID of the User
return integer

countActiveObjectsForUser() public method

Count active ITIL Objects requested by a user
public countActiveObjectsForUser ( $users_id ) : integer
$users_id integer ID of the User
return integer

countGroups() public method

count groups linked to object by type or global
public countGroups ( $type ) : integer
$type type to search (see constants) / 0 for all (default 0)
return integer

countSuppliers() public method

count suppliers linked to object by type or global
public countSuppliers ( $type ) : integer
$type type to search (see constants) / 0 for all (default 0)
return integer

countUsers() public method

count users linked to object by type or global
public countUsers ( $type ) : integer
$type type to search (see constants) / 0 for all (default 0)
return integer

dropdownImpact() static public method

Dropdown of ITIL object Impact
static public dropdownImpact ( array $options = [] ) : string
$options array array of options - name : select name (default is impact) - value : default value (default 0) - showtype : list proposed : normal, search (default normal) - display : boolean if false get string \
return string id of the select

dropdownPriority() static public method

Dropdown of ITIL object priority
static public dropdownPriority ( array $options = [] ) : string
$options array array of options - name : select name (default is urgency) - value : default value (default 0) - showtype : list proposed : normal, search (default normal) - wthmajor : boolean with major priority ? - display : boolean if false get string
return string id of the select

dropdownStatus() static public method

Dropdown of object status
static public dropdownStatus ( array $options = [] ) : nothing
$options array array of options - name : select name (default is status) - value : default value (default self::INCOMING) - showtype : list proposed : normal, search or allowed (default normal) - display : boolean if false get string
return nothing (display)

dropdownUrgency() static public method

Dropdown of ITIL object Urgency
static public dropdownUrgency ( array $options = [] ) : string
$options array array of options - name : select name (default is urgency) - value : default value (default 0) - showtype : list proposed : normal, search (default normal) - display : boolean if false get string
return string id of the select

getActionTime() static public method

static public getActionTime ( $actiontime )
$actiontime

getActorFieldNameType() static public method

get field part name corresponding to actor type
static public getActorFieldNameType ( $type ) : get
$type integer : user type
return get typename

getActorIcon() static public method

show Icon for Actor
static public getActorIcon ( $user_group, $type ) : nothing
$user_group string 'user or 'group'
$type integer user/group type
return nothing display

getAdditionalDatas() public method

public getAdditionalDatas ( )

getAllStatusArray() static public method

Get the ITIL object status list
static public getAllStatusArray ( $withmetaforsearch = false ) : an
$withmetaforsearch boolean (false by default)
return an array

getAllTypesForHelpdesk() static public method

Get all available types to which an ITIL object can be assigned
static public getAllTypesForHelpdesk ( )

getAllUsers() public method

get users linked to an object including groups ones
public getAllUsers ( $type ) : array
$type type to search (see constants)
return array

getAllowedStatusArray() static public method

Get the ITIL object status allowed for a current status
static public getAllowedStatusArray ( $current ) : an
$current status
return an array

getAssignName() static public method

static public getAssignName ( $ID, $itemtype, $link )
$ID
$itemtype
$link (default 0)

getCalendar() public method

Get correct Calendar: Entity or Sla
Since: 0.90.4
public getCalendar ( )

getClosedStatusArray() static public method

Get the ITIL object closed status list
static public getClosedStatusArray ( ) : an
return an array

getDefaultActor() public method

Get Default actor when creating the object
public getDefaultActor ( $type ) : boolean
$type type to search (see constants)
return boolean

getDefaultActorRightSearch() public method

Get Default actor when creating the object
public getDefaultActorRightSearch ( $type ) : boolean
$type type to search (see constants)
return boolean

getFromDBwithData() public method

Retrieve an item from the database with datas associated (hardwares)
public getFromDBwithData ( $ID, $purecontent ) : true
$ID ID of the item to get
$purecontent boolean true : nothing change / false : convert to HTML display
return true if succeed else false

getGroups() public method

get groups linked to a object
public getGroups ( $type ) : array
$type type to search (see constants)
return array

getImpactName() static public method

Get ITIL object Impact Name
static public getImpactName ( $value )
$value impact ID

getNewStatusArray() static public method

Get the ITIL object new status list
static public getNewStatusArray ( ) : an
return an array

getPriorityName() static public method

Get ITIL object priority Name
static public getPriorityName ( $value )
$value priority ID

getProcessStatus() static public method

Get the ITIL object process status list
static public getProcessStatus ( ) : an
return an array

getSearchOptionsActors() public method

getSearchOptionsMain() public method

getSearchOptionsSolution() public method

getSearchOptionsStats() public method

getSolvedStatusArray() static public method

Get the ITIL object solved status list
static public getSolvedStatusArray ( ) : an
return an array

getSpecificValueToDisplay() static public method

display a value according to a field
static public getSpecificValueToDisplay ( $field, $values, array $options = [] ) : a
$field String name of the field
$values String / Array with the value to display
$options array Array of option
return a string

getSpecificValueToSelect() static public method

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

getStatus() static public method

Get ITIL object status Name
static public getStatus ( $value )
$value status ID

getStatusIconURL() static public method

Get status icon URL
static public getStatusIconURL ( $status ) : icon
$status status to get icon URL
return icon URL

getSuppliers() public method

get suppliers linked to a object
public getSuppliers ( $type ) : array
$type type to search (see constants)
return array

getUrgencyName() static public method

Get ITIL object Urgency Name
static public getUrgencyName ( $value )
$value urgency ID

getUsedAssignGroupBetween() public method

Get groups assigned to itil object between 2 dates
public getUsedAssignGroupBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct groups assigned to a tickets

getUsedAuthorBetween() public method

Get users_ids of itil object between 2 dates
public getUsedAuthorBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct users_ids which have itil object

getUsedGroupBetween() public method

Get groups which have itil object between 2 dates
public getUsedGroupBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct groups of tickets

getUsedImpactBetween() public method

Get impacts of itil object between 2 dates
public getUsedImpactBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct priorities of tickets

getUsedPriorityBetween() public method

Get priorities of itil object between 2 dates
public getUsedPriorityBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct priorities of tickets

getUsedRecipientBetween() public method

Get recipient of itil object between 2 dates
public getUsedRecipientBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct recipents which have itil object

getUsedRequestTypeBetween() public method

Get request types of itil object between 2 dates
public getUsedRequestTypeBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct request types of tickets

getUsedSolutionTypeBetween() public method

Get solution types of itil object between 2 dates
public getUsedSolutionTypeBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct request types of tickets

getUsedSupplierBetween() public method

Get enterprises which have itil object assigned to between 2 dates
public getUsedSupplierBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct enterprises which have any tickets assigned to.

getUsedTechBetween() public method

Get users which have intervention assigned to between 2 dates
public getUsedTechBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct users which have any intervention assigned to.

getUsedTechTaskBetween() public method

Get users which have followup assigned to between 2 dates
public getUsedTechTaskBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct users which have any followup assigned to.

getUsedUrgencyBetween() public method

Get urgencies of itil object between 2 dates
public getUsedUrgencyBetween ( $date1 = '', $date2 = '' ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct priorities of tickets

getUsedUserTitleOrTypeBetween() public method

Get recipient of itil object between 2 dates
public getUsedUserTitleOrTypeBetween ( $date1 = '', $date2 = '', $title = true ) : array
$date1 date : begin date (default '')
$date2 date : end date (default '')
return array contains the distinct recipents which have tickets

getUsers() public method

get users linked to a object
public getUsers ( $type ) : array
$type type to search (see constants)
return array

haveAGroup() public method

Is one of groups linked to the object ?
public haveAGroup ( $type, array $groups ) : boolean
$type type to search (see constants)
$groups array array of group ID
return boolean

isAllowedStatus() static public method

check is the user can change from / to a status
static public isAllowedStatus ( $old, $new ) : boolean
$old string value of old/current status
$new string value of target status
return boolean

isGroup() public method

Is a group linked to the object ?
public isGroup ( $type, $groups_id ) : boolean
$type type to search (see constants)
$groups_id integer group ID
return boolean

isPossibleToAssignType() static public method

Check if it's possible to assign ITIL object to a type (core or plugin)
static public isPossibleToAssignType ( $itemtype ) : true
$itemtype the object's type
return true if ticket can be assign to this type, false if not

isStatusExists() static public method

Is the ITIL object status exists for the object
static public isStatusExists ( $status ) : boolean
$status status
return boolean

isSupplier() public method

Is a supplier linked to the object ?
public isSupplier ( $type, $suppliers_id ) : boolean
$type type to search (see constants)
$suppliers_id integer supplier ID
return boolean

isUser() public method

Is a user linked to the object ?
public isUser ( $type, $users_id ) : boolean
$type type to search (see constants)
$users_id integer user ID
return boolean

loadActors() public method

public loadActors ( )

post_addItem() public method

public post_addItem ( )

post_getFromDB() public method

qualification
public post_getFromDB ( )

pre_updateInDB() public method

public pre_updateInDB ( )

prepareInputForAdd() public method

public prepareInputForAdd ( $input )

prepareInputForUpdate() public method

public prepareInputForUpdate ( $input )

processMassiveActionsForOneItemtype() static public method

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

showActorAddForm() public method

show actor add div
public showActorAddForm ( $type, $rand_type, $entities_id, $is_hidden = [], $withgroup = true, $withsupplier = false, $inobject = true ) : nothing
$type string actor type
$rand_type integer rand value of div to use
$entities_id integer entity ID
$is_hidden array of hidden fields (if empty consider as not hidden)
$withgroup boolean allow adding a group (true by default)
$withsupplier boolean allow adding a supplier (only one possible in ASSIGN case) (false by default)
$inobject boolean display in ITIL object ? (true by default)
return nothing display

showActorAddFormOnCreate() public method

show user add div on creation
public showActorAddFormOnCreate ( $type, array $options ) : nothing
$type integer actor type
$options array array options for default values ($options of showForm)
return nothing display

showActorsPartForm() public method

show actor part in ITIL object form
public showActorsPartForm ( $ID, array $options ) : nothing
$ID integer ITIL object ID
$options array array options for default values ($options of showForm)
return nothing display

showGroupsAssociated() public method

show groups asociated
public showGroupsAssociated ( $type, $canedit, array $options = [] ) : nothing
$type integer : user type
$canedit boolean : can edit ?
$options array array options for default values ($options of showForm)
return nothing display

showMassiveActionsSubForm() static public method

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

showMassiveSolutionForm() static public method

Form to add a solution to an ITIL object
static public showMassiveSolutionForm ( $entities_id )
$entities_id

showShort() static public method

Display a line for an object
static public showShort ( $id, $options = [] )
$id Integer ID of the object
$options array of options output_type : Default output type (see Search class / default Search::HTML_OUTPUT) row_num : row num used for display type_for_massiveaction : itemtype for massive action id_for_massaction : default 0 means no massive action followups : only for Tickets : show followup columns

showSolutionForm() public method

Form to add a solution to an ITIL object
public showSolutionForm ( $knowbase_id_toload )
$knowbase_id_toload integer load a kb article as solution (0 = no load by default) (default 0)

showStats() public method

public showStats ( )

showSupplierAddFormOnCreate() public method

show supplier add div on creation
public showSupplierAddFormOnCreate ( array $options ) : nothing
$options array array options for default values ($options of showForm)
return nothing display

showSuppliersAssociated() public method

show suppliers associated
public showSuppliersAssociated ( $type, $canedit, array $options = [] ) : nothing
$type integer : user type
$canedit boolean : can edit ?
$options array array options for default values ($options of showForm)
return nothing display

showUsersAssociated() public method

show tooltip for user notification information
public showUsersAssociated ( $type, $canedit, array $options = [] ) : nothing
$type integer user type
$canedit boolean can edit ?
$options array array options for default values ($options of showForm)
return nothing display

updateActionTime() public method

Update actiontime of the object based on actiontime of the tasks
public updateActionTime ( $ID ) : boolean
$ID ID of the object
return boolean : success

updateDateMod() public method

Update date mod of the ITIL object
public updateDateMod ( $ID, $no_stat_computation = false, $users_id_lastupdater )
$ID integer ID of the ITIL object
$no_stat_computation boolean do not cumpute take into account stat (false by default)
$users_id_lastupdater integer to force last_update id (default 0 = not used)

Property Details

$grouplinkclass public_oe property

public $grouplinkclass

$groups protected_oe property

Groups by type
protected $groups

$mailqueueonaction public_oe property

From CommonDBTM
public $mailqueueonaction

$supplierlinkclass public_oe property

public $supplierlinkclass

$suppliers protected_oe property

Suppliers by type
protected $suppliers

$userentity_oncreate protected_oe property

Use user entity to select entity of the object
protected $userentity_oncreate

$userlinkclass public_oe property

public $userlinkclass

$users protected_oe property

Users by type
protected $users