TicketValidation class. More...

List of all members.

Public Member Functions

 getForbiddenStandardMassiveAction ()
 Get the standard massive actions which are forbidden.
 canDeleteItem ()
 Is the current user have right to delete the current validation ?
 canUpdateItem ()
 Is the current user have right to update the current validation ?
 getTabNameForItem (CommonGLPI $item, $withtemplate=0)
 Get Tab Name used for itemtype.
 post_getEmpty ()
 Actions done at the end of the getEmpty function.
 prepareInputForAdd ($input)
 post_addItem ()
 Actions done after the ADD of the item in the database.
 prepareInputForUpdate ($input)
 post_updateItem ($history=1)
 Actions done after the UPDATE of the item in the database.
 getHistoryChangeWhenUpdateField ($field)
 getHistoryNameForItem (CommonDBTM $item, $case)
 showSummary ($ticket)
 Print the validation list into ticket.
 showForm ($ID, $options=array())
 Print the validation form.
 getSearchOptions ()
 Get the Search options for the given Type.

Static Public Member Functions

static getTypeName ($nb=0)
 Return the localized name of the current Type Should be overloaded in each new class.
static canCreate ()
static canView ()
static canUpdate ()
static canDelete ()
static canValidate ($tickets_id)
static displayTabContentForItem (CommonGLPI $item, $tabnum=1, $withtemplate=0)
 show Tab content
static getAllStatusArray ($withmetaforsearch=false, $global=false)
 get the Ticket validation status list
static dropdownStatus ($name, $options=array())
 Dropdown of validation status.
static getStatus ($value)
 Get Ticket validation status Name.
static getStatusColor ($value)
 Get Ticket validation status Color.
static isAllValidationsHaveSameStatusForTicket ($tickets_id)
 All validations requests for a ticket have the same status ?
static getNumberValidationForTicket ($tickets_id)
 Get Ticket validation demands count.
static getNumberTicketsToValidate ($users_id)
 Get Ticket validation demands count for a user.
static getTicketStatusNumber ($tickets_id, $status)
 Get the number of validations attached to a ticket having a specified status.
static showFormMassiveAction ()
 Form for Followup on Massive action.
static getSpecificValueToDisplay ($field, $values, array $options=array())
static getSpecificValueToSelect ($field, $name='', $values='', array $options=array())

Public Attributes

 $auto_message_on_action = false
 Set false to desactivate automatic message on action.

Static Public Attributes

static $itemtype = 'Ticket'
static $items_id = 'tickets_id'
static $log_history_add = Log::HISTORY_LOG_SIMPLE_MESSAGE
static $log_history_update = Log::HISTORY_LOG_SIMPLE_MESSAGE
static $log_history_delete = Log::HISTORY_LOG_SIMPLE_MESSAGE

Detailed Description

TicketValidation class.

Definition at line 41 of file ticketvalidation.class.php.


Member Function Documentation

static canCreate ( ) [static]
Since:
version 0.84

Reimplemented from CommonDBChild.

Definition at line 68 of file ticketvalidation.class.php.

References Session\haveRight().

Referenced by Ticket\getSpecificMassiveActions(), and Ticket\prepareInputForUpdate().

static canDelete ( ) [static]
Since:
version 0.84

Reimplemented from CommonDBChild.

Definition at line 93 of file ticketvalidation.class.php.

References Session\haveRight().

Is the current user have right to delete the current validation ?

Since:
version 0.84
Returns:
boolean

Reimplemented from CommonDBChild.

Definition at line 106 of file ticketvalidation.class.php.

References Session\getLoginUserID(), and Session\haveRight().

static canUpdate ( ) [static]
Since:
version 0.84

Reimplemented from CommonDBChild.

Definition at line 84 of file ticketvalidation.class.php.

References Session\haveRight().

Is the current user have right to update the current validation ?

Returns:
boolean

Reimplemented from CommonDBChild.

Definition at line 121 of file ticketvalidation.class.php.

References Session\getLoginUserID(), and Session\haveRight().

static canValidate ( tickets_id) [static]
Parameters:
$tickets_id

Definition at line 136 of file ticketvalidation.class.php.

References $DB, $query, and $result.

Referenced by Ticket\canViewItem(), and Ticket\prepareInputForUpdate().

static canView ( ) [static]
Since:
version 0.84

Reimplemented from CommonDBChild.

