<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)job_details.jsp    1.12    03/05/29     SMI"
   * 
   */
 --%>
<%@ include file="/layout/toptags.jsp"%>
<!-- locale stuff -->
<html:html locale="true">
<!-- end locale -->

<!-- Place Java Script Here -->

<!-- HTML -->
<head>
<%@include file="/layout/page_head_section.jsp"%>
	<title>
		<bean:message  key="jobs.general.title"/>
	</title>
</head>
<%@ include file="/layout/bodytag.jsp"%>
<%@include file="/layout/top.jsp"%>
<%@include file="/layout/breadcrumb.jsp"%>
<%@include file="/layout/spacer.jsp"%>
<%@include file="/layout/user_messages.jsp"%>
<html:form action="/root.menu.item4.item0.do">
<jsp:include page="/layout/section_header.jsp" flush="true">
	<jsp:param name="sectionname" value="jobs.details.section.title" />
</jsp:include>
<% JobInterface currentJob = (JobInterface) request.getAttribute(Constants.HttpRequestFields.CURRENT_JOB); %>

<!-- hidden element which specifies the action for this form -->
<input type="hidden" name="action" value="<%=request.getAttribute("action")%>">
<div class="content-layout">
<!-- Button row -->
<table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td nowrap>
      	<table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left">
              <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td>
                    <component:button text="button.cancel" href="javascript:submitForm('cancel');" title="jobs.details.cancel.title" isEnabled="true" />
				  </td>
				</tr>
		      </table>
		    </td>
		  </tr>

         <tr>
            <td><img alt border="0" src="images/general/dot.gif" width="1" height="5"></td>
          </tr>
          <tr>
            <td nowrap>
              <table class="back-table" border="0" cellspacing="0" cellpadding="1" width="50%">

                <tr>
                  <td>
                    <table class="front-table" border="0" cellspacing="0" cellpadding="0" width="100%">
                      <tr class="header-row">
                        <td>
                          <div class="table-header-text">
                            <bean:message key="detail.property" />
                          </div>
                        </td>

                        <td>
                          <div class="table-header-text">
                            <bean:message key="detail.value" />
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="jobs.general.jobid" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="<%=Constants.HttpRequestFields.CURRENT_JOB%>" property="id" />
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="jobs.general.array" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="<%=Constants.HttpRequestFields.CURRENT_JOB%>" property="array" />
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="jobs.general.description" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <component:partialTextDisplay textLength="40" 
                                text='<%=currentJob.getDescription()%>' />
                          </div>
                        </td>
                      </tr>

                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="jobs.general.percentcomplete" />
                          </div>
                        </td>

                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="<%=Constants.HttpRequestFields.CURRENT_JOB%>" property="percentComplete" />
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="jobs.general.start" />
                          </div>
                        </td>

                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <component:localDateTimeDisplay date='<%=currentJob.getStartTime()%>' stylePattern='<%=DateFormat.MEDIUM%>' />
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="jobs.general.finish" />
                          </div>
                        </td>

                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <component:localDateTimeDisplay date='<%=currentJob.getEndTime()%>' stylePattern='<%=DateFormat.MEDIUM%>' />
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="jobs.general.notify" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
			     <% String notify = ((JobInterface)request.
					getAttribute(Constants.HttpRequestFields.CURRENT_JOB)).
					getNotifyEmail(); 
				%>

				<component:partialTextDisplay textLength="80" text='<%=notify%>' />

                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="jobs.details.subscriptions" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
			  <%String jobCategory="pool";
			    if(currentJob.getDescription() != null &&
			    	 (currentJob.getDescription().indexOf("job.description.createvolume") >= 0 || currentJob.getDescription().indexOf("job.description.deletevolume") >= 0) ) {
				 jobCategory = "vol";
			    }
			    %>
                            <a href="root.menu.item3.item5category.do?action=selectCategory&selectedCategory=<%=jobCategory%>" ><bean:message key="jobs.details.subscriptions.show" /></a>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="jobs.general.status" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="<%= currentJob.getStatusKey() %>"/>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="jobs.details.jobstate" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
			  <% try { %>
                            <bean:message key="<%= Constants.JobProperties.STATUS_VALUE + currentJob.getJobStatus() %>"/>
			    <% } catch (Throwable e) { %>
                            <bean:message key="<%= Constants.JobProperties.STATUS_VALUE + "Unknown" %>"/>
			    <% } %>
                          </div>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</div>

</html:form>
</body>
</html:html> 
