Example #1
0
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate) {
         if (in_array($item->getType(), self::getTypes(true)) && plugin_immobilizationsheets_haveRight("immobilizationsheets", "r")) {
             return self::getTypeName();
         }
     }
     return '';
 }
Example #2
0
function plugin_init_immobilizationsheets()
{
    global $PLUGIN_HOOKS, $CFG_GLPI;
    $PLUGIN_HOOKS['csrf_compliant']['immobilizationsheets'] = true;
    $PLUGIN_HOOKS['change_profile']['immobilizationsheets'] = array('PluginImmobilizationsheetsProfile', 'changeProfile');
    //Clean Plugin on Profile delete
    $PLUGIN_HOOKS['pre_item_purge']['immobilizationsheets'] = array('Profile' => array('PluginImmobilizationsheetsProfile', 'purgeProfiles'));
    if (Session::getLoginUserID()) {
        Plugin::registerClass('PluginImmobilizationsheetsProfile', array('addtabon' => 'Profile'));
        if (plugin_immobilizationsheets_haveRight("immobilizationsheets", "r")) {
            $PLUGIN_HOOKS['menu_entry']['immobilizationsheets'] = 'front/immobilizationsheet.php';
            $PLUGIN_HOOKS['submenu_entry']['immobilizationsheets']['config'] = 'front/config.form.php';
            $PLUGIN_HOOKS['use_massive_action']['immobilizationsheets'] = 1;
        }
        // Config page
        if (plugin_immobilizationsheets_haveRight("immobilizationsheets", "r") || Session::haveRight("config", "w")) {
            $PLUGIN_HOOKS['config_page']['immobilizationsheets'] = 'front/config.form.php';
        }
        // End init, when all types are registered
        $PLUGIN_HOOKS['post_init']['immobilizationsheets'] = 'plugin_immobilizationsheets_postinit';
    }
}
Example #3
0
 public static function canCreate()
 {
     return plugin_immobilizationsheets_haveRight("immobilizationsheets", "r");
 }