<%@page pageEncoding="UTF-8" contentType="text/html" %> <%@ page import ="org.dbforms.config.DbFormsConfigRegistry,java.sql.Connection,java.sql.Statement,java.sql.ResultSet" %> <%if (request.getParameter("logoff") != null&&request.getSession()!=null) { request.getSession().invalidate(); }; StringBuffer LinkMandantID=new StringBuffer(""); //Spezieller Bericht gewünscht? StringBuffer defaultReport=new StringBuffer(); StringBuffer selectedReport=new StringBuffer(); defaultReport.append("?a=b"); String defaultTimeunit=request.getParameter("timeunit"); if(defaultTimeunit == null || defaultTimeunit.equals("")) defaultTimeunit = "S"; if(defaultTimeunit != null && !defaultTimeunit.toString().equals("")) defaultReport.append("&timeunit="+defaultTimeunit.toString()); String defaultReportParam=request.getParameter("report_id"); if(defaultReportParam != null && !defaultReportParam.toString().equals("")) { defaultReport.append("&report_id="+defaultReportParam.toString()); selectedReport.append(defaultReportParam.toString()); } String defaultMandantenIDParam=request.getParameter("MandantID"); String referrer=request.getParameter("referrer"); if(defaultMandantenIDParam != null && !defaultMandantenIDParam.toString().equals("")) { defaultReport.append("&MandantID="+defaultMandantenIDParam.toString()); LinkMandantID.append("/"+defaultMandantenIDParam.toString()); } if (request.getSession()!=null&&request.getSession().getAttribute("sessiontype")!=null&& request.getSession().getAttribute("sessiontype").equals("superx")) { Object mandantobject=request.getSession().getAttribute("MandantenID"); Object userid=request.getSession().getAttribute("UserID"); String mandantenid=""; if(mandantobject != null) mandantenid=mandantobject.toString(); else { if(defaultMandantenIDParam != null) mandantenid=defaultMandantenIDParam.toString(); } //der superx-Default-Mandant ist bei dbforms ein Leerstring if(mandantenid.equals("default")) mandantenid=""; Connection conmm=null; Statement st5; ResultSet l_rset5; try { conmm = DbFormsConfigRegistry.instance().lookup().getConnection(mandantenid); st5=conmm.createStatement(); String queryMaskenRechte = "--alle Abfragen für die die Gruppe über Sachgebiete berechtigt \n" + "select distinct M.tid,M.name \n" + " from maskeninfo M, sachgeb_maske_bez S, group_sachgeb_bez G, user_group_bez U \n" + " where M.tid = S.maskeninfo_id \n" + " and S.sachgebiete_id = G.sachgebiete_id \n" + " and G.groupinfo_id = U.groupinfo_id \n" + " and U.userinfo_id = " + userid + " \n" + " union \n" + " --alle Abfragen für die die Gruppe berechtigt (Einzelrechte) \n" + " select distinct M.tid,M.name \n" + " from maskeninfo M, group_masken_bez G, user_group_bez U \n" + " where M.tid = G.maskeninfo_id \n" + " and G.groupinfo_id = U.groupinfo_id \n" + " and U.userinfo_id = " + userid + " \n" + " union \n" + "--alle Abfragen aus Sachgebieten für die der Nutzer Rechte hat \n" + " select distinct M.tid,M.name \n" + " from maskeninfo M \n" + " where \n" + " (M.tid in (select maskeninfo_id from sachgeb_maske_bez S where S.sachgebiete_id in \n" + " (select sachgebiete_id from user_sachgeb_bez U where U.userinfo_id=" + userid + " ))) \n" + " union \n" + "--alle Abfragen für die Einzelrechte in user_masken_bez angegeben \n" + " select distinct M.tid,M.name \n" + " from maskeninfo M, user_masken_bez B \n" + " where \n" + " B.userinfo_id = " + userid + " \n" + " and (M.tid = B.maskeninfo_id \n" + " or B.maskeninfo_id = 0)"; l_rset5 = st5.executeQuery(queryMaskenRechte); StringBuffer maskRights=new StringBuffer(); while (l_rset5.next()) { maskRights.append(l_rset5.getObject(1)+","); } l_rset5.close(); st5.close(); //Semester ermitteln: st5=conmm.createStatement(); String semestersql = "select tid,eintrag,akad_jahr_absolv from man_semester where today() >= sem_beginn order by 1 desc"; l_rset5 = st5.executeQuery(semestersql); StringBuffer SemesterOptions=new StringBuffer(); StringBuffer SemesterArray=new StringBuffer(); int i=0; SemesterArray.append("semArray= new Array();\n"); while (l_rset5.next()) { i++; SemesterOptions.append(""); SemesterArray.append("semArray["+i+"] = new Array();"); SemesterArray.append("semArray["+i+"][1] = "+l_rset5.getObject(1)+";"); SemesterArray.append("semArray["+i+"][2] = "+l_rset5.getObject(3)+";\n"); } l_rset5.close(); st5.close(); //Jahr ermitteln: st5=conmm.createStatement(); String jahrsql2 = "select tid,tid from man_jahr where year(today()) >= tid order by 1 desc"; l_rset5 = st5.executeQuery(jahrsql2); StringBuffer SelectJahrOptions=new StringBuffer(); while (l_rset5.next()) { SelectJahrOptions.append(""); } l_rset5.close(); st5.close(); //maximales Jahr vor "heute" ermitteln st5=conmm.createStatement(); String jahrsql = "select tid from man_jahr where year(today()) >= tid order by 1 desc"; l_rset5 = st5.executeQuery(jahrsql); StringBuffer JahrOptions=new StringBuffer(); int jahre=0; while (l_rset5.next()) { jahre++; JahrOptions.append("validYear["+jahre+"]="+l_rset5.getObject(1)+";\n"); } l_rset5.close(); st5.close(); //Portlets holen //st5=conmm.createStatement(); //StringBuffer portlet=new StringBuffer(); //l_rset5 = st5.executeQuery("select name,class,icon,content from sx_portlet where today() between gueltig_von and gueltig_bis and type='IFRAME_MAN' and (visible != 'false' or visible is null) order by sortnr_initial,tid"); //while (l_rset5.next()) //{ // if(l_rset5.getObject(1) !=null && l_rset5.getObject(2) !=null && l_rset5.getObject(3) !=null && l_rset5.getObject(4) !=null) // portlet.append("
"); // portlet.append(" "); //} //l_rset5.close(); //st5.close(); //Hochschulnamen ermitteln: Statement st_hs_name; ResultSet rs_hs_name; st_hs_name=conmm.createStatement(); String sql_hs_name = "select trim(contents_short) from sx_captions where id='REPORT_HEADING_INSTITUTION'"; rs_hs_name = st_hs_name.executeQuery(sql_hs_name); String sb_hs_name=""; while (rs_hs_name.next()) { if(rs_hs_name.getObject(1) !=null) sb_hs_name=rs_hs_name.getObject(1).toString(); } rs_hs_name.close(); st_hs_name.close(); if(sb_hs_name==null || sb_hs_name.equals("")) sb_hs_name="Hochschule"; //Ende Hochschulnamen ermitteln //Logopfad ermitteln: Statement st_lg_path; ResultSet rs_lg_path; st_lg_path=conmm.createStatement(); String sql_lg_path = "select trim(contents_short) from sx_captions where id='REPORT_LOGO_FILE'"; rs_lg_path = st_lg_path.executeQuery(sql_lg_path); String sb_lg_path=""; while (rs_lg_path.next()) { if(rs_lg_path.getObject(1) !=null) sb_lg_path="../"+rs_lg_path.getObject(1).toString();} rs_lg_path.close(); st_lg_path.close(); if(sb_lg_path==null || sb_lg_path.equals("")|| sb_lg_path.equals("../")) sb_lg_path="../../images/superx.gif"; //Ende Logopfad ermitteln conmm.close(); int countMaskRights=0; boolean hasFinRights=false;boolean hasDrittRights=false;boolean hasManRights=false; //String maskRights=request.getSession().getAttribute("UserMaskRights").toString(); if (maskRights.indexOf("14571000")>-1) {countMaskRights++;hasFinRights=true;} if (maskRights.indexOf("888880120")>-1) {countMaskRights++;hasDrittRights=true;} if (maskRights.indexOf("888881190")>-1) {countMaskRights++;hasManRights=true;} if (countMaskRights==0) { %> Managementübersicht <%= sb_hs_name %>




Sie haben keine Rechte für Finanz- oder Drittmittelbericht oder Managementübersicht

<% } else //if (countMaskRights==1&&hasManRights) response.sendRedirect("/superx/servlet/SuperXmlTabelle?tid=888880190&Semester=20131"); //else if (countMaskRights==1&&hasFinRights) response.sendRedirect("/superx/servlet/SuperXmlMaske?tid=14571000"); else if (countMaskRights==1&&hasDrittRights) response.sendRedirect("/superx/servlet/SuperXmlMaske?tid=888880120"); else {%> <%= sb_hs_name %>

<%= sb_hs_name %>

<% } } //ende Suche DB Verbindung catch (Exception e) { out.print("Fehler bei Datenverbindung: "+e+ " MandantID"+mandantenid); } } else { if (request.getSession()!=null) session.invalidate(); String send_redirect="/superx" + LinkMandantID.toString() + "/xml/management/index.jsp" + defaultReport.toString(); response.sendRedirect(send_redirect); return; } %>