PHP Класс Ticket, glpi

Автор: kspooner
Наследование: extends AppModel
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$computerfound Is a hardware found in getHardwareData / getFromDBwithData : hardware link to the job
$dohistory From CommonDBTM
$grouplinkclass
$hardwaredatas Hardware datas used by getFromDBwithData
$rightname
$supplierlinkclass
$userlinkclass From CommonITIL

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

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

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

Метод Описание
addImagePaste ( ) : nothing Add image pasted to GLPI doc after ADD and before UPDATE of the item in the database
canAddFollowups ( ) : boolean Is the current user have right to add followups to the current ticket ?
canAddItem ( $type ) : rights Overloaded from commonDBTM
canAdminActors ( )
canApprove ( ) : boolean Is the current user have right to approve solution of the current ticket ?
canAssign ( )
canAssignToMe ( )
canCreateItem ( ) : boolean Is the current user have right to create the current ticket ?
canDelete ( )
canDeleteItem ( ) : boolean Is the current user have right to delete the current ticket ?
canMassiveAction ( $action, $field, $value )
canSolve ( ) : boolean Is the current user have right to solve the current ticket ?
canUpdate ( )
canUpdateItem ( ) : boolean Is the current user have right to update the current ticket ?
canView ( )
canViewItem ( ) : boolean Is the current user have right to show the current ticket ?
cleanDBonPurge ( )
cleanTagOrImage ( $content, $tags ) : htlm Delete tag or image from ticket content
computeTakeIntoAccountDelayStat ( ) Compute take into account stat of the current ticket
computeTco ( CommonDBTM $item ) : float Calculate Ticket TCO for an item
convertContentForNotification ( $content, $item ) : htlm Convert img or tag of ticket for notification mails
convertContentForTicket ( $content_html, $files, $tags ) : htlm Convert img of the collector for ticket
convertImageToTag ( $content_html, $force_update = false ) : htlm Convert image to tag
convertTagToImage ( $content_text, $force_update = false, $doc_data = [] ) : nothing Convert tag to image
countActiveTicketsForItem ( $itemtype, $items_id ) : integer Count active tickets for an hardware
countSolvedTicketsForItemLastDays ( $itemtype, $items_id, $days ) : integer Count solved tickets for an hardware last X days
cronAlertNotClosed ( $task ) : integer Cron for alert old tickets which are not solved
cronCloseTicket ( $task ) : integer Cron for ticket's automatic close
cronCreateInquest ( $task ) : integer Cron for ticketsatisfaction's automatic generated
cronInfo ( $name ) : arrray Give cron information
defineTabs ( $options = [] )
deleteSLT ( $id, $type, $delete_date ) : type Delete SLT for the ticket
displayTabContentForItem ( CommonGLPI $item, $tabnum = 1, $withtemplate )
dropdownType ( $name, $options = [] ) : string Dropdown of ticket type
filterTimeline ( )
getActiveOrSolvedLastDaysTicketsForItem ( $itemtype, $items_id, $days ) : integer Get active or solved tickets for an hardware last X days
getAdditionalDatas ( ) : nothing Retrieve data of the hardware linked to the ticket if exists
getAdditionalMenuContent ( )
getAdditionalMenuLinks ( )
getAdditionalMenuOptions ( )
getAllStatusArray ( $withmetaforsearch = false ) : an get the Ticket status list
getCalendar ( ) Get correct Calendar: Entity or Sla
getClosedStatusArray ( ) : an Get the ITIL object closed status list
getCommonLeftJoin ( )
getCommonSelect ( )
getDatasToAddSLT ( $slts_id, $entities_id, $date, $type ) : array Get Datas to be added for SLT add
getDefaultActor ( $type )
getDefaultActorRightSearch ( $type )
getDefaultSearchRequest ( ) Get default values to search engine to override
getDefaultValues ( $entity )
getForbiddenStandardMassiveAction ( )
getMenuShorcut ( )
getNewStatusArray ( ) : an Get the ITIL object new status list
getProcessStatusArray ( ) : an Get the ITIL object assign or plan status list
getReopenableStatusArray ( ) : an Get the ITIL object closed, solved or waiting status list
getRights ( $interface = 'central' )
getSearchOptions ( )
getSolvedStatusArray ( ) : an Get the ITIL object solved status list
getSpecificMassiveActions ( $checkitem = NULL )
getSpecificValueToDisplay ( $field, $values, array $options = [] )
getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] ) : string
getSplittedSubmitButtonHtml ( $tickets_id, $action = "add" )
getTabNameForItem ( CommonGLPI $item, $withtemplate )
getTicketActors ( )
getTicketTemplateToUse ( $force_template, $type, $itilcategories_id, $entities_id ) : ticket Get ticket template to use Use force_template first, then try on template define for type and category then use default template of active profile of connected user and then use default entity one
getTicketTypeName ( $value ) Get ticket type Name
getTimelineItems ( )
getTypeName ( $nb ) Name of the type
getTypes ( ) : array Get ticket types
getValueToSelect ( $field_id_or_search_options, $name = '', $values = '', $options = [] ) Select a field using standard system
manageSltLevel ( $slts_id ) Manage SLT level escalation
manageValidationAdd ( $input ) : nothing Manage Validation add from input
numberOfFollowups ( $with_private = 1 ) : followup Number of followups of the ticket
numberOfTasks ( $with_private = 1 ) : followup Number of tasks of the ticket
post_addItem ( )
post_updateItem ( $history = 1 )
pre_deleteItem ( )
pre_updateInDB ( )
prepareInputForAdd ( $input )
prepareInputForUpdate ( $input )
setRichTextContent ( $name, $content, $rand ) Convert simple text content to rich text content, init html editor
setSimpleTextContent ( $content ) Convert rich text content to simple text content
showCentralCount ( $foruser = false ) Get tickets count
showCentralList ( $start, $status = "process", $showgrouptickets = true )
showCentralNewList ( )
showDebug ( ) Display debug information for current object
showDocumentAddButton ( $size = 25 )
showForm ( $ID, $options = [] )
showFormHelpdesk ( $ID, $ticket_template = false ) : nothing Print the helpdesk form
showFormHelpdeskObserver ( $options = [] ) Display a single oberver selector
showListForItem ( CommonDBTM $item ) : nothing Display tickets for an item
showPreviewAssignAction ( $output )
showSubForm ( CommonDBTM $item, $id, $params )
showTimeline ( $rand )
showTimelineForm ( $rand )
showTimelineHeader ( )
showVeryShort ( $ID, $forcetab = '' )
sltAffect ( $type, &$input, $manual_slts_id ) SLT affect by rules : reset due_date and time_to_own Manual SLT defined : reset due date and time_to_own No manual SLT and due date defined : reset auto SLT
updateDateMod ( $ID, $no_stat_computation = false, $users_id_lastupdater ) Update date mod of the ticket

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

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

