<%@ page import="com.atlassian.jira.util.BuildUtils"%>
<%@ page import="com.atlassian.jira.web.action.util.JiraLicenseUtils"%>
<%@ taglib uri="webwork" prefix="webwork" %>
<%@ taglib uri="webwork" prefix="ui" %>
<%@ taglib uri="sitemesh-page" prefix="page" %>
<html>
<head>
	<title><webwork:text name="'admin.license.information'"/></title>
</head>
<body>
<page:applyDecorator name="jirapanel">
    <page:param name="title"><webwork:text name="'admin.license.information'"/></page:param>
    <page:param name="width">100%</page:param>
    <webwork:text name="'admin.license.this.page.shows'"/>
    <p>
    <webwork:text name="'admin.license.you.instructions'"/>
</page:applyDecorator>
<p>
<table align="center" bgcolor="#bbbbbb" border="0" cellpadding="0" cellspacing="0" width="80%"><tr><td>
<table border="0" cellpadding="3" cellspacing="1" width="100%" id="license_table">
	<tr>
		<td bgcolor="#f0f0f0" class="colHeaderLink" width="20%" valign="top">
			<b><webwork:text name="'admin.license.organisation'"/></b>
		</td>
        <td bgcolor="#ffffff">
			<b><webwork:property value="/license/organisation"/></b>
		</td>
	</tr>
	<tr bgcolor="#f0f0f0">
        <td class="colHeaderLink" valign="top">
            <b><webwork:text name="'admin.license.date.purchased'"/></b>
        </td>
        <td bgcolor="#ffffff">
			<b><webwork:property value="/outlookDate/formatDMY(/license/datePurchased)"/></b>
		</td>
	</tr>
    <tr bgcolor="#f0f0f0">
        <td class="colHeaderLink" valign="top">
            <b><webwork:text name="'admin.license.type'"/></b>
        </td>
        <td bgcolor="#ffffff">
			<b><webwork:property value="/license/licenseType"/></b>
		</td>
    </tr>
     <tr bgcolor="#f0f0f0">
        <td class="colHeaderLink" valign="top">
            <b><webwork:text name="'admin.server.id'"/></b>
        </td>
        <td bgcolor="#ffffff">
			<b><span id="serverId"><webwork:property value="/serverId"/></span></b>
		</td>
    </tr>
    <webwork:property value="/license/partnerName">
    <webwork:if test=". != null && . != ''">
        <tr bgcolor="#f0f0f0">
            <td class="colHeaderLink" valign="top">
                <b><webwork:text name="'admin.license.partner.name'"/></b>
            </td>
            <td bgcolor="#ffffff">
                <b><webwork:property value="."/></b>
            </td>
        </tr>
    </webwork:if>
    </webwork:property>
    <webwork:if test="oldLicenseWithNewInstall == false">
        <tr bgcolor="#f0f0f0">
            <webwork:if test="evaluationLicense == true" >
                <td>
                    <b><webwork:text name="'admin.license.expiration'"/></b>
                </td>
                <td bgcolor="#ffffff">
                    <webwork:if test="license/expired == false">
                        <webwork:text name="'admin.license.expiration.date'">
                            <webwork:param name="'value0'"><b><webwork:property value="expiryTime" /></b></webwork:param>
                        </webwork:text>
                    </webwork:if>
                    <webwork:else>
                        <webwork:text name="'admin.license.expired'">
                            <webwork:param name="'value0'"><b><webwork:property value="/outlookDate/formatDMY(license/expiryDate)" /></b></webwork:param>
                        </webwork:text>
                    </webwork:else>
                </td>
            </webwork:if>
            <webwork:else>
                <td class="colHeaderLink" valign="top">
                    <b><webwork:text name="'admin.license.support.period'"/></b>
                </td>
                <td bgcolor="#ffffff">
                    <webwork:if test="hasSupportPeriodExpired == false">
                        <webwork:if test="/academicLicense == true">
                            <webwork:text name="'admin.license.support.period.date.academic'">
                                <webwork:param name="'value0'"><b><webwork:property value="/outlookDate/formatDMY(supportPeriodEnd)" /></b></webwork:param>
                            </webwork:text>
                        </webwork:if>
                        <webwork:elseIf test="/nonProfitLicense == true">
                            <webwork:text name="'admin.license.support.period.date.non.profit'">
                                <webwork:param name="'value0'"><b><webwork:property value="/outlookDate/formatDMY(supportPeriodEnd)" /></b></webwork:param>
                            </webwork:text>
                        </webwork:elseIf>
                        <webwork:elseIf test="/commercialLicense == true">
                            <webwork:text name="'admin.license.support.period.date'">
                                <webwork:param name="'value0'"><b><webwork:property value="/outlookDate/formatDMY(supportPeriodEnd)" /></b></webwork:param>
                            </webwork:text>
                        </webwork:elseIf>
                        <webwork:elseIf test="/communityLicense == true">
                            <webwork:text name="'admin.license.support.period.date.community'">
                                <webwork:param name="'value0'"><b><webwork:property value="/outlookDate/formatDMY(supportPeriodEnd)" /></b></webwork:param>
                            </webwork:text>
                        </webwork:elseIf>
                        <webwork:elseIf test="/openSourceLicense == true">
                            <webwork:text name="'admin.license.support.period.date.open.source'">
                                <webwork:param name="'value0'"><b><webwork:property value="/outlookDate/formatDMY(supportPeriodEnd)" /></b></webwork:param>
                            </webwork:text>
                        </webwork:elseIf>
                        <webwork:elseIf test="/developerLicense == true">
                            <webwork:text name="'admin.license.support.period.date.developer'">
                                <webwork:param name="'value0'"><b><webwork:property value="/outlookDate/formatDMY(supportPeriodEnd)" /></b></webwork:param>
                            </webwork:text>
                        </webwork:elseIf>
                        <webwork:elseIf test="/demonstrationLicense == true">
                            <webwork:text name="'admin.license.support.period.date.demonstration'">
                                <webwork:param name="'value0'"><b><webwork:property value="/outlookDate/formatDMY(supportPeriodEnd)" /></b></webwork:param>
                            </webwork:text>
                        </webwork:elseIf>
                        <webwork:if test="supportPeriodAlmostExpired == true">
                            <br><span style="color:#b00"><webwork:text name="'admin.license.contact.atlassian'">
                                <webwork:param name="'value0'"><a href="mailto:<webwork:component name="'external.link.atlassian.sales.mail.to'" template="externallink.jsp" />"><webwork:component name="'external.link.atlassian.sales.mail.to.description'" template="externallink.jsp" /></a></webwork:param>
                            </webwork:text></span>
                        </webwork:if>
                    </webwork:if>
                    <webwork:else>
                        <webwork:text name="'admin.license.commercial.support.ended.on'">
                            <webwork:param name="'value0'"><b><webwork:property value="/outlookDate/formatDMY(supportPeriodEnd)" /></b></webwork:param>
                        </webwork:text>
                        <webwork:text name="'admin.license.commercial.jira.updates.created.after'">
                            <webwork:param name="'value0'"><b><webwork:property value="/outlookDate/formatDMY(supportPeriodEnd)" /></b></webwork:param>
                        </webwork:text>
                        <br><span style="color:#b00"><webwork:text name="'admin.license.if.you.wish.to.renew'">
                            <webwork:param name="'value0'"><a href="mailto:<webwork:component name="'external.link.atlassian.sales.mail.to'" template="externallink.jsp" />"><webwork:component name="'external.link.atlassian.sales.mail.to.description'" template="externallink.jsp" /></a></webwork:param>
                        </webwork:text></span>
                    </webwork:else>
                </td>
             </webwork:else>
        </tr>
    </webwork:if>
	<webwork:else>
        <tr bgcolor="#f0f0f0">
            <td class="colHeaderLink" valign="top">
                <b><webwork:text name="'admin.license.expiration'"/></b>
            </td>
            <td bgcolor="#ffffff">
                <webwork:text name="'admin.license.jira.licenses.contain'">
                    <webwork:param name="'value0'"><webwork:property value="/outlookDate/formatDMY(supportPeriodEnd)" /></webwork:param>
                </webwork:text>
                <p>
                <webwork:text name="'admin.license.you.are.currently.using'"/>
                <p>
                <webwork:text name="'admin.license.the.current.version'">
                    <webwork:param name="'value0'"><%= BuildUtils.getVersion()%></webwork:param>
                    <webwork:param name="'value1'"><webwork:property value="confirmedUser/fullName" /> (<webwork:property value="confirmedUser/name" />)</webwork:param>
                    <webwork:param name="'value2'"><webwork:property value="/outlookDate/formatDMY(confirmedDate)" /></webwork:param>
                </webwork:text>
                <p>
			    <webwork:if test="confirmExtendLicenseExpired == true" >
                        <b><span style="color:#c00"><webwork:text name="'admin.license.your.evaluation.period.has.expired'"/></span> <webwork:text name="'admin.license.you.will.need.to.purchase.a.new.server.license'"/></b>
                </webwork:if>
                <webwork:else>
                        <span style="color:#c00">
                            <webwork:text name="'admin.license.your.evaluation.period.will.expire.in'">
                                <webwork:param name="'value0'"><span style="color:#000;font-weight:bold"><webwork:property value="expiryTime"/></span></webwork:param>
                            </webwork:text>
                        </span>
                </webwork:else>
                    <p><webwork:text name="'admin.license.please.contact.atlassian'">
                        <webwork:param name="'value0'"><a href="<webwork:component name="'external.link.jira.license.extension'" template="externallink.jsp" >
                                <webwork:param name="'value0'"><%= BuildUtils.getVersion() %></webwork:param>
                                <webwork:param name="'value1'"><%= BuildUtils.getCurrentBuildNumber() %></webwork:param>
                                <webwork:param name="'value2'"><%= BuildUtils.getEdition() %></webwork:param>
                                <webwork:param name="'value3'"><%= JiraLicenseUtils.getServerId() %></webwork:param>
                            </webwork:component>"></webwork:param>
                        <webwork:param name="'value1'"></a></webwork:param>
                    </webwork:text>
                    <br/><webwork:text name="'admin.license.alternatively'"/>
		    </td>
	    </tr>
    </webwork:else>
</table>
</td></tr></table>
<style type="text/css">
.fieldLabelArea
{
    width: 10%;
}
</style>
<p>
<page:applyDecorator name="jiraform">
	<page:param name="action">ViewLicense.jspa</page:param>
	<page:param name="submitName"><webwork:text name="'common.forms.add'"/></page:param>
	<page:param name="width">100%</page:param>
	<page:param name="title"><webwork:if test="/license != null"><webwork:text name="'admin.license.update.license'"/></webwork:if><webwork:else><webwork:text name="'admin.license.add.license'"/></webwork:else></page:param>
	<page:param name="description"><webwork:text name="'admin.license.copy.and.paste'"/></page:param>
	<ui:textarea label="text('admin.license')" name="'licenseString'" cols="50" rows="10" />
</page:applyDecorator>
</p>
</body>
</html>