Exemple #1
0
function plugin_init_surveyticket()
{
    global $PLUGIN_HOOKS;
    $PLUGIN_HOOKS['csrf_compliant']['surveyticket'] = true;
    if (isset($_SESSION["glpiID"])) {
        $plugin = new Plugin();
        if ($plugin->isActivated('surveyticket')) {
            Plugin::registerClass('PluginSurveyticketProfile', array('addtabon' => array('Profile')));
            $PLUGIN_HOOKS['change_profile']['surveyticket'] = array('PluginSurveyticketProfile', 'changeprofile');
            PluginSurveyticketProfile::changeprofile();
            if (PluginSurveyticketProfile::haveRight("config", 'r')) {
                $PLUGIN_HOOKS['menu_entry']['surveyticket'] = true;
                $PLUGIN_HOOKS['config_page']['surveyticket'] = 'front/menu.php';
            }
            $PLUGIN_HOOKS['post_init']['surveyticket'] = 'plugin_surveyticket_post_init';
        }
        // Icons add, search...
        $PLUGIN_HOOKS['submenu_entry']['surveyticket']['add']['questions'] = 'front/question.form.php?add=1';
        $PLUGIN_HOOKS['submenu_entry']['surveyticket']['search']['questions'] = 'front/question.php';
        $PLUGIN_HOOKS['submenu_entry']['surveyticket']['add']['survey'] = 'front/survey.form.php?add=1';
        $PLUGIN_HOOKS['submenu_entry']['surveyticket']['search']['survey'] = 'front/survey.php';
        $PLUGIN_HOOKS['submenu_entry']['surveyticket']['add']['answers'] = 'front/answer.form.php?add=1';
        // Fil ariane
        $PLUGIN_HOOKS['submenu_entry']['surveyticket']['options']['questions']['title'] = "Questions";
        $PLUGIN_HOOKS['submenu_entry']['surveyticket']['options']['questions']['page'] = '/plugins/surveyticket/front/question.php';
        $PLUGIN_HOOKS['submenu_entry']['surveyticket']['options']['answers']['title'] = "Answers";
        //         $PLUGIN_HOOKS['submenu_entry']['surveyticket']['options']['answers']['page']  = '/plugins/surveyticket/front/answer.php';
        $PLUGIN_HOOKS['submenu_entry']['surveyticket']['options']['survey']['title'] = "Surveys";
        $PLUGIN_HOOKS['submenu_entry']['surveyticket']['options']['survey']['page'] = '/plugins/surveyticket/front/survey.php';
    }
}
Exemple #2
0
 static function checkRight($module, $right)
 {
     global $CFG_GLPI;
     if (!PluginSurveyticketProfile::haveRight($module, $right)) {
         // Gestion timeout session
         if (!Session::getLoginUserID()) {
             Html::redirect($CFG_GLPI["root_doc"] . "/index.php");
             exit;
         }
         Html::displayRightError();
     }
 }
Exemple #3
0
 static function canView()
 {
     return PluginSurveyticketProfile::haveRight("config", 'r');
 }