Add image pasted to GLPI doc after ADD and before UPDATE of the item in the database
public addImagePaste ( ) : nothing
Результат nothing

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

Is the current user have right to add followups to the current ticket ?
public canAddFollowups ( ) : boolean
Результат boolean

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

Overloaded from commonDBTM
public canAddItem ( $type ) : rights
$type itemtype of object to add
Результат rights

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

public canAdminActors ( )

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

Is the current user have right to approve solution of the current ticket ?
public canApprove ( ) : boolean
Результат boolean

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

public canAssign ( )

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

public canAssignToMe ( )

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

Is the current user have right to create the current ticket ?
public canCreateItem ( ) : boolean
Результат boolean

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

static public canDelete ( )

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

Is the current user have right to delete the current ticket ?
public canDeleteItem ( ) : boolean
Результат boolean

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

См. также: CommonDBTM::canMassiveAction()
public canMassiveAction ( $action, $field, $value )

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

Is the current user have right to solve the current ticket ?
public canSolve ( ) : boolean
Результат boolean

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

static public canUpdate ( )

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

Is the current user have right to update the current ticket ?
public canUpdateItem ( ) : boolean
Результат boolean

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

static public canView ( )

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

Is the current user have right to show the current ticket ?
public canViewItem ( ) : boolean
Результат boolean

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

public cleanDBonPurge ( )

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

Delete tag or image from ticket content
public cleanTagOrImage ( $content, $tags ) : htlm
$content html content of input
$tags
Результат htlm content

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

Compute take into account stat of the current ticket

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

Calculate Ticket TCO for an item
static public computeTco ( CommonDBTM $item ) : float
$item CommonDBTM CommonDBTM object of the item
Результат float

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

Convert img or tag of ticket for notification mails
public convertContentForNotification ( $content, $item ) : htlm
$content : html content of input
$item : item to store filenames and tags found for each image in $content
Результат htlm content

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

Convert img of the collector for ticket
static public convertContentForTicket ( $content_html, $files, $tags ) : htlm
$content_html html content of input
$files array of filename
$tags array of image tag
Результат htlm content

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

