Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ILIAS-eLearning/ILIAS
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v8.15
Choose a base ref
...
head repository: ILIAS-eLearning/ILIAS
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: release_8
Choose a head ref

Commits on May 15, 2024

  1. Fixes array diff call, the structure of the compared arrays did not m…

    …atch
    chlulei committed May 15, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bc23fa4 View commit details
  2. copyright fix

    chlulei committed May 15, 2024
    Copy the full SHA
    10771d6 View commit details
  3. copyright fix

    chlulei committed May 15, 2024
    Copy the full SHA
    0049ed9 View commit details

Commits on May 20, 2024

  1. Display public key in LTI provider form

    The form didn't display the RSA public key material, leaving the user in the dark about whether their key material was actually saved. With this change, the stored key gets displayed.
    FElliger authored May 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ec6f796 View commit details
  2. Allow using RSA key when saving LTI Content Selection

    Previously, the LTI forms allowed storing a static public key, but the code for processing the content selection response only looked for the keyset URL. With this change, both ways are supported, depending on which key type is stored.
    FElliger committed May 20, 2024
    Copy the full SHA
    6ca36e9 View commit details

Commits on Jun 6, 2024

  1. fix some functoins if optional parameters are omitted

    ingoj authored Jun 6, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    45050cd View commit details

Commits on Jul 17, 2024

  1. Fix 0041741: SOAP function Ilias.addUserRoleEntry and Ilias.deleteUse…

    …rRoleEntry always throw an error.
    thomas-neumann-axtesys committed Jul 17, 2024
    Copy the full SHA
    f718661 View commit details

Commits on Sep 9, 2024

  1. SOAP: Avoid client.ini.php change to make SOAP plugins work

    This is a follow-up PR for #7116 .
    Instead of setting cookies based on the `sid` passed in
    the SOAP request, `session_id` is used to set the current
    session id to load the user session when `session_start`
    is called.
    mjansenDatabay committed Sep 9, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    mjansenDatabay Michael Jansen
    Copy the full SHA
    e7a1ea7 View commit details
  2. BackgroundTask: Use CLIENT_ID constant as fallback for SOAP request

    mjansenDatabay committed Sep 9, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    mjansenDatabay Michael Jansen
    Copy the full SHA
    bc3575e View commit details

