From 389b9d0d00f0b32357cf8d3ac61826e7b70f264a Mon Sep 17 00:00:00 2001 From: ziegler Date: Thu, 14 Nov 2024 13:11:53 +0100 Subject: [PATCH 1/2] fix: open in edit mode on doc init --- .../src/main/php/src/tools/onlyoffice/OnlyOffice.php | 10 +++++++++- .../src/main/php/src/tools/onlyoffice/doceditor.php | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/service/src/main/php/src/tools/onlyoffice/OnlyOffice.php b/service/src/main/php/src/tools/onlyoffice/OnlyOffice.php index 2570c38..700bb25 100644 --- a/service/src/main/php/src/tools/onlyoffice/OnlyOffice.php +++ b/service/src/main/php/src/tools/onlyoffice/OnlyOffice.php @@ -6,6 +6,8 @@ class OnlyOffice extends \connector\lib\Tool { + private bool $isNewDocument = true; + public function run(Response $response) { //$_SESSION[$this->connectorId]['fileUrl'] = $_SESSION[$this->connectorId]['node']->node->downloadUrl . '&ticket=' . $_SESSION[$this->connectorId]['ticket']; $_SESSION[$this->connectorId]['fileUrl'] = WWWURL . '/oo-content?sessionId=' . $_SESSION[$this->connectorId]['sessionId'] . '&downloadUrl=' . $_SESSION[$this->connectorId]['node']->node->downloadUrl; @@ -53,13 +55,19 @@ public function setNode() if ($node->node->size === NULL) { $this->apiClient->createContentNode($node->node->ref->id, DOCROOT . '/src/tools/onlyoffice/storage/templates/init.' . $_SESSION[$this->connectorId]['filetype'], \connector\tools\onlyoffice\OnlyOffice::getMimetype($_SESSION[$this->connectorId]['filetype']), 'MAIN_FILE_UPLOAD'); $node = $this->apiClient->getNode($node->node->ref->id); + } else { + $this->isNewDocument = false; } $_SESSION[$this->connectorId]['node'] = $node; } private function forwardToEditor() { - header('Location: ' . WWWURL . '/src/tools/onlyoffice/doceditor.php?id=' . $this->connectorId . '&ref=' . base64_encode($_SESSION[$this->connectorId]['node']->node->properties->{'virtual:permalink'}[0])); + $location = WWWURL . '/src/tools/onlyoffice/doceditor.php?id=' . $this->connectorId . '&ref=' . base64_encode($_SESSION[$this->connectorId]['node']->node->properties->{'virtual:permalink'}[0]); + if ($this->isNewDocument) { + $location .= '&initDoc=true'; + } + header('Location: ' . $location); exit(); } diff --git a/service/src/main/php/src/tools/onlyoffice/doceditor.php b/service/src/main/php/src/tools/onlyoffice/doceditor.php index ead60c4..332f75e 100755 --- a/service/src/main/php/src/tools/onlyoffice/doceditor.php +++ b/service/src/main/php/src/tools/onlyoffice/doceditor.php @@ -179,10 +179,11 @@ function getCallbackUrl($id) { //$payload_print = $get_array["embed"] == "true" ? "false" : "true"; $payload_edit = $_SESSION[$id]['edit'] ? true : false; $switchToEditMode = $payload_edit && isset($_GET['requestEdit']) && (bool)$_GET['requestEdit'] === true; + $initWithEditMode = $payload_edit && isset($_GET['initDoc']) && (bool)$_GET['initDoc'] === true; //$payload_comment = $get_array["comment"] == "true" ? "true" : "false"; //$payload_review = $get_array["review"] == "true" ? "true" : "false"; $payload_form = false; - $payload_mode = $switchToEditMode ? 'edit' : 'view'; + $payload_mode = ($switchToEditMode || $initWithEditMode) ? 'edit' : 'view'; $detector = new Mobile_Detect(); $type = $detector->isMobile() ? 'mobile' : 'desktop'; $payload_callback = getCallbackUrl($id); From f456b2dff8d510bee0d75f4334d7e626a36a2197 Mon Sep 17 00:00:00 2001 From: Torsten Simon Date: Mon, 18 Nov 2024 09:45:35 +0100 Subject: [PATCH 2/2] helm:add registry options --- deploy/docker/helm/src/main/chart/Chart.yaml | 4 ++-- .../helm/src/main/chart/templates/statefulset.yml | 6 +++--- deploy/docker/helm/src/main/chart/values.yaml | 10 ++++++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/deploy/docker/helm/src/main/chart/Chart.yaml b/deploy/docker/helm/src/main/chart/Chart.yaml index 85ba9d2..87ad672 100644 --- a/deploy/docker/helm/src/main/chart/Chart.yaml +++ b/deploy/docker/helm/src/main/chart/Chart.yaml @@ -3,5 +3,5 @@ apiVersion: v2 name: edu-sharing-services-connector description: Helm chart for edu-sharing connector app type: application -version: 9.0.1 -appVersion: 9.0.1 \ No newline at end of file +version: 9.0.2 +appVersion: 9.0.2 \ No newline at end of file diff --git a/deploy/docker/helm/src/main/chart/templates/statefulset.yml b/deploy/docker/helm/src/main/chart/templates/statefulset.yml index e56fc19..d4635bf 100644 --- a/deploy/docker/helm/src/main/chart/templates/statefulset.yml +++ b/deploy/docker/helm/src/main/chart/templates/statefulset.yml @@ -18,11 +18,11 @@ spec: {{- end }} containers: - name: edu-sharing-connector - image: docker.edu-sharing.com/community/edu_sharing-community-services-edu-connector-service:{{ .Values.version }} + image: {{ .Values.global.image.registry }}/community/edu_sharing-community-services-edu-connector-service:{{ .Values.version }} {{- with .Values.securityContext }} securityContext: {{ toYaml . | nindent 10 }} {{- end }} - imagePullPolicy: Always + imagePullPolicy: {{ .Values.global.image.pullPolicy }} env: - name: HOST_EXTERNAL value: {{ if .Values.absoluteUrl }}{{ .Values.absoluteUrl }}{{else}}"connector.services.{{ .Values.baseUrl }}"{{ end }} @@ -113,7 +113,7 @@ spec: {{- end }} containers: - name: edu-sharing-connector-db - image: {{ .Values.images.postgresql }} + image: {{ .Values.image.custom.postgresql }} {{- with merge .Values.database.securityContext .Values.securityContext }} securityContext: {{ toYaml . | nindent 10 }} {{- end }} diff --git a/deploy/docker/helm/src/main/chart/values.yaml b/deploy/docker/helm/src/main/chart/values.yaml index f2e71c6..1c12dce 100644 --- a/deploy/docker/helm/src/main/chart/values.yaml +++ b/deploy/docker/helm/src/main/chart/values.yaml @@ -20,8 +20,14 @@ onlyofficeEdusharingPlugin: enabled: false label: url: -images: - postgresql: docker.edu-sharing.com/community/common/edu_sharing-community-common-docker-postgresql:13.15.0 + +global: + image: + registry: docker.edu-sharing.com + pullPolicy: Always +image: + custom: + postgresql: docker.edu-sharing.com/community/common/edu_sharing-community-common-docker-postgresql:13.15.0 podSecurityContext: