Skip to content

Commit

Permalink
Merge branch 'update_9' into 'release_9'
Browse files Browse the repository at this point in the history
Update to ILIAS 9.4 (09.09.2024)

See merge request ilias-hosting/ilias!9
  • Loading branch information
iszmais committed Sep 9, 2024
2 parents 628b7ee + b946beb commit 54c9e8b
Show file tree
Hide file tree
Showing 168 changed files with 1,890 additions and 987 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/style-to-repo_trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and deploy style files
on:
push:
branches:
- "trunk"
- "release_9"

jobs:
style-to-repo:
Expand Down
2 changes: 2 additions & 0 deletions CI/Style-To-Repo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ STYLE_REPO_NAME_SHORT="foo/style_test.git"

### Add a token for an user with admin access to style repository

https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic

- open settings for the user on github
- click 'Developer settings/Personal access tokens/Tokens (classic)'
- click 'Generate new token (classic)'
Expand Down
6 changes: 6 additions & 0 deletions CI/Style-To-Repo/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,10 @@ function deploy() {
git -C ${DEPLOY_BASE_FOLDER} commit -m "Style changes from '${HASH}'" -m "Original message: '${MSG}'" -m "${URL}"
git -C ${DEPLOY_BASE_FOLDER} push origin ${BRANCH}
fi
if [ $? = 0 ] ; then
echo "[${NOW}] remote repo updated."
else
echo "[${NOW}] git commit/push failed."
exit $?
fi
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,6 +16,8 @@
*
*********************************************************************/

declare(strict_types=1);

/**
* @author Stefan Meyer <[email protected]>
* @ilCtrl_Calls ilObjCategoryReferenceGUI: ilPermissionGUI, ilInfoScreenGUI, ilPropertyFormGUI
Expand Down
17 changes: 0 additions & 17 deletions Modules/CmiXapi/LuceneObjectDefinition.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ObjectDefinition xmlns:xi="http://www.w3.org/2001/XInclude" type="cmix">
<Document type="default">
<!--
<xi:include href="../../Services/Object/LuceneDataSource.xml" />
<xi:include href="../../Services/Tagging/LuceneDataSource.xml" />
<xi:include href="../../Services/MetaData/LuceneDataSource.xml" />
-->
<DataSource type="JDBC" action="append">
<Query>
SELECT title FROM object_data
</Query>
<Param format="list" type="int" value="objId" />
<Field store="YES" index="ANALYZED" column="title" type="text" name="propertyLow" />
</DataSource>
<DataSource type="JDBC" action="append">
<Query>
SELECT description FROM object_data
</Query>
<Param format="list" type="int" value="objId" />
<Field store="YES" index="ANALYZED" column="description" type="text" name="propertyLow" />
</DataSource>
</Document>
</ObjectDefinition>
7 changes: 6 additions & 1 deletion Modules/CmiXapi/classes/class.ilCmiXapiLrsTypesTableGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ilCmiXapiLrsTypesTableGUI extends ilTable2GUI
public const TABLE_ID = 'cmix_lrs_types_table';

private \ILIAS\DI\Container $dic;
private bool $writePermission;

public function __construct(ilObjCmiXapiAdministrationGUI $a_parent_obj, string $a_parent_cmd)
{
Expand All @@ -42,6 +43,8 @@ public function __construct(ilObjCmiXapiAdministrationGUI $a_parent_obj, string
$this->setId(self::TABLE_ID);
parent::__construct($a_parent_obj, $a_parent_cmd);

$this->writePermission = $this->dic->rbac()->system()->checkAccess('write', $a_parent_obj->getRefId());

$this->setFormAction($DIC->ctrl()->getFormAction($a_parent_obj, $a_parent_cmd));
$this->setRowTemplate('tpl.cmix_lrs_types_table_row.html', 'Modules/CmiXapi');

Expand All @@ -64,7 +67,9 @@ protected function fillRow(array $a_set): void
$this->tpl->setVariable('LRS_TYPE_TITLE', $a_set['title']);
$this->tpl->setVariable('LRS_TYPE_AVAILABILITY', $this->getAvailabilityLabel((string) $a_set['availability']));
$this->tpl->setVariable('LRS_TYPE_USAGES', $a_set['usages'] ? $a_set['usages'] : '');
$this->tpl->setVariable('ACTIONS', $this->getActionsList($a_set));
if ($this->writePermission) {
$this->tpl->setVariable('ACTIONS', $this->getActionsList($a_set));
}
}

protected function getAvailabilityLabel(string $availability): string
Expand Down
15 changes: 14 additions & 1 deletion Modules/CmiXapi/classes/class.ilCmiXapiSettingsGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function initSubtabs(): void
$this->dic->tabs()->addSubTab(
self::SUBTAB_ID_CERTIFICATE,
$this->language->txt(self::SUBTAB_ID_CERTIFICATE),
$this->dic->ctrl()->getLinkTargetByClass(ilCertificateGUI::class, 'certificateEditor')
$this->dic->ctrl()->getLinkTargetByClass([ilCmiXapiSettingsGUI::class,ilCertificateGUI::class], 'certificateEditor')
);
}
}
Expand Down Expand Up @@ -181,6 +181,16 @@ protected function buildForm(): \ilPropertyFormGUI
$lpDeterioration->setChecked(true);
}

//
// presentation
//
$item = new ilFormSectionHeaderGUI();
$item->setTitle($this->language->txt("obj_presentation"));
$form->addItem($item);

// tile image
$this->dic->object()->commonSettings()->legacyForm($form, $this->object)->addTileImage();

if (!$this->object->isSourceTypeExternal()) {
$item = new ilFormSectionHeaderGUI();
$item->setTitle($this->language->txt("launch_options"));
Expand Down Expand Up @@ -670,6 +680,9 @@ protected function saveSettings(ilPropertyFormGUI $form): void
$this->object->setHighscoreTopNum((int) $form->getInput('highscore_top_num'));
}

// tile image
$this->dic->object()->commonSettings()->legacyForm($form, $this->object)->saveTileImage();

$this->object->update();
}

Expand Down
12 changes: 9 additions & 3 deletions Modules/CmiXapi/classes/class.ilObjCmiXapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -836,9 +836,15 @@ protected function loadRepositoryActivationSettings(): void
switch ($activation["timing_type"]) {
case ilObjectActivation::TIMINGS_ACTIVATION:
$this->setActivationLimited(true);
if (!is_null($activation["timing_start"])) {
$activation["timing_start"] = (int) $activation["timing_start"];
}
$this->setActivationStartingTime($activation["timing_start"]);
if (!is_null($activation["timing_end"])) {
$activation["timing_end"] = (int) $activation["timing_end"];
}
$this->setActivationEndingTime($activation["timing_end"]);
$this->setActivationVisibility($activation["visible"]);
$this->setActivationVisibility((bool) $activation["visible"]);
break;

default:
Expand Down Expand Up @@ -1811,7 +1817,7 @@ public function getActivationStartingTime(): ?int
return $this->activationStartingTime;
}

public function setActivationStartingTime(int $activationStartingTime): void
public function setActivationStartingTime(?int $activationStartingTime = null): void
{
$this->activationStartingTime = $activationStartingTime;
}
Expand All @@ -1821,7 +1827,7 @@ public function getActivationEndingTime(): ?int
return $this->activationEndingTime;
}

public function setActivationEndingTime(int $activationEndingTime): void
public function setActivationEndingTime(?int $activationEndingTime = null): void
{
$this->activationEndingTime = $activationEndingTime;
}
Expand Down
20 changes: 12 additions & 8 deletions Modules/CmiXapi/classes/class.ilObjCmiXapiAdministrationGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ public function getAdminTabs(): void
);

// permissions tab

$this->tabs_gui->addTab(
self::TAB_ID_PERMISSIONS,
$this->lng->txt(self::TAB_ID_PERMISSIONS),
$this->ctrl->getLinkTargetByClass(ilPermissionGUI::class, 'perm')
);
if ($this->rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
$this->tabs_gui->addTab(
self::TAB_ID_PERMISSIONS,
$this->lng->txt(self::TAB_ID_PERMISSIONS),
$this->ctrl->getLinkTargetByClass(ilPermissionGUI::class, 'perm')
);
}
}

public function executeCommand(): void
Expand Down Expand Up @@ -89,12 +90,15 @@ protected function showLrsTypesListCmd(): void
{
$this->tabs_gui->activateTab(self::TAB_ID_LRS_TYPES);

$toolbar = $this->buildLrsTypesToolbarGUI();
$toolbarHtml = "";
if ($this->rbac_system->checkAccess('write', $this->getRefId())) {
$toolbarHtml = $this->buildLrsTypesToolbarGUI()->getHTML();
}

$table = $this->buildLrsTypesTableGUI();

$table->setData(ilCmiXapiLrsTypeList::getTypesData(true));
$this->tpl->setContent($toolbar->getHTML() . $table->getHTML());
$this->tpl->setContent($toolbarHtml . $table->getHTML());
}

protected function buildLrsTypesTableGUI(): \ilCmiXapiLrsTypesTableGUI
Expand Down
4 changes: 3 additions & 1 deletion Modules/CmiXapi/xapitoken.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@

function send($response): void
{
header('Access-Control-Allow-Origin: ' . $_SERVER["HTTP_ORIGIN"]);
if (isset($_SERVER["HTTP_ORIGIN"]) && $_SERVER["HTTP_ORIGIN"] != "") {
header('Access-Control-Allow-Origin: ' . $_SERVER["HTTP_ORIGIN"]);
}
header('Access-Control-Allow-Credentials: true');
header('Content-type:application/json;charset=utf-8');
echo json_encode($response);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -16,6 +15,8 @@
*
*********************************************************************/

declare(strict_types=0);

/**
* TableGUI for question assignments of course objectives
* @author Stefan Meyer <[email protected]>
Expand Down Expand Up @@ -137,7 +138,7 @@ public function parse(array $a_assignable): void
$tmp_data = array();
$subobjects = array();

if (!$tmp_tst = ilObjectFactory::getInstanceByRefId((int) $node['ref_id'], false)) {
if (!$tmp_tst = ilObjectFactory::getInstanceByRefId((int) ($node['ref_id'] ?? 0), false)) {
continue;
}

Expand Down
4 changes: 3 additions & 1 deletion Modules/Course/classes/Objectives/class.ilLOEditorGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,9 @@ protected function initSettingsForm(): ilPropertyFormGUI
$type_qa->addSubItem($start_q);

$passed_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_passed_mode'), 'passed_mode');
$passed_mode->setValue((string) $this->getSettings()->getPassedObjectiveMode());
$passed_mode->setValue(
(string) ($this->getSettings()->getPassedObjectiveMode() ?: ilLOSettings::HIDE_PASSED_OBJECTIVE_QST)
);

$passed_mode->addOption(
new ilRadioOption(
Expand Down
24 changes: 22 additions & 2 deletions Modules/Course/classes/Objectives/class.ilLOSettings.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<?php

declare(strict_types=0);
/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -17,6 +15,8 @@
*
*********************************************************************/

declare(strict_types=0);

/**
* Settings for LO courses
* @author Stefan Meyer <[email protected]>
Expand Down Expand Up @@ -451,8 +451,28 @@ protected function read(): void
if ($this->tree->isDeleted($this->getQualifiedTest())) {
$this->setQualifiedTest(0);
}
$this->purgeReferences();
}

protected function purgeReferences(): void
{
if ($this->getInitialTest() > 0) {
$obj = ilObjectFactory::getInstanceByRefId($this->getInitialTest(), false);
if (!$obj instanceof ilObjTest) {
$this->setInitialTest(0);
$this->update();
}
}
if ($this->getQualifiedTest() > 0) {
$obj = ilObjectFactory::getInstanceByRefId($this->getQualifiedTest(), false);
if (!$obj instanceof ilObjTest) {
$this->setQualifiedTest(0);
$this->update();
}
}
}


public function toXml(ilXmlWriter $writer): void
{
$writer->xmlElement(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*
*********************************************************************/


/**
* @author Stefan Meyer <[email protected]>
* @version $Id$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,11 @@ public function getSortingValue(bool $link = true)
*/
public function addHiddenItemsToConfirmation(ilConfirmationGUI $confirmation)
{
;
if (!is_array($this->getValue())) {
$confirmation->addHiddenItem('field_' . $this->field->getId(), (string) $this->getValue());
} else {
foreach ($this->getValue() as $key => $value) {
$confirmation->addHiddenItem('field_' . $this->field->getId() . "[$key]", $value);
$confirmation->addHiddenItem('field_' . $this->field->getId() . "[$key]", (string) $value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,6 @@ public function parseValue($value)
return $this->getValue();
}

public function addHiddenItemsToConfirmation(ilConfirmationGUI $confirmation): void
{
if (is_array($this->getValue())) {
foreach ($this->getValue() as $key => $value) {
$confirmation->addHiddenItem('field_' . $this->field->getId() . '[' . $key . ']', $value);
}
}
}

public function delete(): void
{
if (($rid = $this->valueToRID($this->value)) !== null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ public function getSingleHTML(?array $options = null, bool $link = true): string

public function getHTML(bool $link = true, array $options = []): string
{
$rid_string = $this->record_field->getValue();
$value = $this->record_field->getValue();

if ($rid_string === null || is_array($rid_string)) {
if ($value === null) {
return '';
}

$title = $this->valueToFileTitle($rid_string);
if (is_array($value)) {
return $value['name'] ?? 'undefined';
}

$title = $this->valueToFileTitle($value);

if ($title === '') {
return $this->lng->txt('file_not_found');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,6 @@ public function parseValue($value)
return $return;
}

public function addHiddenItemsToConfirmation(ilConfirmationGUI $confirmation): void
{
if (is_array($this->getValue())) {
foreach ($this->getValue() as $key => $value) {
$confirmation->addHiddenItem('field_' . $this->field->getId() . '[' . $key . ']', $value);
}
}
}

/**
* Set value for record field
* @param string|int $value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,6 @@ public function parseExportValue($value)
return $file;
}

public function addHiddenItemsToConfirmation(ilConfirmationGUI $confirmation): void
{
if (is_array($this->getValue())) {
foreach ($this->getValue() as $key => $value) {
$confirmation->addHiddenItem('field_' . $this->field->getId() . '[' . $key . ']', $value);
}
}
}

/**
* Returns sortable value for the specific field-types
* @param int $value
Expand Down
Loading

0 comments on commit 54c9e8b

Please sign in to comment.