From 96fd4d57c96ab033733d77c7b9eb52d096e417ee Mon Sep 17 00:00:00 2001 From: Ronak P Patel Date: Tue, 31 May 2022 03:27:35 +0000 Subject: [PATCH 01/16] Revert "Merge branch 'dev/onlyoffice-dashboard' into 'main'" This reverts merge request !11 --- lib/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Util.php b/lib/Util.php index b04c4ea..2f8dc14 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -136,7 +136,7 @@ class Util if ($this->appManager->isEnabledForUser("onlyoffice")) { $office_entries = $this->getOnlyOfficeEntries(); - $entries = array_merge($entries, $office_entries); + $entries = array_merge($office_entries, $entries); } return array( 'apps' => $entries ); -- GitLab From d6d02077fa8e2d44215cccfd786b916db4afa6df Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 1 Jun 2022 15:31:17 +0530 Subject: [PATCH 02/16] made differnce in href as it is not working for ordering --- lib/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Util.php b/lib/Util.php index 2f8dc14..4b59410 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -77,7 +77,7 @@ class Util $onlyOfficeEntries = array_map(function ($entry) { $entry["type"] = "onlyoffice"; $entry["active"] = false; - $entry["href"] = "/apps/onlyoffice/ajax/new"; + $entry["href"] = "/apps/onlyoffice/ajax/new?type=".$entry["id"]; return $entry; }, $onlyOfficeEntries); -- GitLab From d0dfe062efc27ab8d34151c0c7d5583fff6a53b2 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Wed, 1 Jun 2022 15:40:22 +0530 Subject: [PATCH 03/16] order correction --- lib/Util.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 4b59410..26c4c42 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -85,7 +85,7 @@ class Util } public function getOrder() { - $order_raw = $this->config->getUserValue($this->userId, 'ecloud-launcher', 'order'); + $order_raw = $this->config->getUserValue($this->userId, 'murena_launcher', 'order'); // If order raw empty try to get from 'apporder' app config $order_raw = !$order_raw ? $this->config->getUserValue($this->userId, 'apporder', 'order') : $order_raw; // If order raw is still empty, return empty array @@ -105,6 +105,12 @@ class Util foreach ($entries as &$entry) { $entriesByHref[$entry["href"]] = $entry; } + if ($this->appManager->isEnabledForUser("onlyoffice")) { + $office_entries = $this->getOnlyOfficeEntries(); + foreach ($office_entries as &$of_entry) { + $entriesByHref[$of_entry["href"]] = $of_entry; + } + } foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { @@ -132,13 +138,9 @@ class Util } unset($entriesByHref['/apps/dashboard/']); unset($entriesByHref['/apps/ecloud-dashboard/']); + unset($entriesByHref['']); $entries = array_values($entriesByHref); - - if ($this->appManager->isEnabledForUser("onlyoffice")) { - $office_entries = $this->getOnlyOfficeEntries(); - $entries = array_merge($office_entries, $entries); - } - + return array( 'apps' => $entries ); } /** -- GitLab From 604a715e419eddd1e7a722f8f056d2d234bff427 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 14:17:11 +0530 Subject: [PATCH 04/16] used array_merge --- lib/Util.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 26c4c42..f0bf405 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -99,9 +99,12 @@ class Util { $entries = array_values($this->navigationManager->getAll()); $order = $this->getOrder(); - $external = array(); $entriesByHref = array(); - // slice + + if ($this->appManager->isEnabledForUser("onlyoffice")) { + $office_entries = $this->getOnlyOfficeEntries(); + $entries = array_merge($entries , $office_entries); + } foreach ($entries as &$entry) { $entriesByHref[$entry["href"]] = $entry; } -- GitLab From 01a0a83e8a0f07f2d0f02059be0e1d4943b5e475 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 15:03:17 +0530 Subject: [PATCH 05/16] added office only access --- src/components/AllApps.vue | 52 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index ab295b5..1c1b820 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -16,7 +16,8 @@ v-for="entry in entries" :key="entry.message" class="item" - :href="entry.href"> + :href="entry.href" + @click="handleOfficeClick(entry, $event)">
{{ entry.name }}
@@ -26,7 +27,8 @@ v-for="entry in external" :key="entry.message" class="item" - :href="entry.href"> + :href="entry.href" + @click="handleOfficeClick(entry, $event)">
{{ entry.name }}
@@ -36,6 +38,7 @@ -- GitLab From 81d319950ae21652ae29a968d678890dfc4490ef Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 15:12:18 +0530 Subject: [PATCH 06/16] removed console log --- src/components/AllApps.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index 1c1b820..a2aee71 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -79,7 +79,6 @@ export default { }) }, handleOfficeClick(entry, e) { - console.log(entry) if (entry.type === 'onlyoffice') { e.preventDefault() const newWindow = window.open('about:blank', '_blank') -- GitLab From 4d3d9426572c81f8a468018bb50866b408edd02c Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 15:18:16 +0530 Subject: [PATCH 07/16] removed duplicat code --- lib/Util.php | 6 ------ src/components/AllApps.vue | 1 - 2 files changed, 7 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index f0bf405..8560085 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -108,12 +108,6 @@ class Util foreach ($entries as &$entry) { $entriesByHref[$entry["href"]] = $entry; } - if ($this->appManager->isEnabledForUser("onlyoffice")) { - $office_entries = $this->getOnlyOfficeEntries(); - foreach ($office_entries as &$of_entry) { - $entriesByHref[$of_entry["href"]] = $of_entry; - } - } foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { diff --git a/src/components/AllApps.vue b/src/components/AllApps.vue index 1c1b820..a2aee71 100755 --- a/src/components/AllApps.vue +++ b/src/components/AllApps.vue @@ -79,7 +79,6 @@ export default { }) }, handleOfficeClick(entry, e) { - console.log(entry) if (entry.type === 'onlyoffice') { e.preventDefault() const newWindow = window.open('about:blank', '_blank') -- GitLab From ebf993f28c2eb68c794eb092e19b4af733a0de5c Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 15:20:19 +0530 Subject: [PATCH 08/16] formatted code --- lib/Util.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 8560085..14498e2 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -105,9 +105,9 @@ class Util $office_entries = $this->getOnlyOfficeEntries(); $entries = array_merge($entries , $office_entries); } - foreach ($entries as &$entry) { - $entriesByHref[$entry["href"]] = $entry; - } + foreach ($entries as &$entry) { + $entriesByHref[$entry["href"]] = $entry; + } foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { -- GitLab From 4fcf995a7a24174b2917410c16cfe912f57741f7 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 15:21:18 +0530 Subject: [PATCH 09/16] formatted code #2 --- lib/Util.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 14498e2..c11fe3e 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -100,7 +100,6 @@ class Util $entries = array_values($this->navigationManager->getAll()); $order = $this->getOrder(); $entriesByHref = array(); - if ($this->appManager->isEnabledForUser("onlyoffice")) { $office_entries = $this->getOnlyOfficeEntries(); $entries = array_merge($entries , $office_entries); @@ -108,7 +107,6 @@ class Util foreach ($entries as &$entry) { $entriesByHref[$entry["href"]] = $entry; } - foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { $entry["style"] = ""; -- GitLab From 129aced118b67e8b0487a4da07d1b392bcb2d7a7 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 15:32:25 +0530 Subject: [PATCH 10/16] formatted code #3 --- lib/Util.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Util.php b/lib/Util.php index c11fe3e..b8ac30e 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -107,6 +107,7 @@ class Util foreach ($entries as &$entry) { $entriesByHref[$entry["href"]] = $entry; } + foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { $entry["style"] = ""; -- GitLab From d17b899adbe50e97511e0327d7bec698812a757c Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 15:41:05 +0530 Subject: [PATCH 11/16] formatted cide --- lib/Util.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index b8ac30e..de4dd3b 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -100,13 +100,13 @@ class Util $entries = array_values($this->navigationManager->getAll()); $order = $this->getOrder(); $entriesByHref = array(); - if ($this->appManager->isEnabledForUser("onlyoffice")) { + if ($this->appManager->isEnabledForUser("onlyoffice")) { $office_entries = $this->getOnlyOfficeEntries(); $entries = array_merge($entries , $office_entries); - } - foreach ($entries as &$entry) { + } + foreach ($entries as &$entry) { $entriesByHref[$entry["href"]] = $entry; - } + } foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { -- GitLab From 5433536572dcc68b310863ccf281723de65ace12 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 15:45:11 +0530 Subject: [PATCH 12/16] formatted code #1 --- lib/Util.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Util.php b/lib/Util.php index de4dd3b..4cdd119 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -107,6 +107,13 @@ class Util foreach ($entries as &$entry) { $entriesByHref[$entry["href"]] = $entry; } + + if ($this->appManager->isEnabledForUser("onlyoffice")) { + $office_entries = $this->getOnlyOfficeEntries(); + foreach ($office_entries as &$of_entry) { + $entriesByHref[$of_entry["href"]] = $of_entry; + } + } foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { -- GitLab From fd3dc69f477a11e3c5ec9a07cb9f397a577cdb3e Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 16:12:06 +0530 Subject: [PATCH 13/16] space issue --- lib/Util.php | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 4cdd119..d76f180 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -101,26 +101,19 @@ class Util $order = $this->getOrder(); $entriesByHref = array(); if ($this->appManager->isEnabledForUser("onlyoffice")) { - $office_entries = $this->getOnlyOfficeEntries(); - $entries = array_merge($entries , $office_entries); + $office_entries = $this->getOnlyOfficeEntries(); + $entries = array_merge($entries , $office_entries); } foreach ($entries as &$entry) { - $entriesByHref[$entry["href"]] = $entry; + $entriesByHref[$entry["href"]] = $entry; } - - if ($this->appManager->isEnabledForUser("onlyoffice")) { - $office_entries = $this->getOnlyOfficeEntries(); - foreach ($office_entries as &$of_entry) { - $entriesByHref[$of_entry["href"]] = $of_entry; - } - } foreach ($entries as &$entry) { - if (strpos($entry["id"], "external_index") !== 0) { + if (strpos($entry["id"], "external_index") !== 0) { $entry["style"] = ""; - }else{ - $entry["style"] = "background-image: url('". $entry["icon"] ."')"; - } + }else{ + $entry["style"] = "background-image: url('". $entry["icon"] ."')"; + } $entry["iconOffsetY"] = 0; $entriesByHref[$entry["href"]] = $entry; @@ -146,6 +139,7 @@ class Util return array( 'apps' => $entries ); } + /** * returns a sorted list of the user's group GIDs * -- GitLab From 4232af88547fbb877898f7179666e046b10a89e6 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 18:52:28 +0530 Subject: [PATCH 14/16] type to id --- lib/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Util.php b/lib/Util.php index d76f180..5407742 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -77,7 +77,7 @@ class Util $onlyOfficeEntries = array_map(function ($entry) { $entry["type"] = "onlyoffice"; $entry["active"] = false; - $entry["href"] = "/apps/onlyoffice/ajax/new?type=".$entry["id"]; + $entry["href"] = "/apps/onlyoffice/ajax/new?id=".$entry["id"]; return $entry; }, $onlyOfficeEntries); -- GitLab From 2fb8f0b637181df2abe5f2c65611d98b3f8787e8 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Thu, 2 Jun 2022 19:03:36 +0530 Subject: [PATCH 15/16] removed duplication --- lib/Util.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 5407742..40b7cc4 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -104,9 +104,6 @@ class Util $office_entries = $this->getOnlyOfficeEntries(); $entries = array_merge($entries , $office_entries); } - foreach ($entries as &$entry) { - $entriesByHref[$entry["href"]] = $entry; - } foreach ($entries as &$entry) { if (strpos($entry["id"], "external_index") !== 0) { -- GitLab From b32594fd587ead8d5884c1412331a07a1b59a9e9 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Tue, 7 Jun 2022 19:37:37 +0530 Subject: [PATCH 16/16] removed indentation --- lib/Util.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Util.php b/lib/Util.php index 40b7cc4..191856d 100755 --- a/lib/Util.php +++ b/lib/Util.php @@ -77,7 +77,7 @@ class Util $onlyOfficeEntries = array_map(function ($entry) { $entry["type"] = "onlyoffice"; $entry["active"] = false; - $entry["href"] = "/apps/onlyoffice/ajax/new?id=".$entry["id"]; + $entry["href"] = "/apps/onlyoffice/ajax/new?id=".$entry["id"]; return $entry; }, $onlyOfficeEntries); @@ -85,7 +85,7 @@ class Util } public function getOrder() { - $order_raw = $this->config->getUserValue($this->userId, 'murena_launcher', 'order'); + $order_raw = $this->config->getUserValue($this->userId, 'ecloud-launcher', 'order'); // If order raw empty try to get from 'apporder' app config $order_raw = !$order_raw ? $this->config->getUserValue($this->userId, 'apporder', 'order') : $order_raw; // If order raw is still empty, return empty array -- GitLab