Skip to content

Commit

Permalink
delete: link fill form for pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandrfedorov97 committed Sep 27, 2024
1 parent 831f596 commit 05186e5
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 38 deletions.
19 changes: 3 additions & 16 deletions src/main/java/onlyoffice/conditions/IsOfficeFileAttachment.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

public class IsOfficeFileAttachment implements Condition {
private boolean forEdit;
private boolean form;
private DocumentManager documentManager;
private AttachmentUtil attachmentUtil;

Expand All @@ -41,13 +40,9 @@ public IsOfficeFileAttachment(final DocumentManager documentManager, final Attac

public void init(final Map<String, String> params) throws PluginParseException {
forEdit = false;
form = false;
if (params != null && !params.isEmpty() && params.get("forEdit") != null) {
forEdit = !params.get("forEdit").isEmpty();
}
if (params != null && !params.isEmpty() && params.get("form") != null) {
form = !params.get("form").isEmpty();
}
}

public boolean shouldDisplay(final Map<String, Object> context) {
Expand All @@ -65,20 +60,12 @@ public boolean shouldDisplay(final Map<String, Object> context) {
String fileName = attachment.getFileName();

if (forEdit) {
if (form) {
if (accessEdit && documentManager.isFillable(fileName)) {
return true;
}
} else {
if (accessEdit && documentManager.isEditable(fileName) && !documentManager.isFillable(fileName)) {
return true;
}
if (accessEdit && documentManager.isEditable(fileName)) {
return true;
}
} else {
if (accessView
&& documentManager.isViewable(fileName)
&& !(accessEdit && documentManager.isEditable(fileName))
&& !(accessEdit && documentManager.isFillable(fileName))
&& documentManager.isViewable(fileName) && !(accessEdit && documentManager.isEditable(fileName))
) {
return true;
}
Expand Down
10 changes: 0 additions & 10 deletions src/main/resources/atlassian-plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,6 @@
<link><![CDATA[/plugins/servlet/onlyoffice/doceditor?attachmentId=$attachment.id]]></link>
<styleClass>onlyoffice-doceditor</styleClass>
</web-item>
<web-item key="onlyoffice-docform" name="Link for the attachment fill form" section="system.attachment" weight="9">
<condition class="onlyoffice.conditions.IsOfficeFileAttachment">
<param name="forEdit">true</param>
<param name="form">true</param>
</condition>
<description>The link and the text for it which is used to open the .oform document to fill in the fields in the form.</description>
<label key="onlyoffice.editor.fillFormlink"/>
<link><![CDATA[/plugins/servlet/onlyoffice/doceditor?attachmentId=$attachment.id&mode=fillForms]]></link>
<styleClass>onlyoffice-doceditor</styleClass>
</web-item>
<web-item key="onlyoffice-docviewer" name="Link for viewing the attachment" section="system.attachment" weight="10">
<condition class="onlyoffice.conditions.IsOfficeFileAttachment"/>
<description>Link and text for this link used to open the document which is available for preview only.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ define('cp/component/onlyoffice-button', [
title = AJS.I18n.getText('onlyoffice.editor.editlink');
} else if (response.access == "view") {
title = AJS.I18n.getText('onlyoffice.editor.viewlink');
} else if (response.access == "fillForms") {
title = AJS.I18n.getText('onlyoffice.editor.fillFormlink');
mode = "fillForms";
}
}

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/lang-resource.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ onlyoffice.configuration.banner.message=Easily launch the editors in the cloud w
onlyoffice.configuration.banner.button=Get Now
onlyoffice.editor.editlink=Edit in ONLYOFFICE
onlyoffice.editor.viewlink=View in ONLYOFFICE
onlyoffice.editor.fillFormlink=Open in ONLYOFFICE
onlyoffice.editor.createlink=New document
onlyoffice.editor.createlink.tooltip=Create new file
onlyoffice.editor.dialog.filecreate.docx=Document
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/lang-resource_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ onlyoffice.configuration.banner.message=\u00d6ffnen Sie die Editoren in der Clou
onlyoffice.configuration.banner.button=Jetzt erhalten
onlyoffice.editor.editlink=Mit ONLYOFFICE bearbeiten
onlyoffice.editor.viewlink=Ansicht in ONLYOFFICE
onlyoffice.editor.fillFormlink=In ONLYOFFICE \u00f6ffnen
onlyoffice.editor.createlink=Neues Dokument
onlyoffice.editor.createlink.tooltip=Neue Datei erstellen
onlyoffice.editor.dialog.filecreate.docx=Dokument
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/lang-resource_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ onlyoffice.configuration.banner.message=Inicie f\u00e1cilmente los editores en l
onlyoffice.configuration.banner.button=Obtener ahora
onlyoffice.editor.editlink=Editar en ONLYOFFICE
onlyoffice.editor.viewlink=Ver en ONLYOFFICE
onlyoffice.editor.fillFormlink=Abrir en ONLYOFFICE
onlyoffice.editor.createlink=Nuevo documento
onlyoffice.editor.createlink.tooltip=Crear nuevo archivo
onlyoffice.editor.dialog.filecreate.docx=Documento
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/lang-resource_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ onlyoffice.configuration.banner.message=Lancez facilement les \u00e9diteurs dans
onlyoffice.configuration.banner.button=Obtenir maintenant
onlyoffice.editor.editlink=Modifier dans ONLYOFFICE
onlyoffice.editor.viewlink=Voir dans ONLYOFFICE
onlyoffice.editor.fillFormlink=Ouvrir dans ONLYOFFICE
onlyoffice.editor.createlink=Nouveau document
onlyoffice.editor.createlink.tooltip=\u0421\u0072\u00e9\u0065\u0072 un nouveau fichier
onlyoffice.editor.dialog.filecreate.docx=Document
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/lang-resource_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ onlyoffice.configuration.banner.message=Avvia facilmente gli editor nel cloud se
onlyoffice.configuration.banner.button=Ottieni ora
onlyoffice.editor.editlink=Modifica in ONLYOFFICE
onlyoffice.editor.viewlink=Visualizza in ONLYOFFICE
onlyoffice.editor.fillFormlink=Apri in ONLYOFFICE
onlyoffice.editor.createlink=Nuovo documento
onlyoffice.editor.createlink.tooltip=Crea un nuovo file
onlyoffice.editor.dialog.filecreate.docx=Documento
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/lang-resource_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ onlyoffice.configuration.banner.message=\u041b\u0435\u0433\u043a\u043e\u0020\u04
onlyoffice.configuration.banner.button=\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0020\u0441\u0435\u0439\u0447\u0430\u0441
onlyoffice.editor.editlink=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432 ONLYOFFICE
onlyoffice.editor.viewlink=\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0432 ONLYOFFICE
onlyoffice.editor.fillFormlink=\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u0432 ONLYOFFICE
onlyoffice.editor.createlink=\u041d\u043e\u0432\u044b\u0439\u0020\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442
onlyoffice.editor.createlink.tooltip=\u0421\u043e\u0437\u0434\u0430\u0442\u044c\u0020\u043d\u043e\u0432\u044b\u0439\u0020\u0444\u0430\u0439\u043b\u0020
onlyoffice.editor.dialog.filecreate.docx=\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/lang-resource_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ onlyoffice.configuration.message.settings.saving-error=\u4FDD\u5B58\u8BBE\u7F6E\
onlyoffice.configuration.banner.message=\u65E0\u9700\u4E0B\u8F7D\u548C\u5B89\u88C5\u5373\u53EF\u8F7B\u677E\u542F\u52A8\u4E91\u7AEF\u7F16\u8F91\u5668
onlyoffice.configuration.banner.button=\u7ACB\u5373\u83B7\u53D6
onlyoffice.editor.editlink=\u4F7F\u7528 ONLYOFFICE \u7F16\u8F91
onlyoffice.editor.viewlink=\u4F7F\u7528 ONLYOFFICE \u67E5\u770B
onlyoffice.editor.fillFormlink=\u7528 ONLYOFFICE \u6253\u5f00
onlyoffice.editor.createlink=\u65B0\u5EFA\u6587\u6863
onlyoffice.editor.createlink.tooltip=\u65B0\u5EFA\u6587\u4EF6
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/templates/preview.vm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#if($action == "edit")
<a class="aui-button" target="_blank" style="color: var(--aui-btn-text); margin-bottom: 2px;" href="$req.contextPath/plugins/servlet/onlyoffice/doceditor?attachmentId=${attachmentId}">$i18n.getText('onlyoffice.editor.editlink')</a>
#elseif($action == "fill")
<a class="aui-button" target="_blank" style="color: var(--aui-btn-text); margin-bottom: 2px;" href="$req.contextPath/plugins/servlet/onlyoffice/doceditor?attachmentId=${attachmentId}&mode=fillForms">$i18n.getText('onlyoffice.editor.fillFormlink')</a>
#end

<div id="iframeEditor_${id}"></div>
Expand Down

0 comments on commit 05186e5

Please sign in to comment.