En Plugin078to080 » History » Version 2

Version 1 (ddurieux, 07/15/2011 10:12 AM) → Version 2/3 (Protux, 07/15/2011 01:47 PM)

h1. En Plugin078to080

'doc_types' => 'document_types'
'helpdesk_types' => 'ticket_types'
'netport_types' => 'networkport_types'
'planning_itemtype' => 'planning_types'

*LANG string deleted from core*

Check lang string still exist in core

*Core's function countElementsInTable*
countElementsInTable("table1,table2","condition") => countElementsInTable(array("table1","table2"),"condition")

*Function getSearchOptions*
- Delete linkfields after controle
- if linkfield = '' => massiveaction = false
- for places use function Location::getSearchOptionsToAdd();

Field *realtime* replaced by *actiontime* (timestamp)

*fonction getID*
- function getId() from commonTreeDropdown is renamed into findID (for dropdowns).
- Creation of a new function getID() within commonDBTM to get the object's identifier

*Core's notification*
glpi_notificationtemplates's table now owns a new field
-> To add when there is a INSERT SQL

*New class for the migration usable in the plugins : Migration.class*
This class allows to simply the migration's procedure and to save times by regrouping the actions by table

$migration = new Migration("n° version of the plugin");
$migration->displayMessage(Initilisation of the message displayed during the migration);
Somes actions of the migration

if you want to use the function addField followed by an complex UPDATE (the simple update can be handle by the addField), it must be done a $migration->migrationOneTable($table); between addField and the UPDATE.

*Edit of the redirection's hook(multiple redirections)*
// Simple redirect : http://localhost/glpi/index.php?redirect=plugin_example_2 (ID 2 form)
// $PLUGIN_HOOKS['redirect_page']['example'] = 'example.form.php';
// Multiple redirect : http://localhost/glpi/index.php?redirect=plugin_example_one_2 (ID 2 of the form)
// Multiple redirect : http://localhost/glpi/index.php?redirect=plugin_example_two_2 (ID 2 of the form)
$PLUGIN_HOOKS['redirect_page']['example']['one'] = 'example.form.php';
$PLUGIN_HOOKS['redirect_page']['example']['two'] = 'example2.form.php';

*New hooks*