@@ -150,22 +150,21 @@ String prepareActions(SimpleDocument attachment, boolean useXMLForm,
150
150
builder .append ("<ul>" ).append (newline );
151
151
prepareMenuItem (builder , "updateAttachment('" + attachment .getId () + "','" + language + "');" ,
152
152
resources .getString ("GML.modify" ));
153
- if (useXMLForm ) {
154
- prepareMenuItem (builder , "EditXmlForm('" + attachment .getId () + "','" + language + "');" ,
155
- resources .getString ("attachment.xmlForm.Edit" ));
153
+ prepareMenuItem (builder , "EditXmlForm('" + attachment .getId () + "','" + language + "');" ,
154
+ resources .getString ("attachment.xmlForm.Edit" ));
155
+ String message = resources .getString ("attachment.switchState.toVersioned" );
156
+ if (attachment .isVersioned ()) {
157
+ message = resources .getString ("attachment.switchState.toSimple" );
156
158
}
159
+ prepareMenuItem (builder , "switchState('" + attachment .getId () + "', " + attachment .isVersioned ()
160
+ + ");" , message );
157
161
prepareMenuItem (builder , "deleteAttachment('" + attachment .getId () + "','" + StringEscapeUtils
158
162
.escapeEcmaScript (attachment .getFilename ()) + "');" , resources .getString ("GML.delete" ));
159
163
builder .append ("</ul>" ).append (newline );
160
164
builder .append ("<ul>" ).append (newline );
161
165
prepareMenuItem (builder , "ShareAttachment('" + attachment .getId () + "');" , resources .getString (
162
166
"attachment.share" ));
163
- String message = resources .getString ("attachment.switchState.toVersioned" );
164
- if (attachment .isVersioned ()) {
165
- message = resources .getString ("attachment.switchState.toSimple" );
166
- }
167
- prepareMenuItem (builder , "switchState('" + attachment .getId () + "', " + attachment .isVersioned ()
168
- + ");" , message );
167
+
169
168
builder .append ("</ul>" ).append (newline );
170
169
builder .append ("<ul>" ).append (newline );
171
170
prepareMenuItem (builder , "notifyAttachment('" + attachmentId + "');" , resources .getString (
@@ -202,14 +201,12 @@ String prepareActions(SimpleDocument attachment, boolean useXMLForm,
202
201
builder .append (configureCheckin (attachmentId , !isWorker (userId , attachment )
203
202
&& !isAdmin (userId )));
204
203
builder .append (configureUpdate (attachmentId , !isWorker (userId , attachment )));
205
- builder .append (configureDelete (attachmentId , useXMLForm , true ));
204
+ builder .append (configureDelete (attachmentId , true ));
206
205
if (!userId .equals (attachment .getEditedBy ())) {
207
- // disable xmlForm
208
- if (useXMLForm ) {
209
- builder .append (configureXmlForm (attachmentId , true ));
210
- }
206
+ builder .append (configureXmlForm (attachmentId , true ));
211
207
}
212
208
} else {
209
+ builder .append (configureXmlForm (attachmentId , !useXMLForm ));
213
210
builder .append (configureCheckin (attachmentId , true ));
214
211
builder .append (configureCheckoutAndEdit (attachmentId , !useWebDAV || !attachment .
215
212
isOpenOfficeCompatible ()));
@@ -261,11 +258,8 @@ String configureUpdate(String attachmentId, boolean disable) {
261
258
return String .format (template , attachmentId , "0, 1" , disable );
262
259
}
263
260
264
- String configureDelete (String attachmentId , boolean useXmlForm , boolean disable ) {
265
- if (useXmlForm ) {
266
- return String .format (template , attachmentId , "2, 1" , disable );
267
- }
268
- return String .format (template , attachmentId , "1, 1" , disable );
261
+ String configureDelete (String attachmentId , boolean disable ) {
262
+ return String .format (template , attachmentId , "4, 1" , disable );
269
263
}
270
264
271
265
String configureXmlForm (String attachmentId , boolean disable ) {
@@ -277,7 +271,7 @@ String configureFileSharing(String attachmentId, boolean disable) {
277
271
}
278
272
279
273
String configureSwitchState (String attachmentId , boolean disable ) {
280
- return String .format (template , attachmentId , "1, 2 " , disable );
274
+ return String .format (template , attachmentId , "3, 1 " , disable );
281
275
}
282
276
283
277
String configureNotify (String attachmentId , boolean disable ) {
0 commit comments