Commits on Oct 1, 2024

  1. Update composer.lock after release v8.15

    Releasemanager authored and kergomard committed Oct 1, 2024
    Copy the full SHA
    ae363ec View commit details
  2. refactor dc plugin fields (#8125)

    iszmais authored Oct 1, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7e2218d View commit details
  3. Test: Fix Autosave Message

    kergomard committed Oct 1, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    bba7f42 View commit details
  4. Object: Fix Too Long Title On Copy

    kergomard committed Oct 1, 2024
    2

    Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    8c215b4 View commit details

Commits on Oct 2, 2024

  1. Object: Fix MB Safety for Titles

    kergomard committed Oct 2, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    36143b7 View commit details

Commits on Oct 8, 2024

  1. Fix typo and clarify db-install

    arbuilder: the file offered for download has an extention of .php (not .tet). I added a note to clarify that arBuilder only creates a step to install a db-table.
    ingoj authored and chfsx committed Oct 8, 2024
    Copy the full SHA
    74c9c86 View commit details
  2. 38715: Download all submissions (team upload) > submission time not v…

    …isible in ZIP-archive (Excel missing)
    alex40724 committed Oct 8, 2024
    Copy the full SHA
    80329fe View commit details

Commits on Oct 9, 2024

  1. Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    08afb59 View commit details
  2. Test: Fix Presentation of Only Image Feedback IPE

    kergomard committed Oct 9, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    ab6326f View commit details
  3. Test: Fix Filter in Scoring By Question Table

    kergomard committed Oct 9, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    474b1c3 View commit details
  4. 28398: Accordion -Carousel: magnifying glass icon is displayed oversi…

    …zed, when inserting a picture/media with full screen option
    alex40724 committed Oct 9, 2024
    Copy the full SHA
    7a50cd4 View commit details
  5. Merge branch 'release_8' of https://github.com/ILIAS-eLearning/ILIAS

    …into release_8
    alex40724 committed Oct 9, 2024
    Copy the full SHA
    074eaf5 View commit details
  6. Test: Fix Error On Long Log

    kergomard committed Oct 9, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    9f2954d View commit details
  7. 42227: Error File Upload: A file is not added correctly to the item g…

    …roup
    alex40724 committed Oct 9, 2024
    Copy the full SHA
    158d8a5 View commit details
  8. Add lang var for creation of ecs categories

    dsstrassner authored and matthiaskunkel committed Oct 9, 2024
    Copy the full SHA
    2942cf0 View commit details
  9. Test: Fix Incomplete Resetting of SetBuilder

    kergomard committed Oct 9, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    220950c View commit details
  10. [FIX] fixed display issue in detailed results view of cloze questions

    lzehnder authored and kergomard committed Oct 9, 2024
    Copy the full SHA
    e3c09dc View commit details
  11. Test: Fix Wrong Date Format in Exports

    kergomard committed Oct 9, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    5d84ac2 View commit details
  12. 41345: Eingabe von Verbotenen Tag möglich und speicherbar, obwohl kei…

    …ne Berechtigung » Invalid ref id.
    alex40724 committed Oct 9, 2024
    Copy the full SHA
    8e99b72 View commit details
  13. fixed typo

    alex40724 committed Oct 9, 2024
    Copy the full SHA
    09239c4 View commit details

Commits on Oct 10, 2024

  1. 42246: Export of tiny mce does not include paragraphs and images

    alex40724 committed Oct 10, 2024
    Copy the full SHA
    4d6d6b7 View commit details
  2. 41334: No response when importing incorrect file type to Survey Quest…

    …ion Pool
    alex40724 committed Oct 10, 2024
    Copy the full SHA
    495e50a View commit details
  3. [FIX] Auth: pass arguments as correct data-type.

    (cherry picked from commit 07cced8)
    thibsy authored and mjansenDatabay committed Oct 10, 2024
    Copy the full SHA
    111a28b View commit details
  4. SOAP: Fix extracting NULL when parsing XML

    mjansenDatabay committed Oct 10, 2024
    Copy the full SHA
    50d08ab View commit details
  5. 32413: Page Editor: adding a link to a section turns text colour black

    alex40724 committed Oct 10, 2024
    Copy the full SHA
    b7b00d2 View commit details
  6. 41494: Mediacasts can't be completed if Completion Threshold is set t…

    …o 100%
    alex40724 committed Oct 10, 2024
    Copy the full SHA
    2cee750 View commit details

Commits on Oct 14, 2024

  1. PRG: 42037, check for target_ref_id as well as for access

    nhaagen authored and klees committed Oct 14, 2024
    Copy the full SHA
    062dfaa View commit details
  2. Activate default language for records

    mjansenDatabay committed Oct 14, 2024
    1
    Copy the full SHA
    02e5755 View commit details
  3. Revert "Activate default language for records"

    This reverts commit 02e5755.
    mjansenDatabay committed Oct 14, 2024
    Copy the full SHA
    824d61c View commit details

Commits on Oct 15, 2024

  1. Test: Fix Reporting Date Presentation on InfoPage

    kergomard committed Oct 15, 2024
    Copy the full SHA
    d879eea View commit details
  2. Test: Set Timezone Explicitly

    kergomard committed Oct 15, 2024
    Copy the full SHA
    c13fd58 View commit details

Commits on Oct 16, 2024

  1. Some language improvements in English lang file by Chris Potter

    matthiaskunkel committed Oct 16, 2024
    Copy the full SHA
    b0cb2b2 View commit details
  2. Forum: Don't support notifications for anonymous

    See: https://mantis.ilias.de/view.php?id=42301
    
    (cherry picked from commit 4c310d7)
    mjansenDatabay committed Oct 16, 2024
    Copy the full SHA
    f18d2ab View commit details
  3. Some improvements as part of the gendermainstreaming activities for t…

    …he German lang file.
    matthiaskunkel committed Oct 16, 2024
    Copy the full SHA
    93cb50b View commit details
  4. Fixed 42110: Typo in DE > irss#:#full_size# by removing several 'Helv…

    …eticisms'
    matthiaskunkel committed Oct 16, 2024
    Copy the full SHA
    3d6be11 View commit details
  5. Copy the full SHA
    eb0d973 View commit details

Commits on Oct 17, 2024

  1. Fixes scoring datetime handling by using the default server time inst…

    …ead of generic utc
    lukas-heinrich authored and kergomard committed Oct 17, 2024
    Copy the full SHA
    3004d9b View commit details
  2. Test: Fix Copyright

    kergomard committed Oct 17, 2024
    Copy the full SHA
    ec0ed4d View commit details
  3. Merge pull request #8184 from mjansenDatabay/hotfix/8/42056

    SOAP: Fix extracting NULL when parsing XML
    jeph864 authored Oct 17, 2024
    Copy the full SHA
    0604360 View commit details
  4. fix some functions if optional parameters are omitted

    ingoj authored Oct 17, 2024
    Copy the full SHA
    e99189e View commit details

Commits on Oct 18, 2024

  1. Merge pull request #8196 from mjansenDatabay/hotfix/8/42308

    AdvancedMetadata: Fix problem with missing `decimals`
    smeyer-ilias authored Oct 18, 2024
    Copy the full SHA
    f798695 View commit details
Showing 575 changed files with 14,794 additions and 9,358 deletions.
2 changes: 1 addition & 1 deletion Modules/Blog/classes/class.ilObjBlogGUI.php
Original file line number Diff line number Diff line change
@@ -1347,7 +1347,7 @@ protected function buildPostingList(
foreach (ilBlogPosting::getAllPostings($a_obj_id) as $posting) {
if ($this->author &&
($posting["author"] == $this->author ||
(is_array($posting["editors"]) && in_array($this->author, $posting["editors"])))) {
(is_array($posting["editors"] ?? false) && in_array($this->author, $posting["editors"])))) {
$author_found = true;
}

4 changes: 4 additions & 0 deletions Modules/BookingManager/Objects/class.ilBookingObjectGUI.php
Original file line number Diff line number Diff line change
@@ -88,6 +88,10 @@ public function __construct(
$this->ref_id = $this->book_request->getRefId();
$this->ctrl->saveParameter($this, "object_id");

if ($this->object_id > 0 && ilBookingObject::lookupPoolId($this->object_id) !== $this->pool_gui->getObject()->getId()) {
throw new ilPermissionException("Booking object pool id does not match pool id.");
}

$this->rsv_ids = array_map('intval', $this->book_request->getReservationIdsFromString());
}

Original file line number Diff line number Diff line change
@@ -360,7 +360,7 @@ protected function fillRow(array $a_set): void
}

if ($has_booking || $this->may_edit) {
if (trim($a_set['post_text']) || $a_set['post_file']) {
if (trim($a_set['post_text'] ?? "") || $a_set['post_file']) {
$items[] = $this->ui_factory->button()->shy(
$lng->txt('book_post_booking_information'),
$ilCtrl->getLinkTargetByClass("ilbookingprocessgui", 'displayPostInfo')
Original file line number Diff line number Diff line change
@@ -86,6 +86,8 @@ public function __construct(
$this->addColumn("", "", 1);
$this->addColumn($this->lng->txt("title"), "title");

$this->lng->loadLanguageModule("crs");

$selected = $this->getSelectedColumns();
$cols = $this->getSelectableColumns();

@@ -539,10 +541,11 @@ public function getItems(array $filter): void
$user_ids = array_diff($user_ids, ilMemberAgreement::lookupAcceptedAgreements($parent_obj_id));
}
$odf_data = ilCourseUserData::_getValuesByObjId($parent_obj_id);

$usr_data = [];
foreach ($odf_data as $usr_id => $fields) {
if (in_array($usr_id, $user_ids, true)) {
// this currently does not with strict mode, since
// $user_ids holds strings
if (in_array($usr_id, $user_ids)) {
foreach ($fields as $field_id => $value) {
if (in_array($field_id, $odf_ids, true)) {
$usr_data[$usr_id]['odf_' . $field_id] = $value;
@@ -667,7 +670,7 @@ protected function fillRow(array $a_set): void
foreach ($this->getSelectedColumns() as $col) {
if (isset($user_cols[$col])) {
$this->tpl->setCurrentBlock("user_col");
$this->tpl->setVariable("VALUE_USER_COL", $a_set[$col] . " ");
$this->tpl->setVariable("VALUE_USER_COL", ($a_set[$col] ?? "") . " ");
$this->tpl->parseCurrentBlock();
}
}
21 changes: 18 additions & 3 deletions Modules/BookingManager/Schedule/class.ilBookingSchedule.php
Original file line number Diff line number Diff line change
@@ -202,12 +202,12 @@ protected function read(): void
}
}

public function save(): bool
public function save(): ?int
{
$ilDB = $this->db;

if ($this->id) {
return false;
return null;
}

$this->id = $ilDB->nextId('booking_schedule');
@@ -264,7 +264,7 @@ public function update(): bool
return true;
}

public function doClone(int $a_pool_id): bool
public function doClone(int $a_pool_id): int
{
$new_obj = new self();
$new_obj->setPoolId($a_pool_id);
@@ -311,6 +311,21 @@ protected function saveDefinition(): bool
return true;
}

public static function lookupPoolId(int $schedule_id): int
{
global $DIC;

$ilDB = $DIC->database();

$set = $ilDB->query("SELECT pool_id " .
" FROM booking_schedule" .
" WHERE booking_schedule_id = " . $ilDB->quote($schedule_id, 'integer'));
if ($rec = $ilDB->fetchAssoc($set)) {
return (int) $rec['pool_id'];
}
return 0;
}

/**
* Check if given pool has any defined schedules
*/
Original file line number Diff line number Diff line change
@@ -53,6 +53,11 @@ public function __construct(
->gui()
->standardRequest();
$this->schedule_id = $this->book_request->getScheduleId();

if ($this->schedule_id > 0 && ilBookingSchedule::lookupPoolId($this->schedule_id) !== ilObject::_lookupObjId($this->ref_id)) {
throw new ilPermissionException("Schedule pool id does not match pool id.");
}

}

public function executeCommand(): void
7 changes: 6 additions & 1 deletion Modules/BookingManager/classes/Setup/class.Agent.php
Original file line number Diff line number Diff line change
@@ -29,6 +29,11 @@ class Agent extends Setup\Agent\NullAgent
{
public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
{
return new \ilDatabaseUpdateStepsExecutedObjective(new ilBookingManagerDBUpdateSteps());
return new Setup\ObjectiveCollection(
'Booking Manager Update',
true,
new \ilDatabaseUpdateStepsExecutedObjective(new ilBookingManagerDBUpdateSteps()),
new \ilDatabaseUpdateStepsExecutedObjective(new ilBookingManager8HotfixDBUpdateSteps())
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

declare(strict_types=1);

namespace ILIAS\BookingManager\Setup;

class ilBookingManager8HotfixDBUpdateSteps implements \ilDatabaseUpdateSteps
{
protected \ilDBInterface $db;

public function prepare(\ilDBInterface $db): void
{
$this->db = $db;
}

public function step_1(): void
{
$db = $this->db;
$set1 = $db->queryF("SELECT * FROM booking_object " .
" WHERE schedule_id = %s ",
["integer"],
[1]
);
while ($rec1 = $db->fetchAssoc($set1)) {
$set2 = $db->queryF("SELECT * FROM booking_schedule " .
" WHERE pool_id = %s ORDER BY booking_schedule_id ASC LIMIT 1",
["integer"],
[$rec1["pool_id"]]
);
if ($rec2 = $db->fetchAssoc($set2)) {
if ((int) $rec2["booking_schedule_id"] !== 1) {
$db->update("booking_object", [
"schedule_id" => ["intger", $rec2["booking_schedule_id"]]
], [ // where
"booking_object_id" => ["integer", $rec1["booking_object_id"]]
]
);
}
}
}
}
}
10 changes: 10 additions & 0 deletions Modules/BookingManager/classes/class.ilObjBookingPoolGUI.php
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
*/
class ilObjBookingPoolGUI extends ilObjectGUI
{
protected \ILIAS\BookingManager\InternalDomainService $domain;
protected ilCronManager $cron_manager;
protected \ILIAS\BookingManager\StandardGUIRequest $book_request;
protected \ILIAS\BookingManager\InternalService $service;
@@ -91,6 +92,7 @@ public function __construct(
throw new ilException("Booking Object ID does not match Booking Pool.");
}
$this->cron_manager = $DIC->cron()->manager();
$this->domain = $DIC->bookingManager()->internal()->domain();
}

/**
@@ -372,20 +374,28 @@ protected function initEditCustomForm(ilPropertyFormGUI $form): void
$pref->setInfo($this->lng->txt("book_schedule_type_none_preference_info"));
$type->addOption($pref);

$pref_options_disabled = false;
if ($this->object->getScheduleType() === ilObjBookingPool::TYPE_NO_SCHEDULE_PREFERENCES) {
$pref_manager = $this->domain->preferences($this->object);
$pref_options_disabled = $pref_manager->hasRun();
}

// number of preferences
$pref_nr = new ilNumberInputGUI($this->lng->txt("book_nr_of_preferences"), "preference_nr");
$pref_nr->setSize(4);
$pref_nr->setMinValue(1);
$pref_nr->setInfo($this->lng->txt("book_nr_of_preferences_info"));
$pref_nr->setSuffix($this->lng->txt("book_nr_preferences"));
$pref_nr->setRequired(true);
$pref_nr->setDisabled($pref_options_disabled);
$pref->addSubItem($pref_nr);

// preference deadline
$pref_deadline = new ilDateTimeInputGUI($this->lng->txt("book_pref_deadline"), "pref_deadline");
$pref_deadline->setInfo($this->lng->txt("book_pref_deadline_info"));
$pref_deadline->setShowTime(true);
$pref_deadline->setRequired(true);
$pref_deadline->setDisabled($pref_options_disabled);
$pref->addSubItem($pref_deadline);

$public = new ilCheckboxInputGUI($this->lng->txt("book_public_log"), "public");
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ public function __construct(

parent::__construct($a_parent_obj, $a_parent_cmd);

$this->addColumn("", "", "", true, "4%");
$this->addColumn("", "", "4%", true);
$this->addColumn($lng->txt("title"), "title", "35%");
$this->addColumn($lng->txt("description"), "desc", "45%");
$this->addColumn($lng->txt("type"), "type", "16%");
60 changes: 30 additions & 30 deletions Modules/Chatroom/chat/node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Modules/Chatroom/chat/node_modules/@types/node/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Modules/Chatroom/chat/node_modules/@types/node/assert.d.ts
12 changes: 6 additions & 6 deletions Modules/Chatroom/chat/node_modules/@types/node/async_hooks.d.ts
385 changes: 385 additions & 0 deletions Modules/Chatroom/chat/node_modules/@types/node/buffer.buffer.d.ts

Large diffs are not rendered by default.

514 changes: 42 additions & 472 deletions Modules/Chatroom/chat/node_modules/@types/node/buffer.d.ts

Large diffs are not rendered by default.

67 changes: 36 additions & 31 deletions Modules/Chatroom/chat/node_modules/@types/node/child_process.d.ts
33 changes: 17 additions & 16 deletions Modules/Chatroom/chat/node_modules/@types/node/cluster.d.ts
34 changes: 17 additions & 17 deletions Modules/Chatroom/chat/node_modules/@types/node/console.d.ts
98 changes: 13 additions & 85 deletions Modules/Chatroom/chat/node_modules/@types/node/crypto.d.ts
2 changes: 1 addition & 1 deletion Modules/Chatroom/chat/node_modules/@types/node/dgram.d.ts
45 changes: 23 additions & 22 deletions Modules/Chatroom/chat/node_modules/@types/node/dns.d.ts
10 changes: 5 additions & 5 deletions Modules/Chatroom/chat/node_modules/@types/node/dns/promises.d.ts
6 changes: 3 additions & 3 deletions Modules/Chatroom/chat/node_modules/@types/node/domain.d.ts
42 changes: 13 additions & 29 deletions Modules/Chatroom/chat/node_modules/@types/node/events.d.ts
83 changes: 78 additions & 5 deletions Modules/Chatroom/chat/node_modules/@types/node/fs.d.ts
23 changes: 21 additions & 2 deletions Modules/Chatroom/chat/node_modules/@types/node/fs/promises.d.ts
284 changes: 219 additions & 65 deletions Modules/Chatroom/chat/node_modules/@types/node/globals.d.ts

This file was deleted.

67 changes: 58 additions & 9 deletions Modules/Chatroom/chat/node_modules/@types/node/http.d.ts
343 changes: 240 additions & 103 deletions Modules/Chatroom/chat/node_modules/@types/node/http2.d.ts

Large diffs are not rendered by default.

42 changes: 18 additions & 24 deletions Modules/Chatroom/chat/node_modules/@types/node/https.d.ts
21 changes: 12 additions & 9 deletions Modules/Chatroom/chat/node_modules/@types/node/index.d.ts
1,442 changes: 1,331 additions & 111 deletions Modules/Chatroom/chat/node_modules/@types/node/inspector.d.ts

Large diffs are not rendered by default.

111 changes: 94 additions & 17 deletions Modules/Chatroom/chat/node_modules/@types/node/module.d.ts
34 changes: 18 additions & 16 deletions Modules/Chatroom/chat/node_modules/@types/node/net.d.ts
8 changes: 4 additions & 4 deletions Modules/Chatroom/chat/node_modules/@types/node/os.d.ts
16 changes: 12 additions & 4 deletions Modules/Chatroom/chat/node_modules/@types/node/package.json
13 changes: 11 additions & 2 deletions Modules/Chatroom/chat/node_modules/@types/node/path.d.ts
116 changes: 88 additions & 28 deletions Modules/Chatroom/chat/node_modules/@types/node/perf_hooks.d.ts
196 changes: 177 additions & 19 deletions Modules/Chatroom/chat/node_modules/@types/node/process.d.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Modules/Chatroom/chat/node_modules/@types/node/punycode.d.ts
40 changes: 20 additions & 20 deletions Modules/Chatroom/chat/node_modules/@types/node/readline.d.ts
32 changes: 16 additions & 16 deletions Modules/Chatroom/chat/node_modules/@types/node/repl.d.ts
2 changes: 1 addition & 1 deletion Modules/Chatroom/chat/node_modules/@types/node/sea.d.ts
213 changes: 213 additions & 0 deletions Modules/Chatroom/chat/node_modules/@types/node/sqlite.d.ts
71 changes: 45 additions & 26 deletions Modules/Chatroom/chat/node_modules/@types/node/stream.d.ts
292 changes: 267 additions & 25 deletions Modules/Chatroom/chat/node_modules/@types/node/stream/web.d.ts

Large diffs are not rendered by default.

596 changes: 494 additions & 102 deletions Modules/Chatroom/chat/node_modules/@types/node/test.d.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Modules/Chatroom/chat/node_modules/@types/node/timers.d.ts
17 changes: 10 additions & 7 deletions Modules/Chatroom/chat/node_modules/@types/node/tls.d.ts
20 changes: 10 additions & 10 deletions Modules/Chatroom/chat/node_modules/@types/node/trace_events.d.ts

Large diffs are not rendered by default.

92 changes: 92 additions & 0 deletions Modules/Chatroom/chat/node_modules/@types/node/ts5.6/index.d.ts
4 changes: 2 additions & 2 deletions Modules/Chatroom/chat/node_modules/@types/node/tty.d.ts
46 changes: 33 additions & 13 deletions Modules/Chatroom/chat/node_modules/@types/node/url.d.ts
119 changes: 64 additions & 55 deletions Modules/Chatroom/chat/node_modules/@types/node/util.d.ts

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions Modules/Chatroom/chat/node_modules/@types/node/v8.d.ts
132 changes: 92 additions & 40 deletions Modules/Chatroom/chat/node_modules/@types/node/vm.d.ts
4 changes: 2 additions & 2 deletions Modules/Chatroom/chat/node_modules/@types/node/wasi.d.ts
66 changes: 42 additions & 24 deletions Modules/Chatroom/chat/node_modules/@types/node/worker_threads.d.ts
31 changes: 20 additions & 11 deletions Modules/Chatroom/chat/node_modules/@types/node/zlib.d.ts
134 changes: 0 additions & 134 deletions Modules/Chatroom/chat/node_modules/cookie/HISTORY.md

This file was deleted.

133 changes: 82 additions & 51 deletions Modules/Chatroom/chat/node_modules/cookie/README.md
212 changes: 172 additions & 40 deletions Modules/Chatroom/chat/node_modules/cookie/index.js
18 changes: 10 additions & 8 deletions Modules/Chatroom/chat/node_modules/cookie/package.json
2 changes: 1 addition & 1 deletion Modules/Chatroom/chat/node_modules/engine.io/LICENSE
58 changes: 27 additions & 31 deletions Modules/Chatroom/chat/node_modules/engine.io/build/server.d.ts
69 changes: 29 additions & 40 deletions Modules/Chatroom/chat/node_modules/engine.io/build/server.js
90 changes: 54 additions & 36 deletions Modules/Chatroom/chat/node_modules/engine.io/build/socket.d.ts
151 changes: 68 additions & 83 deletions Modules/Chatroom/chat/node_modules/engine.io/build/socket.js
87 changes: 59 additions & 28 deletions Modules/Chatroom/chat/node_modules/engine.io/build/transport.d.ts
54 changes: 28 additions & 26 deletions Modules/Chatroom/chat/node_modules/engine.io/build/transport.js
17 changes: 11 additions & 6 deletions Modules/Chatroom/chat/node_modules/engine.io/build/userver.js
28 changes: 7 additions & 21 deletions Modules/Chatroom/chat/node_modules/engine.io/package.json
5 changes: 5 additions & 0 deletions Modules/Chatroom/chat/node_modules/express/History.md

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions Modules/Chatroom/chat/node_modules/express/package.json
2 changes: 1 addition & 1 deletion Modules/Chatroom/chat/node_modules/socket.io/LICENSE
4 changes: 3 additions & 1 deletion Modules/Chatroom/chat/node_modules/socket.io/Readme.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6,319 changes: 3,395 additions & 2,924 deletions Modules/Chatroom/chat/node_modules/socket.io/client-dist/socket.io.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

95 changes: 81 additions & 14 deletions Modules/Chatroom/chat/node_modules/socket.io/dist/index.d.ts
11 changes: 6 additions & 5 deletions Modules/Chatroom/chat/node_modules/socket.io/dist/index.js
16 changes: 11 additions & 5 deletions Modules/Chatroom/chat/node_modules/socket.io/dist/namespace.d.ts
26 changes: 14 additions & 12 deletions Modules/Chatroom/chat/node_modules/socket.io/dist/namespace.js
11 changes: 11 additions & 0 deletions Modules/Chatroom/chat/node_modules/socket.io/dist/socket-types.js
62 changes: 3 additions & 59 deletions Modules/Chatroom/chat/node_modules/socket.io/dist/socket.d.ts
21 changes: 7 additions & 14 deletions Modules/Chatroom/chat/node_modules/socket.io/dist/socket.js
47 changes: 23 additions & 24 deletions Modules/Chatroom/chat/node_modules/socket.io/dist/typed-events.d.ts
37 changes: 19 additions & 18 deletions Modules/Chatroom/chat/node_modules/socket.io/dist/uws.js
26 changes: 7 additions & 19 deletions Modules/Chatroom/chat/node_modules/socket.io/package.json
21 changes: 21 additions & 0 deletions Modules/Chatroom/chat/node_modules/undici-types/LICENSE
11 changes: 11 additions & 0 deletions Modules/Chatroom/chat/node_modules/undici-types/balanced-pool.d.ts
13 changes: 12 additions & 1 deletion Modules/Chatroom/chat/node_modules/undici-types/client.d.ts
22 changes: 18 additions & 4 deletions Modules/Chatroom/chat/node_modules/undici-types/dispatcher.d.ts
21 changes: 21 additions & 0 deletions Modules/Chatroom/chat/node_modules/undici-types/errors.d.ts
63 changes: 63 additions & 0 deletions Modules/Chatroom/chat/node_modules/undici-types/eventsource.d.ts
50 changes: 25 additions & 25 deletions Modules/Chatroom/chat/node_modules/undici-types/fetch.d.ts
14 changes: 10 additions & 4 deletions Modules/Chatroom/chat/node_modules/undici-types/handlers.d.ts
12 changes: 10 additions & 2 deletions Modules/Chatroom/chat/node_modules/undici-types/index.d.ts
14 changes: 12 additions & 2 deletions Modules/Chatroom/chat/node_modules/undici-types/interceptors.d.ts
11 changes: 11 additions & 0 deletions Modules/Chatroom/chat/node_modules/undici-types/pool.d.ts
5 changes: 2 additions & 3 deletions Modules/Chatroom/chat/node_modules/undici-types/readable.d.ts
116 changes: 116 additions & 0 deletions Modules/Chatroom/chat/node_modules/undici-types/retry-handler.d.ts
18 changes: 18 additions & 0 deletions Modules/Chatroom/chat/node_modules/undici-types/util.d.ts
18 changes: 10 additions & 8 deletions Modules/Chatroom/chat/node_modules/undici-types/webidl.d.ts
23 changes: 22 additions & 1 deletion Modules/Chatroom/chat/node_modules/undici-types/websocket.d.ts
118 changes: 59 additions & 59 deletions Modules/Chatroom/chat/package-lock.json
4 changes: 2 additions & 2 deletions Modules/Chatroom/chat/package.json
Original file line number Diff line number Diff line change
@@ -4,12 +4,12 @@
"version": "2.0.0",
"dependencies": {
"async": "^3.2",
"express": "^4.21.0",
"express": "^4.21.1",
"mysql": "^2.18.1",
"node-mysql": "^0.4.2",
"node-schedule": "^2.1.0",
"node-uuid": "^1.4.8",
"socket.io": "^4.7.5",
"socket.io": "^4.8.0",
"socket.io-client": "^4.7.5",
"winston": "^2.4.1"
}
4 changes: 2 additions & 2 deletions Modules/Chatroom/classes/class.ilChatroom.php
Original file line number Diff line number Diff line change
@@ -1296,8 +1296,8 @@ public function getLastMessages(int $number, ilChatroomUser $chatuser): array
}

usort($results, static function (stdClass $a, stdClass $b): int {
$a_timestamp = strlen((string) $a->timestamp) === 13 ? ((int) substr($a->timestamp, 0, -3)) : $a->timestamp;
$b_timestamp = strlen((string) $b->timestamp) === 13 ? ((int) substr($b->timestamp, 0, -3)) : $b->timestamp;
$a_timestamp = strlen((string) $a->timestamp) === 13 ? ((int) substr((string) $a->timestamp, 0, -3)) : $a->timestamp;
$b_timestamp = strlen((string) $b->timestamp) === 13 ? ((int) substr((string) $b->timestamp, 0, -3)) : $b->timestamp;

return $b_timestamp - $a_timestamp;
});
3 changes: 1 addition & 2 deletions Modules/CmiXapi/classes/class.ilCmiXapiResult.php
Original file line number Diff line number Diff line change
@@ -224,13 +224,12 @@ public static function getResultsForObject(int $objId): array

$results = [];

if ($row = $DIC->database()->fetchAssoc($res)) {
while ($row = $DIC->database()->fetchAssoc($res)) {
$result = new self();
$result->assignFromDbRow($row);

$results[$result->getUsrId()] = $result;
}

return $results;
}
}
11 changes: 11 additions & 0 deletions Modules/Course/classes/class.ilObjCourseGUI.php
Original file line number Diff line number Diff line change
@@ -289,10 +289,20 @@ public function infoScreen(): void
);
}
if ($this->object->getContactEmail()) {
/* needs to be rbacsystem, does not work with ilAccess */
$has_mail_access = $this->rbacsystem->checkAccessOfUser(
$this->user->getId(),
'internal_mail',
ilMailGlobalServices::getMailObjectRefId()
);
$emails = explode(",", $this->object->getContactEmail());
$mailString = '';
foreach ($emails as $email) {
$email = trim($email);
if (!$has_mail_access) {
$mailString .= $email . "<br />";
continue;
}
$etpl = new ilTemplate("tpl.crs_contact_email.html", true, true, 'Modules/Course');
$etpl->setVariable(
"EMAIL_LINK",
@@ -744,6 +754,7 @@ public function updateObject(): void
$GLOBALS['DIC']->language()->txt('crs_tile_and_objective_view_not_supported')
);
$this->editObject($form);
return;
}

// Additional checks: both tile and session limitation activated (not supported)
2 changes: 1 addition & 1 deletion Modules/Course/classes/class.ilTimingsCronReminder.php
Original file line number Diff line number Diff line change
@@ -251,7 +251,7 @@ protected function fillObjectListForMailBody(array $objects, ilTemplate $tpl): b
{
$has_elements = false;
foreach ($objects as $object_id => $object_details) {
if ($object_details['type'] == 'fold') {
if ($object_details['type'] != 'fold') {
$tpl->setCurrentBlock('items');
$tpl->setVariable('HREF', $object_details['url']);
$tpl->setVariable('ITEM_TITLE', $object_details['title']);
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* @author martin@fluxlabs.ch
*/
class ilDataCollectionAccessAdapter implements ilDataCollectionAccessPort
{
private ilAccess $ilAccess;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* @author martin@fluxlabs.ch
*/
class ilDataCollectionOutboundsAdapter implements ilDataCollectionOutboundsPort
{
private function __construct()
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* @author martin@fluxlabs.ch
*/
class ilDataCollectionEndpointAdapter implements ilDataCollectionEndpointPort
{
private ilCtrl $ctrl;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* @author martin@fluxlabs.ch
*/
class ilDataCollectionUiAdapter implements ilDataCollectionUiPort
{
protected static ?self $instance = null;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,15 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Hook-Class for exporting data-collections (used in SOAP-Class)
* This Class avoids duplicated code by routing the request to the right place
* @author Michael Herren <mh@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
class ilDclContentExporter
{
public const SOAP_FUNCTION_NAME = 'exportDataCollectionContent';
Original file line number Diff line number Diff line change
@@ -16,12 +16,6 @@
*
*********************************************************************/

/**
* Hook-Class for exporting data-collections (used in SOAP-Class)
* This Class avoids duplicated code by routing the request to the right place
* @author Michael Herren <mh@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
class ilDclContentImporter
{
//const SOAP_FUNCTION_NAME = 'exportDataCollectionContent';
Original file line number Diff line number Diff line change
@@ -16,15 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclRecordEditGUI
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @version $Id:
*/
class ilDclRecordEditGUI
{
/**
Original file line number Diff line number Diff line change
@@ -16,14 +16,6 @@
*
*********************************************************************/

/**
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclRecordListGUI
{
public const GET_TABLE_ID = 'table_id';
@@ -56,6 +48,7 @@ class ilDclRecordListGUI
protected ilTabsGUI $tabs;
protected ILIAS\HTTP\Services $http;
protected ILIAS\Refinery\Factory $refinery;
protected bool $filter_changed = false;

private function init(
ilDataCollectionOutboundsAdapter $adapter
@@ -332,7 +325,8 @@ protected function applyFilter(): void
$table->initFilter();
$table->resetOffset();
$table->writeFilterToSession();
$this->ctrl->redirect($this, self::CMD_LIST_RECORDS);
$this->filter_changed = true;
$this->listRecords();
}

/**
@@ -344,7 +338,8 @@ protected function resetFilter(): void
$table->initFilter();
$table->resetOffset();
$table->resetFilter();
$this->ctrl->redirect($this, self::CMD_LIST_RECORDS);
$this->filter_changed = true;
$this->listRecords();
}

/**
@@ -536,24 +531,13 @@ protected function getRecordListTableGUI(bool $use_tableview_filter): ilDclRecor
$list->setExternalSorting(true);
$list->determineOffsetAndOrder();

$limit = $list->getLimit();
$offset = $list->getOffset();

$num_records = count($table_obj->getPartialRecords(
(string) $this->getRefId(),
$list->getOrderField(),
$list->getOrderDirection(),
$limit,
$offset,
$list->getFilter()
));

// Fix no data found on new filter application when on a site other than the first
if ($num_records === 0) {
if ($this->filter_changed) {
$list->resetOffset();
$offset = 0;
}

$limit = $list->getLimit();
$offset = $list->getOffset();

$data = $table_obj->getPartialRecords(
(string) $this->getRefId(),
$list->getOrderField(),
Original file line number Diff line number Diff line change
@@ -16,15 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclRecordListTableGUI extends ilTable2GUI
{
public const EXPORT_EXCEL_ASYNC = 10;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclCreateViewDefinition
* @author studer + raimann ag - Team Custom 1 <support-custom1@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
class ilDclCreateViewDefinition extends ilPageObject
{
public const PARENT_TYPE = 'dclf';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclCreateViewDefinitionConfig
* @author studer + raimann ag - Team Custom 1 <support-custom1@studer-raimann.ch>
*/
class ilDclCreateViewDefinitionConfig extends ilPageConfig
{
public function init(): void
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,9 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclCreateViewDefinitionGUI
* @author studer + raimann ag - Team Custom 1 <support-custom1@studer-raimann.ch>
* @ilCtrl_Calls ilDclCreateViewDefinitionGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector
* @ilCtrl_Calls ilDclCreateViewDefinitionGUI: ilPublicUserProfileGUI, ilPageObjectGUI
*/
@@ -146,21 +144,6 @@ public function deleteView(): void
$ilCtrl->redirectByClass("ilDclTableViewEditGUI", "editGeneralSettings");
}

/**
* Release page lock
* overwrite to redirect properly
*/
public function releasePageLock(): void
{
global $DIC;
$ilCtrl = $DIC['ilCtrl'];
$lng = $DIC['lng'];

$this->getPageObject()->releasePageLock();
$this->tpl->setOnScreenMessage('success', $lng->txt("cont_page_lock_released"), true);
$ilCtrl->redirectByClass('ilDclTableViewGUI', "show");
}

/**
* Finalizing output processing
* @param string $a_output
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclCreateViewTableGUI
* @author studer + raimann ag - Team Custom 1 <support-custom1@studer-raimann.ch>
*/
class ilDclCreateViewTableGUI extends ilTable2GUI
{
public const VALID_DEFAULT_VALUE_TYPES = [
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,18 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDetailedViewDefinition
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclDetailedViewDefinition extends ilPageObject
{
public const PARENT_TYPE = 'dclf';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,15 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* View definition page configuration
* @author Alex Killing <alex.killing@gmx.de>
* @version $Id$
* @ingroup ModulesDataCollection
*/
class ilDclDetailedViewDefinitionConfig extends ilPageConfig
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,15 +14,9 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDetailedViewDefinitionGUI
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Jörg Lützenkirchen <luetzenkirchen@leifos.com>
* @ilCtrl_Calls ilDclDetailedViewDefinitionGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector
* @ilCtrl_Calls ilDclDetailedViewDefinitionGUI: ilPublicUserProfileGUI, ilPageObjectGUI
*/
@@ -168,17 +163,6 @@ public function deleteView(): void
$this->ctrl->redirectByClass(self::class, "edit");
}

/**
* Release page lock
* overwrite to redirect properly
*/
public function releasePageLock(): void
{
$this->getPageObject()->releasePageLock();
$this->tpl->setOnScreenMessage('success', $this->lng->txt("cont_page_lock_released"), true);
$this->ctrl->redirectByClass('ilDclTableViewGUI', "show");
}

/**
* Finalizing output processing
*/
Original file line number Diff line number Diff line change
@@ -14,14 +14,9 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @version $Id:
* @ilCtrl_Calls ilDclDetailedViewGUI: ilDclDetailedViewDefinitionGUI, ilEditClipboardGUI
*/
class ilDclDetailedViewGUI
@@ -418,14 +413,14 @@ private function setOptions(string $link_name): array
*/
private function loadSession(): void
{
// We need the default sorting etc. to dertermine on which position we currently are, thus we instantiate the table gui.
$list = new ilDclRecordListTableGUI(
new ilDclRecordListGUI($this->dcl_gui_object, $this->table->getId(), $this->tableview_id),
"listRecords",
$this->table,
$this->tableview_id
);
//we then partially load the records. note that this also fills up session data.
$list->initFilter();
$list->determineOffsetAndOrder();
$this->table->getPartialRecords(
$this->table->getId(),
$list->getOrderField(),
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclEditViewDefinition
* @author studer + raimann ag - Team Custom 1 <support-custom1@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
class ilDclEditViewDefinition extends ilPageObject
{
public const PARENT_TYPE = 'dclf';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclEditViewDefinitionConfig
* @author studer + raimann ag - Team Custom 1 <support-custom1@studer-raimann.ch>
*/
class ilDclEditViewDefinitionConfig extends ilPageConfig
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,9 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclEditViewDefinitionGUI
* @author studer + raimann ag - Team Custom 1 <support-custom1@studer-raimann.ch>
* @ilCtrl_Calls ilDclEditViewDefinitionGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector
* @ilCtrl_Calls ilDclEditViewDefinitionGUI: ilPublicUserProfileGUI, ilPageObjectGUI
*/
@@ -143,21 +141,6 @@ public function deleteView(): void
$ilCtrl->redirectByClass("ilDclTableViewEditGUI", "editGeneralSettings");
}

/**
* Release page lock
* overwrite to redirect properly
*/
public function releasePageLock(): void
{
global $DIC;
$ilCtrl = $DIC['ilCtrl'];
$lng = $DIC['lng'];

$this->getPageObject()->releasePageLock();
$this->tpl->setOnScreenMessage('success', $lng->txt("cont_page_lock_released"), true);
$ilCtrl->redirectByClass('ilDclTableViewGUI', "show");
}

/**
* Finalizing output processing
* @param string $a_output
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclEditViewTableGUI
* @author studer + raimann ag - Team Custom 1 <support-custom1@studer-raimann.ch>
*/
class ilDclEditViewTableGUI extends ilTable2GUI
{
protected ilLanguage $lng;
Original file line number Diff line number Diff line change
@@ -16,15 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
class ilDclBaseFieldModel
{
protected string $id = "";
@@ -33,7 +24,7 @@ class ilDclBaseFieldModel
protected string $description = "";
protected int $datatypeId = 0;
protected ?int $order = null;
protected bool $unique;
protected bool $unique = false;
/** @var ilDclFieldProperty[] */
protected array $property = [];
protected bool $exportable = false;
@@ -220,10 +211,19 @@ public function getDatatype(): ilDclDatatype
public function getDatatypeTitle(): string
{
$this->loadDatatype();

return $this->datatype->getTitle();
}

public function getPresentationTitle(): string
{
return $this->lng->txt('dcl_' . $this->getDatatypeTitle());
}

public function getPresentationDescription(): string
{
return $this->lng->txt('dcl_' . $this->getDatatypeTitle() . '_desc');
}

/**
* Get storage location for the model
*/
@@ -716,11 +716,17 @@ public function checkFieldCreationInput(ilPropertyFormGUI $form): bool
return true;
}

/**
* @deprecated
*/
public function getStorageLocationOverride(): ?int
{
return $this->storage_location_override;
}

/**
* @deprecated override ilDclFieldTypePlugin::getStorageLocation() instead
*/
public function setStorageLocationOverride(?int $storage_location_override): void
{
$this->storage_location_override = $storage_location_override;
Original file line number Diff line number Diff line change
@@ -16,11 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclBaseFieldRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
abstract class ilDclBaseFieldRepresentation
{
protected ilDclBaseFieldModel $field;
@@ -142,15 +137,6 @@ public function addFieldCreationForm(
): void {
$opt = $this->buildFieldCreationInput($dcl, $mode);
if ($opt !== null) {
if ($mode != 'create' && $this->getField()->getDatatypeId() == ilDclDatatype::INPUTFORMAT_PLUGIN) {
$new_plugin_title = $opt->getTitle();
$plugin_name = ilDclFieldFactory::getPluginNameFromFieldModel($this->getField());
if ($plugin_name !== "DclBase") {
$new_plugin_title .= ': ' . $plugin_name;
}
$opt->setTitle($new_plugin_title);
}

$form->addOption($opt);
}
}
@@ -160,11 +146,13 @@ public function addFieldCreationForm(
*/
protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ?ilRadioOption
{
$opt = new ilRadioOption(
$this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()),
$this->getField()->getDatatypeId()
);
$opt->setInfo($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle() . '_desc'));
$opt = null;
if ($this->getField()->getDatatypeId() !== null) {
$title = $this->field->getPresentationTitle();
$info = $this->field->getPresentationDescription();
$opt = new ilRadioOption($title, (string) $this->getField()->getDatatypeId());
$opt->setInfo($info);
}

return $opt;
}
Original file line number Diff line number Diff line change
@@ -16,16 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclBaseRecordFieldModel
{
protected ?int $id = null;
Original file line number Diff line number Diff line change
@@ -18,16 +18,6 @@

use ILIAS\Notes\Service;

/**
* Class ilDclBaseRecordModel
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclBaseRecordModel
{
protected \ILIAS\UI\Factory $ui_factory;
@@ -128,6 +118,7 @@ public function doRead(): void
}

$this->setTableId((int) $rec["table_id"]);
$this->loadTable();
if (null !== $rec["create_date"]) {
$this->setCreateDate(new ilDateTime($rec["create_date"], IL_CAL_DATETIME));
}
Original file line number Diff line number Diff line change
@@ -16,11 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclBaseRecordRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclBaseRecordRepresentation
{
protected ilDclBaseRecordFieldModel $record_field;
26 changes: 12 additions & 14 deletions Modules/DataCollection/classes/Fields/Base/class.ilDclDatatype.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,19 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDatatype
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclDatatype
{
public const INPUTFORMAT_NONE = 0;
@@ -40,6 +30,7 @@ class ilDclDatatype
public const INPUTFORMAT_MOB = 9;
public const INPUTFORMAT_REFERENCELIST = 10;
public const INPUTFORMAT_FORMULA = 11;
/** @deprecated */
public const INPUTFORMAT_PLUGIN = 12;
public const INPUTFORMAT_TEXT_SELECTION = 14;
public const INPUTFORMAT_DATE_SELECTION = 15;
@@ -122,7 +113,7 @@ public function doRead(): void
/**
* Get all possible Datatypes
*/
public static function getAllDatatype(): array
public static function getAllDatatype(bool $force = false): array
{
global $DIC;
$ilDB = $DIC['ilDB'];
@@ -137,7 +128,14 @@ public static function getAllDatatype(): array
$instance = new ilDclDatatype();
$instance->loadDatatype($rec);

self::$datatype_cache[$rec['id']] = $instance;
if (
$force ||
!ilDclFieldTypePlugin::isPluginDatatype($instance->getTitle()) ||
$DIC['component.repository']->hasActivatedPlugin(ilDclFieldTypePlugin::getPluginId($instance->getTitle()))
) {
self::$datatype_cache[$rec['id']] = $instance;
}

}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclFieldProperty
* @author Michael Herren <mh@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
class ilDclFieldProperty extends ActiveRecord
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,18 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclStandardField extends ilDclBaseFieldModel
{
private ilGlobalTemplateInterface $main_tpl;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBooleanFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclBooleanFieldModel extends ilDclBaseFieldModel
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclFileuploadFieldRepresentaion
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclBooleanFieldRepresentation extends ilDclBaseFieldRepresentation
{
public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilDclCheckboxInputGUI
Original file line number Diff line number Diff line change
@@ -14,15 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @version $Id:
*/
class ilDclBooleanRecordFieldModel extends ilDclBaseRecordFieldModel
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBooleanRecordRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclBooleanRecordRepresentation extends ilDclBaseRecordRepresentation
{
/**
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

class ilDclCopyFieldModel extends ilDclBaseFieldModel
{
public function getRecordQueryFilterObject(
$filter_value = "",
?ilDclBaseFieldModel $sort_field = null
): ?ilDclRecordQueryObject {
$join_str
= "INNER JOIN il_dcl_record_field AS filter_record_field_{$this->getId()} ON (filter_record_field_{$this->getId()}.record_id = record.id AND filter_record_field_{$this->getId()}.field_id = "
. $this->db->quote($this->getId(), 'integer') . ") ";
$join_str .= "INNER JOIN il_dcl_stloc{$this->getStorageLocation()}_value AS filter_stloc_{$this->getId()} ON (filter_stloc_{$this->getId()}.record_field_id = filter_record_field_{$this->getId()}.id AND filter_stloc_{$this->getId()}.value LIKE "
. $this->db->quote("%$filter_value%", 'text') . ") ";

$sql_obj = new ilDclRecordQueryObject();
$sql_obj->setJoinStatement($join_str);

return $sql_obj;
}

public function getValidFieldProperties(): array
{
return [
ilDclBaseFieldModel::PROP_REFERENCE,
ilDclBaseFieldModel::PROP_N_REFERENCE
];
}

public function getPresentationTitle(): string
{
return $this->lng->txt('dcl_copy_field');
}

public function getPresentationDescription(): string
{
return $this->lng->txt('dcl_copy_field_desc');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

class ilDclCopyFieldRepresentation extends ilDclBaseFieldRepresentation
{
private const VALID_TYPES = [
ilDclDatatype::INPUTFORMAT_TEXT,
ilDclDatatype::INPUTFORMAT_NUMBER,
ilDclDatatype::INPUTFORMAT_BOOLEAN,
ilDclDatatype::INPUTFORMAT_DATETIME,
];

/**
* @return ilSelectInputGUI|ilMultiSelectInputGUI
*/
public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilFormPropertyGUI
{
if ($this->getField()->getProperty(ilDclBaseFieldModel::PROP_N_REFERENCE)) {
$input = new ilMultiSelectInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
} else {
$input = new ilSelectInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
}

$this->setupInputField($input, $this->getField());

$options = [];
if (!$this->getField()->getProperty(ilDclBaseFieldModel::PROP_N_REFERENCE)) {
$options[''] = $this->lng->txt('dcl_please_select');
}

$value = null;
$copy_id = $this->getField()->getProperty(ilDclBaseFieldModel::PROP_REFERENCE);
$copy_field = ilDclCache::getFieldCache($copy_id);
if ($copy_field->getTableId() !== 0) {
$copy_table = ilDclCache::getTableCache($copy_field->getTableId());
foreach ($copy_table->getRecords() as $record) {
$option = $record->getRecordField($copy_field->getId())->getPlainText();
if (!in_array($option, $options)) {
$options[$option] = $option;
}
}
} else {
$input->setAlert($this->lng->txt('dcl_origin_not_found'));
}

if ($record_id !== null) {
$value = ilDclCache::getRecordCache($record_id)->getRecordFieldValue($this->getField()->getId());
if ($value !== '' && !array_key_exists($value, $options)) {
$options[$value] = $value . ' ' . $this->lng->txt('dcl_deprecated_copy');
}
}

$input->setOptions($options);

return $input;
}

public function addFilterInputFieldToTable(ilTable2GUI $table)
{
$input = $table->addFilterItemByMetaType(
"filter_" . $this->getField()->getId(),
ilTable2GUI::FILTER_TEXT,
false,
$this->getField()->getId()
);
$input->setSubmitFormOnEnter(true);

$this->setupFilterInputField($input);

return $this->getFilterInputFieldValue($input);
}

public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
{
$pass = parent::passThroughFilter($record, $filter);

$value = $record->getRecordFieldValue($this->getField()->getId());
if (!$filter || strpos(strtolower($value), strtolower($filter)) !== false) {
$pass = true;
}

return $pass;
}

protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ilRadioOption
{
$datetype_title = $this->getField()->getPresentationTitle();
$opt = new ilRadioOption($this->getField()->getPresentationTitle(), $this->getField()->getDatatypeId());
$opt->setInfo($this->getField()->getPresentationDescription());

$options = [];
$tables = $dcl->getTables();
foreach ($tables as $table) {
foreach ($table->getRecordFields() as $field) {
if (in_array($field->getDatatypeId(), self::VALID_TYPES)) {
$options[$field->getId()] = $table->getTitle() . ' -> ' . $field->getTitle();
}
}
}

$prop_table_selection = new ilSelectInputGUI(
$this->lng->txt('dcl_copy_title'),
'prop_' . ilDclBaseFieldModel::PROP_REFERENCE
);
$prop_table_selection->setOptions($options);
$opt->addSubItem($prop_table_selection);

$prop_multi_select = new ilDclCheckboxInputGUI(
$this->lng->txt('dcl_multiple_selection'),
'prop_' . ilDclBaseFieldModel::PROP_N_REFERENCE
);
$opt->addSubItem($prop_multi_select);

return $opt;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

class ilDclCopyRecordFieldModel extends ilDclBaseRecordFieldModel
{
public function deserializeData($value)
{
return (string) $value;
}

public function setValueFromForm(ilPropertyFormGUI $form): void
{
$value = $form->getInput('field_' . $this->getField()->getId());
if (is_array($value)) {
$value = implode(', ', $value);
}
$this->setValue($value);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

class ilDclCopyRecordRepresentation extends ilDclBaseRecordRepresentation
{
public function parseFormInput($value)
{
if ($this->getField()->getProperty(ilDclBaseFieldModel::PROP_N_REFERENCE)) {
$value = [$value];
}

return parent::parseFormInput($value);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDateSelectionFieldModel
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclDateSelectionFieldModel extends ilDclSelectionFieldModel
{
public const PROP_SELECTION_TYPE = 'date_selection_type';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDateSelectionFieldRepresentation
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclDateSelectionFieldRepresentation extends ilDclSelectionFieldRepresentation
{
public const PROP_SELECTION_TYPE = 'date_selection_type';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDateSelectionRecordFieldModel
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclDateSelectionRecordFieldModel extends ilDclSelectionRecordFieldModel
{
public const PROP_SELECTION_TYPE = 'date_selection_type';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDateSelectionRecordRepresentation
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclDateSelectionRecordRepresentation extends ilDclSelectionRecordRepresentation
{
public const PROP_SELECTION_TYPE = 'date_selection_type';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBooleanFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclDatetimeFieldModel extends ilDclBaseFieldModel
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDateTimeREpresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclDatetimeFieldRepresentation extends ilDclBaseFieldRepresentation
{
public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilDateTimeInputGUI
Original file line number Diff line number Diff line change
@@ -14,15 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @version $Id:
*/
class ilDclDatetimeRecordFieldModel extends ilDclBaseRecordFieldModel
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDateTimeRecordRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclDatetimeRecordRepresentation extends ilDclBaseRecordRepresentation
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBooleanFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclFileuploadFieldModel extends ilDclBaseFieldModel
{
public function getRecordQuerySortObject(
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclFileuploadFieldRepresentaion
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclFileuploadFieldRepresentation extends ilDclBaseFieldRepresentation
{
public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilFileInputGUI
Original file line number Diff line number Diff line change
@@ -19,12 +19,6 @@
use ILIAS\FileUpload\MimeType;
use ILIAS\Filesystem\Stream\Streams;

/**
* Class ilDclBaseFieldModel
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @version $Id:
*/
class ilDclFileuploadRecordFieldModel extends ilDclBaseRecordFieldModel
{
private \ILIAS\FileUpload\FileUpload $upload;
Original file line number Diff line number Diff line change
@@ -16,12 +16,6 @@
*
*********************************************************************/


/**
* Class ilDclFileuploadRecordRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclFileuploadRecordRepresentation extends ilDclBaseRecordRepresentation
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclExpressionParser
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
class ilDclExpressionParser
{
public const N_DECIMALS = 1;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,16 +14,17 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclFormulaFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclFormulaFieldModel extends ilDclBaseFieldModel
{
public const SUPPORTED_FIELDS = [
ilDclDatatype::INPUTFORMAT_NUMBER,
ilDclDatatype::INPUTFORMAT_TEXT,
ilDclDatatype::INPUTFORMAT_BOOLEAN,
ilDclDatatype::INPUTFORMAT_DATETIME,
];

/**
* Returns a query-object for building the record-loader-sql-query
*/
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
/**
* Class ilDclDateTimeREpresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
*********************************************************************/

class ilDclFormulaFieldRepresentation extends ilDclBaseFieldRepresentation
{
public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilTextInputGUI
Original file line number Diff line number Diff line change
@@ -14,15 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @version $Id:
*/
class ilDclFormulaRecordFieldModel extends ilDclBaseRecordFieldModel
{
protected string $expression = '';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclFormulaRecordQueryObject
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclFormulaRecordQueryObject extends ilDclRecordQueryObject
{
public function applyCustomSorting(
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclStack
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
class ilDclStack
{
protected array $stack = array();
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTokenizer
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
class ilDclTokenizer
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBooleanFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclIliasReferenceFieldModel extends ilDclBaseFieldModel
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclIliasReferenceFieldRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclIliasReferenceFieldRepresentation extends ilDclBaseFieldRepresentation
{
public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilRepositorySelector2InputGUI
Original file line number Diff line number Diff line change
@@ -14,18 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclIliasReferenceRecordFieldModel
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclIliasReferenceRecordFieldModel extends ilDclBaseRecordFieldModel
{
protected int $dcl_obj_id;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclIliasRecordRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclIliasReferenceRecordRepresentation extends ilDclBaseRecordRepresentation
{
public function getHTML(bool $link = true, array $options = []): string
Original file line number Diff line number Diff line change
@@ -16,11 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclBooleanFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclMobFieldModel extends ilDclFileuploadFieldModel
{
public static array $mob_suffixes = array('jpg', 'jpeg', 'gif', 'png', 'mp3', 'flx', 'mp4', 'm4v', 'mov', 'wmv');
Original file line number Diff line number Diff line change
@@ -16,11 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclFileuploadFieldRepresentaion
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclMobFieldRepresentation extends ilDclFileuploadFieldRepresentation
{
public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilFileInputGUI
Original file line number Diff line number Diff line change
@@ -16,12 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclMobRecordFieldModel
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Michael Herren <mh@studer-raimann.ch>
*/
class ilDclMobRecordFieldModel extends ilDclBaseRecordFieldModel
{
private \ilGlobalTemplateInterface $main_tpl;
Original file line number Diff line number Diff line change
@@ -16,11 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclMobRecordRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclMobRecordRepresentation extends ilDclFileuploadRecordRepresentation
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBooleanFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclNumberFieldModel extends ilDclBaseFieldModel
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDateTimeREpresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclNumberFieldRepresentation extends ilDclBaseFieldRepresentation
{
public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilNumberInputGUI
Original file line number Diff line number Diff line change
@@ -14,15 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclNumberRecordFieldModel
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @version $Id:
*/
class ilDclNumberRecordFieldModel extends ilDclBaseRecordFieldModel
{
public function parseValue($value): ?float
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,56 +14,65 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

declare(strict_types=1);

/**
* Class ilDclFieldTypePlugin
* Definition of the PluginHook
* @author Michael Herren
* @extends ilPlugin
*/
abstract class ilDclFieldTypePlugin extends ilPlugin
{
public const DB_TYPES = ['text', 'text', 'integer', 'date'];
public const COMPONENT_NAME = "DataCollection";
public const SLOT_NAME = "FieldTypeHook";
public const SLOT_ID = "dclfth";
public const PLUGIN_SLOT_PREFIX = 'plugin_fth_';

/**
* @var ilDclFieldTypePlugin[] singleton-instance
*/
protected static array $instances = array();

/**
* Singleton for abstract class
*/
public static function getInstance(): ilDclFieldTypePlugin
public function install(): void
{
$class = get_called_class();
if (!isset(self::$instances[$class])) {
self::$instances[$class] = new $class();
$field_type_name = ilDclFieldTypePlugin::PLUGIN_SLOT_PREFIX . $this->getId();
$datatypes = ilDclDatatype::getAllDatatype(true);
foreach ($datatypes as $datatype) {
if ($datatype->getTitle() === $field_type_name) {
parent::install();
return;
}
}

return self::$instances[$class];
$field_model_class = 'il' . $this->getPluginName() . 'FieldModel';
$type = (new $field_model_class())->getStorageLocationOverride() ?? $this->getStorageLocation();
$this->db->manipulateF(
'INSERT INTO il_dcl_datatype (id, title, ildb_type, storage_location, sort) SELECT GREATEST(MAX(id), 1000) + 1, %s, %s, %s, GREATEST(MAX(sort), 10000) + 10 FROM il_dcl_datatype;',
[
ilDBConstants::T_TEXT,
ilDBConstants::T_TEXT,
ilDBConstants::T_INTEGER,
],
[
$field_type_name,
$this::DB_TYPES[$type],
$type
]
);
}

public function getPluginTablePrefix(): string
public function getStorageLocation(): int
{
return $this->getLanguageHandler()->getPrefix();
return 1;
}

public function getPluginTableName(): string
public static function getDataType(string $plugin_id): string
{
return $this->getPluginTablePrefix() . "_props";
return self::PLUGIN_SLOT_PREFIX . $plugin_id;
}

public function getPluginConfigTableName(): string
public static function getPluginId(string $datatype): string
{
return $this->getPluginTablePrefix() . "_config";
if (self::isPluginDatatype($datatype)) {
return substr($datatype, strlen(self::PLUGIN_SLOT_PREFIX));
}
throw new ilPluginException('Invalid datatype prefix for FieldTypHook-plugin');
}

public function getPluginClassPrefix(): string
public static function isPluginDatatype(string $datatype): bool
{
return 'il';
return substr($datatype, 0, strlen(self::PLUGIN_SLOT_PREFIX)) === self::PLUGIN_SLOT_PREFIX;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
/**
* Class ilDclPluginFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
*/
*********************************************************************/

class ilDclPluginFieldModel extends ilDclBaseFieldModel
{
public function getValidFieldProperties(): array
@@ -41,4 +38,24 @@ public function allowFilterInListView(): bool
{
return false;
}

public function getPresentationTitle(): string
{
global $DIC;
$plugin = $DIC["component.factory"]->getPlugin(ilDclFieldTypePlugin::getPluginId($this->getDatatype()->getTitle()));
if (str_ends_with($plugin->txt('field_type_name'), 'field_type_name-')) {
return $plugin->getPluginName();
}
return $plugin->txt('field_type_name');
}

public function getPresentationDescription(): string
{
global $DIC;
$plugin = $DIC["component.factory"]->getPlugin(ilDclFieldTypePlugin::getPluginId($this->getDatatype()->getTitle()));
if (str_ends_with($plugin->txt('field_type_info'), 'field_type_info-')) {
return '';
}
return $plugin->txt('field_type_info');
}
}
Original file line number Diff line number Diff line change
@@ -16,11 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclPluginFieldRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclPluginFieldRepresentation extends ilDclBaseFieldRepresentation
{
protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ?ilRadioOption
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclPluginRecordFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
*/
class ilDclPluginRecordFieldModel extends ilDclBaseRecordFieldModel
{
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclRatingFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclRatingFieldModel extends ilDclBaseFieldModel
{
public function getRecordQuerySortObject(
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclDateTimeREpresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclRatingFieldRepresentation extends ilDclBaseFieldRepresentation
{
public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilTextInputGUI
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,18 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclRatingRecordFieldModel extends ilDclBaseRecordFieldModel
{
protected int $dcl_obj_id;
Original file line number Diff line number Diff line change
@@ -14,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclMobRecordRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclRatingRecordRepresentation extends ilDclBaseRecordRepresentation
{
public function getHTML(bool $link = true, array $options = []): string
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclReferenceFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclReferenceFieldModel extends ilDclBaseFieldModel
{
public const PROP_REFERENCE = 'table_id';
@@ -39,11 +34,15 @@ public function getRecordQuerySortObject(
global $DIC;
$ilDB = $DIC['ilDB'];

if ($this->hasProperty(self::PROP_N_REFERENCE)) {
if (
$this->hasProperty(self::PROP_N_REFERENCE) ||
$this->getProperty(self::PROP_REFERENCE) === null ||
ilDclCache::getFieldCache((int) $this->getProperty(self::PROP_REFERENCE))->getTableId() === 0
) {
return null;
}

$ref_field = ilDclCache::getFieldCache($this->getProperty(self::PROP_REFERENCE));
$ref_field = ilDclCache::getFieldCache((int) $this->getProperty(self::PROP_REFERENCE));

$select_str = "stloc_{$this->getId()}_joined.value AS field_{$this->getId()},";
$join_str = "LEFT JOIN il_dcl_record_field AS record_field_{$this->getId()} ON (record_field_{$this->getId()}.record_id = record.id AND record_field_{$this->getId()}.field_id = "
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTextFieldRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclReferenceFieldRepresentation extends ilDclBaseFieldRepresentation
{
public const REFERENCE_SEPARATOR = " -> ";
Original file line number Diff line number Diff line change
@@ -14,18 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclReferenceRecordFieldModel extends ilDclBaseRecordFieldModel
{
protected ?int $dcl_obj_id;
@@ -158,8 +148,8 @@ public function afterClone(): void
$record_field_clone = ilDclCache::getRecordFieldCache($record_clone, $field_clone);
$clone_references = $record_field_clone->getValue();

$value = [];
if (is_array($clone_references)) {
$value = [];
foreach ($clone_references as $clone_reference) {
if (!is_null($temp_value = $this->getCloneRecordId($clone_reference))) {
$value[] = $temp_value;
Original file line number Diff line number Diff line change
@@ -16,11 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclReferenceRecordRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclReferenceRecordRepresentation extends ilDclBaseRecordRepresentation
{
public function getHTML(bool $link = true, array $options = []): string
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclSelectionFieldModel
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
abstract class ilDclSelectionFieldModel extends ilDclBaseFieldModel
{
public const SELECTION_TYPE_SINGLE = 'selection_type_single';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclSelectionFieldRepresentation
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
abstract class ilDclSelectionFieldRepresentation extends ilDclBaseFieldRepresentation
{
// those should be overwritten by subclasses
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclSelectionOption
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclSelectionOption extends ActiveRecord
{
public const DB_TABLE_NAME = "il_dcl_sel_opts";
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclSelectionRecordFieldModel
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
abstract class ilDclSelectionRecordFieldModel extends ilDclBaseRecordFieldModel
{
// those should be overwritten by subclasses
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclSelectionRecordRepresentation
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
abstract class ilDclSelectionRecordRepresentation extends ilDclBaseRecordRepresentation
{
// those should be overwritten by subclasses
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

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

/**
* Class ilDclTextFieldModel
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclTextFieldModel extends ilDclBaseFieldModel
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
/**
* Class ilDclTextFieldRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
*********************************************************************/

class ilDclTextFieldRepresentation extends ilDclBaseFieldRepresentation
{
public function addFilterInputFieldToTable(ilTable2GUI $table): ?string
Original file line number Diff line number Diff line change
@@ -18,10 +18,6 @@

use PhpOffice\PhpSpreadsheet\Cell\DataType;

/**
* Class ilDclTextRecordFieldModel
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclTextRecordFieldModel extends ilDclBaseRecordFieldModel
{
public function setValueFromForm(ilPropertyFormGUI $form): void
@@ -157,4 +153,18 @@ public function parseSortingValue($value, bool $link = true): string
return $value;
}
}

public function deserializeData($value)
{
$value = (string) $value;
if ($this->getField()->getProperty(ilDclBaseFieldModel::PROP_URL)) {
$deserialize = json_decode($value, true);
return [
'title' => $deserialize['title'] ?? '',
'link' => $deserialize['link'] ?? '',
];
}

return $value;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTextRecordQueryObject
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclTextRecordQueryObject extends ilDclRecordQueryObject
{
public function applyCustomSorting(ilDclBaseFieldModel $field, array $all_records, $direction = 'asc'): array
Original file line number Diff line number Diff line change
@@ -16,11 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclTextFieldRepresentation
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclTextRecordRepresentation extends ilDclBaseRecordRepresentation
{
public const LINK_MAX_LENGTH = 40;
@@ -89,10 +84,6 @@ public function getHTML(bool $link = true, array $options = []): string
$html = (is_array($value) && isset($value['link'])) ? $value['link'] : nl2br((string) $value);
}

if (!$html) {
$html = "";
}

return $html;
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTextSelectionFieldModel
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclTextSelectionFieldModel extends ilDclSelectionFieldModel
{
public const PROP_SELECTION_TYPE = 'text_selection_type';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTextSelectionFieldRepresentation
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclTextSelectionFieldRepresentation extends ilDclSelectionFieldRepresentation
{
public const PROP_SELECTION_TYPE = 'text_selection_type';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,15 +14,10 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

use PhpOffice\PhpSpreadsheet\Cell\DataType;

/**
* Class ilDclTextSelectionRecordFieldModel
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclTextSelectionRecordFieldModel extends ilDclSelectionRecordFieldModel
{
public const PROP_SELECTION_TYPE = 'text_selection_type';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTextSelectionRecordRepresentation
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclTextSelectionRecordRepresentation extends ilDclSelectionRecordRepresentation
{
public const PROP_SELECTION_TYPE = 'text_selection_type';
16 changes: 4 additions & 12 deletions Modules/DataCollection/classes/Fields/class.ilDclFieldEditGUI.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,18 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclFieldEditGUI
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclFieldEditGUI
{
protected int $obj_id;
@@ -260,8 +251,9 @@ public function initForm(string $a_mode = "create"): void
foreach (ilDclDatatype::getAllDatatype() as $datatype) {
$model = new ilDclBaseFieldModel();
$model->setDatatypeId($datatype->getId());
$model = ilDclFieldFactory::getFieldModelInstanceByClass($model);

if ($a_mode == 'edit' && $datatype->getId() == $this->field_obj->getDatatypeId()) {
if ($a_mode == 'edit' && $datatype->getId() === $this->field_obj->getDatatypeId()) {
$model = $this->field_obj;
}

64 changes: 15 additions & 49 deletions Modules/DataCollection/classes/Fields/class.ilDclFieldFactory.php
Original file line number Diff line number Diff line change
@@ -16,12 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclFieldFactory
* This Class handles the creation of all field-classes
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclFieldFactory
{
public static string $field_base_path_patter = "./Modules/DataCollection/classes/Fields/%s/";
@@ -39,10 +33,8 @@ class ilDclFieldFactory
* @throws ilDclException
* @throws Exception
*/
public static function getRecordFieldInstance(
object $field, //object|ilDclBaseFieldModel
object $record //object|ilDclBaseRecordModel
): ?ilDclBaseRecordFieldModel {
public static function getRecordFieldInstance(object $field, object $record): ilDclBaseRecordFieldModel
{
if (!empty(self::$record_field_cache[$field->getId()][$record->getId()])) {
return self::$record_field_cache[$field->getId()][$record->getId()];
}
@@ -66,7 +58,6 @@ public static function getRecordFieldInstance(
}

throw new RuntimeException("file not found " . $path);
return null;
}

protected static array $field_class_cache = array();
@@ -210,6 +201,7 @@ public static function getFieldModelInstanceByClass(
if ($instance == null) {
throw new ilDclException("Could not create FieldModel of " . $class);
}
$instance->setDatatypeId($field->getDatatypeId());

if ($field->getId() != null) {
self::$field_model_cache[$field->getId()] = $instance;
@@ -223,34 +215,23 @@ public static function getFieldModelInstanceByClass(
public static function getFieldTypeByInstance(ilDclBaseFieldModel $field): string
{
global $DIC;
$component_factory = $DIC["component.factory"];
$component_repository = $DIC["component.repository"];
$datatype = $field->getDatatype();

if (!empty(self::$field_type_cache[$datatype->getId()])) {
if ($datatype->getId() == ilDclDatatype::INPUTFORMAT_PLUGIN) {
if (!empty(self::$field_type_cache[$datatype->getId()][$field->getId()])) {
return self::$field_type_cache[$datatype->getId()][$field->getId()];
}
} else {
return self::$field_type_cache[$datatype->getId()];
}
return self::$field_type_cache[$datatype->getId()];
}

if ($datatype->getId() == ilDclDatatype::INPUTFORMAT_PLUGIN) {
if ($field->hasProperty(ilDclBaseFieldModel::PROP_PLUGIN_HOOK_NAME)) {
$pd = $component_repository->getPluginByName($field->getProperty(ilDclBaseFieldModel::PROP_PLUGIN_HOOK_NAME));
$plugin_data = $component_factory->getPlugin($pd->getId());
$fieldtype = $plugin_data->getPluginClassPrefix() . ucfirst($plugin_data->getPluginName());
if (ilDclFieldTypePlugin::isPluginDatatype($datatype->getTitle())) {
$plugin_id = ilDclFieldTypePlugin::getPluginId($datatype->getTitle());
if ($DIC["component.repository"]->hasActivatedPlugin($plugin_id)) {
$fieldtype = 'il' . $DIC["component.repository"]->getPluginById($plugin_id)->getName();
} else {
$fieldtype = self::$default_prefix . ucfirst(self::parseDatatypeTitle($datatype->getTitle()));
$fieldtype = '';
}
self::$field_type_cache[$datatype->getId()][$field->getId()] = $fieldtype;
} else {
$fieldtype = self::$default_prefix . ucfirst(self::parseDatatypeTitle($datatype->getTitle()));
self::$field_type_cache[$datatype->getId()] = $fieldtype;
}

self::$field_type_cache[$datatype->getId()] = $fieldtype;
return $fieldtype;
}

@@ -269,33 +250,18 @@ public static function getClassByInstance(ilDclBaseFieldModel $field, string $cl
public static function getClassPathByInstance(ilDclBaseFieldModel $field, string $class_pattern): string
{
global $DIC;
$component_factory = $DIC["component.factory"];
$component_repository = $DIC["component.repository"];
$datatype = $field->getDatatype();

if ($field->getId() != null && !empty(self::$class_path_cache[$field->getId()][$class_pattern])) {
return self::$class_path_cache[$field->getId()][$class_pattern];
}

if ($datatype->getId() == ilDclDatatype::INPUTFORMAT_PLUGIN) {
if ($field->hasProperty(ilDclBaseFieldModel::PROP_PLUGIN_HOOK_NAME)) {
if (!$component_repository->getPluginSlotById(ilDclFieldTypePlugin::SLOT_ID)->hasPluginName($field->getProperty(ilDclBaseFieldModel::PROP_PLUGIN_HOOK_NAME))) {
throw new ilDclException(
"Something went wrong by initializing the FieldHook-Plugin '"
. $field->getProperty(ilDclBaseFieldModel::PROP_PLUGIN_HOOK_NAME) . "' on Component '"
. ilDclFieldTypePlugin::COMPONENT_NAME . "' with slot '" . ilDclFieldTypePlugin::SLOT_ID . "' on field: "
. $field->getTitle()
);
}
$pd = $component_repository->getPluginByName($field->getProperty(ilDclBaseFieldModel::PROP_PLUGIN_HOOK_NAME));
$plugin_data = $component_factory->getPlugin($pd->getId());

$class_path = $plugin_data->getDirectory() . "/classes/";
if (ilDclFieldTypePlugin::isPluginDatatype($datatype->getTitle())) {
$plugin_id = ilDclFieldTypePlugin::getPluginId($datatype->getTitle());
if ($DIC["component.repository"]->hasActivatedPlugin($plugin_id)) {
$class_path = $DIC["component.repository"]->getPluginById($plugin_id)->getPath() . '/classes/';
} else {
$class_path = sprintf(
self::$field_base_path_patter,
ucfirst(self::parseDatatypeTitle($datatype->getTitle()))
);
return '';
}
} else {
$class_path = sprintf(
13 changes: 2 additions & 11 deletions Modules/DataCollection/classes/Fields/class.ilDclFieldListGUI.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,18 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclFieldListGUI
{
protected ilCtrl $ctrl;
Original file line number Diff line number Diff line change
@@ -14,19 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclFieldListTableGUI
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @extends ilTable2GUI
* @ilCtrl_Calls ilDateTime
*/
class ilDclFieldListTableGUI extends ilTable2GUI
{
private $order = null;
@@ -50,6 +39,7 @@ public function __construct(ilDclFieldListGUI $a_parent_obj, string $a_parent_cm

$this->parent_obj = $a_parent_obj;
$this->table = ilDclCache::getTableCache($table_id);
$this->table->showInvalidFields(true);

$this->setId('dcl_field_list');
$this->addColumn('', '', '1', true);
@@ -255,7 +245,7 @@ public function fillRowFromObject(ilDclBaseFieldModel $a_set): void

$this->tpl->setVariable('TITLE', $a_set->getTitle());
$this->tpl->setVariable('DESCRIPTION', $a_set->getDescription());
$this->tpl->setVariable('DATATYPE', $a_set->getDatatypeTitle());
$this->tpl->setVariable('DATATYPE', $a_set->getPresentationTitle());

if (!$a_set->isStandardField()) {
switch ($a_set->isUnique()) {
@@ -282,7 +272,9 @@ public function fillRowFromObject(ilDclBaseFieldModel $a_set): void
$this->parent_obj->getDataCollectionObject()->getRefId(),
$this->table->getId()
)) {
$alist->addItem($lng->txt('edit'), 'edit', $ilCtrl->getLinkTargetByClass('ildclfieldeditgui', 'edit'));
if (in_array($a_set->getDatatypeId(), array_keys(ilDclDatatype::getAllDatatype()))) {
$alist->addItem($lng->txt('edit'), 'edit', $ilCtrl->getLinkTargetByClass('ildclfieldeditgui', 'edit'));
}
$alist->addItem(
$lng->txt('delete'),
'delete',
11 changes: 4 additions & 7 deletions Modules/DataCollection/classes/Helpers/class.ilDclCache.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclCache
* @author Oskar Truffer <ot@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
class ilDclCache
{
public const TYPE_DATACOLLECTION = 'dcl';
@@ -97,6 +92,8 @@ protected static function initCloneMapping(): void
public static function getCloneOf(int $id, string $type): ?object
{
$type_cache = self::$clone_mapping[$type];
$clone_id = null;

if (!is_array($type_cache)) {
return null;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclCheckboxInputGUI
* @author Stefan Wanzenried <sw@studer-raimann.ch>
*/
class ilDclCheckboxInputGUI extends ilCheckboxInputGUI
{
public function checkInput(): bool
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
/**
* Class ilDclGenericMultiInputGUI
* @author Michael Herren <mh@studer-raimann.ch>
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
*********************************************************************/

class ilDclGenericMultiInputGUI extends ilFormPropertyGUI
{
public const HOOK_IS_LINE_REMOVABLE = "hook_is_line_removable";
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* @author Michael Herren <mh@studer-raimann.ch>
*/
class ilDclLinkButton extends ilLinkButton
{
public const TYPE_DATACOLLECTION_LINK = 99;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclMultiTextInputGUI
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclMultiTextInputGUI extends ilMultipleTextsInputGUI
{
public function setValues($values): void
Original file line number Diff line number Diff line change
@@ -17,9 +17,6 @@
*********************************************************************/

/**
* Class ilDclPropertyFormGUI
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
* @ilCtrl_Calls ilDclPropertyFormGUI: ilFormPropertyDispatchGUI
*/
class ilDclPropertyFormGUI extends ilPropertyFormGUI
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclRecordQueryObject
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclRecordQueryObject
{
protected string $selectStatement = "";
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTextInputGUI
* @author Stefan Wanzenried <sw@studer-raimann.ch>
*/
class ilDclTextInputGUI extends ilTextInputGUI
{
public function setValueByArray(array $a_values): void
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,11 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
/**
* @author martin@fluxlabs.ch
*/
*********************************************************************/

interface ilDataCollectionAccessPort
{
public function hasVisibleOrReadPermission(int $refId): bool;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,11 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
/**
* @author martin@fluxlabs.ch
*/
*********************************************************************/

interface ilDataCollectionOutboundsPort
{
public function getDataCollectionUi(): ilDataCollectionUiPort;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,11 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
/**
* @author martin@fluxlabs.ch
*/
*********************************************************************/

interface ilDataCollectionEndpointPort
{
public function getListTablesLink(): string;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,11 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
/**
* @author martin@fluxlabs.ch
*/
*********************************************************************/

interface ilDataCollectionGuiClassFactoryPort
{
public function getIlInfoScreenGUI(): ilDataCollectionGuiClassPort;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* @author martin@fluxlabs.ch
*/
interface ilDataCollectionGuiClassPort
{
public function getLowerCaseGuiClassName(): string;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* @author martin@fluxlabs.ch
*/
interface ilDataCollectionUiPort
{
public function addOnLoadJavaScriptCode(string $a_code): void;
Original file line number Diff line number Diff line change
@@ -17,12 +17,51 @@
*********************************************************************/

use ILIAS\Setup;
use ILIAS\Setup\Config;
use ILIAS\Setup\Objective;
use ILIAS\Setup\Metrics\Storage;
use ILIAS\Setup\Objective\NullObjective;
use ILIAS\Refinery\Transformation;

class ilDataCollectionAgent extends Setup\Agent\NullAgent
class ilDataCollectionAgent implements Setup\Agent
{
public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
public function getUpdateObjective(Config $config = null): Objective
{
return new \ilDatabaseUpdateStepsExecutedObjective(new ilDataCollectionDBUpdateSteps());
return new ilDataCollectionObjective(new ilDataCollectionDBUpdateSteps());
}

public function hasConfig(): bool
{
return false;
}

public function getArrayToConfigTransformation(): Transformation
{
throw new LogicException(self::class . " has no config.");
}

public function getInstallObjective(Config $config = null): Objective
{
return new NullObjective();
}

public function getBuildArtifactObjective(): Objective
{
return new NullObjective();
}

public function getStatusObjective(Storage $storage): Objective
{
return new NullObjective();
}

public function getMigrations(): array
{
return [];
}

public function getNamedObjectives(?Config $config = null): array
{
return [];
}
}
Original file line number Diff line number Diff line change
@@ -18,9 +18,9 @@

class ilDataCollectionDBUpdateSteps implements \ilDatabaseUpdateSteps
{
protected \ilDBInterface $db;
protected ilDBInterface $db;

public function prepare(\ilDBInterface $db): void
public function prepare(ilDBInterface $db): void
{
$this->db = $db;
}
@@ -145,4 +145,103 @@ public function step_10(): void
{
$this->db->manipulate('UPDATE il_dcl_field_prop SET value = "" WHERE value IS NULL');
}

public function step_11(): void
{
if ($this->db->tableExists('il_dcl_field_prop_b')) {
$this->db->dropTable('il_dcl_field_prop_b');
}

if ($this->db->tableExists('il_dcl_field_prop_s_b')) {
$this->db->dropTable('il_dcl_field_prop_s_b');
}
}

public function step_12(): void
{
global $DIC;
$slot = $DIC['component.repository']->getPluginSlotById(ilDclFieldTypePlugin::SLOT_ID);
foreach ($slot->getPlugins() as $plugin) {
$plugin = $DIC['component.factory']->getPlugin($plugin->getId());
$field_type_name = ilDclFieldTypePlugin::getDataType($plugin->getId());

$field_ids = [];
$stmt = $this->db->queryF(
'SELECT field_id FROM il_dcl_field_prop WHERE name = "plugin_hook_name" AND value = %s',
[ilDBConstants::T_TEXT],
[$plugin->getPluginName()]
);
while ($row = $this->db->fetchAssoc($stmt)) {
$field_ids[] = (int) $row['field_id'];
}

$id = 0;
$stmt = $this->db->queryF('SELECT id FROM il_dcl_datatype WHERE title LIKE %s', [ilDBConstants::T_TEXT], [$field_type_name]);
while ($row = $this->db->fetchAssoc($stmt)) {
$id = (int) $row['id'];
}
if ($id === 0) {
$type = $plugin->getStorageLocation();
$field_model_class = 'il' . $plugin->getPluginName() . 'FieldModel';
$type = (new $field_model_class())->getStorageLocationOverride() ?? $plugin->getStorageLocation();

$this->db->manipulateF(
'INSERT INTO il_dcl_datatype (id, title, ildb_type, storage_location, sort) SELECT GREATEST(MAX(id), 1000) + 1, %s, %s, %s, GREATEST(MAX(sort), 10000) + 10 FROM il_dcl_datatype;',
[
ilDBConstants::T_TEXT,
ilDBConstants::T_TEXT,
ilDBConstants::T_INTEGER
],
[
$field_type_name,
ilDclFieldTypePlugin::DB_TYPES[$type],
$type
]
);
$stmt = $this->db->queryF('SELECT id FROM il_dcl_datatype WHERE title LIKE %s', [ilDBConstants::T_TEXT], [$field_type_name]);
$id = (int) $this->db->fetchAssoc($stmt)['id'];
}

foreach ($field_ids as $field_id) {
$this->db->manipulateF(
'UPDATE il_dcl_field SET datatype_id = %s WHERE id = %s',
[ilDBConstants::T_INTEGER, ilDBConstants::T_INTEGER],
[$id, $field_id]
);
}

$this->db->manipulateF(
'DELETE FROM il_dcl_field_prop WHERE name = "plugin_hook_name" AND value = %s',
[ilDBConstants::T_TEXT],
[$plugin->getPluginName()]
);
}
$this->db->manipulateF(
'DELETE FROM il_dcl_datatype WHERE id = %s',
[ilDBConstants::T_TEXT],
[ilDclDatatype::INPUTFORMAT_PLUGIN]
);
}

public function step_13(): void
{
$id = false;
$stmt = $this->db->queryF('SELECT id FROM il_dcl_datatype WHERE id LIKE %s', [ilDBConstants::T_INTEGER], [17]);
if ($row = $this->db->fetchAssoc($stmt)) {
$id = true;
}

if (!$id) {
$this->db->insert(
'il_dcl_datatype',
[
'id' => [ilDBConstants::T_INTEGER, 17],
'title' => [ilDBConstants::T_TEXT, 'copy'],
'ildb_type' => [ilDBConstants::T_TEXT, ilDBConstants::T_TEXT],
'storage_location' => [ilDBConstants::T_INTEGER, 1],
'sort' => [ilDBConstants::T_INTEGER, 85],
]
);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

declare(strict_types=1);

use ILIAS\DI\Container;
use ILIAS\Setup\Environment;

class ilDataCollectionObjective extends ilDatabaseUpdateStepsExecutedObjective
{
/** @var ilDataCollectionDBUpdateSteps */
protected ilDatabaseUpdateSteps $steps;

public function __construct(ilDatabaseUpdateSteps $steps)
{
if ($steps instanceof ilDataCollectionDBUpdateSteps) {
parent::__construct($steps);
} else {
throw new InvalidArgumentException('$steps must be instance of ilDataCollectionDBUpdateSteps');
}
}

public function getPreconditions(Environment $environment): array
{
return array_merge(
parent::getPreconditions($environment),
[
new ilComponentFactoryExistsObjective(),
new ilComponentRepositoryExistsObjective()
]
);
}

public function achieve(Environment $environment): Environment
{
global $DIC;
$DIC = new Container();
$DIC['lng'] = new ilSetupLanguage('en');
$DIC['ilDB'] = $environment->getResource(Environment::RESOURCE_DATABASE);
$DIC['component.factory'] = $environment->getResource(Environment::RESOURCE_COMPONENT_FACTORY);
$DIC['component.repository'] = $environment->getResource(Environment::RESOURCE_COMPONENT_REPOSITORY);
return parent::achieve($environment);
}
}
62 changes: 34 additions & 28 deletions Modules/DataCollection/classes/Table/class.ilDclTable.php
Original file line number Diff line number Diff line change
@@ -16,16 +16,6 @@
*
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclTable
{
protected int $id = 0;
@@ -86,6 +76,7 @@ class ilDclTable
protected ILIAS\Refinery\Factory $refinery;
protected ilObjUser $user;
protected ilDBInterface $db;
protected bool $show_invalid = false;

public function __construct(int $a_id = 0)
{
@@ -401,7 +392,9 @@ protected function loadCustomFields(): void
$fields = [];
while ($rec = $this->db->fetchAssoc($set)) {
$field = ilDclCache::buildFieldFromRecord($rec);
$fields[] = $field;
if ($this->show_invalid || in_array($field->getDatatypeId(), array_keys(ilDclDatatype::getAllDatatype()))) {
$fields[] = $field;
}
}
$this->fields = $fields;

@@ -536,23 +529,18 @@ public function getFirstTableViewId(int $ref_id, int $user_id = 0, bool $with_de
*/
public function getFieldsForFormula(): array
{
$unsupported = [
ilDclDatatype::INPUTFORMAT_ILIAS_REF,
ilDclDatatype::INPUTFORMAT_FORMULA,
ilDclDatatype::INPUTFORMAT_MOB,
ilDclDatatype::INPUTFORMAT_REFERENCELIST,
ilDclDatatype::INPUTFORMAT_REFERENCE,
ilDclDatatype::INPUTFORMAT_FILE,
ilDclDatatype::INPUTFORMAT_RATING,
];

$this->loadCustomFields();
$return = $this->getStandardFields();
/**
* @var $field ilDclBaseFieldModel
*/
foreach ($this->fields as $field) {
if (!in_array($field->getDatatypeId(), $unsupported)) {
$syntax_chars = array_merge(
array_keys(ilDclExpressionParser::getOperators()),
ilDclExpressionParser::getFunctions(),
['(', ')', ',']
);
foreach ($this->getFields() as $field) {
if (in_array($field->getDatatypeId(), ilDclFormulaFieldModel::SUPPORTED_FIELDS)) {
foreach ($syntax_chars as $element) {
if (str_contains($field->getTitle(), $element)) {
continue 2;
}
}
$return[] = $field;
}
}
@@ -1049,6 +1037,9 @@ public function cloneStructure(ilDclTable $original): void
if (!$orig_field->isStandardField()) {
$class_name = get_class($orig_field);
$new_field = new $class_name();
if ($new_field instanceof ilDclReferenceFieldModel && $new_field->getFieldRef()->getTableId() === 0) {
continue;
}
$new_field->setTableId($this->getId());
$new_field->cloneStructure($orig_field->getId());
$new_fields[$orig_field->getId()] = $new_field;
@@ -1299,6 +1290,16 @@ public function getPartialRecords(
$total_record_ids = $sort_query_object->applyCustomSorting($sort_field, $total_record_ids, $direction);
}

if ($sort === 'n_comments') {
global $DIC;
$comments_nr = [];
foreach ($total_record_ids as $id) {
$comments_nr[$id] = $DIC->notes()->domain()->getNrOfCommentsForContext($DIC->notes()->data()->context($this->getObjId(), $id, 'dcl'));
}
uasort($comments_nr, static fn ($a, $b) => ($direction === 'asc' ? 1 : -1) * ($a <=> $b));
$total_record_ids = array_keys($comments_nr);
}

// Now slice the array to load only the needed records in memory
$record_ids = array_slice($total_record_ids, $offset, $limit);

@@ -1309,4 +1310,9 @@ public function getPartialRecords(

return ['records' => $records, 'total' => count($total_record_ids)];
}

public function showInvalidFields(bool $value): void
{
$this->show_invalid = $value;
}
}
12 changes: 1 addition & 11 deletions Modules/DataCollection/classes/Table/class.ilDclTableEditGUI.php
Original file line number Diff line number Diff line change
@@ -14,18 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclTableEditGUI
{
private ?int $table_id;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,15 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTableFieldSetting
* defines table/field specific settings: field_order, editable, exportable
* @author Theodor Truffer <tt@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
class ilDclTableFieldSetting extends ActiveRecord
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTableHelper
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
class ilDclTableHelper
{
protected int $obj_id = 0;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,9 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTableListGUI
* @author Theodor Truffer <tt@studer-raimann.ch>
* @ilCtrl_Calls ilDclTableListGUI: ilDclFieldListGUI, ilDclFieldEditGUI, ilDclTableViewGUI, ilDclTableEditGUI
*/
class ilDclTableListGUI
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTableListTableGUI
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilDclTableListTableGUI extends ilTable2GUI
{
/**
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

class ilDclDefaultValueFactory
{
public const STORAGE_LOCATION_MAPPING = [
29 changes: 18 additions & 11 deletions Modules/DataCollection/classes/TableView/class.ilDclTableView.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTableView
* @author Theodor Truffer <tt@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
class ilDclTableView extends ActiveRecord
{
/**
@@ -340,12 +335,24 @@ public function getVisibleFields(): array
*/
public function getFieldSettings(): array
{
return ilDclTableViewFieldSetting::where(
array(
$settings = ilDclTableViewFieldSetting::where(
[
'tableview_id' => $this->getId(),
'il_dcl_tfield_set.table_id' => $this->getTableId(),
)
)->innerjoin('il_dcl_tfield_set', 'field', 'field', array('field_order'))->orderBy('field_order')->get();
]
)
->innerjoin('il_dcl_tfield_set', 'field', 'field', ['field_order'])->orderBy('field_order')
->get();

$result = [];
foreach ($settings as $setting) {
$datatype = $setting->getFieldObject()->getDatatypeId();
if ($datatype === null || in_array($datatype, array_keys(ilDclDatatype::getAllDatatype()))) {
$result[] = $setting;
}
}

return $result;
}

/**
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
<?php

/**
* Class ilDclTableViewBaseDefaultValue
* @author Jannik Dolf <jd@studer-raimann.ch>
*/
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

abstract class ilDclTableViewBaseDefaultValue extends ActiveRecord
{
/**
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
<?php

/**
* Class ilDclTableViewDateDefaultValue
* @author Jannik Dolf <jd@studer-raimann.ch>
*/
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

class ilDclTableViewDateDefaultValue extends ilDclTableViewBaseDefaultValue
{
/**
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
<?php

/**
* Class ilDclTableViewEditFieldsTableGUI
* @author Theodor Truffer <tt@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

class ilDclTableViewEditFieldsTableGUI extends ilTable2GUI
{
public function __construct(ilDclTableViewEditGUI $a_parent_obj)
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
<?php

/**
* Class ilDclTableViewEditFormGUI
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

class ilDclTableViewEditFormGUI extends ilPropertyFormGUI
{
protected ilDclTableView $tableview;
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
<?php

/**
* Class ilDclTableViewEditGUI
* @author Theodor Truffer <tt@studer-raimann.ch>
* @ingroup ModulesDataCollection
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

/**
* @ilCtrl_Calls ilDclTableViewEditGUI: ilDclDetailedViewDefinitionGUI
* @ilCtrl_Calls ilDclTableViewEditGUI: ilDclCreateViewDefinitionGUI
* @ilCtrl_Calls ilDclTableViewEditGUI: ilDclEditViewDefinitionGUI
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,15 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTableViewFieldSetting
* defines tableview/field specific settings: visible, in_filter, filter_value, filter_changeable
* @author Theodor Truffer <tt@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
class ilDclTableViewFieldSetting extends ActiveRecord
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,13 +14,9 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTableViewGUI
* @author Theodor Truffer <tt@studer-raimann.ch>
* @ingroup ModulesDataCollection
* @ilCtrl_Calls ilDclTableViewGUI: ilDclTableViewEditGUI
*/
class ilDclTableViewGUI
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
<?php

/**
* Class ilDclBaseTableViewDefaultValue
* @author Jannik Dolf <jd@studer-raimann.ch>
*/
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

class ilDclTableViewNumberDefaultValue extends ilDclTableViewBaseDefaultValue
{
/**
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclTableViewTableGUI
* @author Theodor Truffer <tt@studer-raimann.ch>
* @ingroup ModulesDataCollection
*/
class ilDclTableViewTableGUI extends ilTable2GUI
{
protected ilDclTable $table;
@@ -229,7 +224,9 @@ public function fillRowFromObject(ilDclTableView $a_set): void
}
$this->tpl->setVariable("TITLE", $a_set->getTitle());
$this->ctrl->setParameterByClass('ildcltablevieweditgui', 'tableview_id', $a_set->getId());
$this->tpl->setVariable("TITLE_LINK", $this->ctrl->getLinkTargetByClass('ildcltablevieweditgui'));
$this->tpl->setVariable("TITLE_LINK", $this->ctrl->getLinkTargetByClass(
[ilDclTableListGUI::class, ilDclTableViewGUI::class, ilDclTableViewEditGUI::class]
));
$this->tpl->setVariable("DESCRIPTION", $a_set->getDescription());

$icon = $this->factory->symbol()->icon()->custom(ilUtil::getImagePath('icon_not_ok_monochrome.svg'), $this->lng->txt("yes"));
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
<?php

/**
* Class ilDclTableViewTextDefaultValue
* @author Jannik Dolf <jd@studer-raimann.ch>
*/
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

class ilDclTableViewTextDefaultValue extends ilDclTableViewBaseDefaultValue
{
/**
51 changes: 30 additions & 21 deletions Modules/DataCollection/classes/class.ilDataCollectionDataSet.php
Original file line number Diff line number Diff line change
@@ -16,11 +16,6 @@
*
*********************************************************************/

/**
* DataCollection dataset class
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
class ilDataCollectionDataSet extends ilDataSet
{
/**
@@ -204,29 +199,42 @@ public function importRecord(
case 'il_dcl_field':
$new_table_id = $a_mapping->getMapping('Modules/DataCollection', 'il_dcl_table', $a_rec['table_id']);
if ($new_table_id) {
$field = new ilDclBaseFieldModel();
$field->setTableId($new_table_id);
$field->setDatatypeId($a_rec['datatype_id']);
$field->setTitle($a_rec['title']);
$field->setDescription($a_rec['description']);
$field->setUnique($a_rec['is_unique']);
$field->doCreate();
$a_mapping->addMapping('Modules/DataCollection', 'il_dcl_field', $a_rec['id'], $field->getId());
// Check if this field was used as default order by, if so, update to new id
$table = ilDclCache::getTableCache($new_table_id);
if ($table && $table->getDefaultSortField() == $a_rec['id']) {
$table->setDefaultSortField($field->getId());
$table->doUpdate();
$datatype_id = $a_rec['datatype_id'];
$datatype = $a_rec['datatype_title'] ?? null;
$datatypes = ilDclDatatype::getAllDatatype();
if ($datatype !== null && ilDclFieldTypePlugin::isPluginDatatype($datatype)) {
$datatype_id = null;
foreach ($datatypes as $dt) {
if ($dt->getTitle() === $datatype) {
$datatype_id = $dt->getId();
}
}
}
if (in_array($datatype_id, array_keys($datatypes))) {
$field = new ilDclBaseFieldModel();
$field->setTableId($new_table_id);
$field->setDatatypeId($datatype_id);
$field->setTitle($a_rec['title']);
$field->setDescription($a_rec['description']);
$field->setUnique($a_rec['is_unique']);
$field->doCreate();
$a_mapping->addMapping('Modules/DataCollection', 'il_dcl_field', $a_rec['id'], $field->getId());
// Check if this field was used as default order by, if so, update to new id
$table = ilDclCache::getTableCache($new_table_id);
if ($table && $table->getDefaultSortField() == $a_rec['id']) {
$table->setDefaultSortField($field->getId());
$table->doUpdate();
}
}
}
break;
case 'il_dcl_tfield_set':
$new_table_id = $a_mapping->getMapping('Modules/DataCollection', 'il_dcl_table', $a_rec['table_id']);
$new_field_id = $a_mapping->getMapping('Modules/DataCollection', 'il_dcl_field', $a_rec['field']);
if ($new_table_id) {
if ($new_table_id && $new_field_id) {
$setting = ilDclTableFieldSetting::getInstance(
$new_table_id,
$new_field_id ?: $a_rec['field']
$new_field_id
);
$setting->setFieldOrder($a_rec['field_order']);
$setting->setExportable($a_rec['exportable']);
@@ -599,6 +607,7 @@ protected function getTypes(string $a_entity, string $a_version): array
'title' => 'text',
'description' => 'text',
'datatype_id' => 'integer',
'datatype_title' => 'text',
'is_unique' => 'integer',
];
case 'il_dcl_tview_set':
@@ -707,7 +716,7 @@ protected function getDependencies(
'integer'
));
$ids_records = $this->buildCache('il_dcl_record', $set);
$set = $this->db->query('SELECT * FROM il_dcl_field WHERE table_id = ' . $this->db->quote(
$set = $this->db->query('SELECT il_dcl_field.*, il_dcl_datatype.title as datatype_title FROM il_dcl_field INNER JOIN il_dcl_datatype ON il_dcl_field.datatype_id = il_dcl_datatype.id WHERE table_id = ' . $this->db->quote(
$a_rec['id'],
'integer'
));
Original file line number Diff line number Diff line change
@@ -16,11 +16,6 @@
*
*********************************************************************/

/**
* Class ilDataCollectionExporter
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
class ilDataCollectionExporter extends ilXmlExporter
{
protected ilDataCollectionDataSet $ds;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,18 +14,11 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

include_once("./Services/UICore/lib/html-it/IT.php");
include_once("./Services/UICore/lib/html-it/ITX.php");

/**
* special template class to simplify handling of ITX/PEAR
* @author Stefan Kesseler <skesseler@databay.de>
* @author Sascha Hofmann <shofmann@databay.de>
* @version $Id$
*/
class ilDataCollectionGlobalTemplate implements ilGlobalTemplateInterface
{
protected $tree_flat_link = "";
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDataCollectionImporter
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
class ilDataCollectionImporter extends ilXmlImporter
{
protected ilDataCollectionDataSet $ds;
9 changes: 3 additions & 6 deletions Modules/DataCollection/classes/class.ilDclExportGUI.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
/**
* Export User Interface Class
* @author Michael Herren <mh@studer-raimann.ch>
*/
*********************************************************************/

class ilDclExportGUI extends ilExportGUI
{
protected function buildExportTableGUI(): ilExportTableGUI
9 changes: 3 additions & 6 deletions Modules/DataCollection/classes/class.ilDclExportTableGUI.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,12 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
/**
* Export User Interface Class
* @author Michael Herren <mh@studer-raimann.ch>
*/
*********************************************************************/

class ilDclExportTableGUI extends ilExportTableGUI
{
public function __construct(ilDclExportGUI $a_parent_obj, string $a_parent_cmd, ilObject $a_exp_obj)
9 changes: 1 addition & 8 deletions Modules/DataCollection/classes/class.ilObjDataCollection.php
Original file line number Diff line number Diff line change
@@ -16,13 +16,6 @@
*
*********************************************************************/

/**
* Class ilObjDataCollection
* @author Jörg Lützenkirchen <luetzenkirchen@leifos.com>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @version $Id: class.ilObjFolder.php 25528 2010-09-03 10:37:11Z smeyer $
* @extends ilObject2
*/
class ilObjDataCollection extends ilObject2
{
private bool $is_online = false;
@@ -209,7 +202,7 @@ public function sendNotification($a_action, $a_table_id, $a_record_id = null)
$message .= $this->prepareMessageText($t);
}
$message .= "------------------------------------\n";
$message .= $ulng->txt('dcl_changed_by') . ": " . $ilUser->getFullname() . " " . ilUserUtil::getNamePresentation($ilUser->getId())
$message .= $ulng->txt('dcl_changed_by') . ": " . ilUserUtil::getNamePresentation($ilUser->getId())
. "\n\n";
$message .= $ulng->txt('dcl_change_notification_link') . ": " . $link . "\n\n";

Original file line number Diff line number Diff line change
@@ -14,17 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilObjDataCollectionAccess
* @author Jörg Lützenkirchen <luetzenkirchen@leifos.com>
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @version $Id: class.ilObjDataCollectionAccess.php 15678 2008-01-06 20:40:55Z akill $
*/
class ilObjDataCollectionAccess extends ilObjectAccess
{
/**
Original file line number Diff line number Diff line change
@@ -17,13 +17,6 @@
*********************************************************************/

/**
* Class ilObjDataCollectionGUI
* @author Jörg Lützenkirchen <luetzenkirchen@leifos.com>
* @author Martin Studer <martin@fluxlabs.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @author Stefan Wanzenried <sw@studer-raimann.ch>
* @ilCtrl_Calls ilObjDataCollectionGUI: ilInfoScreenGUI, ilNoteGUI, ilCommonActionDispatcherGUI
* @ilCtrl_Calls ilObjDataCollectionGUI: ilPermissionGUI, ilObjectCopyGUI, ilDclExportGUI
* @ilCtrl_Calls ilObjDataCollectionGUI: ilDclRecordListGUI, ilDclRecordEditGUI
@@ -33,7 +26,6 @@
* @ilCtrl_Calls ilObjDataCollectionGUI: ilRatingGUI
* @ilCtrl_Calls ilObjDataCollectionGUI: ilPropertyFormGUI
* @ilCtrl_Calls ilObjDataCollectionGUI: ilDclPropertyFormGUI
* @extends ilObject2GUI
*/
class ilObjDataCollectionGUI extends ilObject2GUI
{
Original file line number Diff line number Diff line change
@@ -14,16 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilObjDataCollectionListGUI
* @author Jörg Lützenkirchen <luetzenkirchen@leifos.com>
* @author Fabian Schmid <fs@studer-raimann.ch>
* $Id: class.ilObjRootFolderListGUI.php 23764 2010-05-06 15:11:30Z smeyer $
* @extends ilObjectListGUI
*/
class ilObjDataCollectionListGUI extends ilObjectListGUI
{
/**
9 changes: 2 additions & 7 deletions Modules/DataCollection/exceptions/class.ilDclException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
@@ -13,14 +14,8 @@
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
********************************************************************
*/
*********************************************************************/

/**
* Class ilDclException
* @author Michael Herren <mh@studer-raimann.ch>
* @version 1.0.0
*/
class ilDclException extends ilException
{
public function __construct($a_message, $a_code = 0)
16 changes: 5 additions & 11 deletions Modules/DataCollection/exceptions/class.ilDclInputException.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
********************************************************************
*/
*
*********************************************************************/

/**
* Class ilDclBaseFieldModel
* @author Martin Studer <ms@studer-raimann.ch>
* @author Marcel Raimann <mr@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
* @author Oskar Truffer <ot@studer-raimann.ch>
* @version $Id:
* @ingroup ModulesDataCollection
*/
class ilDclInputException extends ilException
{
public const TYPE_EXCEPTION = 0;
17 changes: 13 additions & 4 deletions Modules/DataCollection/js/datacollection.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
/**
* ilDataCollection JS
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* @author Oskar Truffer <ot@studer-raimann.ch>
* @author Fabian Schmid <fs@studer-raimann.ch>
*/
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

$(document).ready(function () {
var dcl = {};
16 changes: 16 additions & 0 deletions Modules/DataCollection/js/generic_multi_line_input.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

il = il || {};
il.DataCollection = il.DataCollection || {};

Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<tr class="{CSS_ROW}" id="{ID}">
<td class="name">{TITLE}</td>
<td class="std">
<input style="margin-top: -3px; vertical-align: middle" type="radio" id="v_{FIELD_ID}"
name="RadioGroup_{FIELD_ID}" value="VisibleCreate_{FIELD_ID}" {HIDDEN} {IS_VISIBLE}>
<label style="margin-top: 4px; margin-right: 10px" for="v_{FIELD_ID}" {HIDDEN}>{TEXT_VISIBLE}</label>
<input style="margin-top: -3px; vertical-align: middle" type="radio" id="rv_{FIELD_ID}"
name="RadioGroup_{FIELD_ID}" value="RequiredCreate_{FIELD_ID}" {HIDDEN} {IS_REQUIRED}>
<label style="margin-top: 4px; margin-right: 10px" for="rv_{FIELD_ID}" {HIDDEN}>{TEXT_REQUIRED_VISIBLE}</label>
<input style="margin-top: -3px; vertical-align: middle" type="radio" id="lv_{FIELD_ID}"
name="RadioGroup_{FIELD_ID}" value="LockedCreate_{FIELD_ID}" {HIDDEN} {IS_LOCKED}>
<label style="margin-top: 4px; margin-right: 10px" for="lv_{FIELD_ID}" {HIDDEN}>{TEXT_LOCKED_VISIBLE}</label>
<input style="margin-top: -3px; vertical-align: middle" type="radio" id="nv_{FIELD_ID}"
name="RadioGroup_{FIELD_ID}" value="NotVisibleCreate_{FIELD_ID}" {HIDDEN} {IS_NOT_VISIBLE}>
<label for="nv_{FIELD_ID}" {HIDDEN}>{TEXT_NOT_VISIBLE}</label>
<td class="std" style="display: flex;gap: 14px";>
<label for="v_{FIELD_ID}" {HIDDEN}>
<input type="radio" id="v_{FIELD_ID}" name="RadioGroup_{FIELD_ID}" value="VisibleCreate_{FIELD_ID}" {HIDDEN} {IS_VISIBLE}>
{TEXT_VISIBLE}
</label>
<label for="rv_{FIELD_ID}" {HIDDEN}>
<input type="radio" id="rv_{FIELD_ID}" name="RadioGroup_{FIELD_ID}" value="RequiredCreate_{FIELD_ID}" {HIDDEN} {IS_REQUIRED}>
{TEXT_REQUIRED_VISIBLE}
</label>
<label for="lv_{FIELD_ID}" {HIDDEN}>
<input type="radio" id="lv_{FIELD_ID}" name="RadioGroup_{FIELD_ID}" value="LockedCreate_{FIELD_ID}" {HIDDEN} {IS_LOCKED}>
{TEXT_LOCKED_VISIBLE}
</label>
<label for="nv_{FIELD_ID}" {HIDDEN}>
<input type="radio" id="nv_{FIELD_ID}" name="RadioGroup_{FIELD_ID}" value="NotVisibleCreate_{FIELD_ID}" {HIDDEN} {IS_NOT_VISIBLE}>
{TEXT_NOT_VISIBLE}
</label>
</td>
<td class="std">
{EXTRA_INPUT}
Original file line number Diff line number Diff line change
@@ -13,19 +13,23 @@

<tr class="{CSS_ROW}" id="{ID}">
<td class="name">{TITLE}</td>
<td class="std">
<input style="margin-top: -3px; vertical-align: middle" type="radio" id="v_{FIELD_ID}"
name="RadioGroup_{FIELD_ID}" value="VisibleEdit_{FIELD_ID}" {HIDDEN} {IS_VISIBLE}>
<label style="margin-top: 4px; margin-right: 10px" for="v_{FIELD_ID}" {HIDDEN}>{TEXT_VISIBLE}</label>
<input style="margin-top: -3px; vertical-align: middle" type="radio" id="rv_{FIELD_ID}"
name="RadioGroup_{FIELD_ID}" value="RequiredEdit_{FIELD_ID}" {HIDDEN} {IS_REQUIRED}>
<label style="margin-top: 4px; margin-right: 10px" for="rv_{FIELD_ID}" {HIDDEN}>{TEXT_REQUIRED_VISIBLE}</label>
<input style="margin-top: -3px; vertical-align: middle" type="radio" id="lv_{FIELD_ID}"
name="RadioGroup_{FIELD_ID}" value="LockedEdit_{FIELD_ID}" {HIDDEN} {IS_LOCKED}>
<label style="margin-top: 4px; margin-right: 10px" for="lv_{FIELD_ID}" {HIDDEN}>{TEXT_LOCKED_VISIBLE}</label>
<input style="margin-top: -3px; vertical-align: middle" type="radio" id="nv_{FIELD_ID}"
name="RadioGroup_{FIELD_ID}" value="NotVisibleEdit_{FIELD_ID}" {HIDDEN} {IS_NOT_VISIBLE}>
<label style="margin-top: 4px; margin-right: 10px" for="nv_{FIELD_ID}" {HIDDEN}>{TEXT_NOT_VISIBLE}</label>
<td class="std" style="display: flex;gap: 14px";>
<label for="v_{FIELD_ID}" {HIDDEN}>
<input type="radio" id="v_{FIELD_ID}" name="RadioGroup_{FIELD_ID}" value="VisibleEdit_{FIELD_ID}" {HIDDEN} {IS_VISIBLE}>
{TEXT_VISIBLE}
</label>
<label for="rv_{FIELD_ID}" {HIDDEN}>
<input type="radio" id="rv_{FIELD_ID}" name="RadioGroup_{FIELD_ID}" value="RequiredEdit_{FIELD_ID}" {HIDDEN} {IS_REQUIRED}>
{TEXT_REQUIRED_VISIBLE}
</label>
<label for="lv_{FIELD_ID}" {HIDDEN}>
<input type="radio" id="lv_{FIELD_ID}" name="RadioGroup_{FIELD_ID}" value="LockedEdit_{FIELD_ID}" {HIDDEN} {IS_LOCKED}>
{TEXT_LOCKED_VISIBLE}
</label>
<label for="nv_{FIELD_ID}" {HIDDEN}>
<input type="radio" id="nv_{FIELD_ID}" name="RadioGroup_{FIELD_ID}" value="NotVisibleEdit_{FIELD_ID}" {HIDDEN} {IS_NOT_VISIBLE}>
{TEXT_NOT_VISIBLE}
</label>
</td>
</tr>

20 changes: 16 additions & 4 deletions Modules/DataCollection/test/ilModulesDataCollectionSuite.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

use PHPUnit\Framework\TestSuite;

/**
* Class ilModulesDataCollectionSuite
* @author Theodor Truffer <tt@studer-raimann.ch>
*/
class ilModulesDataCollectionSuite extends TestSuite
{
public static function suite()
20 changes: 10 additions & 10 deletions Modules/EmployeeTalk/classes/Talk/class.ilEmployeeTalkTableGUI.php
Original file line number Diff line number Diff line change
@@ -188,8 +188,8 @@ public function setTalkData(array $talks): void
continue;
}

if ($filter['etal_employee'] !== "") {
$filterUser = ilObjUser::getUserIdByLogin($filter['etal_employee']);
if (trim($filter['etal_employee']) !== "") {
$filterUser = ilObjUser::getUserIdByLogin(trim($filter['etal_employee']));
if ($val->getEmployee() !== $filterUser) {
continue;
}
@@ -208,15 +208,15 @@ public function setTalkData(array $talks): void
$employeeName = ilObjUser::_lookupLogin($talkData->getEmployee());
}

if ($filter['etal_superior'] !== "") {
$filterUser = ilObjUser::getUserIdByLogin($filter['etal_superior']);
if (trim($filter['etal_superior']) !== "") {
$filterUser = ilObjUser::getUserIdByLogin(trim($filter['etal_superior']));
if (intval($talk->getOwner()) !== $filterUser) {
continue;
}
}

if ($filter['etal_title'] !== "") {
if (strpos($talk->getTitle(), $filter['etal_title']) === false) {
if (trim($filter['etal_title']) !== "") {
if (strpos(strtolower($talk->getTitle()), strtolower(trim($filter['etal_title']))) === false) {
continue;
}
}
@@ -241,12 +241,12 @@ public function setTalkData(array $talks): void
}

$template_title = '';
if ($talkData->getTemplateId() > 0) {
if ($talkData->getTemplateId() > 0 && ilObject::_exists($talkData->getTemplateId())) {
$template = ilObjectFactory::getInstanceByObjId($talkData->getTemplateId());
$template_title = $template->getTitle();
}
if ($filter['etal_template'] !== "") {
if (strpos($template_title, $filter['etal_template']) === false) {
if (trim($filter['etal_template']) !== "") {
if (strpos(strtolower($template_title), strtolower(trim($filter['etal_template']))) === false) {
continue;
}
}
@@ -265,7 +265,7 @@ public function setTalkData(array $talks): void
}

$offset = intval($this->getOffset());
$limit = intval($this->getLimit()) + 1;
$limit = intval($this->getLimit());

$this->setMaxCount(count($data));

Original file line number Diff line number Diff line change
@@ -331,7 +331,7 @@ protected function parseRow(

$lcomment = new ilTextAreaInputGUI($this->lng->txt("exc_comment_for_learner"), "lcomment_" . $a_ass->getId() . "_" . $a_user_id);
$lcomment->setInfo($this->lng->txt("exc_comment_for_learner_info"));
$lcomment->setValue((string) $a_row["comment"]);
$lcomment->setValue((string) ($a_row["comment"] ?? ""));
$lcomment->setRows(10);
$lcomment_form->addItem($lcomment);

@@ -391,7 +391,7 @@ protected function parseRow(
if (!$has_no_team_yet) {
$this->tpl->setVariable(
"VAL_" . strtoupper($col),
ilLegacyFormElementsUtil::prepareFormOutput(trim($a_row[$col]))
ilLegacyFormElementsUtil::prepareFormOutput(trim($a_row[$col] ?? ""))
);
}
break;
@@ -400,7 +400,7 @@ protected function parseRow(
// see #22076
$this->tpl->setVariable(
"VAL_" . strtoupper($col),
ilLegacyFormElementsUtil::prepareFormOutput(trim($a_row[$col]))
ilLegacyFormElementsUtil::prepareFormOutput(trim($a_row[$col] ?? ""))
);
break;

@@ -409,7 +409,7 @@ protected function parseRow(
$this->tpl->setVariable("LCOMMENT_ID", $comment_id . "_snip");

// see #22076
$this->tpl->setVariable("VAL_" . strtoupper($col), (trim($a_row[$col]) !== "")
$this->tpl->setVariable("VAL_" . strtoupper($col), (trim($a_row[$col] ?? "") !== "")
? nl2br(trim($a_row[$col]))
: "&nbsp;");
break;
@@ -429,7 +429,7 @@ protected function parseRow(
}
$this->tpl->setVariable(
"VAL_" . strtoupper($col),
$a_row[$col]
($a_row[$col] ?? false)
? ilDatePresentation::formatDate(
new ilDateTime($a_row[$col], IL_CAL_DATETIME),
false,
Original file line number Diff line number Diff line change
@@ -95,9 +95,12 @@ public function interaction(
$path = null;
}
$this->logger->debug("Path: " . $path);
if (!is_null($path) && $filesystem->has($path)) {
$this->logger->debug("Delete dir: " . dirname($path));
$filesystem->deleteDir(dirname($path));
try {
if (!is_null($path) && $filesystem->has($path)) {
$this->logger->debug("Delete dir: " . dirname($path));
$filesystem->deleteDir(dirname($path));
}
} catch (Exception $e) {
}

return $download_name;
Original file line number Diff line number Diff line change
@@ -256,7 +256,8 @@ public function collectSubmissionFiles(): void

protected function isExcelNeeded(int $a_ass_type, bool $a_has_fbk): bool
{
if ($a_ass_type == ilExAssignment::TYPE_TEXT) {
if ($a_ass_type == ilExAssignment::TYPE_TEXT || $a_ass_type == ilExAssignment::TYPE_UPLOAD
|| $a_ass_type == ilExAssignment::TYPE_UPLOAD_TEAM) {
return true;
} elseif ($a_has_fbk && $a_ass_type != ilExAssignment::TYPE_UPLOAD_TEAM) {
return true;
@@ -498,6 +499,11 @@ protected function collectAssignmentData(int $assignment_id): void
$this->title_columns[] = $this->lng->txt("exc_submission_text");
break;
case ilExAssignment::TYPE_UPLOAD:
case ilExAssignment::TYPE_UPLOAD_TEAM:
if ($assignment_type === ilExAssignment::TYPE_UPLOAD_TEAM) {
$first_excel_column_for_review++;
$this->title_columns[] = $this->lng->txt("exc_team");
}
$num_columns_submission = $this->getExtraColumnsForSubmissionFiles($this->exercise_id, $assignment_id);
if ($num_columns_submission > 1) {
for ($i = 1; $i <= $num_columns_submission; $i++) {
@@ -553,6 +559,11 @@ protected function collectAssignmentData(int $assignment_id): void
}
} else {
$col = self::FIRST_DEFAULT_SUBMIT_COLUMN;
if ($assignment_type === ilExAssignment::TYPE_UPLOAD_TEAM) {
$team_id = ilExAssignmentTeam::getTeamId($this->assignment->getId(), $participant_id, false);
$this->excel->setCell($row, $col, (string) $team_id);
$col++;
}
foreach ($submission_files as $submission_file) {
$this->excel->setCell($row, self::SUBMISSION_DATE_COLUMN, $submission_file['timestamp']);

@@ -562,7 +573,9 @@ protected function collectAssignmentData(int $assignment_id): void
$this->excel->setCell($row, $col, $submission_file['filetitle']);
}
$this->excel->setColors($this->excel->getCoordByColumnAndRow($col, $row), self::BG_COLOR, self::LINK_COLOR);
$this->addLink($row, $col, $submission_file);
if ($assignment_type != ilExAssignment::TYPE_UPLOAD_TEAM) {
$this->addLink($row, $col, $submission_file);
}
$col++; //does not affect blogs and portfolios.
}
}
@@ -637,6 +650,9 @@ public function getAssignmentMembersIds(): array
" WHERE ass_id = " . $ilDB->quote($this->assignment->getId(), "integer"));

while ($rec = $ilDB->fetchAssoc($set)) {
if (!\ilObjUser::userExists([(int) $rec['usr_id']])) {
continue;
}
$members[] = $rec['usr_id'];
}

209 changes: 209 additions & 0 deletions Modules/Forum/classes/Subject/PostingReplySubjectBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

declare(strict_types=1);

class PostingReplySubjectBuilder
{
private const EXPECTED_REPLY_PREFIX_END = ':';
private const EXPECTED_NUMBER_WRAPPER_CHAR_START_PATTERN = '\\(';
private const EXPECTED_NUMBER_WRAPPER_CHAR_END_PATTERN = '\\)';
private const EXPECTED_NUMBER_WRAPPER_CHAR_START = '(';
private const EXPECTED_NUMBER_WRAPPER_CHAR_END = ')';

/** @var null|array{"strpos": \Closure(string, string, ?int=): (int|false), "strrpos": \Closure(string, string, ?int=): (int|false), "strlen": \Closure(string): int, "substr": \Closure(string, int, ?int=): string} */
private static ?array $f = null;

private string $reply_prefix;
private string $optimized_repeated_reply_prefix;

/**
* @param string $reply_prefix e.g. 'Re:'
* @param string $optimized_repeated_reply_prefix e.g. 'Re (%s):'
*/
public function __construct(string $reply_prefix, string $optimized_repeated_reply_prefix)
{
$this->reply_prefix = trim($reply_prefix);
$this->optimized_repeated_reply_prefix = trim($optimized_repeated_reply_prefix);

if (self::$f === null) {
self::$f = [
'strpos' => function (string $haystack, string $needle, ?int $offset = 0) {
return function_exists('mb_strpos') ? mb_strpos($haystack, $needle, $offset, 'UTF-8') : strpos(
$haystack,
$needle,
$offset
);
},
'strrpos' => function (string $haystack, string $needle, ?int $offset = 0) {
return function_exists('mb_strrpos') ? mb_strrpos($haystack, $needle, $offset, 'UTF-8') : strrpos(
$haystack,
$needle,
$offset
);
},
'strlen' => function (string $string): int {
return function_exists('mb_strlen') ? mb_strlen($string, 'UTF-8') : strlen($string);
},
'substr' => function (string $string, int $start, ?int $length = null): string {
return function_exists('mb_substr') ? mb_substr($string, $start, $length, 'UTF-8') : substr(
$string,
$start,
$length
);
}
];
}
}

public function build(string $subject_of_parent_posting): string
{
$subject_of_parent_posting = trim($subject_of_parent_posting);
$subject_of_reply = '';

$reply_prefix = $this->reply_prefix;
if ((self::$f['substr'])(
$reply_prefix,
-((self::$f['strlen'])(self::EXPECTED_REPLY_PREFIX_END))
) !== self::EXPECTED_REPLY_PREFIX_END) {
$reply_prefix .= self::EXPECTED_REPLY_PREFIX_END;
}

$optimized_repeated_reply_prefix = $this->optimized_repeated_reply_prefix;
if ((self::$f['substr'])(
$optimized_repeated_reply_prefix,
-((self::$f['strlen'])(self::EXPECTED_REPLY_PREFIX_END))
) !== self::EXPECTED_REPLY_PREFIX_END) {
$optimized_repeated_reply_prefix .= self::EXPECTED_REPLY_PREFIX_END;
}

$optimized_repeated_reply_prefix_start = substr_replace(
$reply_prefix,
self::EXPECTED_NUMBER_WRAPPER_CHAR_START,
(self::$f['strrpos'])($reply_prefix, self::EXPECTED_REPLY_PREFIX_END),
(self::$f['strlen'])(self::EXPECTED_REPLY_PREFIX_END)
);

$optimized_repeated_reply_prefix_begin_pattern = preg_quote(
(self::$f['substr'])(
$optimized_repeated_reply_prefix_start,
0,
(self::$f['strrpos'])(
$optimized_repeated_reply_prefix_start,
self::EXPECTED_NUMBER_WRAPPER_CHAR_START
)
),
'/'
);

$optimized_repeated_reply_prefix_regex = implode('', [
'/^',
$optimized_repeated_reply_prefix_begin_pattern,
'\s*?' . self::EXPECTED_NUMBER_WRAPPER_CHAR_START_PATTERN . '\s*?\d+\s*?' . self::EXPECTED_NUMBER_WRAPPER_CHAR_END_PATTERN,
'/'
]);

if (preg_match($optimized_repeated_reply_prefix_regex, $subject_of_parent_posting)) {
// i.e. $subj_of_parent_posting = "Re(12):" or "Re (12):"
$subject_of_reply = $this->handleSubjectStartsWithOptimizedRepetitionReplyPattern(
$subject_of_parent_posting
);
} else {
// i.e. $subj_of_parent_posting = "Re: Re: Re: ..."
$subject_of_reply = $this->handleSubjectWithoutReplyPrefixOrRepeatedReplyPrefix(
$subject_of_parent_posting,
$reply_prefix,
$optimized_repeated_reply_prefix
);
}

return $subject_of_reply;
}

private function handleSubjectWithoutReplyPrefixOrRepeatedReplyPrefix(
string $subject_of_parent_posting,
string $effective_reply_prefix,
string $effective_optimized_repeated_reply_prefix
): string {
$subject_of_reply = $subject_of_parent_posting;

$reply_prefix_start = (self::$f['substr'])(
$effective_reply_prefix,
0,
-(self::$f['strlen'])(self::EXPECTED_REPLY_PREFIX_END)
);

$repeated_reply_prefix_regex = implode('', [
'/^',
'(' . preg_quote($reply_prefix_start, '/') . '\s*' . self::EXPECTED_REPLY_PREFIX_END . '\s*)+',
'/'
]);

$matches = null;
preg_match($repeated_reply_prefix_regex, $subject_of_parent_posting, $matches);
$number_of_repetitions = isset($matches[0]) ?
preg_match_all(
'/' . preg_quote($reply_prefix_start, '/') . '\s*' . self::EXPECTED_REPLY_PREFIX_END . '\s*/',
$matches[0]
) : 0;

if ($number_of_repetitions >= 1) {
// i.e. $final_subject = "Re: Re: Re: ... " -> "Re(4):"
$number_of_repetitions++;
$subject_of_reply = sprintf(
$effective_optimized_repeated_reply_prefix,
$number_of_repetitions
) . ' ' . trim(str_replace($matches[0], '', $subject_of_parent_posting));
} elseif ($number_of_repetitions === 0) {
// the first reply to a thread
$subject_of_reply = $effective_reply_prefix . ' ' . $subject_of_parent_posting;
}

return $subject_of_reply;
}

private function handleSubjectStartsWithOptimizedRepetitionReplyPattern(string $subject_of_parent_posting): string
{
$subject_of_reply = $subject_of_parent_posting;

$wrapper_start_pos = (self::$f['strpos'])($subject_of_parent_posting, self::EXPECTED_NUMBER_WRAPPER_CHAR_START);
$wrapper_end_pos = (self::$f['strpos'])($subject_of_parent_posting, self::EXPECTED_NUMBER_WRAPPER_CHAR_END);

if ($wrapper_start_pos === false || $wrapper_end_pos === false || $wrapper_end_pos < $wrapper_start_pos) {
return $subject_of_reply;
}

$length = $wrapper_end_pos - $wrapper_start_pos;
$wrapper_start_pos++;

$txt_num_replies = (self::$f['substr'])($subject_of_parent_posting, $wrapper_start_pos, $length - 1);
if (is_numeric($txt_num_replies) && $txt_num_replies > 0) {
$number_of_replies = ((int) trim($txt_num_replies)) + 1;
$subject_of_reply = (self::$f['substr'])(
$subject_of_parent_posting,
0,
$wrapper_start_pos
) . $number_of_replies . (self::$f['substr'])(
$subject_of_parent_posting,
$wrapper_end_pos
);
}

return $subject_of_reply;
}
}
7 changes: 7 additions & 0 deletions Modules/Forum/classes/class.ilForumAppEventListener.php
Original file line number Diff line number Diff line change
@@ -554,6 +554,13 @@ public static function sendNotification(
implode(', ', $recipients)
));

if (defined('ANONYMOUS_USER_ID')) {
$recipients = array_filter(
$recipients,
static fn (int $recipient): bool => $recipient !== ANONYMOUS_USER_ID
);
}

$mailNotification = new ilForumMailEventNotificationSender($provider, $logger);
$mailNotification->setType($notificationTypes);
$mailNotification->setRecipients($recipients);
6 changes: 5 additions & 1 deletion Modules/Forum/classes/class.ilForumCronNotification.php
Original file line number Diff line number Diff line change
@@ -237,6 +237,10 @@ public function sendCronForumNotification(ilDBStatement $res, int $notification_
self::$deleted_ids_cache[$row['deleted_id']] = $row['deleted_id'];
}

if (defined('ANONYMOUS_USER_ID') && (int) $row['user_id'] === ANONYMOUS_USER_ID) {
continue;
}

$ref_id = $this->getFirstAccessibleRefIdBUserAndObjId((int) $row['user_id'], (int) $row['obj_id']);
if ($ref_id < 1) {
$this->logger->debug(
@@ -305,7 +309,7 @@ public function sendCronForumNotification(ilDBStatement $res, int $notification_
$mailNotification->send();

$this->num_sent_messages += count($provider->getCronRecipients());
$this->logger->info("Sent notifications ... ");
$this->logger->info('Sent notifications ... ');

++$i;
}
Loading