Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ protected function confirmDelete(): void
*/
$xoctPublicationUsage = $this->repository->getUsage($this->identifier);
$confirm = new ilConfirmationGUI();
$confirm->setHeaderText($this->getLocaleString('confirm_delete_text'));
$confirm->addItem(self::IDENTIFIER, $xoctPublicationUsage->getUsageId(), $xoctPublicationUsage->getTitle());
$confirm->setFormAction($this->ctrl->getFormAction($this));
$confirm->setCancel($this->getLocaleString(self::CMD_CANCEL), self::CMD_CANCEL);
Expand Down
8 changes: 8 additions & 0 deletions classes/Conf/class.xoctConfFormGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,14 @@ protected function initEventsSection(): void
$cbs2->setRequired(false);
$cbs->addSubItem($cbs2);

// ENABLE CUTTING
$cb = new ilCheckboxInputGUI(
$this->getLocaleString(PluginConfig::F_ENABLE_CUTTING),
PluginConfig::F_ENABLE_CUTTING
);
$cb->setInfo($this->getLocaleString(PluginConfig::F_ENABLE_CUTTING . '_info'));
$this->addItem($cb);

// MODALS
$cb = new ilCheckboxInputGUI($this->getLocaleString(PluginConfig::F_USE_MODALS), PluginConfig::F_USE_MODALS);
$cb->setInfo($this->getLocaleString(PluginConfig::F_USE_MODALS . '_info'));
Expand Down
3 changes: 2 additions & 1 deletion classes/Event/class.xoctEventRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,8 @@ public function getActions(): array
}

// Cut Event
if (ilObjOpenCastAccess::checkAction(ilObjOpenCastAccess::ACTION_CUT, $this->event, $xoctUser)) {
if (PluginConfig::getConfig(PluginConfig::F_ENABLE_CUTTING)
&& ilObjOpenCastAccess::checkAction(ilObjOpenCastAccess::ACTION_CUT, $this->event, $xoctUser)) {
$actions[] = $this->factory->link()->standard(
$this->plugin->txt('event_cut'),
$this->ctrl->getLinkTargetByClass(xoctEventGUI::class, xoctEventGUI::CMD_CUT)
Expand Down
21 changes: 21 additions & 0 deletions classes/Setup/class.ilOpenCastDBUpdateSteps.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,25 @@ public function step_5(): void
]
);
}

