Skip to content
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Changes:

\-

## v2023-05-30-1
Fixes
- https://github.com/fluxapps/UserDefaults/issues/9
- adjustments cascade select

## v2023-02-16-1

Changes:
Expand Down
4 changes: 1 addition & 3 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
require_once __DIR__ . "/vendor/srag/dic/src/PHPVersionChecker.php";

$id = 'usrdef';
$version = "2023.02.16";
$version = "2023.05.30";
$ilias_min_version = '6.0';
$ilias_max_version = '7.999';
$responsible = 'studer + raimann ag - Team Custom 1';
$responsible_mail = 'support-custom1@studer-raimann.ch';
5 changes: 3 additions & 2 deletions src/UDFCheck/UDFCheckFormGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected function initForm() {



$select_gui = $plugin->getFormPropertyForDefinition($definition);
$select_gui = $plugin->getFormPropertyForDefinition($definition,true,null,true);

$check_radio = new ilRadioGroupInputGUI("", self::F_CHECK_RADIO);

Expand All @@ -160,6 +160,7 @@ protected function initForm() {
if (is_array($name)) {
$name=$name["name"]." ( ".$name["default"]." ) ";
}

$text_gui = new ilTextInputGUI($name, self::F_CHECK_VALUE_MUL . $key);
$check_radio_text->addSubItem($text_gui);
}
Expand Down Expand Up @@ -238,7 +239,7 @@ public function saveObject() {
if (self::isCustomUserFieldsHelperAvailable()) {
$plugin = ilCustomUserFieldsHelper::getInstance()->getPluginForType($definition["field_type"]);
if ($plugin instanceof ilUDFDefinitionPlugin) {
$select_gui = $plugin->getFormPropertyForDefinition($definition);
$select_gui = $plugin->getFormPropertyForDefinition($definition, true, null, true);
$check_values = [];
foreach ($select_gui->getColumnDefinition() as $key => $name) {
$check_values[] = $this->getInput(self::F_CHECK_VALUE_MUL . $key);
Expand Down
21 changes: 13 additions & 8 deletions src/UserSetting/UserSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use ilGroupParticipants;
use ilObjCourse;
use ilObject2;

//use ilObject;
use ilObjExercise;
use ilObjGroup;
use ilObjOrgUnit;
Expand All @@ -30,6 +32,7 @@
use srag\Plugins\UserDefaults\UDFCheck\UDFCheck;
use srag\Plugins\UserDefaults\Utils\UserDefaultsTrait;
use srag\ActiveRecordConfig\UserDefaults\Config\Config;
use ilRbacReview;

/**
* Class ilUserSetting
Expand Down Expand Up @@ -388,7 +391,6 @@ protected function unsubscribeGroups() {
if (!$this->isUnsubscrfromgrp()) {
return;
}

$groups = $this->getAssignedGroupes();
if (count($groups) === 0) {
return;
Expand All @@ -398,13 +400,16 @@ protected function unsubscribeGroups() {
if ($id === "" || ilObject2::_lookupType($id) !== "grp") {
continue;
}

$part = ilGroupParticipants::_getInstanceByObjId($id);
$usr_id = $this->getUsrObject()->getId();
if (!$part->isMember($usr_id)) {
continue;
}
$added = $part->deleteParticipants(array( $usr_id ));
$usr_id = $this->getUsrObject()->getId();
$reference=array_shift(ilObject2::_getAllReferences($id));
$groupRoles = self::dic()->rbac()->review()->getRolesOfRoleFolder($reference);
foreach ($groupRoles as $grouprole) {
if (ilObject2::_lookupTitle($grouprole) == 'il_grp_member_'.$reference) {
$memberRole = $grouprole;
self::dic()->rbac()->admin()->deassignUser($memberRole,$usr_id);
continue;
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ static function getReservedWords()
}


/**
* @inheritdoc
*/
public function primaryExistsByFields(string $table_name, array $fields) : bool
{
return $this->db->primaryExistsByFields($table_name, $fields);
}

/**
* @inheritDoc
*/
Expand Down
2 changes: 2 additions & 0 deletions vendor/srag/dic/src/Database/DatabaseDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,6 @@ public function store(string $table_name, array $values, string $primary_key_fie
return $primary_key_value;
}
}


}
4 changes: 2 additions & 2 deletions vendor/srag/dic/src/Output/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getHTML($value) : string
foreach ($value as $gui) {
$html .= $this->getHTML($gui);
}
} else {
} else {
switch (true) {
// HTML
case (is_string($value)):
Expand All @@ -67,7 +67,7 @@ public function getHTML($value) : string
$html = $value->render();
break;
case method_exists($value, "getHTML"):
$html = $value->getHTML();
$html = $value->getHTML();
break;

// Template instance
Expand Down