<%@ taglib uri="webwork" prefix="webwork" %>
<%@ taglib uri="sitemesh-page" prefix="page" %>

<!-- STEP 1 - Move Sub Task: Choose Operation-->

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

<script language="javascript">
    function cellHover(cell)
    {
        cell.oldClassName = cell.className;
        cell.className = 'rowHover';
        cell.onmouseout = function()
        {
            this.className = this.oldClassName;
        }
    }

    function selectCellRadioBox(cell)
    {
        var id = cell.id.substring(4, cell.id.length);
        document.forms['movesubtask'].elements[id + '_id'].checked = true;
    }
</script>

<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="ffffff">
<tr>
    <td width=200 valign=top bgcolor=f0f0f0>
        <jsp:include page="/secure/views/issue/movetaskpane.jsp" flush="false" />
    </td>
    <td valign=top>
        <table cellspacing=0 cellpadding=10 border=0 width="100%">
        <tr><td>
            <page:applyDecorator name="jirapanel">
            <page:param name="title"><webwork:text name="'movesubtask.title'"/>: <webwork:text name="'move.chooseoperation.title'"/></page:param>
            <page:param name="description">
                <webwork:text name="'move.subtask.step1.desc'">
                   <webwork:param name="'value0'"><webwork:property value="/issue/string('key')"/></webwork:param>
               </webwork:text>
            </page:param>
            <page:param name="width">100%</page:param>
            </page:applyDecorator>
            <p>

        <form name="movesubtask" method="POST" action="MoveSubTaskChooseOperation.jspa?id=<webwork:property value="/issue/string('id')"/>">
            <p align=left>
                <input type=submit name="<webwork:text name="'common.forms.next'"/>" id="<webwork:text name="'common.forms.next'"/>" value="<webwork:text name="'common.forms.next'"/> >>"
                       title="<webwork:text name="'common.forms.submit.tooltip'">
                       <webwork:param name="'value0'"><webwork:text name="'common.forms.submit.accesskey'"/></webwork:param>
                       </webwork:text>"
                >&nbsp;
                <input type=button id="<webwork:text name="'common.forms.cancel'"/>" name="<webwork:text name="'common.forms.cancel'"/>" value="<webwork:text name="'common.forms.cancel'"/>" onclick="location.href='<webwork:property value="issuePath" />'">
            </p>


                <table bgcolor="bbbbbb" border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr><td>
                   <table border="0" cellpadding="3" cellspacing="1" width="100%">

                   <webwork:iterator value="moveSubTaskOperations" status="'status'">
                        <tr <webwork:if test="@status/even == true">class="rowAlternate"</webwork:if><webwork:else>class="rowNormal"</webwork:else>
                            onmouseover="cellHover(this)" onclick="selectCellRadioBox(this)" id="cell<webwork:property value="./nameKey"/>">
                                <%-- if the operation is available draw the radio button --%>
                                <webwork:if test="/canPerform(.) == true">
                                    <td align="center">
                                        <input type="radio" name="operation" id="<webwork:property value="./nameKey"/>_id" value="<webwork:property value="./nameKey"/>">
                                    </td>
                                    <td>
                                        <label for="<webwork:property value="./nameKey"/>_id"><webwork:text name="./nameKey"/></label>
                                    </td>
                                    <td>
                                        <label for="<webwork:property value="./nameKey"/>_id"><webwork:text name="./descriptionKey"/></label>
                                    </td>
                                </webwork:if>
                                <webwork:else>
                                    <td valign="top" bgcolor="f0f0f0" align="center"><webwork:text name="'bulkedit.constants.na'"/></td>
                                    <td  bgcolor="f0f0f0">
                                        <webwork:text name="./nameKey"/>
                                    </td>
                                    <td  bgcolor="f0f0f0">
                                        <webwork:text name="./cannotPerformMessageKey">
                                            <webwork:param name="'value0'"><b><font color="bb0000"></webwork:param>
                                            <webwork:param name="'value1'"></font></b></webwork:param>
                                        </webwork:text>
                                    </td>
                                </webwork:else>
                        </tr>
                    </webwork:iterator>
                </table>
                </td></tr></table>

            <p align=left>
                <input type=submit name="<webwork:text name="'common.forms.next'"/>" id="<webwork:text name="'common.forms.next'"/>" value="<webwork:text name="'common.forms.next'"/> >>"
                       accesskey="<webwork:text name="'common.forms.submit.accesskey'"/>"
                       title="<webwork:text name="'common.forms.submit.tooltip'">
                       <webwork:param name="'value0'"><webwork:text name="'common.forms.submit.accesskey'"/></webwork:param>
                       </webwork:text>"
                >&nbsp;
                <input type=button id="<webwork:text name="'common.forms.cancel'"/>" name="<webwork:text name="'common.forms.cancel'"/>" value="<webwork:text name="'common.forms.cancel'"/>" onclick="location.href='<webwork:property value="issuePath" />'">
            </p>
        </form>
        </td></tr></table>
    </td>
</tr>
</table>

</body>
</html>