Methods summary
public
array
|
#
getForbiddenStandardMassiveAction( )
Get the standard massive actions which are forbidden
Get the standard massive actions which are forbidden
Returns
array an array of massive actions
Since
0.84
This should be overloaded in Class
Overrides
|
public static
string
|
#
getTypeName( integer $nb = 0 )
Return the localized name of the current Type
Should be overloaded in each new class
Return the localized name of the current Type
Should be overloaded in each new class
Parameters
Returns
string
Overrides
|
public
array
|
#
defineTabs( array $options = [] )
Define tabs to display
NB : Only called for existing object
Parameters
- $options
Options
- withtemplate is a template view ?
Returns
array array containing the tabs
Overrides
|
public static
boolean
|
#
canDelete( )
Have I the global right to "delete" the Object
Have I the global right to "delete" the Object
May be overloaded if needed
Returns
boolean
Overrides
|
public
|
#
cleanDBonPurge( )
Actions done when item is deleted from the database
Actions done when item is deleted from the database
Overrides
|
public
boolean
|
#
getFromDBbyName( string $itemtype, string $name )
Read a Crontask by its name
Read a Crontask by its name
Used by plugins to load its crontasks
Parameters
- $itemtype
- itemtype of the crontask
- $name
- name of the task
Returns
boolean true if succeed else false
|
public
integer
|
#
isDisabled( )
Give a task state
Returns
integer 0 : task is enabled
if disable : 1: by config, 2: by system lock, 3: by plugin
|
public static
string[]
|
|
public
|
#
signal( $signo )
Signal handler callback
Since
9.1
|
public
boolean
|
#
start( )
Start a task, timer, stat, log, ...
Start a task, timer, stat, log, ...
Returns
boolean : true if ok (not start by another)
|
public
|
#
setVolume( $volume )
Set the currently proccessed volume of a running task
Set the currently proccessed volume of a running task
Parameters
|
public
|
#
addVolume( $volume )
Increase the currently proccessed volume of a running task
Increase the currently proccessed volume of a running task
Parameters
|
public
boolean
|
#
end( $retcode )
Start a task, timer, stat, log, ...
Start a task, timer, stat, log, ...
Parameters
- $retcode
- <0 : need to run again, 0:nothing to do, >0:ok
Returns
boolean : true if ok (not start by another)
|
public
|
#
log( $content )
Add a log message for a running task
Add a log message for a running task
Parameters
|
public
boolean
|
#
getNeedToRun( integer $mode = 0, string $name = '' )
read the first task which need to be run by cron
read the first task which need to be run by cron
Parameters
- $mode
0 retrieve task configured for this mode
<0 retrieve task allowed for this mode (force, no time check)
- $name
- one specify action
Returns
boolean false if no task to run
|
public
boolean
|
#
showForm( integer $ID, array $options = [] )
Print the contact form
Parameters
- $ID
- $options
- target filename : where to go when done.
- withtemplate boolean : template or basic item
Returns
boolean
|
public
|
#
resetDate( )
reset the next launch date => for a launch as soon as possible
reset the next launch date => for a launch as soon as possible
|
public
|
|
public
string
|
#
getDescription( $id )
Translate task description
Translate task description
Parameters
Returns
string
|
public
string
|
|
public static
string
|
#
getStateName( $state )
Translate state to string
Translate state to string
Parameters
Returns
string
|
public static
string|integer
|
#
dropdownState( string $name, integer $value = 0, boolean $display = true )
Dropdown of state
Parameters
- $name
- select name
- $value
- default value
- $display
- display or get string
Returns
string|integer HTML output, or random part of dropdown ID.
|
public static
string
|
#
getModeName( $mode )
Translate Mode to string
Parameters
Returns
string
|
private static
Boolean
|
#
get_lock( )
Get a global database lock for cron
Get a global database lock for cron
Returns
Boolean
|
private static
|
#
release_lock( )
Release the global database lock
Release the global database lock
|
public static
string|boolean
|
#
launch( integer $mode, integer $max = 1, string $name = '' )
Launch the need cron tasks
Launch the need cron tasks
Parameters
- $mode
- (internal/external, <0 to force)
- $max
- number of task to launch
- $name
- name of task to run
Returns
string|boolean the name of last task launched, or false if execution not available
|
public static
boolean
|
#
register( string $itemtype, string $name, integer $frequency, array $options = [] )
Register new task for plugin (called by plugin during install)
Register new task for plugin (called by plugin during install)
Parameters
- $itemtype
- itemtype of the plugin object
- $name
- task name
- $frequency
- execution frequency
- $options
optional options
(state, mode, allowmode, hourmin, hourmax, logs_lifetime, param, comment)
Returns
boolean
|
public static
boolean
|
#
unregister( $plugin )
Unregister tasks for a plugin (call by glpi after uninstall)
Unregister tasks for a plugin (call by glpi after uninstall)
Parameters
- $plugin
- name of the plugin
Returns
boolean for success
|
public
|
#
showStatistics( )
Display statistics of a task
Display statistics of a task
|
public
|
#
showHistory( )
Display list of a runned tasks
Display list of a runned tasks
|
public
|
#
showHistoryDetail( $logid )
Display detail of a runned task
Display detail of a runned task
Parameters
|
public static
string
|
#
getSpecificValueToSelect( $field, $name = '', $values = '', array $options = [] )
Parameters
- $field
- $name
- '')
- $values
- '')
- $options
- array
Returns
string the string to display
Since
0.84
Overrides
|
public static
string
|
#
getSpecificValueToDisplay( string $field, string|array $values, array $options = [] )
display a specific field value
display a specific field value
Parameters
- $field
- name of the field
- $values
- with the value to display or a Single value
- $options
- Array of options
Returns
string the string to display
Since
0.83
Overrides
|
public
array
|
#
getSpecificMassiveActions( object $checkitem = null )
Get the specific massive actions
Get the specific massive actions
Parameters
- $checkitem
- link item to check right (default NULL)
Returns
array an array of massive actions
Since
0.84
This should be overloaded in Class
Overrides
|
public static
|
#
processMassiveActionsForOneItemtype( MassiveAction $ma, CommonDBTM $item, array $ids )
Class specific execution of the massive action (new system) by itemtypes
Class specific execution of the massive action (new system) by itemtypes
Parameters
- $ma
- the current massive action object
- $item
- the item on which apply the massive action
- $ids
- an array of the ids of the item on which apply the action
Returns
(direct submit to $ma object)
Since
0.85
Overrides
|
public
array
|
#
rawSearchOptions( )
Provides search options configuration. Do not rely directly
on this, @see CommonDBTM::searchOptions instead.
Provides search options configuration. Do not rely directly
on this, @see CommonDBTM::searchOptions instead.
Returns
array a not indexed array of search options
Since
9.3
This should be overloaded in Class
See
https://glpi-developer-documentation.rtfd.io/en/master/devapi/search.html
Overrides
|
public static
integer
|
#
cronSession( CronTask $task )
Garbage collector for expired file session
Garbage collector for expired file session
Parameters
Returns
integer
|
public static
integer
|
|
public static
integer
|
#
cronGraph( CronTask $task )
Garbage collector for cleaning graph files
Garbage collector for cleaning graph files
Parameters
Returns
integer
|
public static
integer
|
#
cronTemp( CronTask $task )
Garbage collector for cleaning tmp files
Garbage collector for cleaning tmp files
Parameters
Returns
integer
|
public static
integer
|
|
public static
integer
|
#
cronCheckUpdate( CronTask $task )
Cron job to check if a new version is available
Cron job to check if a new version is available
Parameters
Returns
integer
|
public static
integer
|
|
public static
array
|
#
cronInfo( $name )
get Cron description parameter for this class
get Cron description parameter for this class
Parameters
Returns
array of string
|
public
string|integer
|
#
dropdownFrequency( string $name, integer $value = 0 )
Dropdown for frequency (interval between 2 actions)
Dropdown for frequency (interval between 2 actions)
Parameters
- $name
- select name
- $value
- default value (default 0)
Returns
string|integer HTML output, or random part of dropdown ID.
|
public static
boolean
|
#
callCronForce( )
Call cron without time check
Call cron without time check
Returns
boolean : true if launched
|
public static
|
#
callCron( )
Call cron if time since last launch elapsed
Call cron if time since last launch elapsed
|