Methods summary
public
nothing
|
#
__construct( array $POST, array $GET, $stage )
Constructor of massive actions.
There is three stages and each one have its own objectives:
- initial: propose the actions and filter the checkboxes (only once)
- specialize: add action specific fields and filter items. There can be as many as needed!
- process: process the massive action (only once, but can be reload to avoid timeout)
Constructor of massive actions.
There is three stages and each one have its own objectives:
- initial: propose the actions and filter the checkboxes (only once)
- specialize: add action specific fields and filter items. There can be as many as needed!
- process: process the massive action (only once, but can be reload to avoid timeout)
We trust all previous stages: we don't redo the checks
Parameters
- $POST
- like $_POST
- $GET
- like $_GET
- $stage
- current stage
Returns
nothing (it is a constructor).
|
public
array
|
#
getInput( )
Get the fields provided by previous stage through $_POST.
Beware that the fields that are common (items, action ...) are not provided
Get the fields provided by previous stage through $_POST.
Beware that the fields that are common (items, action ...) are not provided
Returns
array of the elements
|
public
a
|
#
getAction( )
Get current action
Returns
a string with the current action or NULL if we are at initial stage
|
public
array
|
#
getItems( )
Get all items on which this action must work
Get all items on which this action must work
Returns
array of the items (empty if initial state)
|
public
array
|
#
getRemainings( )
Get remaining items
Returns
array of the remaining items (empty if not in process state)
|
public
|
#
__destruct( )
Destructor of the object
It is used when reloading the page during process to store informations in $_SESSION.
Destructor of the object
It is used when reloading the page during process to store informations in $_SESSION.
|
public
|
|
public
nothing
|
#
addHiddenFields( )
Add hidden fields containing all the checked items to the current form
Add hidden fields containing all the checked items to the current form
Returns
nothing (display)
|
public
the
|
#
getItemtype( $display_selector )
Extract itemtype from the input (ie.: $input['itemtype'] is defined or $input['item'] only
contains one type of item. If none is available and we can display selector (inside the modal
window), then display a dropdown to select the itemtype.
This is only usefull in case of itemtype specific massive actions (update, ...)
Extract itemtype from the input (ie.: $input['itemtype'] is defined or $input['item'] only
contains one type of item. If none is available and we can display selector (inside the modal
window), then display a dropdown to select the itemtype.
This is only usefull in case of itemtype specific massive actions (update, ...)
Parameters
- $display_selector
- we display the itemtype selector ?
Returns
the itemtype or false if we cannot define it (and we cannot display the selector)
|
public static
|
#
getAddTransferList( array & $actions )
Get 'add to transfer list' action when needed
Get 'add to transfer list' action when needed
Parameters
|
public static
an
|
#
getAllMassiveActions( $item, $is_deleted = 0, CommonDBTM $checkitem = null )
Get the standard massive actions
Get the standard massive actions
Parameters
- $item
- item for which we want the massive actions
- $is_deleted
- action for deleted items ? (default 0)
- $checkitem
- item to check right (default NULL)
Returns
an array of massive actions or false if $item is not valid
|
public
nothing:
|
#
showSubForm( )
Main entry of the modal window for massive actions
Main entry of the modal window for massive actions
Returns
nothing: display
|
public
nothing
|
#
showDefaultSubForm( )
Class-specific method used to show the fields to specify the massive action
Class-specific method used to show the fields to specify the massive action
Returns
nothing (display only)
|
public static
|
|
public
nothing
|
#
updateProgressBars( )
Update the progress bar
Display and update the progress bar. If the delay is more than 1 second, then activate it
Returns
nothing (display only)
|
public
an
|
#
process( )
Process the massive actions for all passed items. This a switch between different methods:
new system, old one and plugins ...
Process the massive actions for all passed items. This a switch between different methods:
new system, old one and plugins ...
Returns
an array of results (ok, ko, noright counts, redirect ...)
|
public
array
|
#
processForSeveralItemtypes( )
Process the specific massive actions for severl itemtypes
Process the specific massive actions for severl itemtypes
Returns
array of the results for the actions
|
public static
|
|
public
nothing
|
#
setRedirect( $redirect )
Set the page to redirect for specific actions. By default, call previous page.
This should be call once for the given action.
Set the page to redirect for specific actions. By default, call previous page.
This should be call once for the given action.
Parameters
Returns
nothing
|
public
nothing
|
#
addMessage( $message )
add a message to display when action is done.
add a message to display when action is done.
Parameters
Returns
nothing
|
public
|
#
itemDone( $itemtype, $id, $result )
Set an item as done. If the delay is too long, then reload the page to continue the action.
Update the progress if necessary.
Set an item as done. If the delay is too long, then reload the page to continue the action.
Update the progress if necessary.
Parameters
- $itemtype
- type of the item that has been done
- $id
- or array of ids of the item(s) that have been done.
- $result
in case of no specific action (used internally for older actions)
MassiveAction::ACTION_OK everything is OK for the action
MassiveAction::ACTION_KO something went wrong for the action
MassiveAction::ACTION_NORIGHT not anough right for the action
|