mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
review massive action prototype due to change of doOneHook call
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@132 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
parent
2464e4713d
commit
ff5a90f24b
19
hook.php
19
hook.php
@ -224,12 +224,13 @@ function plugin_example_MassiveActions($type) {
|
|||||||
|
|
||||||
|
|
||||||
// How to display specific actions ?
|
// How to display specific actions ?
|
||||||
function plugin_example_MassiveActionsDisplay($type,$action) {
|
// options contain at least itemtype and and action
|
||||||
|
function plugin_example_MassiveActionsDisplay($options=array()) {
|
||||||
global $LANG;
|
global $LANG;
|
||||||
|
|
||||||
switch ($type) {
|
switch ($options['itemtype']) {
|
||||||
case 'Computer' :
|
case 'Computer' :
|
||||||
switch ($action) {
|
switch ($options['action']) {
|
||||||
case "plugin_example_DoIt" :
|
case "plugin_example_DoIt" :
|
||||||
echo " <input type='submit' name='massiveaction' class='submit' value='".
|
echo " <input type='submit' name='massiveaction' class='submit' value='".
|
||||||
$LANG["buttons"][2]."'> but do nothing :)";
|
$LANG["buttons"][2]."'> but do nothing :)";
|
||||||
@ -238,7 +239,7 @@ function plugin_example_MassiveActionsDisplay($type,$action) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'PluginExampleExample' :
|
case 'PluginExampleExample' :
|
||||||
switch ($action) {
|
switch ($options['action']) {
|
||||||
// No case for add_document : use GLPI core one
|
// No case for add_document : use GLPI core one
|
||||||
case "do_nothing" :
|
case "do_nothing" :
|
||||||
echo " <input type='submit' name='massiveaction' class='submit' value='".
|
echo " <input type='submit' name='massiveaction' class='submit' value='".
|
||||||
@ -290,9 +291,15 @@ function plugin_example_MassiveActionsProcess($data) {
|
|||||||
|
|
||||||
|
|
||||||
// How to display specific update fields ?
|
// How to display specific update fields ?
|
||||||
function plugin_example_MassiveActionsFieldsDisplay($type,$table,$field,$linkfield) {
|
// options must contain at least itemtype and options array
|
||||||
|
function plugin_example_MassiveActionsFieldsDisplay($options=array()) {
|
||||||
|
//$type,$table,$field,$linkfield
|
||||||
|
|
||||||
|
if ($table == getTableForItemType($options)) {
|
||||||
|
$table = $options['options']['table'];
|
||||||
|
$field = $options['options']['field'];
|
||||||
|
$linkfield = $options['options']['linkfield'];
|
||||||
|
|
||||||
if ($table == getTableForItemType($type)) {
|
|
||||||
// Table fields
|
// Table fields
|
||||||
switch ($table.".".$field) {
|
switch ($table.".".$field) {
|
||||||
case 'glpi_plugin_example.serial' :
|
case 'glpi_plugin_example.serial' :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user