|
183 | 183 | </c:otherwise>
|
184 | 184 | </c:choose>
|
185 | 185 | <c:set var="componentId" value="${param.ComponentId}" />
|
186 |
| - |
187 | 186 | <%
|
188 | 187 | List<SimpleDocument> attachments = AttachmentServiceFactory.getAttachmentService().
|
189 | 188 | listDocumentsByForeignKeyAndType(new ForeignPK(request.getParameter("Id"), request.getParameter("ComponentId")),
|
|
521 | 520 | pageMustBeReloadingAfterSorting = true;
|
522 | 521 | }
|
523 | 522 |
|
524 |
| - function checkin(id, oldId, webdav, forceRelease) { |
| 523 | + function checkin(id, oldId, webdav, forceRelease, isVersioned) { |
| 524 | + if(isVersioned === true) { |
| 525 | + $("#simple_fields_attachment-checkin").hide(); |
| 526 | + $("#versioned_fields_attachment-checkin").show(); |
| 527 | + }else { |
| 528 | + $("#versioned_fields_attachment-checkin").hide(); |
| 529 | + $("#simple_fields_attachment-checkin").show(); |
| 530 | + } |
525 | 531 | $("#dialog-attachment-checkin").data("attachmentId", id).data("oldId", oldId).data("webdav", webdav).data("forceRelease", forceRelease).dialog("open");
|
526 | 532 | pageMustBeReloadingAfterSorting = true;
|
527 | 533 | }
|
|
915 | 921 | }
|
916 | 922 | });
|
917 | 923 | },
|
918 |
| - close: function() { |
| 924 | + '<fmt:message key="GML.cancel"/>': function() { |
919 | 925 | $(this).dialog("close");
|
920 | 926 | }
|
921 | 927 | }
|
|
996 | 1002 | $('#fileName').text(attachment.fileName);
|
997 | 1003 | $('#fileTitle').val(attachment.title);
|
998 | 1004 | $('#fileDescription').val(attachment.description);
|
| 1005 | + if(attachment.versioned === 'true') { |
| 1006 | + $('#fileName_label').text('<fmt:message key="attachment.version.actual" />'); |
| 1007 | + $('#file_upload_label').text('<fmt:message key="attachment.version.new" />'); |
| 1008 | + $('#versioned_fields_attachment-update').show(); |
| 1009 | + } else { |
| 1010 | + $('#versioned_fields_attachment-update').hide(); |
| 1011 | + $('#fileName_label').text('<fmt:message key="GML.file"/>') |
| 1012 | + $('#file_upload_label').text('<fmt:message key="fichierJoint" />'); |
| 1013 | + } |
999 | 1014 | }
|
1000 | 1015 |
|
1001 | 1016 | function clearAttachment() {
|
1002 | 1017 | $('#fileName').html('');
|
1003 | 1018 | $('#fileTitle').val('');
|
1004 | 1019 | $('#fileDescription').val('');
|
| 1020 | + $('#versioned_fields_attachment-update').hide(); |
1005 | 1021 | }
|
1006 | 1022 |
|
1007 | 1023 | function clearCheckin() {
|
|
1053 | 1069 | <div id="dialog-attachment-update" style="display:none">
|
1054 | 1070 | <form name="update-attachment-form" id="update-attachment-form" method="post" enctype="multipart/form-data;charset=utf-8" accept-charset="UTF-8" target="iframe-post-form">
|
1055 | 1071 | <input type="hidden" name="IdAttachment" id="attachmentId"/>
|
1056 |
| - <c:choose> |
1057 |
| - <c:when test="${not isVersionActive}"> |
1058 |
| - <c:if test="${silfn:isI18n() && not view:booleanValue(param.notI18n) }"> |
1059 |
| - <label for="langCreate" class="label-ui-dialog"><fmt:message key="GML.language"/></label> |
1060 |
| - <span class="champ-ui-dialog"><view:langSelect elementName="fileLang" elementId="fileLang" langCode="${contentLanguage}" includeLabel="false" /></span> |
1061 |
| - </c:if> |
1062 |
| - <label for="fileName" class="label-ui-dialog"><fmt:message key="GML.file" /></label> |
1063 |
| - <span id="fileName" class="champ-ui-dialog"></span> |
1064 |
| - <label for="file_upload" class="label-ui-dialog"><fmt:message key="fichierJoint" /></label> |
1065 |
| - <span class="champ-ui-dialog"><input type="file" name="file_upload" size="50" id="file_upload" /></span> |
1066 |
| - |
1067 |
| - <label for="fileTitle" class="label-ui-dialog"><fmt:message key="Title"/></label> |
1068 |
| - <span class="champ-ui-dialog"><input type="text" name="fileTitle" size="60" id="fileTitle" /></span> |
1069 |
| - <label for="fileDescription" class="label-ui-dialog"><fmt:message key="GML.description" /></label> |
1070 |
| - <span class="champ-ui-dialog"><textarea name="fileDescription" cols="60" rows="3" id="fileDescription"></textarea></span> |
1071 |
| - </c:when> |
1072 |
| - <c:otherwise> |
1073 |
| - <label for="fileName" class="label-ui-dialog"><fmt:message key="attachment.version.actual" /></label> |
1074 |
| - <span id="fileName" class="champ-ui-dialog"></span> |
1075 |
| - |
1076 |
| - <label for="file_upload" class="label-ui-dialog"><fmt:message key="attachment.version.new" /></label> |
1077 |
| - <span class="champ-ui-dialog"><input type="file" name="file_upload" size="50" id="file_upload" /></span> |
1078 |
| - |
1079 |
| - <label for="fileTitle" class="label-ui-dialog"><fmt:message key="Title"/></label> |
1080 |
| - <span class="champ-ui-dialog"><input type="text" name="fileTitle" size="60" id="fileTitle" /></span> |
1081 |
| - <label for="fileDescription" class="label-ui-dialog"><fmt:message key="GML.description" /></label> |
1082 |
| - <span class="champ-ui-dialog"><textarea name="fileDescription" cols="60" rows="3" id="fileDescription"></textarea></span> |
1083 |
| - |
1084 |
| - <label for="versionType" class="label-ui-dialog"><fmt:message key="attachment.version.label"/></label> |
1085 |
| - <span class="champ-ui-dialog"><input value="0" type="radio" name="versionType" id="versionType" checked="checked"/><fmt:message key="attachment.version_public.label"/> |
1086 |
| - <input value="1" type="radio" name="versionType" id="versionType"/><fmt:message key="attachment.version_wip.label"/></span> |
1087 |
| - <label for="commentMessage" class="label-ui-dialog"><fmt:message key="attachment.dialog.comment"/></label> |
1088 |
| - <span class="champ-ui-dialog"><textarea name="commentMessage" cols="60" rows="3" id="commentMessage"></textarea></span> |
1089 |
| - </c:otherwise> |
1090 |
| - </c:choose> |
| 1072 | + <c:if test="${silfn:isI18n() && not view:booleanValue(param.notI18n) }"> |
| 1073 | + <label for="langCreate" class="label-ui-dialog"><fmt:message key="GML.language"/></label> |
| 1074 | + <span class="champ-ui-dialog"><view:langSelect elementName="fileLang" elementId="fileLang" langCode="${contentLanguage}" includeLabel="false" /></span> |
| 1075 | + </c:if> |
| 1076 | + <label id="fileName_label" for="fileName" class="label-ui-dialog"><fmt:message key="GML.file" /></label> |
| 1077 | + <span id="fileName" class="champ-ui-dialog"></span> |
| 1078 | + |
| 1079 | + <label id="file_upload_label" for="file_upload" class="label-ui-dialog"><fmt:message key="fichierJoint" /></label> |
| 1080 | + <span class="champ-ui-dialog"><input type="file" name="file_upload" size="50" id="file_upload" /></span> |
| 1081 | + |
| 1082 | + <label for="fileTitle" class="label-ui-dialog"><fmt:message key="Title"/></label> |
| 1083 | + <span class="champ-ui-dialog"><input type="text" name="fileTitle" size="60" id="fileTitle" /></span> |
| 1084 | + |
| 1085 | + <label for="fileDescription" class="label-ui-dialog"><fmt:message key="GML.description" /></label> |
| 1086 | + <span class="champ-ui-dialog"><textarea name="fileDescription" cols="60" rows="3" id="fileDescription"></textarea></span> |
| 1087 | + |
| 1088 | + <div id="versioned_fields_attachment-update" style="display:none"> |
| 1089 | + <label for="versionType" class="label-ui-dialog"><fmt:message key="attachment.version.label"/></label> |
| 1090 | + <span class="champ-ui-dialog"><input value="0" type="radio" name="versionType" id="versionType" checked="checked"/><fmt:message key="attachment.version_public.label"/> |
| 1091 | + <input value="1" type="radio" name="versionType" id="versionType"/><fmt:message key="attachment.version_wip.label"/></span> |
| 1092 | + |
| 1093 | + <label for="commentMessage" class="label-ui-dialog"><fmt:message key="attachment.dialog.comment"/></label> |
| 1094 | + <span class="champ-ui-dialog"><textarea name="commentMessage" cols="60" rows="3" id="commentMessage"></textarea></span> |
| 1095 | + </div> |
1091 | 1096 | <input type="submit" value="Submit" style="display:none" />
|
1092 | 1097 | </form>
|
1093 | 1098 | </div>
|
|
1096 | 1101 | <form name="add-attachment-form" id="add-attachment-form" method="post" enctype="multipart/form-data;charset=utf-8" accept-charset="UTF-8" target="iframe-post-form">
|
1097 | 1102 | <input type="hidden" name="foreignId" id="foreignId" value="<c:out value="${sessionScope.Silverpeas_Attachment_ObjectId}" />" />
|
1098 | 1103 | <input type="hidden" name="indexIt" id="indexIt" value="<c:out value="${indexIt}" />" />
|
1099 |
| - |
1100 | 1104 | <c:if test="${silfn:isI18n() && not isVersionActive && not view:booleanValue(param.notI18n)}">
|
1101 | 1105 | <label for="langCreate" class="label-ui-dialog"><fmt:message key="GML.language"/></label>
|
1102 | 1106 | <span class="champ-ui-dialog"><view:langSelect elementName="fileLang" elementId="langCreate" langCode="${contentLanguage}" includeLabel="false"/></span>
|
1103 | 1107 | </c:if>
|
1104 |
| - |
1105 | 1108 | <label for="file_create" class="label-ui-dialog"><fmt:message key="fichierJoint"/></label>
|
1106 | 1109 | <span class="champ-ui-dialog"><input type="file" name="file_upload" size="50" id="file_create" /></span>
|
1107 | 1110 | <label for="fileTitleCreate" class="label-ui-dialog"><fmt:message key="Title"/></label>
|
|
1121 | 1124 |
|
1122 | 1125 | <div id="dialog-attachment-delete" style="display:none">
|
1123 | 1126 | <span id="attachment-delete-warning-message"><fmt:message key="attachment.suppressionConfirmation" /></span>
|
1124 |
| - <c:if test="${silfn:isI18n() && not isVersionActive && not view:booleanValue(param.notI18n)}"> |
| 1127 | + <c:if test="${silfn:isI18n() && not view:booleanValue(param.notI18n)}"> |
1125 | 1128 | <div id="attachment-delete-select-lang" style="display:none">
|
1126 | 1129 | <div id="languages">
|
1127 | 1130 | <c:forEach items="<%=com.silverpeas.util.i18n.I18NHelper.getAllSupportedLanguages()%>" var="supportedLanguage">
|
1128 | 1131 | <span id='delete-language-<c:out value="${supportedLanguage}"/>' style="display:none"><input type="checkbox" id='<c:out value="${supportedLanguage}"/>ToDelete' name="languagesToDelete" value='<c:out value="${supportedLanguage}"/>'/><c:out value="${silfn:i18nLanguageLabel(supportedLanguage, sessionScope.SilverSessionController.favoriteLanguage)}"/></span>
|
1129 |
| - </c:forEach> |
| 1132 | + </c:forEach>data("isVersioned", isVersioned) |
1130 | 1133 | </div>
|
1131 | 1134 | </div>
|
1132 | 1135 | </c:if>
|
1133 | 1136 | </div>
|
1134 | 1137 |
|
1135 |
| - <div id="dialog-attachment-switch" style="display:none"></div> |
| 1138 | +<div id="dialog-attachment-switch" style="display:none"></div> |
1136 | 1139 |
|
1137 | 1140 | <div id="dialog-attachment-checkin" style="display:none">
|
1138 | 1141 | <form name="checkin-attachment-form" id="checkin-attachment-form" method="post" accept-charset="UTF-8" target="iframe-post-form">
|
1139 | 1142 | <input type="hidden" name="checkin_oldId" id="checkin_oldId" value="-1" />
|
1140 | 1143 | <input type="hidden" name="force" id="force" value="false" />
|
1141 | 1144 | <input type="hidden" name="webdav" id="webdav" value="false" />
|
1142 |
| - <c:choose> |
1143 |
| - <c:when test="${isVersionActive}"> |
1144 |
| - <label for="private" class="label-ui-dialog"><fmt:message key="attachment.version.label"/></label> |
1145 |
| - <span class="champ-ui-dialog"><input value="false" type="radio" name="private" id="private" checked="checked"/><fmt:message key="attachment.version_public.label"/> |
1146 |
| - <input value="true" type="radio" name="private" id="private"/><fmt:message key="attachment.version_wip.label"/></span> |
1147 |
| - <label for="comment" class="label-ui-dialog"><fmt:message key="attachment.dialog.comment" /></label> |
1148 |
| - <span class="champ-ui-dialog"><textarea name="comment" cols="60" rows="3" id="comment"></textarea></span> |
1149 |
| - </c:when> |
1150 |
| - <c:otherwise> |
1151 |
| - <fmt:message key="confirm.checkin.message" /> |
1152 |
| - </c:otherwise> |
1153 |
| - </c:choose> |
| 1145 | + <div id="versioned_fields_attachment-checkin" style="display:none"> |
| 1146 | + <label for="private" class="label-ui-dialog"><fmt:message key="attachment.version.label"/></label> |
| 1147 | + <span class="champ-ui-dialog"><input value="false" type="radio" name="private" id="private" checked="checked"/><fmt:message key="attachment.version_public.label"/> |
| 1148 | + <input value="true" type="radio" name="private" id="private"/><fmt:message key="attachment.version_wip.label"/></span> |
| 1149 | + |
| 1150 | + <label for="comment" class="label-ui-dialog"><fmt:message key="attachment.dialog.comment" /></label> |
| 1151 | + <span class="champ-ui-dialog"><textarea name="comment" cols="60" rows="3" id="comment"></textarea></span> |
| 1152 | + </div> |
| 1153 | + <div id="simple_fields_attachment-checkin" style="display:none"><fmt:message key="confirm.checkin.message" /></div> |
1154 | 1154 | <input type="submit" value="Submit" style="display:none" />
|
1155 | 1155 | </form>
|
1156 | 1156 | </div>
|
|
0 commit comments