-
Notifications
You must be signed in to change notification settings - Fork 35
0.84 to 0.85
The plugin have now the possibility to add their own configuration in glpi_configs table
Core rights have been completely revised in 0.85 version. Right Value is now stored as integer.
Old reading right was converted in READ constant.
session::haveRight('Document', 'r')
becomes
session::haveRight('Document', READ)
Old writing right has been exploded in CREATE, UPDATE, DELETE (if object have dustbin) and PURGE constants. On migration, old writing right also included reading right.
To control a right, you can use session::HaveRightsOr('object', array(rights list)) function Ex :
Session::haveRightsOr('Document', array(READ, UPDATE))
In this case, the function returns true when the first right is found in the profile.
To control several rights, you can use session::HaveRightsAnd('objet', array(rights list)) function. Ex :
Session::haveRightsAnd('Document', array(READ, UPDATE))
In this case, the function returns true when all right found in the profile.
Old "Yes" rights has been exploded in same way as the 'w' old rights.
Moreover, the rights are merged by object. For example, the read right on files is now a value of 'Ticket' right (READALL) The definition of all object's rights is in the getRights function of the object's class. This function remove unnecessary standard rights and special rights are added according to the user interface.
The choice of the types of elements associable to a ticket is now completely handled by core (including plugins). Once set $PLUGIN_HOOKS['assign_to_ticket'] and related function, the association of different possible types is done directly in core's profiles like other objects.
TODO
TODO
-
If you want to insert you plugin in the GLPI menu:
- Change the Html::header function to target core menu. Ex :
Html::header("my name", $_SERVER['PHP_SELF'] ,
"assets", 'toy', 'mytoy' ); // In 'assets' menu, breadcrumb 'toy' and option 'mytoy'
- Add to setup.php :
$PLUGIN_HOOKS['menu_toadd']['example'] = array('assets' => 'PluginExampleExample');
previously, you had to define 2 lines in setup.php :
$PLUGIN_HOOKS['submenu_entry']['pluginname']['add'] = array(...);
$PLUGIN_HOOKS['submenu_entry']['pluginname']['search'] = array(...);
in order to have the + and magnifying icon on your items page.
You need to add menu (see above section) then add in PluginExampleExample class :
static function getAdditionalMenuOptions() {
return array('toy' = array(
'title' => PluginExampleJouet::getTypeName(),
'page' => PluginExampleJouet::getSearchURL(false),
'links' => array(
'search' => '/plugins/example/front/toy.php',
'add' => '/plugins/example/front/toy.form.php'
));
}
- You need to delete $this->showTabs($options); and $this->addDivForTabs(); in showForm function
- You need to replace $object->showForm($_GET["id"]); call (in your front/ files) with $object->display($_GET);
- You need to migrate plugins notes in core table (glpi_notepads)
- Add new 'note' right in plugin classes :
protected $usenotepadrights = true;
- Change tab call :
$this->addStandardTab('Notepad', $ong, $options);