Esempio n. 1
0
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (in_array($item->getType(), self::getTypes(true)) && plugin_financialreports_haveRight("financialreports", "r")) {
         return PluginFinancialreportsFinancialreport::getTypeName();
     }
     return '';
 }
Esempio n. 2
0
function plugin_init_financialreports()
{
    global $PLUGIN_HOOKS, $CFG_GLPI;
    $PLUGIN_HOOKS['csrf_compliant']['financialreports'] = true;
    $PLUGIN_HOOKS['change_profile']['financialreports'] = array('PluginFinancialreportsProfile', 'changeProfile');
    //Clean Plugin on Profile delete
    $PLUGIN_HOOKS['pre_item_purge']['financialreports'] = array('Profile' => array('PluginFinancialreportsProfile', 'purgeProfiles'));
    if (Session::getLoginUserID()) {
        if (plugin_financialreports_haveRight("financialreports", "r")) {
            $PLUGIN_HOOKS['reports']['financialreports'] = array('front/financialreport.php' => __('Report'));
            $PLUGIN_HOOKS['use_massive_action']['financialreports'] = 1;
        }
        if (plugin_financialreports_haveRight("financialreports", "r") || Session::haveRight("config", "w")) {
            $PLUGIN_HOOKS['config_page']['financialreports'] = 'front/config.form.php';
        }
        $PLUGIN_HOOKS['post_init']['financialreports'] = 'plugin_financialreports_postinit';
    }
}
 static function canView()
 {
     return plugin_financialreports_haveRight("financialreports", "r");
 }
Esempio n. 4
0
function plugin_financialreports_getAddSearchOptions($itemtype)
{
    $sopt = array();
    if (in_array($itemtype, PluginFinancialreportsDisposalItem::getTypes())) {
        if (plugin_financialreports_haveRight("financialreports", "r")) {
            $sopt[3450]['table'] = 'glpi_plugin_financialreports_disposalitems';
            $sopt[3450]['field'] = 'date_disposal';
            $sopt[3450]['linkfield'] = '';
            $sopt[3450]['name'] = __('Asset situation', 'financialreports') . " - " . __('Disposal date', 'financialreports');
            $sopt[3450]['forcegroupby'] = true;
            $sopt[3450]['datatype'] = 'date';
            $sopt[3450]['massiveaction'] = false;
            $sopt[3450]['joinparams'] = array('jointype' => 'itemtype_item');
        }
    }
    return $sopt;
}