From 39b860ffa2e1058d45584cc9ca35db0aa33591f1 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Fri, 3 Jun 2016 15:00:28 +0200 Subject: [PATCH 1/3] do not query UI language for each doc, it's same for all --- controller/documentcontroller.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controller/documentcontroller.php b/controller/documentcontroller.php index d0f4d37a..f3da228d 100644 --- a/controller/documentcontroller.php +++ b/controller/documentcontroller.php @@ -463,6 +463,7 @@ class DocumentController extends Controller { $fileIds = array(); $documents = array(); + $lolang = strtolower(str_replace('_', '-', $this->settings->getUserValue($this->uid, 'core', 'lang', 'en'))); foreach ($found as $key=>$document) { if (is_object($document)){ $documents[] = $document->getData(); @@ -472,7 +473,7 @@ class DocumentController extends Controller { $documents[$key]['icon'] = preg_replace('/\.png$/', '.svg', \OCP\Template::mimetype_icon($document['mimetype'])); $documents[$key]['hasPreview'] = \OC::$server->getPreviewManager()->isMimeSupported($document['mimetype']); $documents[$key]['urlsrc'] = $this->getWopiSrcUrl($discovery_parsed, $document['mimetype'], 'edit'); - $documents[$key]['lolang'] = strtolower(str_replace('_', '-', $this->settings->getUserValue($this->uid, 'core', 'lang', 'en'))); + $documents[$key]['lolang'] = $lolang; $fileIds[] = $document['fileid']; } From cef6160019ce04bc32a24b8f50a7110ef4548fa2 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Tue, 7 Jun 2016 12:11:50 +0200 Subject: [PATCH 2/3] bccu#1882: Return to the 'Files' app when the editing started there. Also retain the directory where the editing started. --- js/documents.js | 15 +++++++++++++-- js/viewer/viewer.js | 8 +++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/js/documents.js b/js/documents.js index cb524131..0ad57a26 100644 --- a/js/documents.js +++ b/js/documents.js @@ -185,6 +185,7 @@ var documentsMain = { loadErrorMessage : '', loadErrorHint : '', toolbar : '
', + returnToDir : null, // directory where we started from in the 'Files' app UI : { /* Editor wrapper HTML */ @@ -340,7 +341,12 @@ var documentsMain = { } else { // Does anything indicate that we need to autostart a session? - fileId = parent.location.hash.replace(/\W*/g, ''); + fileId = parent.location.hash.replace(/^\W*/, ''); + + if (fileId.indexOf('_') >= 0) { + documentsMain.returnToDir = unescape(fileId.replace(/^[^_]*_/, '')); + fileId = fileId.replace(/_.*/, ''); + } } documentsMain.show(); @@ -637,7 +643,12 @@ var documentsMain = { documentsMain.UI.hideEditor(); documentsMain.closeDocument(); $('#ocToolbar').remove(); - documentsMain.show(); + + if (documentsMain.returnToDir) { + window.location = OC.generateUrl('apps/files?dir={dir}', {dir: documentsMain.returnToDir}); + } else { + documentsMain.show(); + } }, onTerminate: function(){ diff --git a/js/viewer/viewer.js b/js/viewer/viewer.js index c33bc919..0c782d64 100644 --- a/js/viewer/viewer.js +++ b/js/viewer/viewer.js @@ -78,7 +78,13 @@ var odfViewer = { onEdit : function(fileName, context){ var fileId = context.$file.attr('data-id'); - window.location = OC.generateUrl('apps/richdocuments/index#{file_id}', {file_id: fileId}); + var fileDir = context.dir; + + if (fileDir) { + window.location = OC.generateUrl('apps/richdocuments/index#{file_id}_{dir}', {file_id: fileId, dir: fileDir}); + } else { + window.location = OC.generateUrl('apps/richdocuments/index#{file_id}', {file_id: fileId}); + } }, onView: function(filename, context) { From 8534ee60ba81232a95b106be0b3be12a868836e2 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Tue, 7 Jun 2016 12:29:06 +0200 Subject: [PATCH 3/3] CA chain cert name change --- controller/documentcontroller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/documentcontroller.php b/controller/documentcontroller.php index f3da228d..f0813394 100644 --- a/controller/documentcontroller.php +++ b/controller/documentcontroller.php @@ -123,7 +123,7 @@ class DocumentController extends Controller { case '7': throw new ResponseException($this->l10n->t('Collabora Online: Cannot connect to the host "%s".', array($wopiRemote)), $admin_check); case '60': - throw new ResponseException($this->l10n->t('Collabora Online: SSL certificate is not installed.'), $this->l10n->t('Please ask your administrator to add CollaboraCloudSuiteCA_ca-chain.cert.pem to the ownCloud\'s ca-bundle.crt, for example "cat /etc/loolwsd/CollaboraCloudSuiteCA_ca-chain.cert.pem >> owncloud/resources/config/ca-bundle.crt" . The exact error message was: ') . $error_message); + throw new ResponseException($this->l10n->t('Collabora Online: SSL certificate is not installed.'), $this->l10n->t('Please ask your administrator to add ca-chain.cert.pem to the ownCloud\'s ca-bundle.crt, for example "cat /etc/loolwsd/ca-chain.cert.pem >> owncloud/resources/config/ca-bundle.crt" . The exact error message was: ') . $error_message); } } throw new ResponseException($this->l10n->t('Collabora Online unknown error: ') . $error_message, $contact_admin);