Definition at line 75 of file ticketvalidation.class.php.

References Session\haveRight().

static displayTabContentForItem ( CommonGLPI item,
tabnum = 1,
withtemplate = 0 
) [static]

show Tab content

Since:
version 0.83
Parameters:
$itemCommonGLPI object for which the tab need to be displayed
$tabnuminteger tab number (default 1)
$withtemplateboolean is a template object ? (default 0)
Returns:
true

Reimplemented from CommonGLPI.

Definition at line 188 of file ticketvalidation.class.php.

References $validation.

static dropdownStatus ( name,
options = array() 
) [static]

Dropdown of validation status.

Parameters:
$nameselect name
$optionsarray of possible options:
  • value : default value (default waiting)
  • all : boolean display all (default false)
  • global : for global validation (default false)
  • display : boolean display or get string ? (default true)
Returns:
nothing (display)

Definition at line 429 of file ticketvalidation.class.php.

References $options, $val, and getAllStatusArray().

Referenced by getSpecificValueToSelect(), and showForm().

static getAllStatusArray ( withmetaforsearch = false,
global = false 
) [static]

get the Ticket validation status list

Parameters:
$withmetaforsearchboolean (false by default)
$globalboolean (true for global status, with "no validation" option) (false by default)
Returns:
an array

Definition at line 397 of file ticketvalidation.class.php.

References __().

Referenced by dropdownStatus(), getStatus(), and NotificationTargetTicket\getTags().

Get the standard massive actions which are forbidden.

Since:
version 0.84

This should be overloaded in Class

Returns:
an array of massive actions

Reimplemented from CommonDBTM.

Definition at line 55 of file ticketvalidation.class.php.

Since:
version 0.84
See also:
CommonDBConnexity::getHistoryChangeWhenUpdateField

Reimplemented from CommonDBConnexity.

Definition at line 351 of file ticketvalidation.class.php.

References $field, $result, __(), and getUserName().

getHistoryNameForItem ( CommonDBTM item,
case 
)
Since:
version 0.84
See also:
CommonDBChild::getHistoryNameForItem

Reimplemented from CommonDBChild.

Definition at line 374 of file ticketvalidation.class.php.

References __(), and getUserName().

static getNumberTicketsToValidate ( users_id) [static]

Get Ticket validation demands count for a user.

Parameters:
$users_idinteger User ID

Definition at line 540 of file ticketvalidation.class.php.

References $DB, $query, and $result.

Referenced by Ticket\showFormHelpdesk().

static getNumberValidationForTicket ( tickets_id) [static]

Get Ticket validation demands count.

Parameters:
$tickets_idinteger ticket ID

Definition at line 520 of file ticketvalidation.class.php.

References $DB, $query, and $result.

Get the Search options for the given Type.

This should be overloaded in Class

Returns:
an array of search options More information on https://forge.indepnet.net/wiki/glpi/SearchEngine

Reimplemented from CommonDBTM.

Definition at line 816 of file ticketvalidation.class.php.

References __(), and CommonDBTM\getTable().

static getSpecificValueToDisplay ( field,
values,
array $  options = array() 
) [static]
Since:
version 0.84
Parameters:
$field
$values
$optionsarray

Reimplemented from CommonDBTM.

Definition at line 871 of file ticketvalidation.class.php.

References $field, $options, $values, and getStatus().

static getSpecificValueToSelect ( field,
name = '',
values = '',
array $  options = array() 
) [static]
Since:
version 0.84
Parameters:
$field
$name(default '')
$values(default '')
$optionsarray

Reimplemented from CommonDBTM.

Definition at line 893 of file ticketvalidation.class.php.

References $field, $name, $options, $values, and dropdownStatus().

static getStatus ( value) [static]
static getStatusColor ( value) [static]

Get Ticket validation status Color.

Parameters:
$valuestatus ID

Definition at line 476 of file ticketvalidation.class.php.

Referenced by Search\giveItem(), and showSummary().

getTabNameForItem ( CommonGLPI item,
withtemplate = 0 
)

Get Tab Name used for itemtype.

NB : Only called for existing object Must check right on what will be displayed + template

Since:
version 0.83
Parameters:
$itemCommonDBTM object for which the tab need to be displayed
$withtemplateboolean is a template object ? (default 0)
Returns:
string tab name

Reimplemented from CommonGLPI.

