<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"
-%>
-<%@
- taglib prefix="s" uri="/struts-tags"
-%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-
- <head>
- <link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
- <script language="JavaScript">
-
- function initialize () {
-// ----------------------
- bring.documentName.focus();
- }
- </script>
- </head>
- <body onLoad="initialize()">
+ pageEncoding="ISO-8859-1"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
+<script>
+$(document).ready(function () {
+ $("#bring #documentName").focus();
+});
+</script>
<!-- Import dialog
=============================================================================================================================
-->
- <div id=article-box>
- <div id=section><s:text name="title.import"/></div>
- <div id=article-body class=text>
- <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
- <tr height=25 valign=middle>
- <td>
- <s:text name="message.upload">
- <s:param><s:property value="%{fileName}"/></s:param>
- </s:text>
- </td>
- </tr>
- <tr height=1 bgcolor=#AAAAAA><td></td></tr>
- </table>
+<div id=article-box>
+<div id=section><s:text name="title.import" /></div>
+<div id=article-body class=text>
+<table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
+ <tr height=25 valign=middle>
+ <td><s:text name="message.upload">
+ <s:param>
+ <s:property value="%{fileName}" />
+ </s:param>
+ </s:text></td>
+ </tr>
+ <tr height=1 bgcolor=#AAAAAA>
+ <td></td>
+ </tr>
+</table>
- <form name="bring" action="valid-import" method="post">
- <s:hidden name="fileName" value="%{fileName}" />
- <s:hidden name="reference" value="%{reference}" />
- <s:hidden name="documentTitle" value="%{documentName}" />
- <s:hidden name="defaultDocumentType" value="%{documentType}" />
- <s:hidden name="defaultDocumentState" value="%{documentState}" />
- <s:hidden name="version" value="%{version}" />
- <s:hidden name="documentDate" value="%{documentDate}" />
- <table cellpadding=0 cellspacing=0 border=0 class=text>
- <tr height=15><td></td></tr>
- <tr>
- <td align=right><s:text name="field.documentype"/> </td>
- <td align=left> <s:text name="field.documentitle"/></td>
- </tr>
- <tr>
- <td>
- <s:set var="type" value="defaultDocumentType.index"/>
- <s:set var="selectype" value="%{'onChange=submit()'}"/>
- <s:if test="%{documentType != 0}">
- <s:set var="selectype" value="%{'disabled'}"/>
- </s:if>
- <select name="documentType" <s:property value="%{#selectype}"/>>
- <option value="-1"><s:text name="menu.select"/></option>
- <option value="0"> <s:text name="menu.newdoctype"/></option>
- <optgroup label=" <s:text name="label.doctypes"/>">
- <s:iterator value="documentTypes">
- <s:if test="%{index == #type}">
- <option selected value="<s:property value="index"/>"> <s:text name="type.document.%{name}"/></option>
- </s:if><s:else>
- <option value="<s:property value="index"/>"> <s:text name="type.document.%{name}"/></option>
- </s:else>
- </s:iterator>
- </optgroup>
- </select>
- </td>
- <td>
- <s:set var="setname" value="%{''}"/>
- <s:if test="%{reference != null}">
- <s:set var="setname" value="%{'disabled'}"/>
- </s:if>
- <input type="text" name="documentName" size="60" value="<s:property value="documentName"/>" <s:property value="%{#setname}"/> />
- </td>
- </tr>
- <s:if test="defaultDocumentUses.size > 0">
- <tr><td align=right><s:text name="label.uses"/>:</td></tr>
- <s:iterator value="defaultDocumentUses">
- <tr>
- <td align=right><input type="checkbox" name="uses" value="<s:property value="index"/>" checked></td>
- <td><s:property value="title"/></td>
- </tr>
- </s:iterator>
- </s:if>
- <tr height=10><td></td></tr>
- <tr>
- <td align=right>
- <input type="submit" name="cancel" value="<s:text name="button.cancel"/>"/>
- </td>
- <td align=left>
- <input type="submit" name="save" value="<s:text name="button.import"/>"/>
- <select name="documentState" <s:property value="%{#setname}"/>>
- <s:if test="documentState == 'EXTERN'">
- <option value="inWORK"><s:text name="label.inWORK"/></option>
- <option value="inDRAFT"><s:text name="label.inDRAFT"/></option>
- <option value="EXTERN" selected><s:text name="label.EXTERN"/></option>
- </s:if>
- <s:elseif test="documentState == 'inDRAFT'">
- <option value="inWORK"><s:text name="label.inWORK"/></option>
- <option value="inDRAFT" selected><s:text name="label.inDRAFT"/></option>
- <option value="EXTERN"><s:text name="label.EXTERN"/></option>
- </s:elseif>
- <s:else>
- <option value="inWORK" selected><s:text name="label.inWORK"/></option>
- <option value="inDRAFT"><s:text name="label.inDRAFT"/></option>
- <option value="EXTERN"><s:text name="label.EXTERN"/></option>
- </s:else>
- </select>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </div>
- </body>
-</html>
\ No newline at end of file
+<form name="bring" id="bring" action="valid-import" method="post">
+<s:hidden name="fileName" value="%{fileName}" /> <s:hidden
+ name="reference" value="%{reference}" /> <s:hidden
+ name="documentTitle" value="%{documentName}" /> <s:hidden
+ name="defaultDocumentType" value="%{documentType}" /> <s:hidden
+ name="defaultDocumentState" value="%{documentState}" /> <s:hidden
+ name="version" value="%{version}" /> <s:hidden name="documentDate"
+ value="%{documentDate}" />
+<table cellpadding=0 cellspacing=0 border=0 class=text>
+ <tr height=15>
+ <td></td>
+ </tr>
+ <tr>
+ <td align=right><s:text name="field.documentype" /> </td>
+ <td align=left> <s:text name="field.documentitle" /></td>
+ </tr>
+ <tr>
+ <td>
+ <s:select theme="simple" name="documentType" list="documentTypes"
+ listKey="index" listValue="%{getText('type.document.' + getName())}" />
+ </td>
+ <td><s:set var="setname" value="%{''}" /> <s:if
+ test="%{reference != null}">
+ <s:set var="setname" value="%{'disabled'}" />
+ </s:if> <input type="text" name="documentName" id="documentName" size="60"
+ value="<s:property value="documentName"/>"
+ <s:property value="%{#setname}"/> /></td>
+ </tr>
+ <s:if test="defaultDocumentUses.size > 0">
+ <tr>
+ <td align=right><s:text name="label.uses" />:</td>
+ </tr>
+ <s:iterator value="defaultDocumentUses">
+ <tr>
+ <td align=right><input type="checkbox" name="uses"
+ value="<s:property value="index"/>" checked></td>
+ <td><s:property value="title" /></td>
+ </tr>
+ </s:iterator>
+ </s:if>
+ <tr height=10>
+ <td></td>
+ </tr>
+ <tr>
+ <td align=right><input type="submit" name="cancel"
+ value="<s:text name="button.cancel"/>" /> </td>
+ <td align=left><input type="submit" name="save"
+ value="<s:text name="button.import"/>" /> <select
+ name="documentState" <s:property value="%{#setname}"/>>
+ <s:if test="documentState == 'EXTERN'">
+ <option value="inWORK"><s:text name="label.inWORK" /></option>
+ <option value="inDRAFT"><s:text name="label.inDRAFT" /></option>
+ <option value="EXTERN" selected><s:text name="label.EXTERN" /></option>
+ </s:if>
+ <s:elseif test="documentState == 'inDRAFT'">
+ <option value="inWORK"><s:text name="label.inWORK" /></option>
+ <option value="inDRAFT" selected><s:text
+ name="label.inDRAFT" /></option>
+ <option value="EXTERN"><s:text name="label.EXTERN" /></option>
+ </s:elseif>
+ <s:else>
+ <option value="inWORK" selected><s:text name="label.inWORK" /></option>
+ <option value="inDRAFT"><s:text name="label.inDRAFT" /></option>
+ <option value="EXTERN"><s:text name="label.EXTERN" /></option>
+ </s:else>
+ </select></td>
+ </tr>
+</table>
+</form>
+</div>
+</div>
} else {
setToolProperty(Constants.NONE);
}
- initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
- Constants.FALSE, getToolProperty(), Constants.STUDY_MENU);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.FALSE, getToolProperty(),
+ Constants.STUDY_MENU);
User user = getConnectedUser();
File updir = getRepositoryService().getDownloadDirectory(user);
mystudy = getOpenStudy();
Step step = mystudy.getSelectedStep();
_documentTypes = getStepService().getValidDocumentTypes(step);
+ // Set the document type by default
deftype = getApplicationSettings().getDefaultDocumentType(step, filext);
+ if (deftype != null) {
+ setDefaultDocumentType(Long.toString(deftype.getIndex()));
+ }
defuses = new ArrayList<Document>();
state = ProgressState.inWORK;
private void setError(final String errorCode) {
setErrorCode(errorCode);
- initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
- Constants.FALSE, Constants.NONE, Constants.STUDY_MENU);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.FALSE, Constants.NONE,
+ Constants.STUDY_MENU);
}
/**
if (_documentType == 0) {
setErrorCode("message.error.import.type");
- initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
- Constants.TRUE, Constants.NONE, Constants.STUDY_MENU);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.STUDY_MENU);
return ERROR;
}
}
}
if (LOG.isDebugEnabled()) {
- LOG.debug("Document to be imported uses documents with following ids:");
- for (Long usesId: uses) {
+ LOG
+ .debug("Document to be imported uses documents with following ids:");
+ for (Long usesId : uses) {
LOG.debug("#" + usesId);
}
}
setErrorCode("message.error.internal");
}
- initializationFullScreenContext(Constants.STUDY_MENU, Constants.STUDY_MENU,
- Constants.TRUE, Constants.NONE, Constants.STUDY_MENU);
+ initializationFullScreenContext(Constants.STUDY_MENU,
+ Constants.STUDY_MENU, Constants.TRUE, Constants.NONE,
+ Constants.STUDY_MENU);
return ERROR;
}