/**
* This step sets the default value for the "Enable Cutting" configuration to false (off).
*/
public function step_6(): void
{
// Check if the configuration already exists
$r = $this->db->query("SELECT name FROM xoct_config WHERE name = 'enable_cutting'");
if ($r->rowCount() > 0) {
return;
}

// Insert the default configuration value (false)
$this->db->insert(
'xoct_config',
[
'name' => ['text', 'enable_cutting'],
'value' => ['text', json_encode(false)]
]
);
}
}
3 changes: 3 additions & 0 deletions lang/ilias_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ config_presign_links#:#Presign (experimental)
config_presign_links_info#:#Wenn aktiv, werden die Links bereits signiert von Opencast ausgeliefert. Dies kann die Performanz beeinflussen. Beachten Sie, dass obige Konfiguration trotzdem benötigt wird, da in gewissen Situationen Links vom Plugin signiert werden müssen.
config_enable_chat#:#Chat aktivieren
config_enable_chat_info#:#Aktiviert einen On-screen Chat neben dem Live-Event. Diese Option muss zusätzlich in den Einstellungen eines Objektes aktiviert werden, um wirksam zu werden.
config_enable_cutting#:#Schneiden aktivieren
config_enable_cutting_info#:#Ermöglicht es Benutzern, auf das Schnittwerkzeug (Video-Editor) für Videos zuzugreifen. Wenn deaktiviert, ist die Aktion "Schneiden" nicht im Aktionsmenü der Ereignisse verfügbar.
config_ingest_upload#:#Upload via Ingest-Nodes
config_ingest_upload_info#:#Wenn aktiv, wird der Upload über Ingest-Nodes statt über die External-API ausgeführt. Dadurch kann die Last auf dem Opencast-Server bei mehreren gleichzeitigen Uploads besser verteilt werden. Achtung: Dazu muss der REST-Endpunkt /ingest für den ILIAS-Server erreichbar und für den API-Benutzer zugänglich sein.
event_add_new#:#Aufzeichnung hochladen
Expand Down Expand Up @@ -699,6 +701,7 @@ publication_usage_table_title_usage_group#:#Unternutzungsgruppe
publication_usage_create_group#:#Unternutzungsgruppe erstellen
publication_usage_edit_group#:#Unternutzungsgruppe bearbeiten
publication_usage_confirm_delete_text_group#:#Sind Sie sicher, dass Sie diese Unternutzungsgruppe löschen möchten?
publication_usage_confirm_delete_text#:#Sind Sie sicher, dass Sie diese Publikationsnutzung löschen möchten?
publication_usage_extra_config#:#Zusätzliche
pug_display_name_default#:#Mehr
publication_usage_type_captions#:#Captions
Expand Down
3 changes: 3 additions & 0 deletions lang/ilias_en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ config_presign_links#:#Presign (experimental)
config_presign_links_info#:#If active, links will be presigned by Opencast. This may impact the performance. Note that the above configuration is still necessary because links will still have to be signed by the plugin in certain situations.
config_enable_chat#:#Activate Chat
config_enable_chat_info#:#Enables an on-screen chat beside the Live Event. This option must additionally be set in the settings of an object to be effective.
config_enable_cutting#:#Enable Cutting
config_enable_cutting_info#:#Allow users to access the cutting tool (Video Editor) for videos. When disabled, the "Cut" action will not be available in the event actions menu.
config_ingest_upload#:#Upload via Ingest Nodes
config_ingest_upload_info#:#If enabled, the upload will be executed via ingest nodes instead of the external API. This improves the load distribution on the Opencast server when uploading multiple files simultaneously. Note that the REST endpoint /ingest has to be available for the ILIAS server and the API user.
eula#:#Terms of Use
Expand Down Expand Up @@ -703,6 +705,7 @@ publication_usage_table_title_usage_group#:#Publication Groups
publication_usage_create_group#:#Create Group
publication_usage_edit_group#:#Edit Group
publication_usage_confirm_delete_text_group#:#Are you sure you want to delete this publication group?
publication_usage_confirm_delete_text#:#Are you sure you want to delete this publication usage?
publication_usage_extra_config#:#Extras
publication_usage_type_captions#:#Captions
publication_usage_type_captions_fallback#:#Captions Fallback
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

$id = 'xoct';
$version = '9.2.2';
$version = '9.2.3';
$ilias_min_version = '9.0';
$ilias_max_version = '9.999';
$responsible = 'Universität Bern';
Expand Down
1 change: 1 addition & 0 deletions src/Model/Config/PluginConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class PluginConfig extends ActiveRecord
public const F_LIVESTREAM_TYPE = 'livestream_type';
public const F_LIVESTREAM_BUFFERED = 'livestream_buffered';
public const F_ENABLE_CHAT = 'enable_chat';
public const F_ENABLE_CUTTING = 'enable_cutting';

public const F_REPORT_QUALITY = 'report_quality';
public const F_REPORT_QUALITY_EMAIL = 'report_quality_email';
Expand Down
22 changes: 17 additions & 5 deletions src/Util/Transformator/MetadataToXML.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use ilDateTime;
use ilXmlWriter;
use srag\Plugins\Opencast\Model\Metadata\Metadata;
use xoctException;

/**
* Class MetadataToXML
Expand Down Expand Up @@ -46,12 +47,23 @@ public function getXML(): string
$xml_writer->xmlElement('dcterms:spatial', [], $this->metadata->getField('location')->getValue());
$xml_writer->xmlElement('dcterms:rightsHolder', [], $this->metadata->getField('rightsHolder')->getValue());

// Get start date and time with fallback to current date/time if not provided
try {
$start_date = $this->metadata->getField('startDate')->getValueFormatted();
} catch (xoctException $e) {
// If startDate field doesn't exist, use current date
$start_date = date('Y-m-d');
}

try {
$start_time = $this->metadata->getField('startTime')->getValueFormatted();
} catch (xoctException $e) {
// If startTime field doesn't exist, use current time or 00:00:00 as default
$start_time = '00:00:00';
}

$start_end_string_iso = (new ilDateTime(
strtotime(
$this->metadata->getField('startDate')->getValueFormatted() . ' ' . $this->metadata->getField(
'startTime'
)->getValueFormatted()
),
strtotime($start_date . ' ' . $start_time),
IL_CAL_UNIX
)
)->get(IL_CAL_FKT_DATE, 'Y-m-d\TH:i:s.u\Z', 'GMT');
Expand Down