<%@ page extends="oneit.servlets.jsp.JSPInclude" %>

<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>

<%
    String  tabNumber   =   (String)  getData(request, "TabNumber");
    String  firstPage   =   WebUtils.getSamePageInRenderMode(request, "Page");
    String  detailsPage =   WebUtils.getSamePageInRenderMode(request, "HiringTeam");
    String  secondPage  =   WebUtils.getSamePageInRenderMode(request, "ManagePlan");
    String  thirdPage   =   WebUtils.getSamePageInRenderMode(request, "Billing");
    String  forthPage   =   WebUtils.getSamePageInRenderMode(request, "Invoices");
    
    HiringTeam  hiringTeam      =   (HiringTeam) process.getAttribute("HiringTeam");
    SecUser     loggedInUser    =   SecUser.getTXUser(transaction);
    CompanyUser companyUser     =   loggedInUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
    boolean     ownBilling      =   hiringTeam.getManageOwnBilling();
    String      disabled        =   ownBilling ? "false" : "true";
    String      disabledClass   =   ownBilling ? "" : "billing-disabled";
%>

<oneit:dynIncluded>
    <div class="tabing-sidebar">
        <ul class="nav nav-tabs tabs-left">
            <li class="<%= tabNumber == "1" ? "active" : ""%>">
                <oneit:button   value=" "   name="gotoPage" skin="link"
                                requestAttribs="<%= CollectionUtils.mapEntry("nextPage", detailsPage)
                                                                .toMap() %>">
                    Team Details
                </oneit:button>
            </li>
            <%
                RoleType userRole   =   companyUser.getRoleForHiringTeam(hiringTeam);

                if(userRole != RoleType.STANDARD)
                {
            %>
            
                    <oneit:recalcClass  htmlTag="li"  classScript="hiringTeam.getManageOwnBilling() ? tabNumber == '2' ? 'show active' : 'show' : 'hide'"   hiringTeam="<%= hiringTeam %>"  tabNumber="<%= tabNumber %>">
                        <oneit:button   value=" "   name="gotoPage" skin="link"
                                        requestAttribs="<%= CollectionUtils.mapEntry("nextPage", secondPage)
                                                                        .toMap() %>">
                            Manage Plan
                        </oneit:button>                    
                    </oneit:recalcClass>
                    <oneit:recalcClass  htmlTag="li"  classScript="hiringTeam.getManageOwnBilling() ? tabNumber == '3' ? 'show active' : 'show' : 'hide'"   hiringTeam="<%= hiringTeam %>"  tabNumber="<%= tabNumber %>">
                        <oneit:button   value=" "   name="gotoPage" skin="link"
                                        requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage)
                                                                        .toMap() %>">
                            Billing
                        </oneit:button>                    
                    </oneit:recalcClass>
                    <oneit:recalcClass  htmlTag="li"  classScript="hiringTeam.getManageOwnBilling() ? tabNumber == '4' ? 'show active' : 'show' : 'hide'"   hiringTeam="<%= hiringTeam %>"  tabNumber="<%= tabNumber %>">
                        <oneit:button   value=" "   name="gotoPage" skin="link"
                                        requestAttribs="<%= CollectionUtils.mapEntry("nextPage", forthPage)
                                                                        .toMap() %>">
                            Invoices
                        </oneit:button>                    
                    </oneit:recalcClass>
            <%
                }
            %>
        </ul>
    </div>
</oneit:dynIncluded>

