Beispiel #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';
    }
}
Beispiel #2
0
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with Surveyticket plugin. If not, see <http://www.gnu.org/licenses/>.

  ------------------------------------------------------------------------

  @package   Surveyticket plugin
  @author    David Durieux
  @copyright Copyright (c) 2012-2013 Surveyticket plugin team
  @license   AGPL License 3.0 or (at your option) any later version
             http://www.gnu.org/licenses/agpl-3.0-standalone.html
  @link      https://forge.indepnet.net/projects/surveyticket
  @since     2012

  ------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
Session::checkRight("profile", "r");
$psProfile = new PluginSurveyticketProfile();
Session::checkRight("profile", "w");
if ($psProfile->getFromDB($_POST['profiles_id'])) {
    $psProfile->update($_POST);
    $psProfile->changeprofile();
    Html::back();
} else {
    $psProfile->add($_POST);
    $psProfile->changeprofile();
    Html::back();
}