Definition at line 152 of file ticketvalidation.class.php.

References $_SESSION, countElementsInTable(), CommonGLPI\createTabEntry(), getTypeName(), and Session\haveRight().

static getTicketStatusNumber ( tickets_id,
status 
) [static]

Get the number of validations attached to a ticket having a specified status.

Parameters:
$tickets_idinteger ticket ID
$statusstatus

Definition at line 562 of file ticketvalidation.class.php.

References $DB, $query, and $result.

static getTypeName ( nb = 0) [static]

Return the localized name of the current Type Should be overloaded in each new class.

Returns:
string

Reimplemented from CommonGLPI.

Definition at line 63 of file ticketvalidation.class.php.

References $nb, and _n().

Referenced by getTabNameForItem().

static isAllValidationsHaveSameStatusForTicket ( tickets_id) [static]

All validations requests for a ticket have the same status ?

Parameters:
$tickets_idinteger ticket ID

Definition at line 503 of file ticketvalidation.class.php.

References $DB, $query, and $result.

Actions done after the ADD of the item in the database.

Returns:
nothing

Reimplemented from CommonDBChild.

Definition at line 225 of file ticketvalidation.class.php.

References $CFG_GLPI, $input, $options, $user, __(), Session\addMessageAfterRedirect(), User\getDefaultEmail(), CommonDBTM\getFromDB(), User\getName(), and NotificationEvent\raiseEvent().

Actions done at the end of the getEmpty function.

Returns:
nothing

Reimplemented from CommonDBTM.

Definition at line 196 of file ticketvalidation.class.php.

References getLoginUserID().

post_updateItem ( history = 1)

Actions done after the UPDATE of the item in the database.

Since:
version 0.84
Parameters:
$historystore changes history ? (default 1)
Returns:
nothing

Reimplemented from CommonDBChild.

Definition at line 316 of file ticketvalidation.class.php.

References $CFG_GLPI, $input, $options, and NotificationEvent\raiseEvent().

prepareInputForAdd ( input)
Since:
version 0.84

Reimplemented from CommonDBChild.

Definition at line 203 of file ticketvalidation.class.php.

References $_SESSION, $input, getLoginUserID(), and Session\isCron().

prepareInputForUpdate ( input)
Since:
version 0.84

Reimplemented from CommonDBChild.

Definition at line 276 of file ticketvalidation.class.php.

References $_SESSION, $input, $val, __(), Session\addMessageAfterRedirect(), Session\getLoginUserID(), and Session\haveRight().

showForm ( ID,
options = array() 
)

Print the validation form.

Parameters:
$IDinteger ID of the item
$optionsarray options used

Definition at line 722 of file ticketvalidation.class.php.

References $options, $ticket, __(), CommonDBTM\check(), Ticket\DEMAND_TYPE, CommonDBTM\dropdown(), dropdownStatus(), CommonDBChild\getEntityID(), getLoginUserID(), getStatus(), getUserName(), CommonDBTM\showFormButtons(), and CommonDBTM\showFormHeader().

static showFormMassiveAction ( ) [static]

Form for Followup on Massive action.

Definition at line 581 of file ticketvalidation.class.php.

References $_SESSION, and CommonDBTM\dropdown().

Referenced by Ticket\showSpecificMassiveActionsParameters().


Member Data Documentation

$auto_message_on_action = false

Set false to desactivate automatic message on action.

Reimplemented from CommonDBTM.

Definition at line 44 of file ticketvalidation.class.php.

$items_id = 'tickets_id' [static]

Reimplemented from CommonDBChild.

Definition at line 48 of file ticketvalidation.class.php.

$itemtype = 'Ticket' [static]

Reimplemented from CommonDBChild.

Definition at line 47 of file ticketvalidation.class.php.

$log_history_add = Log::HISTORY_LOG_SIMPLE_MESSAGE [static]

Reimplemented from CommonDBChild.

Definition at line 50 of file ticketvalidation.class.php.

$log_history_delete = Log::HISTORY_LOG_SIMPLE_MESSAGE [static]

Reimplemented from CommonDBChild.

Definition at line 52 of file ticketvalidation.class.php.

$log_history_update = Log::HISTORY_LOG_SIMPLE_MESSAGE [static]

Reimplemented from CommonDBChild.

Definition at line 51 of file ticketvalidation.class.php.


The documentation for this class was generated from the following file: