Exemple #1
0
function plugin_init_ideabox()
{
    global $PLUGIN_HOOKS, $CFG_GLPI;
    $PLUGIN_HOOKS['csrf_compliant']['ideabox'] = true;
    $PLUGIN_HOOKS['change_profile']['ideabox'] = array('PluginIdeaboxProfile', 'changeProfile');
    $PLUGIN_HOOKS['pre_item_purge']['ideabox'] = array('Profile' => array('PluginIdeaboxProfile', 'purgeProfiles'));
    $PLUGIN_HOOKS['plugin_datainjection_populate']['ideabox'] = 'plugin_datainjection_populate_ideabox';
    $PLUGIN_HOOKS['assign_to_ticket']['ideabox'] = true;
    if (Session::getLoginUserID()) {
        Plugin::registerClass('PluginIdeaboxIdeabox', array('massiveaction_noupdate_types' => true, 'notificationtemplates_types' => true, 'ticket_types' => true, 'helpdesk_visible_types' => true, 'linkuser_types' => true, 'document_types' => true));
        Plugin::registerClass('PluginIdeaboxComment', array('notificationtemplates_types' => true));
        Plugin::registerClass('PluginIdeaboxProfile', array('addtabon' => 'Profile'));
        // Display a menu entry ?
        if (plugin_ideabox_haveRight("ideabox", "r")) {
            $PLUGIN_HOOKS['menu_entry']['ideabox'] = 'front/ideabox.php';
            $PLUGIN_HOOKS['helpdesk_menu_entry']['ideabox'] = '/front/ideabox.php';
            $PLUGIN_HOOKS['submenu_entry']['ideabox']['search'] = 'front/ideabox.php';
            $PLUGIN_HOOKS['redirect_page']['ideabox'] = "front/ideabox.form.php";
        }
        if (plugin_ideabox_haveRight("ideabox", "w")) {
            $PLUGIN_HOOKS['submenu_entry']['ideabox']['add'] = 'front/ideabox.form.php';
            $PLUGIN_HOOKS['use_massive_action']['ideabox'] = 1;
        }
        $PLUGIN_HOOKS['migratetypes']['ideabox'] = 'plugin_datainjection_migratetypes_ideabox';
    }
}
Exemple #2
0
 static function canView()
 {
     return plugin_ideabox_haveRight('ideabox', 'r');
 }
Exemple #3
0
function plugin_ideabox_AssignToTicket($types)
{
    if (plugin_ideabox_haveRight("open_ticket", "1")) {
        $types['PluginIdeaboxIdeabox'] = PluginIdeaboxIdeabox::getTypeName(2);
    }
    return $types;
}