Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maven/fixes/9.0' into maven/rele…
Browse files Browse the repository at this point in the history
…ase/9.0
  • Loading branch information
metaventis-build committed Nov 18, 2024
2 parents 6124f6f + f456b2d commit 0233bfa
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
4 changes: 2 additions & 2 deletions deploy/docker/helm/src/main/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
version: 9.0.2
appVersion: 9.0.2
6 changes: 3 additions & 3 deletions deploy/docker/helm/src/main/chart/templates/statefulset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
10 changes: 8 additions & 2 deletions deploy/docker/helm/src/main/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
10 changes: 9 additions & 1 deletion service/src/main/php/src/tools/onlyoffice/OnlyOffice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand Down
3 changes: 2 additions & 1 deletion service/src/main/php/src/tools/onlyoffice/doceditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0233bfa

Please sign in to comment.