Convert image to tag
public convertImageToTag ( $content_html, $force_update = false ) : htlm
$content_html html content of input
$force_update force update of content in item (false by default
Результат htlm content

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

Convert tag to image
public convertTagToImage ( $content_text, $force_update = false, $doc_data = [] ) : nothing
$content_text text content of input
$force_update force update of content in item (false by default
$doc_data array of filenames and tags
Результат nothing

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

Count active tickets for an hardware
public countActiveTicketsForItem ( $itemtype, $items_id ) : integer
$itemtype string Item type
$items_id integer ID of the Item
Результат integer

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

Count solved tickets for an hardware last X days
public countSolvedTicketsForItemLastDays ( $itemtype, $items_id, $days ) : integer
$itemtype string Item type
$items_id integer ID of the Item
$days integer day number
Результат integer

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

Cron for alert old tickets which are not solved
static public cronAlertNotClosed ( $task ) : integer
$task : crontask object
Результат integer (0 : nothing done - 1 : done)

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

Cron for ticket's automatic close
static public cronCloseTicket ( $task ) : integer
$task : crontask object
Результат integer (0 : nothing done - 1 : done)

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

Cron for ticketsatisfaction's automatic generated
static public cronCreateInquest ( $task ) : integer
$task : crontask object
Результат integer (0 : nothing done - 1 : done)

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

Give cron information
static public cronInfo ( $name ) : arrray
$name : task's name
Результат arrray of information

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

public defineTabs ( $options = [] )

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

Delete SLT for the ticket
public deleteSLT ( $id, $type, $delete_date ) : type
$id
$type
$delete_date (default 0)
Результат type

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

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

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

Dropdown of ticket type
static public dropdownType ( $name, $options = [] ) : string
$name select name
$options array of options: - value : integer / preselected value (default 0) - toadd : array / array of specific values to add at the begining - on_change : string / value to transmit to "onChange" - display : boolean / display or get string (default true)
Результат string id of the select

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

public filterTimeline ( )

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

Get active or solved tickets for an hardware last X days
public getActiveOrSolvedLastDaysTicketsForItem ( $itemtype, $items_id, $days ) : integer
$itemtype string Item type
$items_id integer ID of the Item
$days integer day number
Результат integer

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

Retrieve data of the hardware linked to the ticket if exists
public getAdditionalDatas ( ) : nothing
Результат nothing : set computerfound to 1 if founded

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

См. также: CommonGLPI::getAdditionalMenuContent()
static public getAdditionalMenuContent ( )

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

См. также: CommonGLPI::getAdditionalMenuOptions()
static public getAdditionalMenuOptions ( )

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

get the Ticket status list
static public getAllStatusArray ( $withmetaforsearch = false ) : an
$withmetaforsearch boolean (false by default)
Результат an array

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

Get correct Calendar: Entity or Sla
С версии: 0.90.4
public getCalendar ( )

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

Get the ITIL object closed status list
static public getClosedStatusArray ( ) : an
Результат an array

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

static public getCommonLeftJoin ( )

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

static public getCommonSelect ( )

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

Get Datas to be added for SLT add
public getDatasToAddSLT ( $slts_id, $entities_id, $date, $type ) : array
$slts_id SLT id
$entities_id entity ID of the ticket
$date begin date of the ticket
$type type of SLT
Результат array of datas to add in ticket

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

См. также: CommonITILObject::getDefaultActor()
public getDefaultActor ( $type )

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

См. также: CommonITILObject::getDefaultActorRightSearch()
public getDefaultActorRightSearch ( $type )

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

Get default values to search engine to override
static public getDefaultSearchRequest ( )

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

static public getDefaultValues ( $entity )
$entity integer entities_id usefull is function called by cron (default 0)

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

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

См. также: CommonGLPI::getMenuShorcut()
static public getMenuShorcut ( )

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

Get the ITIL object new status list
static public getNewStatusArray ( ) : an
Результат an array

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

Get the ITIL object assign or plan status list
static public getProcessStatusArray ( ) : an
Результат an array

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

Get the ITIL object closed, solved or waiting status list
static public getReopenableStatusArray ( ) : an
Результат an array

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

См. также: commonDBTM::getRights()
public getRights ( $interface = 'central' )

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

public getSearchOptions ( )

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

Get the ITIL object solved status list
static public getSolvedStatusArray ( ) : an
Результат an array

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

См. также: CommonDBTM::getSpecificMassiveActions()
public getSpecificMassiveActions ( $checkitem = NULL )

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

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

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

static public getSpecificValueToSelect ( $field, $name = '', $values = '', array $options = [] ) : string
$field
$name (default '')
$values (default '')
$options array array
Результат string

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

static public getSplittedSubmitButtonHtml ( $tickets_id, $action = "add" )
$tickets_id
$action (default 'add')

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

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

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

public getTicketActors ( )

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

Get ticket template to use Use force_template first, then try on template define for type and category then use default template of active profile of connected user and then use default entity one
public getTicketTemplateToUse ( $force_template, $type, $itilcategories_id, $entities_id ) : ticket
$force_template integer tickettemplate_id to used (case of preview for example) (default 0)
$type integer type of the ticket (default 0)
$itilcategories_id integer ticket category (default 0)
$entities_id integer (default -1)
Результат ticket template object

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

Get ticket type Name
static public getTicketTypeName ( $value )
$value type ID

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

public getTimelineItems ( )

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

Name of the type
static public getTypeName ( $nb )
$nb : number of item in the type (default 0)

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

Get ticket types
static public getTypes ( ) : array
Результат array of types

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

Select a field using standard system
public getValueToSelect ( $field_id_or_search_options, $name = '', $values = '', $options = [] )

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

Manage SLT level escalation
public manageSltLevel ( $slts_id )
$slts_id

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

Manage Validation add from input
public manageValidationAdd ( $input ) : nothing
$input array : input array
Результат nothing

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

Number of followups of the ticket
public numberOfFollowups ( $with_private = 1 ) : followup
$with_private boolean : true : all followups / false : only public ones (default 1)
Результат followup count

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

Number of tasks of the ticket
public numberOfTasks ( $with_private = 1 ) : followup
$with_private boolean : true : all ticket / false : only public ones (default 1)
Результат followup count

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

public post_addItem ( )

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

public post_updateItem ( $history = 1 )

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

public pre_deleteItem ( )

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

public pre_updateInDB ( )

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

public prepareInputForAdd ( $input )

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

public prepareInputForUpdate ( $input )

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

Convert simple text content to rich text content, init html editor
public setRichTextContent ( $name, $content, $rand )
$name name of textarea
$content content to convert in html
$rand

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

Convert rich text content to simple text content
public setSimpleTextContent ( $content )
$content : content to convert in html

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

Get tickets count
static public showCentralCount ( $foruser = false )
$foruser boolean : only for current login user as requester (false by default)

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

static public showCentralList ( $start, $status = "process", $showgrouptickets = true )
$start
$status (default ''process)
$showgrouptickets (true by default)

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

static public showCentralNewList ( )

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

Display debug information for current object
public showDebug ( )

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

static public showDocumentAddButton ( $size = 25 )
$size (default 25)

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

public showForm ( $ID, $options = [] )

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

Print the helpdesk form
public showFormHelpdesk ( $ID, $ticket_template = false ) : nothing
$ID integer ID of the user who want to display the Helpdesk
$ticket_template boolean ticket template for preview : false if not used for preview (false by default)
Результат nothing (print the helpdesk)

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

* @param $options array options for default values ($options of showActorAddFormOnCreate)
static public showFormHelpdeskObserver ( $options = [] )

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

Will also display tickets of linked items
static public showListForItem ( CommonDBTM $item ) : nothing
$item CommonDBTM CommonDBTM object
Результат nothing (display a table)

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

static public showPreviewAssignAction ( $output )
$output

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

static public showSubForm ( CommonDBTM $item, $id, $params )
$item CommonDBTM
$id
$params

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

public showTimeline ( $rand )
$rand

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

public showTimelineForm ( $rand )
$rand

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

public showTimelineHeader ( )

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

static public showVeryShort ( $ID, $forcetab = '' )
$ID
$forcetab string name of the tab to force at the display (default '')

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

@since version 9.1
public sltAffect ( $type, &$input, $manual_slts_id )
$type
$input
$manual_slts_id

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

Update date mod of the ticket
public updateDateMod ( $ID, $no_stat_computation = false, $users_id_lastupdater )
$ID ID of the ticket
$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)

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

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

Is a hardware found in getHardwareData / getFromDBwithData : hardware link to the job
public $computerfound

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

From CommonDBTM
public $dohistory

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

protected static $forward_entity_to

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

public $grouplinkclass

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

Hardware datas used by getFromDBwithData
public $hardwaredatas

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

static public $rightname

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

public $supplierlinkclass

$userentity_oncreate защищенное свойство

protected $userentity_oncreate

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

From CommonITIL
public $userlinkclass