diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js
index 1712d65648..30ea658cd3 100644
--- a/apps/api/documents/api.js
+++ b/apps/api/documents/api.js
@@ -1014,7 +1014,7 @@
if (config.frameEditorId)
params += "&frameEditorId=" + config.frameEditorId;
- var type = /^(?:(pdf))$/.exec(config.document.fileType);
+ var type = config.document ? /^(?:(pdf))$/.exec(config.document.fileType) : null;
if (!(type && typeof type[1] === 'string') && (config.editorConfig && config.editorConfig.mode == 'view' ||
config.document && config.document.permissions && (config.document.permissions.edit === false && !config.document.permissions.review )))
params += "&mode=view";
@@ -1031,7 +1031,7 @@
if (config.editorConfig && config.editorConfig.customization && config.editorConfig.customization.uiTheme )
params += "&uitheme=" + config.editorConfig.customization.uiTheme;
- if (config.document.fileType)
+ if (config.document && config.document.fileType)
params += "&fileType=" + config.document.fileType;
return params;
diff --git a/apps/pdfeditor/main/app/controller/Main.js b/apps/pdfeditor/main/app/controller/Main.js
index ef427bcef7..a4dddc79d1 100644
--- a/apps/pdfeditor/main/app/controller/Main.js
+++ b/apps/pdfeditor/main/app/controller/Main.js
@@ -1607,6 +1607,10 @@ define([
config.msg = this.errorInconsistentExt;
break;
+ case Asc.c_oAscError.ID.MailToClientMissing:
+ config.msg = this.errorEmailClient;
+ break;
+
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
break;
@@ -2448,7 +2452,8 @@ define([
txtInvalidPdfFormat: 'The value entered does not match the format of the field "{0}".',
txtValidPdfFormat: 'Field value should match format "{0}".',
txtChoose: 'Choose an item',
- txtEnterDate: 'Enter a date'
+ txtEnterDate: 'Enter a date',
+ errorEmailClient: 'No email client could be found'
}
})(), PDFE.Controllers.Main || {}))
});
\ No newline at end of file
diff --git a/apps/pdfeditor/main/app/controller/Toolbar.js b/apps/pdfeditor/main/app/controller/Toolbar.js
index 8c8ff00dff..40e3ace36c 100644
--- a/apps/pdfeditor/main/app/controller/Toolbar.js
+++ b/apps/pdfeditor/main/app/controller/Toolbar.js
@@ -420,7 +420,35 @@ define([
onDownloadUrl: function(url, fileType) {
if (this._state.isFromToolbarDownloadAs) {
- Common.Gateway.downloadAs(url, fileType);
+ var me = this,
+ defFileName = this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption();
+ !defFileName && (defFileName = me.txtUntitled);
+
+ if (me.toolbar.mode.canRequestSaveAs) {
+ Common.Gateway.requestSaveAs(url, defFileName, fileType);
+ } else {
+ me._saveCopyDlg = new Common.Views.SaveAsDlg({
+ saveFolderUrl: me.toolbar.mode.saveAsUrl,
+ saveFileUrl: url,
+ defFileName: defFileName
+ });
+ me._saveCopyDlg.on('saveaserror', function(obj, err){
+ var config = {
+ closable: false,
+ title: me.notcriticalErrorTitle,
+ msg: err,
+ iconCls: 'warn',
+ buttons: ['ok'],
+ callback: function(btn){
+ Common.NotificationCenter.trigger('edit:complete', me);
+ }
+ };
+ Common.UI.alert(config);
+ }).on('close', function(obj){
+ me._saveCopyDlg = undefined;
+ });
+ me._saveCopyDlg.show();
+ }
}
this._state.isFromToolbarDownloadAs = false;
},
@@ -813,7 +841,8 @@ define([
txtNeedDownload: 'At the moment, PDF viewer can only save new changes in separate file copies. It doesn\'t support co-editing and other users won\'t see your changes unless you share a new file version.',
txtDownload: 'Download',
txtSaveCopy: 'Save copy',
- errorAccessDeny: 'You are trying to perform an action you do not have rights for.
Please contact your Document Server administrator.'
+ errorAccessDeny: 'You are trying to perform an action you do not have rights for.
Please contact your Document Server administrator.',
+ txtUntitled: 'Untitled'
}, PDFE.Controllers.Toolbar || {}));
});
diff --git a/apps/pdfeditor/main/locale/en.json b/apps/pdfeditor/main/locale/en.json
index 5a11ec58ff..c599b7dd74 100644
--- a/apps/pdfeditor/main/locale/en.json
+++ b/apps/pdfeditor/main/locale/en.json
@@ -419,6 +419,7 @@
"PDFE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.
Contact %1 sales team for personal upgrade terms.",
"PDFE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.",
"PDFE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
+ "PDFE.Controllers.Main.errorEmailClient": "No email client could be found.",
"PDFE.Controllers.Navigation.txtBeginning": "Beginning of document",
"PDFE.Controllers.Navigation.txtGotoBeginning": "Go to the beginning of the document",
"PDFE.Controllers.Print.textMarginsLast": "Last Custom",
@@ -439,6 +440,7 @@
"PDFE.Controllers.Toolbar.txtNeedCommentMode": "To save changes to the file, switch to Сommenting mode. Or you can download a copy of the modified file.",
"PDFE.Controllers.Toolbar.txtNeedDownload": "At the moment, PDF viewer can only save new changes in separate file copies. It doesn't support co-editing and other users won't see your changes unless you share a new file version.",
"PDFE.Controllers.Toolbar.txtSaveCopy": "Save copy",
+ "PDFE.Controllers.Toolbar.txtUntitled": "Untitled",
"PDFE.Controllers.Viewport.textFitPage": "Fit to Page",
"PDFE.Controllers.Viewport.textFitWidth": "Fit to Width",
"PDFE.Controllers.Viewport.txtDarkMode": "Dark mode",