<%@ page import="com.atlassian.jira.util.EasyList,
                 com.atlassian.jira.web.action.util.JiraLicenseUtils,
                 com.atlassian.license.License,
                 com.atlassian.license.LicenseManager"%>
<%@ taglib uri="webwork" prefix="webwork" %>
<%@ taglib uri="webwork" prefix="ui" %>
<%@ taglib uri="jiratags" prefix="jira" %>
<%@ taglib uri="sitemesh-page" prefix="page" %>

<html>
<head>
	<title><webwork:text name="'filtersubscription.title'"/></title>
</head>

<body>

<table cellpadding=0 cellspacing=0 border=0 width=100%>
<tr>
<td class="filterSummaryCell">
    <jsp:include page="/includes/navigator/summary-pane.jsp" />
</td>
<td bgcolor=ffffff valign=top>

<table width=100% cellpadding=10 cellspacing=0 border=0><tr><td>

<page:applyDecorator name="jiraform">
    <page:param name="title"><webwork:text name="'filtersubscription.title'"/></page:param>
    <page:param name="action">FilterSubscription.jspa</page:param>
    <page:param name="width">100%</page:param>
    <webwork:property value="subscribed" />
    <page:param name="submitName"><webwork:property value="submitName" /></page:param>
    <page:param name="cancelURI"><webwork:property value="cancelStr"/></page:param>
    <% License license = LicenseManager.getInstance().getLicense(JiraLicenseUtils.JIRA_LICENSE_KEY);
    if (license !=null && license.isLicenseLevel(EasyList.build(JiraLicenseUtils.JIRA_PROFESSIONAL_LEVEL, JiraLicenseUtils.JIRA_ENTERPRISE_LEVEL))) { %>
        <webwork:if test="hasGroupPermission == true">
            <ui:select label="text('filtersubscription.field.recipients')" name="'groupName'" list="groups" listKey="'.'" listValue="'.'" >
                <ui:param name="'headerrow'" value="text('filtersubscription.personal.sub')" />
                <ui:param name="'headervalue'" value="''" />
            </ui:select>
        </webwork:if>
    <% } else { %>
        <ui:component name="'groupName'" value="''" template="hidden.jsp" />
    <% } %>
    <ui:textfield label="text('filtersubscription.field.period')" name="'minutePeriod'">
        <ui:param name="'description'">
            <webwork:text name="'filtersubscription.desc'"/>
        </ui:param>
    </ui:textfield>

    <ui:checkbox label="text('filtersubscription.field.emailZeroResults')" name="'emailOnEmpty'" fieldValue="true" >
        <ui:param name="'description'" >
            <webwork:text name="'filtersubscription.emailEmptyResults'"/>
        </ui:param>
    </ui:checkbox>
    <webwork:if test="lastRunStr" >
        <ui:component label="'Last sent'" value="lastRunStr" template="textlabel.jsp" />
    </webwork:if>
    <webwork:if test="nextRunStr" >
        <ui:component label="'Next send'" value="nextRunStr" template="textlabel.jsp"/>
    </webwork:if>
    <ui:component name="'lastRun'" template="hidden.jsp"/>
    <ui:component name="'nextRun'" template="hidden.jsp"/>
    <ui:component name="'subId'" template="hidden.jsp"/>
    <ui:component name="'filterId'" template="hidden.jsp"/>
</page:applyDecorator>

</td></tr></table>
</td></tr></table>

</body>
</html>

