FastActions » History » Version 9
« Previous -
Version 9/10
(diff) -
Next » -
Current version
tsmr, 12/30/2011 04:16 PM
FastActions¶
Goal : Add a system to display fast actions on GLPI header
GLPI version : 0.84
Developer : Tsmr..
Concerned objects : All objects which have an interest to be launch quickly
Detail :
Example : for a Call Center which need to generate tickets on the fly :
Class | Action | Parameter |
Ticket | New Ticket | Specify requester |
Problem | New Problem | Specify requester |
Plugins | Action defined by plugin | Parameters defined by plugin |
Setup :
Add a system like fields unicity for select for each types which can use rapid actions the possibles actions (prefined dropdown)
Goal : Define the classes & actions listed into the fast actions dropdown
MoYo : Why setup them ? Like Massive Action, fixed actions may be more simple ?
Tsmr : For permit custom configuration of fast actions for each user
Initial Patch :
- 1 file ajax/dropdownHeaderActions.php calling Html::addDropdownActionsForHeader($_POST['action']);
- Add an array into define.php : $CFG_GLPI["header_types"] = array('Ticket'); (and modification of plugin.class.php for using with plugins)
- Add 3 functions into html.class.php :
addCriteriaForHeader which define each classes which can use fast actions (with a hook $PLUGIN_HOOKS["header_entry"])
showActionFromHeader which list each classes into a dropdown
addDropdownActionsForHeader which list actions for each classes.
For plugins :
Plugin::registerClass -> 'header_types' => true
$PLUGIN_HOOKS['header_entry']['example'] = array('My fast action' =>'/plugins/example/front/example.form.php');
$PLUGIN_HOOKS['header_action']['example'] = 'plugin_example_header_action';
function plugin_example_header_action() { global $LANG; echo "<div class='center'><input type=\"submit\" class=\"submit\" value=\"" . $LANG['buttons'][2] . "\" ></div>"; }