#* @vtlvariable name="action" type="com.atlassian.confluence.admin.actions.RaiseSupportRequestAction" *#
<html>
	<head>
		<title>$action.getText("raise.support.request.title")</title>
    </head>
	<body>
		#parse ( "/template/includes/actionerrors.vm" )
            <form method="POST" name="raisesupportrequest" action="doraisesupportrequest.action">
                #form_xsrfToken()
                <div class="steptitle">$action.getText("raise.support.request.subtitle")</div>
				#if (!$action.isMailServerAvailable())
                    #if ($permissionHelper.isSystemAdministrator($remoteUser))
                        <div class="warningMessage">$action.getText("raise.support.request.no.mail.server", ["${req.contextPath}/admin/mail/viewmailservers.action"])</div>
                    #else
                        <div class="warningMessage">$action.getText("raise.support.request.no.mail.server.not.sysadmin")</div>
                    #end
				#end
                <div class="smalltext">$action.getText("raise.support.request.description")</div>
                <div class="smalltext">$action.getText("raise.support.request.patience")</div>
                <p>
                <table width="90%">                
                    #tag( "Label" "label='raise.support.request.to.field'" "name='toAddresses'" "value=toAddresses" )
                    #tag( "TextField" "label='raise.support.request.cc.field'" "name='ccAddresses'" "value=ccAddresses" "size=50" )
                    <tr><td></td><td><div class="descfont">$action.getText("raise.support.request.cc.help")</div></td></tr>
                    #tag( "TextField" "label='raise.support.request.subject.field'" "name='subject'" "value=subject" "size=50" "required='true'" )
                    <!-- probably need to get the note text in the same row as the field -->
                    <tr><td></td><td><div class="descfont">$action.getText("raise.support.request.subject.help")</div></td></tr>
                    #tag( "Textarea" "label='raise.support.request.description.field'" "name='description'" "value=description" "rows=15" "cols=50" "required='true'" )
                    #tag( "TextField" "label='raise.support.request.existing.field'" "name='existingRequest'" "value=existingRequest" "size=50" )
                    <tr><td></td><td><div class="descfont">$action.getText("raise.support.request.existing.help")</div></td></tr>
                    #tag( "TextField" "label='raise.support.request.contactname.field'" "name='contactName'" "value=contactName" "size=50" "required='true'" )
                 	#tag( "TextField" "label='raise.support.request.contactemail.field'" "name='contactEmail'" "value=contactEmail" "size=50" "required='true'" )
                 	#tag( "TextField" "label='raise.support.request.contactnumber.field'" "name='contactNumber'" "value=contactNumber" "size=50" )
                </table>
                <table width="90%">
                    <tr>
                        <td colspan="2" align="center">
                            #tag( "Submit" "id=confirm" "name='confirm'" "value='send.name'" "theme='notable'" )
                            #tag( "Submit" "id=cancel" "name='cancel'" "value='cancel.name'" "theme='notable'" )
                        </td>
                    </tr>
                </table>
                <p>
                <div class="smalltext">$action.getText("raise.support.request.environment.notes")</div>
                <p>
                <div class="steptitle">$action.getText("raise.support.request.environment.field")</div>
				#parse ( "/admin/systeminfo.vm" )
				<p>
				<div class="steptitle">$action.getText("raise.support.request.plugins.field")</div>
				<table width="90%" class="grid">
				<tr><th align="left">$action.getText("raise.support.request.plugin.name")</th><th>$action.getText("raise.support.request.plugin.version")</th><th align="left">$action.getText("raise.support.request.plugin.vendor")</th><th>$action.getText("raise.support.request.plugin.enabled") or $action.getText("raise.support.request.plugin.disabled")</th></tr>
#foreach ($plugin in $action.plugins)
	#set ($pluginInfo = $plugin.pluginInformation)
	            <tr #if ($velocityCount%2 == 0) bgcolor="#f9f9f9" #end>
                    <td align="left">$plugin.name</td>
                    <td align="center">$pluginInfo.version</td>
                    <td align="left">$pluginInfo.vendorName</td>
                    <td align="center">$action.getPluginEnabledAsI18nLabel($plugin.key)</td>
                </tr>
#end
				</table>
				<p>
				<div class="steptitle">$action.getText("raise.support.request.license.field")</div>
				<table width="90%" class="grid">
					<tr>
                        <td width="30%">$action.getText("raise.support.request.support.entitlement.number.field")</td>
                        <td id="supportEntitlementNumber">$action.supportEntitlementNumberOrI18nNone</td>
                    </tr>
					<tr>
                        <td width="30%">$action.getText("server.id")</td>
                        <td id="serverid">$action.serverIdOrI18nNone</td>
                    </tr>
					<tr width="30%" bgcolor="#f9f9f9"><td>$action.getText("raise.support.request.clustered.field")</td><td>$action.clustered</td></tr>
				</table>
				<p>
				<div class="steptitle">$action.getText("raise.support.request.systemprops.field")</div>
				<table width="90%" class="grid">
#set ($sysProps = $action.systemPropertiesHtml)
#foreach ($key in $sysProps.keySet())
					<tr #if ($velocityCount%2 == 0) bgcolor="#f9f9f9" #end><td><strong>$key</strong></td><td>$sysProps.get($key)</td></tr>
#end					
				</table>
				<p>
				<div class="steptitle">$action.getText("raise.support.request.languages.field")</div>
				<table width="90%" class="grid">
#foreach ($language in $action.installedLanguages)
					<tr #if ($velocityCount%2 == 0) bgcolor="#f9f9f9" #end><td>$language.language ($language.country)</td></tr>
#end					
				</table>				
                <table width="90%">
                    <tr>
                        <td colspan="2" align="center">
                            #tag( "Submit" "id=confirm2" "name='confirm'" "value='send.name'" "theme='notable'" )
                            #tag( "Submit" "id=cancel2" "name='cancel'" "value='cancel.name'" "theme='notable'" )
                        </td>
                    </tr>
                </table>
            </form>
		#parse("/breadcrumbs.vm")
	</body>
</html>
