<%@ page import=" java.util.ArrayList , java.util.Collection , java.util.Collections , java.util.Iterator , java.util.List , ysl.util.Log , ysl.util.JSCalendar , ysl.util.Log , ysl.buslog.orgs.OrgEntity , ysl.ui.session.YslSession , ysl.util.StaticData , ysl.util.Term , ysl.util.Utils , ysl.buslog.orgs.Club , ysl.buslog.competitions.Competition , ysl.buslog.competitions.Division , ysl.buslog.competitions.Season , ysl.buslog.users.Role , ysl.buslog.users.User , ysl.buslog.users.UserRole " %> <%@ include file="TestSessionFragment.jsp" %> <% String leagueParam = request.getParameter("leagueId"); League league = null; boolean abort = false; boolean showInfo = YslSession.getViewLeagueInfo(session); boolean showAffiliates = YslSession.getViewLeagueAffiliates(session); boolean showOfficers = YslSession.getViewLeagueOfficers(session); boolean showInactiveSeasons = YslSession.getViewInactiveSeasons(session); boolean haveSeasonHeader = false; boolean refEdit = false; // When a user clicks on an inactive season, we issue a request parameter, // called "addSeason", with the id of the season. If this parameter is present, // we set this attribute into the session, to trigger showing this // inactive season, below. If the parameter equals the string "none", it // means that the user is closing the display of an inactive season, in which // case we remove the session attribute. -- Eben 8/16/02 int addSeasonId = YslSession.getAddedSeasonId(session); String addSeasonParam = request.getParameter("addSeason"); if (Utils.hasData(addSeasonParam)) { if (addSeasonParam.equals("none")) { addSeasonId = 0; YslSession.setAddedSeasonId(session, 0); } else { addSeasonId = Integer.parseInt(addSeasonParam); YslSession.setAddedSeasonId(session, addSeasonId); } } if (leagueParam != null) { league = League.getInstance(leagueParam); session.setAttribute("currentLeague", league); } else { league = (League)session.getAttribute("currentLeague"); } YslSession.setEditUserReturnJsp(session, "ViewLeague.jsp?leagueId=" + league.getId()); if (league == null || league.getName() == null) { // Send them to the page where they choose a league. Happens when // someone uses a favorite while sitting on the login screen, apparently. Also // happens if someone tries to come directly in with a favorite while currentUser is // not null, it seems. ServletUtils.sendRedirect("/ViewLeagueChoose.jsp?YSLkey=" + YSLkey + "&leagueId=0", request, response); return; } Season season = league.getActiveSeason(); String pageTitle = "View League"; %> <%@ include file="header.jsp" %>
<%@ include file="ShowStatusMessageFragment.jsp" %>
Seasons and
Competitions

<% if (Utils.hasData(league.getURL())) { // out.print("
Go to the " ) ; out.print("Go to the " ) ; out.print( "" ) ; out.print( league.toString() ) ; out.println( " Home Page" ); out.println("

"); } else { out.print(""); out.print(league.toString()); out.println("

"); } String leagueComments = league.getComments(); %>
"); out.println(""); out.println("
"); out.println("
" + leagueComments + "

"); } } if (Utils.hasData(leagueComments) == false) out.println("   -   Nothing Currently"); out.println("
"); if (season != null) { // we have an active season haveSeasonHeader = true; %>
<%@ include file="ShowSeasonFragment.jsp" %> <% } // end we have an active season %> <% Collection seasons = league.getSeasons(); if ((season == null && seasons.size() > 0) || seasons.size() > 1) { Iterator seasonIter = seasons.iterator() ; %>
<% if (!haveSeasonHeader) { haveSeasonHeader = true; %> <% } %>
<% if (showInactiveSeasons) { boolean noInactive = true; while (seasonIter.hasNext()) { season = (Season) seasonIter.next(); if (season != null && !season.isActive()) { // season is real if (noInactive) out.println(""); noInactive = false; if (addSeasonId == season.getId()) { // need to show this season out.println("
"); %> <% } } // end of season is real } // end while seasons.hasNext if (noInactive) out.println("No inactive seasons"); else out.println("
<%@ include file="ShowSeasonFragment.jsp" %> <% } else { %>
<%= season %> (inactive)
"); } // end if showInactives } //end of if seasons.hasNext %> <% boolean canDelete = false; boolean hideContactInfo = ( currentUserRole.getRoleId() == Role.GUEST_ID || currentUserRole.getRoleId() == Role.YSL_USER_ID ) && league.hideContactInfo(); %>
<%@ include file="ShowLeagueOfficersFragment.jsp" %>

<% ArrayList orgs = league.getAffiliates(); if (orgs.size() > 0) { %>
<% if (showAffiliates) { %> <%=(!hideContactInfo)?"" : ""%> <% Iterator iter = orgs.iterator(); int row1 = 0; while (iter.hasNext()) { OrgEntity ent = (OrgEntity)iter.next(); out.println( "" ) ; ///User orgAdmin = ent.getAdmin(); User orgRep = ent.getRep(league); if (orgRep != null) { out.println(""); } else { if (!hideContactInfo) { out.println("\n"); } else { out.println("\n"); } } out.println(""); row1++; } out.println("
Name ContactPhoneEmail
"); out.println( ent.getYSLLinkedName(YSLkey) ) ; out.println( "" + orgRep.getDisplayName()); if (!hideContactInfo) { out.println(" " ); out.println( ServletUtils.tableString(orgRep.getPhone())); out.println(" " ) ; out.println( ServletUtils.tableString(orgRep.getLinkedEmail())); } out.println(" No ContactNo Contact
"); } // end of if showAffiliates out.println(""); } // end of if orgs > 0 %>

<% if (currentUserRole.getRoleId() == Role.GUEST_ID && YslSession.getSpecialGuest(session) != null) { %> Log Out <% } else { %> User Home <% } %>