diff --git a/components/ILIAS/Administration/classes/class.ilAdministrationExplorerGUI.php b/components/ILIAS/Administration/classes/class.ilAdministrationExplorerGUI.php
index 0316af22e902..f6efe12b828e 100755
--- a/components/ILIAS/Administration/classes/class.ilAdministrationExplorerGUI.php
+++ b/components/ILIAS/Administration/classes/class.ilAdministrationExplorerGUI.php
@@ -72,7 +72,7 @@ public function __construct(
$white = array();
foreach ($objDefinition->getSubObjectsRecursively("root") as $rtype) {
- if ($rtype["name"] !== "itgr" && !$objDefinition->isSideBlock($rtype["name"])) {
+ if ($rtype["name"] !== "obgr" && !$objDefinition->isSideBlock($rtype["name"])) {
$white[] = $rtype["name"];
}
}
diff --git a/components/ILIAS/COPage/PC/Resources/ResourcesCommandActionHandler.php b/components/ILIAS/COPage/PC/Resources/ResourcesCommandActionHandler.php
index 895870ddc860..2cb55cea0ce6 100755
--- a/components/ILIAS/COPage/PC/Resources/ResourcesCommandActionHandler.php
+++ b/components/ILIAS/COPage/PC/Resources/ResourcesCommandActionHandler.php
@@ -83,7 +83,7 @@ protected function insertCommand(array $body): Server\Response
$res->setResourceListType("_other");
} elseif ($res_type === "_lobj") {
$res->setResourceListType("_lobj");
- } elseif ($res_type !== "itgr") {
+ } elseif ($res_type !== "obgr") {
if (isset($body["type"])) {
$res->setResourceListType(
$body["type"]
@@ -93,7 +93,7 @@ protected function insertCommand(array $body): Server\Response
}
} else {
$res->setItemGroupRefId(
- (int) $body["itgr"]
+ (int) $body["obgr"]
);
}
@@ -121,7 +121,7 @@ protected function updateCommand(array $body): Server\Response
$res->setResourceListType("_other");
} elseif ($res_type === "_lobj") {
$res->setResourceListType("_lobj");
- } elseif ($res_type !== "itgr") {
+ } elseif ($res_type !== "obgr") {
if (isset($body["type"])) {
$res->setResourceListType(
$body["type"]
@@ -131,7 +131,7 @@ protected function updateCommand(array $body): Server\Response
}
} else {
$res->setItemGroupRefId(
- (int) $body["itgr"]
+ (int) $body["obgr"]
);
}
diff --git a/components/ILIAS/COPage/PC/Resources/class.ilPCResourcesGUI.php b/components/ILIAS/COPage/PC/Resources/class.ilPCResourcesGUI.php
index 1ba5592d40b1..47540bc91897 100755
--- a/components/ILIAS/COPage/PC/Resources/class.ilPCResourcesGUI.php
+++ b/components/ILIAS/COPage/PC/Resources/class.ilPCResourcesGUI.php
@@ -85,7 +85,7 @@ public function initForm(bool $a_insert = false): ilPropertyFormGUI
$objDefinition = $this->obj_definition;
$op_type = null;
- $op_itemgroup = null;
+ $op_objectgroup = null;
// edit form
$form = new ilPropertyFormGUI();
@@ -96,12 +96,12 @@ public function initForm(bool $a_insert = false): ilPropertyFormGUI
$form->setTitle($this->lng->txt("cont_update_resources"));
}
- // count number of existing objects per type and collect item groups
+ // count number of existing objects per type and collect object groups
$ref_id = $this->requested_ref_id;
$childs = $this->rep_tree->getChilds($ref_id);
$type_counts = array();
- $item_groups = array();
+ $object_groups = array();
foreach ($childs as $c) {
// see bug #12471
//echo "
-".$c["type"]."-".$objDefinition->getGroupOfObj($c["type"])."-";
@@ -109,8 +109,8 @@ public function initForm(bool $a_insert = false): ilPropertyFormGUI
? $objDefinition->getGroupOfObj($c["type"])
: $c["type"];
$type_counts[$key] = ($type_counts[$key] ?? 0) + 1;
- if ($c["type"] == "itgr") {
- $item_groups[$c["ref_id"]] = $c["title"];
+ if ($c["type"] == "obgr") {
+ $object_groups[$c["ref_id"]] = $c["title"];
}
}
@@ -118,7 +118,7 @@ public function initForm(bool $a_insert = false): ilPropertyFormGUI
$radg = new ilRadioGroupInputGUI($lng->txt("cont_resources"), "res_type");
$form->addItem($radg);
if (!$a_insert && $this->content_obj->getMainType() == "ItemGroup") {
- $radg->setValue("itgr");
+ $radg->setValue("obgr");
} else {
$radg->setValue("by_type");
}
@@ -129,9 +129,9 @@ public function initForm(bool $a_insert = false): ilPropertyFormGUI
//if ($this->supportsTypeBlocks()) {
//}
- if ($this->supportsItemGroups() && count($item_groups) > 0) {
- $op_itemgroup = new ilRadioOption($lng->txt("cont_manual_item_group"), "itgr", "");
- $radg->addOption($op_itemgroup);
+ if ($this->supportsObjectGroups() && count($object_groups) > 0) {
+ $op_objectgroup = new ilRadioOption($lng->txt("cont_manual_object_group"), "obgr", "");
+ $radg->addOption($op_objectgroup);
}
$radg->addOption($op_type);
@@ -151,7 +151,7 @@ public function initForm(bool $a_insert = false): ilPropertyFormGUI
continue;
}
if (!$objDefinition->isPlugin($k)) {
- if ($k != "itgr") {
+ if ($k != "obgr") {
$types[$k] = $this->lng->txt("objs_" . $k) . " (" . $cnt . ")";
}
} else {
@@ -166,18 +166,18 @@ public function initForm(bool $a_insert = false): ilPropertyFormGUI
$type_prop->setValue($selected);
$op_type->addSubItem($type_prop);
- if ($this->supportsItemGroups() && count($item_groups) > 0) {
- // item groups
- $options = $item_groups;
+ if ($this->supportsObjectGroups() && count($object_groups) > 0) {
+ // object groups
+ $options = $object_groups;
asort($options);
- $si = new ilSelectInputGUI($this->lng->txt("obj_itgr"), "itgr");
+ $si = new ilSelectInputGUI($this->lng->txt("obj_obgr"), "obgr");
$si->setOptions($options);
$selected = ($a_insert)
? ""
: $this->content_obj->getItemGroupRefId();
- $op_itemgroup->addSubItem($si);
+ $op_objectgroup->addSubItem($si);
if ($a_insert) {
- $radg->setValue("itgr");
+ $radg->setValue("obgr");
}
}
@@ -235,10 +235,10 @@ protected function getContainerViewManager(): \ILIAS\Container\Content\ViewManag
return $view_manager;
}
- protected function supportsItemGroups(): bool
+ protected function supportsObjectGroups(): bool
{
foreach ($this->getContainerViewManager()->getBlockSequence()->getParts() as $part) {
- if ($part instanceof \ILIAS\Container\Content\ItemGroupBlocks) {
+ if ($part instanceof \ILIAS\Container\Content\ObjectGroupBlocks) {
return true;
}
}
@@ -284,13 +284,13 @@ public function create(): void
$this->content_obj->setResourceListType("_other");
} elseif ($this->request->getString("res_type") === "_lobj") {
$this->content_obj->setResourceListType("_lobj");
- } elseif ($this->request->getString("res_type") !== "itgr") {
+ } elseif ($this->request->getString("res_type") !== "obgr") {
$this->content_obj->setResourceListType(
$this->request->getString("type")
);
} else {
$this->content_obj->setItemGroupRefId(
- $this->request->getString("itgr")
+ $this->request->getString("obgr")
);
}
$this->updated = $this->pg_obj->update();
@@ -307,13 +307,13 @@ public function update(): void
$this->content_obj->setResourceListType("_other");
} elseif ($this->request->getString("res_type") === "_lobj") {
$this->content_obj->setResourceListType("_lobj");
- } elseif ($this->request->getString("res_type") !== "itgr") {
+ } elseif ($this->request->getString("res_type") !== "obgr") {
$this->content_obj->setResourceListType(
$this->request->getString("type")
);
} else {
$this->content_obj->setItemGroupRefId(
- $this->request->getString("itgr")
+ $this->request->getString("obgr")
);
}
$this->updated = $this->pg_obj->update();
@@ -391,7 +391,7 @@ public static function insertResourcesIntoPageContent(
foreach ($block->getItemRefIds() as $ref_id) {
$data = $item_presentation_manager->getRawDataByRefId($ref_id);
if ($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
- if ($data["type"] === "itgr" || in_array($ref_id, $item_ref_ids)) {
+ if ($data["type"] === "obgr" || in_array($ref_id, $item_ref_ids)) {
continue;
}
}
@@ -485,7 +485,7 @@ public static function insertResourcesIntoPageContent(
$type = $block->getId();
$tpl->setVariable("HEADER", $lng->txt("objs_sess"));
$a_content = str_replace("[list-" . $type . "]", $tpl->get(), $a_content);
- } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
+ } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectGroupBlock) {
$id = $block->getId();
$tpl->setVariable("HEADER", \ilObject::_lookupTitle(
\ilObject::_lookupObjId((int) $id)
diff --git a/components/ILIAS/Container/Content/Block/class.ItemGroupBlock.php b/components/ILIAS/Container/Content/Block/class.ObjectGroupBlock.php
similarity index 91%
rename from components/ILIAS/Container/Content/Block/class.ItemGroupBlock.php
rename to components/ILIAS/Container/Content/Block/class.ObjectGroupBlock.php
index f30295f07851..b88ffc7ab0d7 100755
--- a/components/ILIAS/Container/Content/Block/class.ItemGroupBlock.php
+++ b/components/ILIAS/Container/Content/Block/class.ObjectGroupBlock.php
@@ -21,10 +21,10 @@
namespace ILIAS\Container\Content;
/**
- * A block that holds a single item group
+ * A block that holds a single object group
* @author Alexander Killing
*/
-class ItemGroupBlock implements Block
+class ObjectGroupBlock implements Block
{
protected int $ref_id;
diff --git a/components/ILIAS/Container/Content/Block/class.ItemGroupBlocks.php b/components/ILIAS/Container/Content/Block/class.ObjectGroupBlocks.php
similarity index 87%
rename from components/ILIAS/Container/Content/Block/class.ItemGroupBlocks.php
rename to components/ILIAS/Container/Content/Block/class.ObjectGroupBlocks.php
index fa40d22f076b..21c6888a322d 100755
--- a/components/ILIAS/Container/Content/Block/class.ItemGroupBlocks.php
+++ b/components/ILIAS/Container/Content/Block/class.ObjectGroupBlocks.php
@@ -21,10 +21,10 @@
namespace ILIAS\Container\Content;
/**
- * Represents all item groups of a container
+ * Represents all object groups of a container
* @author Alexander Killing
*/
-class ItemGroupBlocks implements BlockSequencePart
+class ObjectGroupBlocks implements BlockSequencePart
{
public function __construct()
{
diff --git a/components/ILIAS/Container/Content/ByTypeView/class.ByTypeViewManager.php b/components/ILIAS/Container/Content/ByTypeView/class.ByTypeViewManager.php
index 7fcf39dcfa4e..d16428c0d34a 100755
--- a/components/ILIAS/Container/Content/ByTypeView/class.ByTypeViewManager.php
+++ b/components/ILIAS/Container/Content/ByTypeView/class.ByTypeViewManager.php
@@ -44,7 +44,7 @@ public function __construct(
public function getBlockSequence(): BlockSequence
{
$blocks = [];
- $blocks[] = $this->data->itemGroupBlocks();
+ $blocks[] = $this->data->objectGroupBlocks();
$blocks[] = $this->data->typeBlocks();
return $this->data->blockSequence($blocks);
}
diff --git a/components/ILIAS/Container/Content/ItemBlock/class.ItemBlockSequenceGenerator.php b/components/ILIAS/Container/Content/ItemBlock/class.ItemBlockSequenceGenerator.php
index 317cdb6e07b8..23b4f21fb461 100755
--- a/components/ILIAS/Container/Content/ItemBlock/class.ItemBlockSequenceGenerator.php
+++ b/components/ILIAS/Container/Content/ItemBlock/class.ItemBlockSequenceGenerator.php
@@ -52,9 +52,9 @@ class ItemBlockSequenceGenerator
/** @var int[] */
protected array $accumulated_ref_ids = [];
/** @var array */
- protected static array $item_group_ref_ids = [];
+ protected static array $object_group_ref_ids = [];
/** @var int[] */
- protected array $all_item_group_item_ref_ids = [];
+ protected array $all_object_group_item_ref_ids = [];
protected array $all_ref_ids = [];
protected \ilLOTestAssignments $test_assignments;
@@ -96,11 +96,11 @@ public function setOmitRefIds(array $omit_ref_ids): void
public function getSequence(): ItemBlockSequence
{
if (is_null($this->sequence)) {
- $this->preloadSessionandItemGroupItemData();
+ $this->preloadSessionandObjectGroupItemData();
$item_blocks = [];
$sorted_blocks = [];
- // get blocks from block sequence parts (item groups, by type, objective)
+ // get blocks from block sequence parts (object groups, by type, objective)
foreach ($this->block_sequence->getParts() as $part) {
foreach ($this->getBlocksForPart($part) as $block) {
$item_blocks[$block->getId()] = $block;
@@ -145,8 +145,8 @@ public function getSequence(): ItemBlockSequence
}
}
} else {
- // e.g. deleted item group
- //throw new \ilException("Missing item group data.");
+ // e.g. deleted object group
+ //throw new \ilException("Missing object group data.");
}
}
@@ -182,7 +182,7 @@ public function getSequence(): ItemBlockSequence
return $this->sequence;
}
- protected function preloadSessionandItemGroupItemData(): void
+ protected function preloadSessionandObjectGroupItemData(): void
{
foreach ($this->block_sequence->getParts() as $part) {
// SessionBlock
@@ -199,16 +199,16 @@ protected function preloadSessionandItemGroupItemData(): void
);
}*/
}
- // ItemGroupBlock
- if ($part instanceof Content\ItemGroupBlock) {
- $item_ref_ids = $this->getItemGroupItemRefIds($part->getRefId());
- $this->all_item_group_item_ref_ids = array_unique(array_merge($this->all_item_group_item_ref_ids, $item_ref_ids));
+ // ObjectGroupBlock
+ if ($part instanceof Content\ObjectGroupBlock) {
+ $item_ref_ids = $this->getObjectGroupItemRefIds($part->getRefId());
+ $this->all_object_group_item_ref_ids = array_unique(array_merge($this->all_object_group_item_ref_ids, $item_ref_ids));
}
- // ItemGroupBlocks
- if ($part instanceof Content\ItemGroupBlocks) {
- foreach ($this->item_set_manager->getRefIdsOfType("itgr") as $item_group_ref_id) {
- $item_ref_ids = $this->getItemGroupItemRefIds($item_group_ref_id);
- $this->all_item_group_item_ref_ids = array_unique(array_merge($this->all_item_group_item_ref_ids, $item_ref_ids));
+ // ObjectGroupBlocks
+ if ($part instanceof Content\ObjectGroupBlocks) {
+ foreach ($this->item_set_manager->getRefIdsOfType("obgr") as $object_group_ref_id) {
+ $item_ref_ids = $this->getObjectGroupItemRefIds($object_group_ref_id);
+ $this->all_object_group_item_ref_ids = array_unique(array_merge($this->all_object_group_item_ref_ids, $item_ref_ids));
}
}
}
@@ -225,7 +225,7 @@ protected function getBlocksForPart(BlockSequencePart $part): \Iterator
$ref_ids = $this->item_set_manager->getRefIdsOfType($type);
$this->accumulateRefIds($ref_ids);
$block_items = $this->determineBlockItems($ref_ids, true);
- if ($type !== "itgr" && count($block_items->getRefIds()) > 0) {
+ if ($type !== "obgr" && count($block_items->getRefIds()) > 0) {
yield $this->data_service->itemBlock(
$type,
$this->data_service->typeBlock($type),
@@ -263,9 +263,9 @@ protected function getBlocksForPart(BlockSequencePart $part): \Iterator
);
}
}
- // ItemGroupBlock
- if ($part instanceof Content\ItemGroupBlock) {
- $block = $this->getItemGroupBlock($part->getRefId());
+ // ObjectGroupBlock
+ if ($part instanceof Content\ObjectGroupBlock) {
+ $block = $this->getObjectGroupBlock($part->getRefId());
if (!is_null($block)) {
yield $block;
}
@@ -273,7 +273,7 @@ protected function getBlocksForPart(BlockSequencePart $part): \Iterator
// ObjectivesBlock
if ($part instanceof Content\ObjectivesBlock) {
// in admin mode, we do not include the objectives block
- // -> all items will be presented in item group/other block
+ // -> all items will be presented in object group/other block
if (!$this->mode_manager->isAdminMode()) {
$objective_ids = \ilCourseObjective::_getObjectiveIds($this->container->getId(), true);
$ref_ids = [];
@@ -300,16 +300,16 @@ protected function getBlocksForPart(BlockSequencePart $part): \Iterator
);
}
}
- // ItemGroupBlocks
- if ($part instanceof Content\ItemGroupBlocks) {
- foreach ($this->item_set_manager->getRefIdsOfType("itgr") as $item_group_ref_id) {
- $block = $this->getItemGroupBlock($item_group_ref_id);
+ // ObjectGroupBlocks
+ if ($part instanceof Content\ObjectGroupBlocks) {
+ foreach ($this->item_set_manager->getRefIdsOfType("obgr") as $object_group_ref_id) {
+ $block = $this->getObjectGroupBlock($object_group_ref_id);
if (!is_null($block)) {
yield $block;
}
}
}
- // ItemGroupBlocks
+ // ObjectGroupBlocks
if ($part instanceof Content\OtherBlock) {
$this->has_other_block = true;
}
@@ -317,7 +317,7 @@ protected function getBlocksForPart(BlockSequencePart $part): \Iterator
protected function determineBlockItems(
array $ref_ids,
- $filter_session_and_item_group_items = false,
+ $filter_session_and_object_group_items = false,
bool $prevent_duplicats = false
): BlockItemsInfo {
$exhausted = false;
@@ -326,7 +326,7 @@ protected function determineBlockItems(
if ($prevent_duplicats && in_array($ref_id, $this->all_ref_ids)) {
continue;
}
- if (\ilObject::_lookupType(\ilObject::_lookupObjId($ref_id)) === "itgr") {
+ if (\ilObject::_lookupType(\ilObject::_lookupObjId($ref_id)) === "obgr") {
continue;
}
$this->all_ref_ids[] = $ref_id;
@@ -336,7 +336,7 @@ protected function determineBlockItems(
if ($this->access->checkAccess('visible', '', $ref_id)) {
if ($this->block_limit > 0 && count($accessible_ref_ids) >= $this->block_limit) {
$exhausted = true;
- } elseif (!$filter_session_and_item_group_items || !in_array($ref_id, $this->all_item_group_item_ref_ids)) {
+ } elseif (!$filter_session_and_object_group_items || !in_array($ref_id, $this->all_object_group_item_ref_ids)) {
if (!in_array($ref_id, $this->omit_ref_ids)) {
$accessible_ref_ids[] = $ref_id;
}
@@ -392,35 +392,35 @@ protected function getGroupedObjTypes(): \Iterator
}
}
- protected function getItemGroupItemRefIds(int $item_group_ref_id): array
+ protected function getObjectGroupItemRefIds(int $object_group_ref_id): array
{
- if (!isset(self::$item_group_ref_ids[$item_group_ref_id])) {
+ if (!isset(self::$object_group_ref_ids[$object_group_ref_id])) {
$items = \ilContainerSorting::_getInstance(
$this->container->getId()
- )->sortSubItems('itgr', \ilObject::_lookupObjId($item_group_ref_id), \ilObjectActivation::getItemsByItemGroup($item_group_ref_id));
+ )->sortSubItems('obgr', \ilObject::_lookupObjId($object_group_ref_id), \ilObjectActivation::getItemsByObjectGroup($object_group_ref_id));
- self::$item_group_ref_ids[$item_group_ref_id] = array_map(static function ($i) {
+ self::$object_group_ref_ids[$object_group_ref_id] = array_map(static function ($i) {
return (int) $i["child"];
}, $items);
}
- return self::$item_group_ref_ids[$item_group_ref_id];
+ return self::$object_group_ref_ids[$object_group_ref_id];
}
- protected function getItemGroupBlock(int $item_group_ref_id): ?ItemBlock
+ protected function getObjectGroupBlock(int $object_group_ref_id): ?ItemBlock
{
- $ref_ids = $this->getItemGroupItemRefIds($item_group_ref_id);
+ $ref_ids = $this->getObjectGroupItemRefIds($object_group_ref_id);
$this->accumulateRefIds($ref_ids);
$block_items = $this->determineBlockItems($ref_ids);
// #16493
- if (!$this->access->checkAccess("visible", "", $item_group_ref_id) ||
- !$this->access->checkAccess("read", "", $item_group_ref_id)) {
+ if (!$this->access->checkAccess("visible", "", $object_group_ref_id) ||
+ !$this->access->checkAccess("read", "", $object_group_ref_id)) {
return null;
}
- // otherwise empty item groups will simply "vanish" from the repository
- if (count($block_items->getRefIds()) > 0 || $this->access->checkAccess('write', '', $item_group_ref_id)) {
+ // otherwise empty object groups will simply "vanish" from the repository
+ if (count($block_items->getRefIds()) > 0 || $this->access->checkAccess('write', '', $object_group_ref_id)) {
return $this->data_service->itemBlock(
- (string) $item_group_ref_id,
- $this->data_service->itemGroupBlock($item_group_ref_id),
+ (string) $object_group_ref_id,
+ $this->data_service->objectGroupBlock($object_group_ref_id),
$block_items->getRefIds(),
$block_items->getLimitExhausted()
);
diff --git a/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php b/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php
index 06c1597db6a2..c331677efdf4 100755
--- a/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php
+++ b/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php
@@ -285,7 +285,7 @@ protected function showMaterials(
if ($a_mode == self::MATERIALS_TESTS and $item_data['type'] != 'tst') {
continue;
}
- if ($item_data['type'] == 'itgr') {
+ if ($item_data['type'] == 'obgr') {
continue;
}
if (!$a_is_manage) {
@@ -333,7 +333,7 @@ protected function showMaterials(
// :TODO:
if ($a_mode != self::MATERIALS_TESTS) {
- $pos = $this->getItemGroupsHTML();
+ $pos = $this->getObjectGroupsHTML();
}
foreach ($item_r as $h) {
diff --git a/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveViewManager.php b/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveViewManager.php
index 3f17e0cac7a9..c809ce42655f 100755
--- a/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveViewManager.php
+++ b/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveViewManager.php
@@ -45,7 +45,7 @@ public function getBlockSequence(): BlockSequence
{
$blocks = [];
$blocks[] = $this->data->objectivesBlock();
- $blocks[] = $this->data->itemGroupBlocks();
+ $blocks[] = $this->data->objectGroupBlocks();
$blocks[] = $this->data->otherBlock();
return $this->data->blockSequence($blocks);
}
diff --git a/components/ILIAS/Container/Content/ObjectiveView/class.ilContainerObjectiveGUI.php b/components/ILIAS/Container/Content/ObjectiveView/class.ilContainerObjectiveGUI.php
index 70cb1bed03b6..ca13f8c63c01 100755
--- a/components/ILIAS/Container/Content/ObjectiveView/class.ilContainerObjectiveGUI.php
+++ b/components/ILIAS/Container/Content/ObjectiveView/class.ilContainerObjectiveGUI.php
@@ -339,7 +339,7 @@ protected function showMaterials(
if ($a_mode === self::MATERIALS_TESTS && $item_data['type'] !== 'tst') {
continue;
}
- if ($item_data['type'] === 'itgr') {
+ if ($item_data['type'] === 'obgr') {
continue;
}
if (!$a_is_manage) {
@@ -387,7 +387,7 @@ protected function showMaterials(
// :TODO:
if ($a_mode !== self::MATERIALS_TESTS) {
- $pos = $this->getItemGroupsHTML();
+ $pos = $this->getObjectGroupsHTML();
}
foreach ($item_r as $h) {
diff --git a/components/ILIAS/Container/Content/Service/class.DataService.php b/components/ILIAS/Container/Content/Service/class.DataService.php
index 78a31e4efa70..1a3586ce0412 100755
--- a/components/ILIAS/Container/Content/Service/class.DataService.php
+++ b/components/ILIAS/Container/Content/Service/class.DataService.php
@@ -54,14 +54,14 @@ public function sessionBlock(): SessionBlock
return new SessionBlock();
}
- public function itemGroupBlock(int $ref_id): ItemGroupBlock
+ public function objectGroupBlock(int $ref_id): ObjectGroupBlock
{
- return new ItemGroupBlock($ref_id);
+ return new ObjectGroupBlock($ref_id);
}
- public function itemGroupBlocks(): ItemGroupBlocks
+ public function objectGroupBlocks(): ObjectGroupBlocks
{
- return new ItemGroupBlocks();
+ return new ObjectGroupBlocks();
}
/**
diff --git a/components/ILIAS/Container/Content/SessionsView/class.SessionsViewManager.php b/components/ILIAS/Container/Content/SessionsView/class.SessionsViewManager.php
index 17d09a4212c3..47d485f6be0c 100755
--- a/components/ILIAS/Container/Content/SessionsView/class.SessionsViewManager.php
+++ b/components/ILIAS/Container/Content/SessionsView/class.SessionsViewManager.php
@@ -45,7 +45,7 @@ public function getBlockSequence(): BlockSequence
{
$blocks = [];
$blocks[] = $this->data->sessionBlock();
- $blocks[] = $this->data->itemGroupBlocks();
+ $blocks[] = $this->data->objectGroupBlocks();
$blocks[] = $this->data->otherBlock();
return $this->data->blockSequence($blocks);
}
diff --git a/components/ILIAS/Container/Content/SimpleView/class.SimpleViewManager.php b/components/ILIAS/Container/Content/SimpleView/class.SimpleViewManager.php
index eede8fad7874..2b3846b80260 100755
--- a/components/ILIAS/Container/Content/SimpleView/class.SimpleViewManager.php
+++ b/components/ILIAS/Container/Content/SimpleView/class.SimpleViewManager.php
@@ -44,7 +44,7 @@ public function __construct(
public function getBlockSequence(): BlockSequence
{
$blocks = [];
- $blocks[] = $this->data->itemGroupBlocks();
+ $blocks[] = $this->data->objectGroupBlocks();
$blocks[] = $this->data->otherBlock();
return $this->data->blockSequence($blocks);
}
diff --git a/components/ILIAS/Container/Content/class.ItemRenderer.php b/components/ILIAS/Container/Content/class.ItemRenderer.php
index 5b705f2c0073..25b2638e1f59 100755
--- a/components/ILIAS/Container/Content/class.ItemRenderer.php
+++ b/components/ILIAS/Container/Content/class.ItemRenderer.php
@@ -64,7 +64,7 @@ public function renderItem(
int $a_position = 0,
bool $a_force_icon = false,
string $a_pos_prefix = "",
- string $item_group_list_presentation = "",
+ string $object_group_list_presentation = "",
int $checkbox = self::CHECKBOX_NONE,
bool $item_ordering = false,
int $details_level = \ilObjectListGUI::DETAILS_ALL
@@ -79,8 +79,8 @@ public function renderItem(
return '';
}*/
$view_mode = $this->view_mode;
- if ($item_group_list_presentation != "") {
- $view_mode = ($item_group_list_presentation === "tile")
+ if ($object_group_list_presentation != "") {
+ $view_mode = ($object_group_list_presentation === "tile")
? \ilContainerContentGUI::VIEW_MODE_TILE
: \ilContainerContentGUI::VIEW_MODE_LIST;
}
diff --git a/components/ILIAS/Container/Content/class.ItemSetManager.php b/components/ILIAS/Container/Content/class.ItemSetManager.php
index 51c7bb870c63..15eb66cc0556 100755
--- a/components/ILIAS/Container/Content/class.ItemSetManager.php
+++ b/components/ILIAS/Container/Content/class.ItemSetManager.php
@@ -207,7 +207,7 @@ protected function groupItems(): void
}
// BEGIN WebDAV: Don't display hidden Files, Folders and Categories
- /* this is an old webdav hack, which leads to issues in item groups
+ /* this is an old webdav hack, which leads to issues in object groups
these objects would be "invisible" but accessible (via url) which makes the behaviour very strange.
They are hidden here, but shown in explorer trees and other places...
if (in_array($object['type'], array('file','fold','cat'))) {
diff --git a/components/ILIAS/Container/Content/class.ilContainerBlockPropertiesStorageGUI.php b/components/ILIAS/Container/Content/class.ilContainerBlockPropertiesStorageGUI.php
index a8eb8322ab12..d9f064acd66e 100755
--- a/components/ILIAS/Container/Content/class.ilContainerBlockPropertiesStorageGUI.php
+++ b/components/ILIAS/Container/Content/class.ilContainerBlockPropertiesStorageGUI.php
@@ -23,7 +23,7 @@
/**
* Save container block property
- * Mainly used for item group expand/collapse
+ * Mainly used for object group expand/collapse
*
* @author Alexander Killing
* @ilCtrl_Calls ilContainerBlockPropertiesStorageGUI: ilContainerBlockPropertiesStorageGUI
diff --git a/components/ILIAS/Container/Content/class.ilContainerContentGUI.php b/components/ILIAS/Container/Content/class.ilContainerContentGUI.php
index 66b7e81b23c8..9dfd855af204 100755
--- a/components/ILIAS/Container/Content/class.ilContainerContentGUI.php
+++ b/components/ILIAS/Container/Content/class.ilContainerContentGUI.php
@@ -408,9 +408,9 @@ public function determinePageEmbeddedBlocks(
}
}
- // determine item groups
+ // determine object groups
while (preg_match('~\[(item-group-([0-9]*))\]~i', $a_container_page_html, $found)) {
- $this->addEmbeddedBlock("itgr", (int) $found[2]);
+ $this->addEmbeddedBlock("obgr", (int) $found[2]);
$html = ''; // This was never defined before
$a_container_page_html = preg_replace('~\[' . $found[1] . '\]~i', $html, $a_container_page_html);
@@ -436,18 +436,18 @@ public function getEmbeddedBlocks(): array
public function renderPageEmbeddedBlocks(): void
{
- // item groups
- if (isset($this->embedded_block["itgr"]) && is_array($this->embedded_block["itgr"])) {
- $item_groups = [];
- if (isset($this->items["itgr"]) && is_array($this->items["itgr"])) {
- foreach ($this->items["itgr"] as $ig) {
- $item_groups[$ig["ref_id"]] = $ig;
+ // object groups
+ if (isset($this->embedded_block["obgr"]) && is_array($this->embedded_block["obgr"])) {
+ $object_groups = [];
+ if (isset($this->items["obgr"]) && is_array($this->items["obgr"])) {
+ foreach ($this->items["obgr"] as $ig) {
+ $object_groups[$ig["ref_id"]] = $ig;
}
}
- foreach ($this->embedded_block["itgr"] as $ref_id) {
- if (isset($item_groups[$ref_id])) {
- $this->renderItemGroup($item_groups[$ref_id]);
+ foreach ($this->embedded_block["obgr"] as $ref_id) {
+ if (isset($object_groups[$ref_id])) {
+ $this->renderObjectGroup($object_groups[$ref_id]);
}
}
}
@@ -491,7 +491,7 @@ public function renderItem(
int $a_position = 0,
bool $a_force_icon = false,
string $a_pos_prefix = "",
- string $item_group_list_presentation = ""
+ string $object_group_list_presentation = ""
): RepositoryObject|string|null {
$ilSetting = $this->settings;
$ilAccess = $this->access;
@@ -502,8 +502,8 @@ public function renderItem(
}
$view_mode = $this->getViewMode();
- if ($item_group_list_presentation != "") {
- $view_mode = ($item_group_list_presentation === "tile")
+ if ($object_group_list_presentation != "") {
+ $view_mode = ($object_group_list_presentation === "tile")
? self::VIEW_MODE_TILE
: self::VIEW_MODE_LIST;
}
@@ -688,13 +688,13 @@ public function insertPageEmbeddedBlocks(string $a_output_html): string
}
}
- // insert all item groups
+ // insert all object groups
while (preg_match('~\[(item-group-([0-9]*))\]~i', $a_output_html, $found)) {
- $itgr_ref_id = (int) $found[2];
+ $obgr_ref_id = (int) $found[2];
$a_output_html = preg_replace(
'~\[' . $found[1] . '\]~i',
- $this->renderer->renderSingleCustomBlock($itgr_ref_id),
+ $this->renderer->renderSingleCustomBlock($obgr_ref_id),
$a_output_html
);
}
@@ -752,29 +752,29 @@ public function getIntroduction(): string
return $tpl->get();
}
- public function getItemGroupsHTML(int $a_pos = 0): int
+ public function getObjectGroupsHTML(int $a_pos = 0): int
{
- if (isset($this->items["itgr"]) && is_array($this->items["itgr"])) {
- foreach ($this->items["itgr"] as $itgr) {
- if (!$this->renderer->hasCustomBlock($itgr["child"])) {
- $this->renderItemGroup($itgr);
+ if (isset($this->items["obgr"]) && is_array($this->items["obgr"])) {
+ foreach ($this->items["obgr"] as $obgr) {
+ if (!$this->renderer->hasCustomBlock($obgr["child"])) {
+ $this->renderObjectGroup($obgr);
- $this->renderer->setBlockPosition($itgr["ref_id"], ++$a_pos);
+ $this->renderer->setBlockPosition($obgr["ref_id"], ++$a_pos);
}
}
}
return $a_pos;
}
- public function renderItemGroup(array $a_itgr): void
+ public function renderObjectGroup(array $a_obgr): void
{
$ilAccess = $this->access;
$ilUser = $this->user;
// #16493
- $perm_ok = ($ilAccess->checkAccess("visible", "", $a_itgr['ref_id']) &&
- $ilAccess->checkAccess("read", "", $a_itgr['ref_id']));
+ $perm_ok = ($ilAccess->checkAccess("visible", "", $a_obgr['ref_id']) &&
+ $ilAccess->checkAccess("read", "", $a_obgr['ref_id']));
- $items = ilObjectActivation::getItemsByItemGroup($a_itgr['ref_id']);
+ $items = ilObjectActivation::getItemsByObjectGroup($a_obgr['ref_id']);
// get all valid ids (this is filtered)
$all_ids = array_map(static function (array $i): int {
@@ -795,59 +795,59 @@ public function renderItemGroup(array $a_itgr): void
return;
}
- $item_list_gui = $this->getItemGUI($a_itgr);
+ $item_list_gui = $this->getItemGUI($a_obgr);
$item_list_gui->enableNotes(false);
$item_list_gui->enableTags(false);
$item_list_gui->enableComments(false);
$item_list_gui->enableTimings(false);
$item_list_gui->getListItemHTML(
- $a_itgr["ref_id"],
- $a_itgr["obj_id"],
- $a_itgr["title"],
- $a_itgr["description"]
+ $a_obgr["ref_id"],
+ $a_obgr["obj_id"],
+ $a_obgr["title"],
+ $a_obgr["description"]
);
// determine behaviour
- $item_group = new ilObjItemGroup($a_itgr['ref_id']);
- $opened = $this->block_repo->getProperty("itgr_{$a_itgr['ref_id']}", $ilUser->getId(), 'opened');
+ $object_group = new ilObjObjectGroup($a_obgr['ref_id']);
+ $opened = $this->block_repo->getProperty("obgr_{$a_obgr['ref_id']}", $ilUser->getId(), 'opened');
- $this->ctrl->setParameterByClass(ilContainerBlockPropertiesStorageGUI::class, 'cont_block_id', "itgr_{$a_itgr['ref_id']}");
+ $this->ctrl->setParameterByClass(ilContainerBlockPropertiesStorageGUI::class, 'cont_block_id', "obgr_{$a_obgr['ref_id']}");
$store_url = $this->ctrl->getLinkTargetByClass(ilContainerBlockPropertiesStorageGUI::class, 'store');
$this->ctrl->clearParameterByClass(ilContainerBlockPropertiesStorageGUI::class, 'cont_block_id');
$this->renderer->addCustomBlock(
- $a_itgr["ref_id"],
- $item_group->getShowTitle() || $this->container_gui->isActiveAdministrationPanel() ? $a_itgr['title'] : '',
- $item_list_gui->getCommandsHTML($a_itgr['title'], false),
+ $a_obgr["ref_id"],
+ $object_group->getShowTitle() || $this->container_gui->isActiveAdministrationPanel() ? $a_obgr['title'] : '',
+ $item_list_gui->getCommandsHTML($a_obgr['title'], false),
[
- 'behaviour' => $item_group->getBehaviour(in_array($opened, ['0', '1'], true) ? (bool) $opened : null),
+ 'behaviour' => $object_group->getBehaviour(in_array($opened, ['0', '1'], true) ? (bool) $opened : null),
'store-url' => "./{$store_url}"
]
);
- // render item group sub items
+ // render object group sub items
$items = ilContainerSorting::_getInstance(
$this->getContainerObject()->getId()
- )->sortSubItems('itgr', $a_itgr['obj_id'], $items);
+ )->sortSubItems('obgr', $a_obgr['obj_id'], $items);
// #18285
$items = ilContainer::getCompleteDescriptions($items);
$position = 1;
foreach ($items as $item) {
- // we are NOT using hasItem() here, because item might be in multiple item groups
+ // we are NOT using hasItem() here, because item might be in multiple object groups
- $it_pres = $item_group->getListPresentation();
+ $it_pres = $object_group->getListPresentation();
if ($this->getContainerGUI()->isActiveOrdering() ||
$this->getContainerGUI()->isActiveAdministrationPanel()) {
$it_pres = "list";
}
- $html2 = $this->renderItem($item, $position++, false, "[itgr][" . $a_itgr['obj_id'] . "]", $it_pres);
+ $html2 = $this->renderItem($item, $position++, false, "[obgr][" . $a_obgr['obj_id'] . "]", $it_pres);
if ($html2 != "") {
// :TODO: show it multiple times?
- $this->renderer->addItemToBlock($a_itgr["ref_id"], $item["type"], $item["child"], $html2, true);
+ $this->renderer->addItemToBlock($a_obgr["ref_id"], $item["type"], $item["child"], $html2, true);
}
}
}
diff --git a/components/ILIAS/Container/Content/class.ilContainerRenderer.php b/components/ILIAS/Container/Content/class.ilContainerRenderer.php
index f6c0d6e25394..ddf35962171b 100755
--- a/components/ILIAS/Container/Content/class.ilContainerRenderer.php
+++ b/components/ILIAS/Container/Content/class.ilContainerRenderer.php
@@ -171,7 +171,7 @@ public function addTypeBlock(
?string $a_block_id = null
): bool {
$block_id = $a_block_id ?? $a_type;
- if ($a_type !== "itgr" &&
+ if ($a_type !== "obgr" &&
!$this->hasTypeBlock($block_id)) {
$this->type_blocks[$block_id] = [
"prefix" => $a_prefix
@@ -305,7 +305,7 @@ public function addItemToBlock(
$a_item_html,
bool $a_force = false
): bool {
- if ($a_item_type !== "itgr" &&
+ if ($a_item_type !== "obgr" &&
$this->isValidBlock($a_block_id) &&
(!$this->hasItem($a_item_id) || $a_force)) {
if (is_string($a_item_html) && trim($a_item_html) === "") {
@@ -516,22 +516,22 @@ protected function renderHelperTypeBlock(
return false;
}
- protected function getViewModeOfItemGroup(int $ref_id): int
+ protected function getViewModeOfObjectGroup(int $ref_id): int
{
- $item_group = new ilObjItemGroup($ref_id);
+ $object_group = new ilObjObjectGroup($ref_id);
$view_mode = ilContainerContentGUI::VIEW_MODE_LIST;
- if ($item_group->getListPresentation() !== "") {
- $view_mode = ($item_group->getListPresentation() === "tile")
+ if ($object_group->getListPresentation() !== "") {
+ $view_mode = ($object_group->getListPresentation() === "tile")
? ilContainerContentGUI::VIEW_MODE_TILE
: ilContainerContentGUI::VIEW_MODE_LIST;
}
return $view_mode;
}
- protected function getListPresentationOfItemGroup(int $ref_id): string
+ protected function getListPresentationOfObjectGroup(int $ref_id): string
{
- $item_group = new ilObjItemGroup($ref_id);
- return $item_group->getListPresentation();
+ $object_group = new ilObjObjectGroup($ref_id);
+ return $object_group->getListPresentation();
}
/**
@@ -563,17 +563,17 @@ protected function renderHelperGeneric(
$tile_size = ilContainer::_lookupContainerSetting($this->container_gui->getObject()->getId(), "tile_size");
}
if (is_numeric($a_block_id)) {
- $item_group = new ilObjItemGroup($a_block_id);
- if ($item_group->getListPresentation() !== "") {
- $view_mode = ($item_group->getListPresentation() === "tile" && !$this->active_block_ordering && !$this->admin_panel)
+ $object_group = new ilObjObjectGroup($a_block_id);
+ if ($object_group->getListPresentation() !== "") {
+ $view_mode = ($object_group->getListPresentation() === "tile" && !$this->active_block_ordering && !$this->admin_panel)
? ilContainerContentGUI::VIEW_MODE_TILE
: ilContainerContentGUI::VIEW_MODE_LIST;
- $tile_size = $item_group->getTileSize();
+ $tile_size = $object_group->getTileSize();
}
}
- // #14610 - manage empty item groups
+ // #14610 - manage empty object groups
if ((isset($this->block_items[$a_block_id]) && is_array($this->block_items[$a_block_id])) ||
is_numeric($a_block_id)) {
$cards = [];
@@ -684,7 +684,7 @@ protected function initBlockTemplate(): ilTemplate
/**
* Render block header
- * @param string $a_order_id item group id or type, e.g. "crs"
+ * @param string $a_order_id object group id or type, e.g. "crs"
* @throws ilTemplateException
*/
protected function addHeaderRow(
@@ -734,7 +734,7 @@ protected function addHeaderRow(
$a_tpl->setVariable("DATA_VALUE", $v);
$a_tpl->parseCurrentBlock();
- if ($k === "behaviour" && $v == ilItemGroupBehaviour::EXPANDABLE_CLOSED) {
+ if ($k === "behaviour" && $v == ilObjectGroupBehaviour::EXPANDABLE_CLOSED) {
$a_tpl->touchBlock("container_items_hide");
}
}
@@ -887,7 +887,7 @@ public function renderItemBlockSequence(
if ($block->getPageEmbedded()) {
$page_block_instance++;
}
- if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
+ if ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectGroupBlock) {
$block_id = (string) $block->getBlock()->getRefId();
$force_item_even_if_already_rendered = true;
}
@@ -911,9 +911,9 @@ public function renderItemBlockSequence(
$pos_prefix = "";
// (1) add block
- if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
- $this->addItemGroupBlock($block_id);
- $pos_prefix = "[itgr][" . \ilObject::_lookupObjId($block->getBlock()->getRefId()) . "]";
+ if ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectGroupBlock) {
+ $this->addObjectGroupBlock($block_id);
+ $pos_prefix = "[obgr][" . \ilObject::_lookupObjId($block->getBlock()->getRefId()) . "]";
}
if ($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
$title = $this->item_presentation->filteredSubtree()
@@ -945,7 +945,7 @@ public function renderItemBlockSequence(
continue;
}
// use block_id as parent for unique IDs when item appears in multiple blocks
- if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
+ if ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectGroupBlock) {
$item_data["block_parent"] = (int) $block_id;
}
if ($block->getPageEmbedded()) {
@@ -957,16 +957,16 @@ public function renderItemBlockSequence(
} elseif ($this->container_gui->isMultiDownloadEnabled()) {
$checkbox = \ILIAS\Containter\Content\ItemRenderer::CHECKBOX_DOWNLOAD;
}
- $item_group_list_presentation = "";
- if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
- if ($this->getListPresentationOfItemGroup((int) $block_id) === "tile") {
+ $object_group_list_presentation = "";
+ if ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectGroupBlock) {
+ if ($this->getListPresentationOfObjectGroup((int) $block_id) === "tile") {
if (!$this->admin_panel && !$this->active_block_ordering) {
- $item_group_list_presentation = "tile";
+ $object_group_list_presentation = "tile";
}
}
- if ($this->getListPresentationOfItemGroup((int) $block_id) === "list") {
+ if ($this->getListPresentationOfObjectGroup((int) $block_id) === "list") {
if (!$this->admin_panel && !$this->active_block_ordering) {
- $item_group_list_presentation = "list";
+ $object_group_list_presentation = "list";
}
}
}
@@ -975,7 +975,7 @@ public function renderItemBlockSequence(
$position++,
false,
$pos_prefix,
- $item_group_list_presentation,
+ $object_group_list_presentation,
$checkbox,
$this->item_presentation->isActiveItemOrdering($item_data["type"]),
$this->getDetailsLevel($item_data["obj_id"])
@@ -1002,7 +1002,7 @@ public function renderItemBlockSequence(
1
);
$valid = true;
- } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
+ } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectGroupBlock) {
$page_html = preg_replace(
'~\[item-group-' . $block->getId() . '\]~i',
$this->renderSingleCustomBlock((int) $block->getId(), $block->getLimitExhausted()),
@@ -1025,7 +1025,7 @@ public function renderItemBlockSequence(
$valid = true;
}
} else {
- if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock ||
+ if ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectGroupBlock ||
$block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
if ($this->renderHelperCustomBlock($block_tpl, $block_id, false, $block->getLimitExhausted())) {
$this->addSeparatorRow($block_tpl);
@@ -1148,9 +1148,9 @@ public function getBlockById(
}
/**
- * replaces ilContainerContentGUI::renderItemGroup
+ * replaces ilContainerContentGUI::renderObjectGroup
*/
- protected function addItemGroupBlock(string $block_id, int $block_pos = 0): void
+ protected function addObjectGroupBlock(string $block_id, int $block_pos = 0): void
{
$item_data = $this->item_presentation->getRawDataByRefId((int) $block_id);
$item_list_gui = $this->item_renderer->getItemGUI($item_data);
@@ -1164,7 +1164,7 @@ protected function addItemGroupBlock(string $block_id, int $block_pos = 0): void
$perm_ok = ($ilAccess->checkAccess("visible", "", $item_data['ref_id']) &&
$ilAccess->checkAccess("read", "", $item_data['ref_id']));
- $items = ilObjectActivation::getItemsByItemGroup($item_data['ref_id']);
+ $items = ilObjectActivation::getItemsByObjectGroup($item_data['ref_id']);
// get all valid ids (this is filtered)
$all_ids = array_map(static function (array $i) : int {
@@ -1193,25 +1193,25 @@ protected function addItemGroupBlock(string $block_id, int $block_pos = 0): void
$item_list_gui->initItem(
(int) $item_data["ref_id"],
(int) $item_data["obj_id"],
- "itgr",
+ "obgr",
$item_data["title"],
$item_data["description"]
);
// determine behaviour
- $item_group = new ilObjItemGroup($item_data['ref_id']);
- $opened = $this->block_repo->getProperty("itgr_{$item_data['ref_id']}", $this->user->getId(), 'opened');
+ $object_group = new ilObjObjectGroup($item_data['ref_id']);
+ $opened = $this->block_repo->getProperty("obgr_{$item_data['ref_id']}", $this->user->getId(), 'opened');
- $this->ctrl->setParameterByClass(ilContainerBlockPropertiesStorageGUI::class, 'cont_block_id', "itgr_{$item_data['ref_id']}");
+ $this->ctrl->setParameterByClass(ilContainerBlockPropertiesStorageGUI::class, 'cont_block_id', "obgr_{$item_data['ref_id']}");
$store_url = $this->ctrl->getLinkTargetByClass(ilContainerBlockPropertiesStorageGUI::class, 'store');
$this->ctrl->clearParameterByClass(ilContainerBlockPropertiesStorageGUI::class, 'cont_block_id');
$this->addCustomBlock(
$block_id,
- $item_group->getShowTitle() || $this->container_gui->isActiveAdministrationPanel() ? $item_data['title'] : '',
+ $object_group->getShowTitle() || $this->container_gui->isActiveAdministrationPanel() ? $item_data['title'] : '',
$item_list_gui->getCommandsHTML(),
[
- 'behaviour' => $item_group->getBehaviour(in_array($opened, ['0', '1'], true) ? (bool) $opened : null),
+ 'behaviour' => $object_group->getBehaviour(in_array($opened, ['0', '1'], true) ? (bool) $opened : null),
'store-url' => "./{$store_url}"
]
);
diff --git a/components/ILIAS/Container/Export/class.ilContainerXmlParser.php b/components/ILIAS/Container/Export/class.ilContainerXmlParser.php
index 435af8e380a7..d152d5fecd8e 100755
--- a/components/ILIAS/Container/Export/class.ilContainerXmlParser.php
+++ b/components/ILIAS/Container/Export/class.ilContainerXmlParser.php
@@ -69,6 +69,7 @@ protected function initItem(
$ref_id = (string) $item['RefId'];
$obj_id = (string) $item['Id'];
$type = (string) $item['Type'];
+ $type = $type === 'itgr' ? 'obgr' : $type;
$new_ref = $this->getMapping()->getMapping('components/ILIAS/Container', 'refs', $ref_id);
diff --git a/components/ILIAS/Container/Page/class.ilContainerPage.php b/components/ILIAS/Container/Page/class.ilContainerPage.php
index 4f9ffeaa9561..3cbf8831f4b8 100755
--- a/components/ILIAS/Container/Page/class.ilContainerPage.php
+++ b/components/ILIAS/Container/Page/class.ilContainerPage.php
@@ -102,7 +102,7 @@ protected function addRepositoryBlockToPage(string $id, \ILIAS\Container\Content
if ($block instanceof \ILIAS\Container\Content\TypeBlock) {
$pc_resources->setResourceListType($id);
- } elseif ($block instanceof \ILIAS\Container\Content\ItemGroupBlock) {
+ } elseif ($block instanceof \ILIAS\Container\Content\ObjectGroupBlock) {
$pc_resources->setItemGroupRefId((int) $id);
} elseif ($block instanceof \ILIAS\Container\Content\OtherBlock) {
$pc_resources->setResourceListType("_other");
diff --git a/components/ILIAS/Container/README-technical.md b/components/ILIAS/Container/README-technical.md
index 39534a8210c6..e3f910f4a3c3 100755
--- a/components/ILIAS/Container/README-technical.md
+++ b/components/ILIAS/Container/README-technical.md
@@ -4,8 +4,8 @@ This file documents the main internal technical concepts. There is currently no
## Data
-- **Block**: An abstract block (no items) in the container: TypeBlock, SessionBlock, OtherBlock, ItemGroupBlock
-- **BlockSequencePart**: Abstract, partial sequence of blocks: TypeBlocks (all "by type" blocks), ItemGroupBlocks, ObjectivesBlocks
+- **Block**: An abstract block (no items) in the container: TypeBlock, SessionBlock, OtherBlock, ObjectGroupBlock
+- **BlockSequencePart**: Abstract, partial sequence of blocks: TypeBlocks (all "by type" blocks), ObjectGroupBlocks, ObjectivesBlocks
- **BlockSequence**: An abstract (no items) sequence of all blocks in a container view.
- **ItemBlock**: A concrete block filled with items (ref IDs). Holds information on items (ref id), block ID, embedded in page status, position, block limit exhausted status.
- **ItemBlockSequence**: The concrete sequence of blocks in a container view, filled with items.
@@ -25,7 +25,7 @@ This manager needs to be implemented by each container view that provides a sepa
- determines ItemBlocks sequence incl. page embedded blocks and items per block
- checks visible permission for items
- in the case of sessions this still holds hidden "previous" and "next" sessions
-- determines block sorting, item sorting is mostly done in ItemSetManager, except for item group subitems (is done also here)
+- determines block sorting, item sorting is mostly done in ItemSetManager, except for object group subitems (is done also here)
- collects items of all blocks (except "other") to filter them out of the "other" block (see accumulateRefIds() in code), to avoid redundant rendering in the "other" block
- api
- getSequence() : ItemBlockSequence
@@ -47,7 +47,7 @@ This manager needs to be implemented by each container view that provides a sepa
- gets complete descriptions
- applies classification filter
- groups items (by grouped repo type)
-- applies sorting for all items (note that this does not work for item group subitems, these are sorted in ItemBlockSequenceGenerator)
+- applies sorting for all items (note that this does not work for object group subitems, these are sorted in ItemBlockSequenceGenerator)
- api
- getRefIdsOfType()
- getAllRefIds()
diff --git a/components/ILIAS/Container/README.md b/components/ILIAS/Container/README.md
index c219026f059f..16b0c46bbc43 100755
--- a/components/ILIAS/Container/README.md
+++ b/components/ILIAS/Container/README.md
@@ -2,13 +2,13 @@
This part of the documentation deals with concepts and business rules, for technical documentation see [README-technical.md](./README-technical.md).
-## Presentation of Resource Lists / Item Groups
+## Presentation of Resource Lists / Object Groups
-- Resource lists and item groups are currently presented underneath the content page, if they are not included in active(!) elements of the page (see bug report #9080, #26011). If resources should be hidden from users, rbac or activation settings need to be used.
-- Items that are assigned to an item group or to a session are not presented in the "Content" block or in any "By Type" blocks again. They are not hidden from other sessions or item groups if assigned multiple times.
+- Resource lists and object groups are currently presented underneath the content page, if they are not included in active(!) elements of the page (see bug report #9080, #26011). If resources should be hidden from users, rbac or activation settings need to be used.
+- Items that are assigned to an object group or to a session are not presented in the "Content" block or in any "By Type" blocks again. They are not hidden from other sessions or object groups if assigned multiple times.
- The page editor will add automatically all existing blocks to the end of the page, if they are not embedded in the page content yet. This happens when the editor is entered and when page content is changed. (ILIAS 9, [1])
- This means, that blocks may reappear at the end of the page, if they are deleted from the content. (ILIAS 9, [1]).
-- Non-existing / empty blocks will not appear when editing the page. Only exception are manually created empty item groups which will be shown with a message "This object is empty and contains no items." (ILIAS 9, [1])
+- Non-existing / empty blocks will not appear when editing the page. Only exception are manually created empty object groups which will be shown with a message "This object is empty and contains no items." (ILIAS 9, [1])
- Blocks containing more than 5 items will be shortened in the editor. (ILIAS 9, [1])
- It is possible to add existing blocks multiple times to the page content.
diff --git a/components/ILIAS/Container/Sorting/Positions/Manager.php b/components/ILIAS/Container/Sorting/Positions/Manager.php
index 0a10f468d159..c7adac57b1c8 100755
--- a/components/ILIAS/Container/Sorting/Positions/Manager.php
+++ b/components/ILIAS/Container/Sorting/Positions/Manager.php
@@ -63,8 +63,8 @@ public function clonePositions(
$new_parent_id = 0;
if ($grouping->getParentID()) {
// see bug #20347
- // at least in the case of sessions and item groups parent_ids in container sorting are object IDs but $mappings store references
- if (in_array($grouping->getParentType(), ["sess", "itgr"])) {
+ // at least in the case of sessions and object groups parent_ids in container sorting are object IDs but $mappings store references
+ if (in_array($grouping->getParentType(), ["sess", "obgr"])) {
$par_refs = ilObject::_getAllReferences($grouping->getParentID());
$par_ref_id = current($par_refs); // should be only one
$logger->debug("Got ref id: " . $par_ref_id . " for obj_id " . $grouping->getParentID() . " map ref id: " . ($mappings[$par_ref_id] ?? "") . ".");
diff --git a/components/ILIAS/Container/classes/class.ilContainer.php b/components/ILIAS/Container/classes/class.ilContainer.php
index f21b06a47de2..8fbb92d7f1da 100755
--- a/components/ILIAS/Container/classes/class.ilContainer.php
+++ b/components/ILIAS/Container/classes/class.ilContainer.php
@@ -486,8 +486,8 @@ public function cloneDependencies(int $target_id, int $copy_id): bool
// fix internal links to other objects
self::fixInternalLinksAfterCopy($target_id, $copy_id, $this->getRefId());
- // fix item group references in page content
- ilObjItemGroup::fixContainerItemGroupRefsAfterCloning($this, $copy_id);
+ // fix object group references in page content
+ ilObjObjectGroup::fixContainerObjectGroupRefsAfterCloning($this, $copy_id);
$olp = ilObjectLP::getInstance($this->getId());
$collection = $olp->getCollectionInstance();
diff --git a/components/ILIAS/Container/classes/class.ilContainerGUI.php b/components/ILIAS/Container/classes/class.ilContainerGUI.php
index b26f36f9a307..e707fa3e0509 100755
--- a/components/ILIAS/Container/classes/class.ilContainerGUI.php
+++ b/components/ILIAS/Container/classes/class.ilContainerGUI.php
@@ -2192,7 +2192,7 @@ public function redrawListItemObject(): void
$item_data = $this->object->getSubItems(false, false, $child_ref_id);
$container_view = $this->getContentGUI();
- $item_group_list_presentation = $this->getListPresentationForRedraw($parent_ref_id);
+ $object_group_list_presentation = $this->getListPresentationForRedraw($parent_ref_id);
// see #41377 (material not redrawn, when not a direct child)
$sess_data = [];
@@ -2215,7 +2215,7 @@ public function redrawListItemObject(): void
if ($parent_ref_id !== 0) {
$event_item["parent"] = $parent_ref_id;
}
- $html = $container_view->renderItem($event_item, 0, false, "", $item_group_list_presentation);
+ $html = $container_view->renderItem($event_item, 0, false, "", $object_group_list_presentation);
}
}
}
@@ -2229,10 +2229,10 @@ public function redrawListItemObject(): void
if ($parent_ref_id !== 0) {
$id_with_block["parent"] = $parent_ref_id;
}
- if ($parent_ref_id > 0 && ilObject::_lookupType($parent_ref_id, true) === "itgr") {
+ if ($parent_ref_id > 0 && ilObject::_lookupType($parent_ref_id, true) === "obgr") {
$id_with_block["block_parent"] = $parent_ref_id;
}
- $html = $container_view->renderItem($id_with_block, 0, false, "", $item_group_list_presentation);
+ $html = $container_view->renderItem($id_with_block, 0, false, "", $object_group_list_presentation);
}
}
}
@@ -2252,9 +2252,9 @@ public function redrawListItemObject(): void
protected function getListPresentationForRedraw(int $parent_ref_id): string
{
- if ($parent_ref_id > 0 && ilObject::_lookupType($parent_ref_id, true) === "itgr") {
- $item_group = new \ilObjItemGroup($parent_ref_id, true);
- $presentation = $item_group->getListPresentation();
+ if ($parent_ref_id > 0 && ilObject::_lookupType($parent_ref_id, true) === "obgr") {
+ $object_group = new \ilObjObjectGroup($parent_ref_id, true);
+ $presentation = $object_group->getListPresentation();
if ($presentation === "tile" || $presentation === "list") {
return $presentation;
}
diff --git a/components/ILIAS/Course/classes/Objectives/class.ilCourseObjectiveMaterials.php b/components/ILIAS/Course/classes/Objectives/class.ilCourseObjectiveMaterials.php
index ac49ae0f3752..ecbd92097d1c 100755
--- a/components/ILIAS/Course/classes/Objectives/class.ilCourseObjectiveMaterials.php
+++ b/components/ILIAS/Course/classes/Objectives/class.ilCourseObjectiveMaterials.php
@@ -134,7 +134,7 @@ public static function _getAssignableMaterials(int $a_container_id): array
case 'crs':
case 'rolf':
- case 'itgr':
+ case 'obgr':
break;
default:
diff --git a/components/ILIAS/Course/classes/Objectives/class.ilLOEditorGUI.php b/components/ILIAS/Course/classes/Objectives/class.ilLOEditorGUI.php
index e3794aae4f5c..5726e8b4ef25 100755
--- a/components/ILIAS/Course/classes/Objectives/class.ilLOEditorGUI.php
+++ b/components/ILIAS/Course/classes/Objectives/class.ilLOEditorGUI.php
@@ -495,7 +495,7 @@ protected function materials(): void
{
$this->tabs->activateSubTab('materials');
- $this->parent_gui->renderAddNewItem('itgr');
+ $this->parent_gui->renderAddNewItem('obgr');
$this->tpl->setOnScreenMessage(
'info',
diff --git a/components/ILIAS/Course/classes/Timings/class.ilTimingsManageTableGUI.php b/components/ILIAS/Course/classes/Timings/class.ilTimingsManageTableGUI.php
index ba4d4c909673..1e560fcf0e66 100755
--- a/components/ILIAS/Course/classes/Timings/class.ilTimingsManageTableGUI.php
+++ b/components/ILIAS/Course/classes/Timings/class.ilTimingsManageTableGUI.php
@@ -242,8 +242,8 @@ public function parse(array $a_item_data, array $a_failed_update = array()): voi
foreach ($a_item_data as $item) {
$current_row = array();
- // no item groups
- if ($item['type'] == 'itgr') {
+ // no object groups
+ if ($item['type'] == 'obgr') {
continue;
}
$current_row['ref_id'] = $item['ref_id'];
diff --git a/components/ILIAS/Course/classes/Timings/class.ilTimingsPersonalTableGUI.php b/components/ILIAS/Course/classes/Timings/class.ilTimingsPersonalTableGUI.php
index 6eea27a47e75..6a011267a784 100755
--- a/components/ILIAS/Course/classes/Timings/class.ilTimingsPersonalTableGUI.php
+++ b/components/ILIAS/Course/classes/Timings/class.ilTimingsPersonalTableGUI.php
@@ -194,8 +194,8 @@ public function parse(array $a_item_data, array $failed = array()): void
$current_row = array();
- // no item groups
- if ($item['type'] == 'itgr') {
+ // no object groups
+ if ($item['type'] == 'obgr') {
continue;
}
$current_row['ref_id'] = $item['ref_id'];
diff --git a/components/ILIAS/DI/src/Container.php b/components/ILIAS/DI/src/Container.php
index 24176b14d2d7..a96ba1424af7 100755
--- a/components/ILIAS/DI/src/Container.php
+++ b/components/ILIAS/DI/src/Container.php
@@ -367,9 +367,9 @@ public function mediaCast(): \ILIAS\MediaCast\Service
return new \ILIAS\MediaCast\Service($this);
}
- public function itemGroup(): \ILIAS\ItemGroup\Service
+ public function objectGroup(): \ILIAS\ObjectGroup\Service
{
- return new \ILIAS\ItemGroup\Service($this);
+ return new \ILIAS\ObjectGroup\Service($this);
}
public function htmlLearningModule(): \ILIAS\HTMLLearningModule\Service
diff --git a/components/ILIAS/Dashboard/Favourites/classes/class.ilFavouritesDBRepository.php b/components/ILIAS/Dashboard/Favourites/classes/class.ilFavouritesDBRepository.php
index b3b28a3fdde1..1617fdf1921d 100644
--- a/components/ILIAS/Dashboard/Favourites/classes/class.ilFavouritesDBRepository.php
+++ b/components/ILIAS/Dashboard/Favourites/classes/class.ilFavouritesDBRepository.php
@@ -102,7 +102,7 @@ public function getFavouritesOfUser(int $user_id, ?array $a_types = null): array
$items = $all_parent_path = [];
while ($item_rec = $ilDB->fetchAssoc($item_set)) {
if ($item_rec['type'] !== 'rolf' &&
- $item_rec['type'] !== 'itgr' &&
+ $item_rec['type'] !== 'obgr' &&
$tree->isInTree((int) $item_rec['ref_id'])) { // due to bug 11508
$parent_ref = $tree->getParentId((int) $item_rec['ref_id']);
@@ -133,7 +133,7 @@ public function getFavouritesOfUser(int $user_id, ?array $a_types = null): array
} else {
$items = [];
foreach ($a_types as $a_type) {
- if ($a_type === 'itgr') {
+ if ($a_type === 'obgr') {
continue;
}
$item_set = $ilDB->queryF(
diff --git a/components/ILIAS/Export/classes/class.ilImport.php b/components/ILIAS/Export/classes/class.ilImport.php
index 86fd0818dfb1..4d82af397bdb 100755
--- a/components/ILIAS/Export/classes/class.ilImport.php
+++ b/components/ILIAS/Export/classes/class.ilImport.php
@@ -329,6 +329,7 @@ protected function doImportObject(
string $a_component = "",
string $a_tmpdir = ""
): array {
+ $a_type = $a_type === 'itgr' ? 'obgr' : $a_type;
if ($a_component == "") {
$a_component = ilImportExportFactory::getComponentForExport($a_type);
}
@@ -352,7 +353,8 @@ protected function doImportObject(
$this->mapping->setInstallId($parser->getInstallId());
// check for correct type
- if ($parser->getMainEntity() != $a_type) {
+ $main_entity = $parser->getMainEntity() === 'itgr' ? 'obgr' : $parser->getMainEntity();
+ if ($main_entity != $a_type) {
throw new ilImportObjectTypeMismatchException(
"Object type does not match. Import file has type '" .
$parser->getMainEntity() . "' but import being processed for '" . $a_type . "'."
diff --git a/components/ILIAS/Export/classes/class.ilImportContainer.php b/components/ILIAS/Export/classes/class.ilImportContainer.php
index f911a4d95871..88a69e8bd2af 100755
--- a/components/ILIAS/Export/classes/class.ilImportContainer.php
+++ b/components/ILIAS/Export/classes/class.ilImportContainer.php
@@ -56,7 +56,8 @@ protected function doImportObject(
$first = true;
$ret = [];
foreach ($parser->getExportSets() as $set) {
- $import_info = parent::doImportObject($dir . DIRECTORY_SEPARATOR . $set['path'], $set['type']);
+ $set_type = $set['type'] === 'itgr' ? 'obgr' : $set['type'];
+ $import_info = parent::doImportObject($dir . DIRECTORY_SEPARATOR . $set['path'], $set_type);
$all_importers = array_merge($all_importers, $import_info['importers']);
if ($first) {
$ret = $import_info;
@@ -72,6 +73,7 @@ protected function doImportObject(
protected function createDummy(string $a_type, string $a_title): ilObject
{
+ $a_type = $a_type === 'itgr' ? 'obgr' : $a_type;
$class_name = "ilObj" . $this->objDefinition->getClassName($a_type);
$new = new $class_name();
diff --git a/components/ILIAS/Export/classes/class.ilImportExportFactory.php b/components/ILIAS/Export/classes/class.ilImportExportFactory.php
index 205f944e54ea..d05fd2d14844 100755
--- a/components/ILIAS/Export/classes/class.ilImportExportFactory.php
+++ b/components/ILIAS/Export/classes/class.ilImportExportFactory.php
@@ -91,6 +91,9 @@ public static function getImporterClass(string $a_component): string
# Object changed to ILIASObject with the component revision
$a_component = ($a_component === "components/ILIAS/Object") ? "components/ILIAS/ILIASObject" : $a_component;
$a_component = ($a_component === "Services/Object") ? "components/ILIAS/ILIASObject" : $a_component;
+ # Item groups (itgr) were renamed to object groups (obgr)
+ $a_component = ($a_component === "Modules/ItemGroup") ? "components/ILIAS/ObjectGroup" : $a_component;
+ $a_component = ($a_component === "components/ILIAS/ItemGroup") ? "components/ILIAS/ObjectGroup" : $a_component;
/**
* @var $objDefinition ilObjectDefinition
*/
diff --git a/components/ILIAS/Export/xml/ilias_itgr_4_3.xsd b/components/ILIAS/Export/xml/ilias_obgr_4_3.xsd
old mode 100755
new mode 100644
similarity index 74%
rename from components/ILIAS/Export/xml/ilias_itgr_4_3.xsd
rename to components/ILIAS/Export/xml/ilias_obgr_4_3.xsd
index 135b23473b8e..a5f2f13dd6bd
--- a/components/ILIAS/Export/xml/ilias_itgr_4_3.xsd
+++ b/components/ILIAS/Export/xml/ilias_obgr_4_3.xsd
@@ -1,16 +1,16 @@
+ targetNamespace = "https://www.ilias.de/Modules/ObjectGroup/obgr/4_3"
+ xmlns:t = 'https://www.ilias.de/Modules/ObjectGroup/obgr/4_3'>
-
-
+
+
@@ -24,4 +24,4 @@
-
\ No newline at end of file
+
diff --git a/components/ILIAS/Export/xml/ilias_itgr_5_3.xsd b/components/ILIAS/Export/xml/ilias_obgr_5_3.xsd
old mode 100755
new mode 100644
similarity index 80%
rename from components/ILIAS/Export/xml/ilias_itgr_5_3.xsd
rename to components/ILIAS/Export/xml/ilias_obgr_5_3.xsd
index 9813d968d33a..01f631d01348
--- a/components/ILIAS/Export/xml/ilias_itgr_5_3.xsd
+++ b/components/ILIAS/Export/xml/ilias_obgr_5_3.xsd
@@ -1,16 +1,16 @@
+ targetNamespace = "https://www.ilias.de/Modules/ObjectGroup/obgr/5_3"
+ xmlns:t = 'https://www.ilias.de/Modules/ObjectGroup/obgr/5_3'>
-
-
+
+
@@ -28,4 +28,4 @@
-
\ No newline at end of file
+
diff --git a/components/ILIAS/ILIASObject/classes/class.ilObject2GUI.php b/components/ILIAS/ILIASObject/classes/class.ilObject2GUI.php
index bc6c2a543cf2..ec00b412e39f 100755
--- a/components/ILIAS/ILIASObject/classes/class.ilObject2GUI.php
+++ b/components/ILIAS/ILIASObject/classes/class.ilObject2GUI.php
@@ -700,7 +700,7 @@ public static function handleAfterSaveCallback(ilObject $obj, ?int $callback_ref
if ($callback_ref_id) {
$callback_type = ilObject::_lookupType($callback_ref_id, true);
$class_name = "ilObj" . $objDefinition->getClassName($callback_type) . "GUI";
- if (strtolower($class_name) == "ilobjitemgroupgui") {
+ if (strtolower($class_name) === strtolower(ilObjObjectGroupGUI::class)) {
$callback_obj = new $class_name($callback_ref_id);
} else {
$callback_obj = new $class_name(null, $callback_ref_id, true, false);
diff --git a/components/ILIAS/ILIASObject/classes/class.ilObjectActivation.php b/components/ILIAS/ILIASObject/classes/class.ilObjectActivation.php
index 46f4096c70e7..03fcac4f5a7f 100755
--- a/components/ILIAS/ILIASObject/classes/class.ilObjectActivation.php
+++ b/components/ILIAS/ILIASObject/classes/class.ilObjectActivation.php
@@ -568,13 +568,11 @@ public static function getItemsByEvent(int $event_id): array
}
/**
- * Get materials of item group
+ * Get materials of object group
*/
- public static function getItemsByItemGroup(int $item_group_ref_id): array
+ public static function getItemsByObjectGroup(int $object_group_ref_id): array
{
- $ig_items = new ilItemGroupItems($item_group_ref_id);
- $items = $ig_items->getValidItems();
- return self::processListItems($items);
+ return self::processListItems((new ilObjectGroupItems($object_group_ref_id))->getValidItems());
}
/**
diff --git a/components/ILIAS/ILIASObject/classes/class.ilObjectDefinition.php b/components/ILIAS/ILIASObject/classes/class.ilObjectDefinition.php
index 59540aaad84d..a0496c9a145c 100755
--- a/components/ILIAS/ILIASObject/classes/class.ilObjectDefinition.php
+++ b/components/ILIAS/ILIASObject/classes/class.ilObjectDefinition.php
@@ -842,7 +842,7 @@ public function getExplorerContainerTypes(): array
foreach ($cnt_grp as $grp) {
$res = array_merge($res, $grp_map[$grp]);
}
- $res[] = "itgr";
+ $res[] = "obgr";
return array_unique($res);
}
diff --git a/components/ILIAS/ILIASObject/src/Creation/CreationCallbackTrait.php b/components/ILIAS/ILIASObject/src/Creation/CreationCallbackTrait.php
index 90414bcdca62..c33f71eab7ae 100755
--- a/components/ILIAS/ILIASObject/src/Creation/CreationCallbackTrait.php
+++ b/components/ILIAS/ILIASObject/src/Creation/CreationCallbackTrait.php
@@ -34,7 +34,7 @@ public function callCreationCallback(
$callback_type = \ilObject::_lookupType((int) $requested_crtcb, true);
$class_name = 'ilObj' . $obj_definition->getClassName($callback_type) . 'GUI';
- if (strtolower($class_name) === 'ilobjitemgroupgui') {
+ if (strtolower($class_name) === strtolower(\ilObjObjectGroupGUI::class)) {
$callback_obj = new $class_name((int) $requested_crtcb);
} else {
$callback_obj = new $class_name(null, $requested_crtcb, true, false);
diff --git a/components/ILIAS/Init/classes/class.ilStartUpGUI.php b/components/ILIAS/Init/classes/class.ilStartUpGUI.php
index 4375ea01c570..b013632be580 100755
--- a/components/ILIAS/Init/classes/class.ilStartUpGUI.php
+++ b/components/ILIAS/Init/classes/class.ilStartUpGUI.php
@@ -1390,6 +1390,11 @@ public static function _checkGoto(string $a_target)
$type = 'glo';
}
+ // Item groups (itgr) were renamed to object groups (obgr).
+ if ($type === 'itgr') {
+ $type = 'obgr';
+ }
+
if ($type === 'pg' | $type === 'st') {
$type = 'lm';
}
diff --git a/components/ILIAS/ItemGroup/README.md b/components/ILIAS/ItemGroup/README.md
deleted file mode 100755
index 071b21de7def..000000000000
--- a/components/ILIAS/ItemGroup/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-# General Documentation
-
-This part of the documentation deals with concepts and business rules, for technical documentation see [README-technical.md](./README-technical.md).
-
-## Business Rules
-
-- Item groups cannot be used in sessions. There is no concept how presentation should work yet.
-- Sessions cannot be used in item groups. See https://docu.ilias.de/goto_docu_wiki_wpage_682_1357.html JF Mar 2014 comment
-- Item blocks are only visual components. They are not part of the repository path of items assigned to the item block (they are no real containers). Revoking permissions to the item block will not revoke permissions to assigned items. The access system only checks read permission to the containers (categories, courses), this means items assigned to an item group may still appear in the search results, even if the user has no permission for the item group.
-- Item groups do not offer a "description" input field with ILIAS 8. Since the description has not been presented in containers, the property was abandoned, see https://mantis.ilias.de/view.php?id=31856
\ No newline at end of file
diff --git a/components/ILIAS/ItemGroup/ROADMAP.md b/components/ILIAS/ItemGroup/ROADMAP.md
deleted file mode 100755
index cf99ea1897e5..000000000000
--- a/components/ILIAS/ItemGroup/ROADMAP.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# Roadmap
-
-
-## Short Term
-
-## Mid Term
-
-### Moving to KS / Enabling Keyboard Control
-
-Like other parts of the repository views, the presentation of item groups should be migrated to KS components. One important open issue is the keyboard control of expandable item groups, which is currently not possible, due to the DIV being used for the group header, see also https://mantis.ilias.de/view.php?id=35988
-
-### Sessions in Item Groups
-
-There is a strong need to support this. See business rules in the README.
-
-### Improve Architecture
-
-- Use Service/ classes to...
-- Introduce repository pattern
-- Improve DI handling
-- Factor business logic out of UI classes
-
-## Long Term
diff --git a/components/ILIAS/ItemGroup/classes/Setup/class.ilItemGroupDBUpdateSteps.php b/components/ILIAS/ItemGroup/classes/Setup/class.ilItemGroupDBUpdateSteps.php
deleted file mode 100755
index 6471e6b5f813..000000000000
--- a/components/ILIAS/ItemGroup/classes/Setup/class.ilItemGroupDBUpdateSteps.php
+++ /dev/null
@@ -1,93 +0,0 @@
-
- */
-class ilItemGroupDBUpdateSteps implements \ilDatabaseUpdateSteps
-{
- protected \ilDBInterface $db;
-
- public function prepare(\ilDBInterface $db): void
- {
- $this->db = $db;
- }
-
- public function step_1(): void
- {
- if (!$this->db->tableColumnExists('itgr_data', 'list_presentation')) {
- $this->db->addTableColumn('itgr_data', 'list_presentation', array(
- "type" => "text",
- "length" => 10
- ));
- }
- }
-
- public function step_2()
- {
- if (!$this->db->tableColumnExists('itgr_data', 'tile_size')) {
- $this->db->addTableColumn('itgr_data', 'tile_size', array(
- "type" => "integer",
- "notnull" => true,
- "default" => 0,
- "length" => 1
- ));
- }
- }
-
- public function step_3(): void
- {
- if (!$this->db->tableColumnExists('itgr_data', 'display')) {
- $this->db->addTableColumn('itgr_data', 'display', [
- 'type' => ilDBConstants::T_TEXT,
- 'notnull' => true,
- 'default' => ilItemGroupAR::DISPLAY_WITH_TITLE,
- 'length' => 255
- ]);
- }
-
- if (!$this->db->tableColumnExists('itgr_data', 'toggleable_initially')) {
- $this->db->addTableColumn('itgr_data', 'toggleable_initially', [
- 'type' => ilDBConstants::T_TEXT,
- 'notnull' => true,
- 'default' => ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN,
- 'length' => 255
- ]);
- }
- }
-
- public function step_4(): void
- {
- if ($this->db->tableColumnExists('itgr_data', 'hide_title')) {
- $this->db->modifyTableColumn('itgr_data', 'hide_title', [
- 'default' => ilItemGroupDisplayMigration::MIGRATED_MARKER,
- ]);
- }
-
- if ($this->db->tableColumnExists('itgr_data', 'behaviour')) {
- $this->db->modifyTableColumn('itgr_data', 'behaviour', [
- 'default' => ilItemGroupDisplayMigration::MIGRATED_MARKER,
- ]);
- }
- }
-}
diff --git a/components/ILIAS/ItemGroup/ItemGroup.php b/components/ILIAS/ObjectGroup/ObjectGroup.php
similarity index 91%
rename from components/ILIAS/ItemGroup/ItemGroup.php
rename to components/ILIAS/ObjectGroup/ObjectGroup.php
index 18dcb3c98b39..8850281ed4a6 100644
--- a/components/ILIAS/ItemGroup/ItemGroup.php
+++ b/components/ILIAS/ObjectGroup/ObjectGroup.php
@@ -20,7 +20,7 @@
namespace ILIAS;
-class ItemGroup implements Component\Component
+class ObjectGroup implements Component\Component
{
public function init(
array | \ArrayAccess &$define,
@@ -33,7 +33,7 @@ public function init(
array | \ArrayAccess &$internal,
): void {
$contribute[\ILIAS\Setup\Agent::class] = static fn() =>
- new \ILIAS\ItemGroup\Setup\Agent(
+ new \ILIAS\ObjectGroup\Setup\Agent(
$pull[\ILIAS\Refinery\Factory::class]
);
}
diff --git a/components/ILIAS/ItemGroup/PRIVACY.md b/components/ILIAS/ObjectGroup/PRIVACY.md
similarity index 67%
rename from components/ILIAS/ItemGroup/PRIVACY.md
rename to components/ILIAS/ObjectGroup/PRIVACY.md
index f8e63357e5a7..68d270b95b08 100755
--- a/components/ILIAS/ItemGroup/PRIVACY.md
+++ b/components/ILIAS/ObjectGroup/PRIVACY.md
@@ -1,4 +1,4 @@
-# Item Group Privacy
+# Object Group Privacy
This documentation does not warrant completeness or correctness. Please report any
missing or wrong information using the [ILIAS issue tracker](https://mantis.ilias.de)
@@ -6,7 +6,7 @@ or contribute a fix via [Pull Request](../../../docs/development/contributing.md
## Integrated Services
-- The Item Group component employs the following services, please consult the respective privacy.mds
+- The Object Group component employs the following services, please consult the respective privacy.mds
- The **Object** service stores the account which created the
object as it's owner and creation and update timestamps for the
object.
@@ -15,16 +15,16 @@ or contribute a fix via [Pull Request](../../../docs/development/contributing.md
## Data being stored
-- The Item Group module itself does not store any personal data.
+- The Object Group module itself does not store any personal data.
## Data presentation
-- The Item group itself does not present any personal data.
+- The Object group itself does not present any personal data.
## Data Deletion
-- The Item group itself does not store or delete any personal data.
+- The Object group itself does not store or delete any personal data.
- Basic object and permission data is deleted once the object is "finally" deleted
(removed from trash).
diff --git a/components/ILIAS/ItemGroup/README-technical.md b/components/ILIAS/ObjectGroup/README-technical.md
similarity index 80%
rename from components/ILIAS/ItemGroup/README-technical.md
rename to components/ILIAS/ObjectGroup/README-technical.md
index 24625a23db9d..f7d47c5fcc7d 100644
--- a/components/ILIAS/ItemGroup/README-technical.md
+++ b/components/ILIAS/ObjectGroup/README-technical.md
@@ -1,8 +1,8 @@
# General Documentation
-## Creating new objects in item groups
+## Creating new objects in object groups
-Item groups support to create repository objects in their "materials" tab. This allows new objects to be created and directly assigned to the item group.
+Object groups support to create repository objects in their "materials" tab. This allows new objects to be created and directly assigned to the object group.
To achieve this, the `ImplementsCreationCallback` interface of the object service is used. This mechanism only works, if the repository object implementation ensures a call to the method `callCreationCallback()` which invokes these callbacks.
@@ -10,4 +10,4 @@ The default implementation in `ilObjectGUI` calls this method in `ilObjectGUI->p
If your repository object does not overwrite these methods, everything should be fine. If your object overwrites `saveObject()` or `importFileObject()`, please ensure that they still contain a call to `putObjectInTree()`. If not, ensure that `$this->callCreationCallback($newObj, $this->obj_definition, $this->requested_crtcb);` is called.
-If the resulting implementation does not call `callCreationCallback(...)` for the import and save workflows, objects will not be added to the item group.
\ No newline at end of file
+If the resulting implementation does not call `callCreationCallback(...)` for the import and save workflows, objects will not be added to the object group.
\ No newline at end of file
diff --git a/components/ILIAS/ObjectGroup/README.md b/components/ILIAS/ObjectGroup/README.md
new file mode 100755
index 000000000000..4abc17b73244
--- /dev/null
+++ b/components/ILIAS/ObjectGroup/README.md
@@ -0,0 +1,10 @@
+# General Documentation
+
+This part of the documentation deals with concepts and business rules, for technical documentation see [README-technical.md](./README-technical.md).
+
+## Business Rules
+
+- Object groups cannot be used in sessions. There is no concept how presentation should work yet.
+- Sessions cannot be used in object groups. See https://docu.ilias.de/goto_docu_wiki_wpage_682_1357.html JF Mar 2014 comment
+- Object groups are only visual components. They are not part of the repository path of items assigned to the object group (they are no real containers). Revoking permissions to the object group will not revoke permissions to assigned items. The access system only checks read permission to the containers (categories, courses), this means items assigned to an object group may still appear in the search results, even if the user has no permission for the object group.
+- Object groups do not offer a "description" input field with ILIAS 8. Since the description has not been presented in containers, the property was abandoned, see https://mantis.ilias.de/view.php?id=31856
\ No newline at end of file
diff --git a/components/ILIAS/ObjectGroup/ROADMAP.md b/components/ILIAS/ObjectGroup/ROADMAP.md
new file mode 100755
index 000000000000..1325307f4336
--- /dev/null
+++ b/components/ILIAS/ObjectGroup/ROADMAP.md
@@ -0,0 +1,23 @@
+# Roadmap
+
+
+## Short Term
+
+## Mid Term
+
+### Moving to KS / Enabling Keyboard Control
+
+Like other parts of the repository views, the presentation of object groups should be migrated to KS components. One important open issue is the keyboard control of expandable object groups, which is currently not possible, due to the DIV being used for the group header, see also https://mantis.ilias.de/view.php?id=35988
+
+### Sessions in Object Groups
+
+There is a strong need to support this. See business rules in the README.
+
+### Improve Architecture
+
+- Use Service/ classes to...
+- Introduce repository pattern
+- Improve DI handling
+- Factor business logic out of UI classes
+
+## Long Term
diff --git a/components/ILIAS/ItemGroup/Service/class.InternalDataService.php b/components/ILIAS/ObjectGroup/Service/class.InternalDataService.php
similarity index 96%
rename from components/ILIAS/ItemGroup/Service/class.InternalDataService.php
rename to components/ILIAS/ObjectGroup/Service/class.InternalDataService.php
index bc94a1a3970b..ce2a4681cf5f 100755
--- a/components/ILIAS/ItemGroup/Service/class.InternalDataService.php
+++ b/components/ILIAS/ObjectGroup/Service/class.InternalDataService.php
@@ -18,7 +18,7 @@
declare(strict_types=1);
-namespace ILIAS\ItemGroup;
+namespace ILIAS\ObjectGroup;
/**
* @author Alexander Killing
diff --git a/components/ILIAS/ItemGroup/Service/class.InternalDomainService.php b/components/ILIAS/ObjectGroup/Service/class.InternalDomainService.php
similarity index 98%
rename from components/ILIAS/ItemGroup/Service/class.InternalDomainService.php
rename to components/ILIAS/ObjectGroup/Service/class.InternalDomainService.php
index e3abb85bf1fb..fafb7137e71a 100755
--- a/components/ILIAS/ItemGroup/Service/class.InternalDomainService.php
+++ b/components/ILIAS/ObjectGroup/Service/class.InternalDomainService.php
@@ -18,7 +18,7 @@
declare(strict_types=1);
-namespace ILIAS\ItemGroup;
+namespace ILIAS\ObjectGroup;
use ILIAS\DI\Container;
use ILIAS\Repository\GlobalDICDomainServices;
diff --git a/components/ILIAS/ItemGroup/Service/class.InternalGUIService.php b/components/ILIAS/ObjectGroup/Service/class.InternalGUIService.php
similarity index 98%
rename from components/ILIAS/ItemGroup/Service/class.InternalGUIService.php
rename to components/ILIAS/ObjectGroup/Service/class.InternalGUIService.php
index b983371af986..db5427c4732d 100755
--- a/components/ILIAS/ItemGroup/Service/class.InternalGUIService.php
+++ b/components/ILIAS/ObjectGroup/Service/class.InternalGUIService.php
@@ -18,7 +18,7 @@
declare(strict_types=1);
-namespace ILIAS\ItemGroup;
+namespace ILIAS\ObjectGroup;
use ILIAS\DI\Container;
use ILIAS\Repository\GlobalDICGUIServices;
diff --git a/components/ILIAS/ItemGroup/Service/class.InternalRepoService.php b/components/ILIAS/ObjectGroup/Service/class.InternalRepoService.php
similarity index 79%
rename from components/ILIAS/ItemGroup/Service/class.InternalRepoService.php
rename to components/ILIAS/ObjectGroup/Service/class.InternalRepoService.php
index c11f3737306a..9ab3dc8c5a87 100755
--- a/components/ILIAS/ItemGroup/Service/class.InternalRepoService.php
+++ b/components/ILIAS/ObjectGroup/Service/class.InternalRepoService.php
@@ -18,10 +18,10 @@
declare(strict_types=1);
-namespace ILIAS\ItemGroup;
+namespace ILIAS\ObjectGroup;
use ilDBInterface;
-use ILIAS\ItemGroup\Repository\ItemGroupRepository;
+use ILIAS\ObjectGroup\Repository\ObjectGroupRepository;
class InternalRepoService
{
@@ -31,8 +31,8 @@ public function __construct(
) {
}
- public function itemGroup(): ItemGroupRepository
+ public function objectGroup(): ObjectGroupRepository
{
- return new ItemGroupRepository($this->db);
+ return new ObjectGroupRepository($this->db);
}
}
diff --git a/components/ILIAS/ItemGroup/Service/class.InternalService.php b/components/ILIAS/ObjectGroup/Service/class.InternalService.php
similarity index 98%
rename from components/ILIAS/ItemGroup/Service/class.InternalService.php
rename to components/ILIAS/ObjectGroup/Service/class.InternalService.php
index bc97e7c6fb6c..c87ca9d81370 100755
--- a/components/ILIAS/ItemGroup/Service/class.InternalService.php
+++ b/components/ILIAS/ObjectGroup/Service/class.InternalService.php
@@ -18,7 +18,7 @@
declare(strict_types=1);
-namespace ILIAS\ItemGroup;
+namespace ILIAS\ObjectGroup;
use ILIAS\DI\Container;
diff --git a/components/ILIAS/ItemGroup/Service/class.Service.php b/components/ILIAS/ObjectGroup/Service/class.Service.php
similarity index 97%
rename from components/ILIAS/ItemGroup/Service/class.Service.php
rename to components/ILIAS/ObjectGroup/Service/class.Service.php
index 095d81d2b4a0..5ff2e1da3f42 100755
--- a/components/ILIAS/ItemGroup/Service/class.Service.php
+++ b/components/ILIAS/ObjectGroup/Service/class.Service.php
@@ -18,7 +18,7 @@
declare(strict_types=1);
-namespace ILIAS\ItemGroup;
+namespace ILIAS\ObjectGroup;
use ILIAS\DI\Container;
diff --git a/components/ILIAS/ItemGroup/classes/Setup/class.Agent.php b/components/ILIAS/ObjectGroup/classes/Setup/class.Agent.php
similarity index 81%
rename from components/ILIAS/ItemGroup/classes/Setup/class.Agent.php
rename to components/ILIAS/ObjectGroup/classes/Setup/class.Agent.php
index fe02a23b5e59..75f2496e5705 100755
--- a/components/ILIAS/ItemGroup/classes/Setup/class.Agent.php
+++ b/components/ILIAS/ObjectGroup/classes/Setup/class.Agent.php
@@ -18,7 +18,7 @@
declare(strict_types=1);
-namespace ILIAS\ItemGroup\Setup;
+namespace ILIAS\ObjectGroup\Setup;
use ILIAS\Setup\Agent\NullAgent;
use ILIAS\Setup\Config;
@@ -29,14 +29,15 @@ class Agent extends NullAgent
{
public function getUpdateObjective(?Config $config = null): Objective
{
- return new ilDatabaseUpdateStepsExecutedObjective(new ilItemGroupDBUpdateSteps());
+ return new ilDatabaseUpdateStepsExecutedObjective(new ilObjectGroupDBUpdateSteps());
}
public function getMigrations(): array
{
return [
- new ilItemGroupDisplayMigration(),
- new ilItemGroupDataTableColumnMigration(),
+ new ilObjectGroupDisplayMigration(),
+ new ilObjectGroupDataTableColumnMigration(),
+ new ilObjectGroupRebrandMigration(),
];
}
}
diff --git a/components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupDBUpdateSteps.php b/components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupDBUpdateSteps.php
new file mode 100755
index 000000000000..e4f7b1cea95b
--- /dev/null
+++ b/components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupDBUpdateSteps.php
@@ -0,0 +1,158 @@
+db = $db;
+ }
+
+ public function step_1(): void
+ {
+ if (!$this->db->tableColumnExists($this->dataTableName(), 'list_presentation')) {
+ $this->db->addTableColumn($this->dataTableName(), 'list_presentation', [
+ 'type' => 'text',
+ 'length' => 10,
+ ]);
+ }
+ }
+
+ public function step_2(): void
+ {
+ if (!$this->db->tableColumnExists($this->dataTableName(), 'tile_size')) {
+ $this->db->addTableColumn($this->dataTableName(), 'tile_size', [
+ 'type' => 'integer',
+ 'notnull' => true,
+ 'default' => 0,
+ 'length' => 1,
+ ]);
+ }
+ }
+
+ public function step_3(): void
+ {
+ if (!$this->db->tableColumnExists($this->dataTableName(), 'display')) {
+ $this->db->addTableColumn($this->dataTableName(), 'display', [
+ 'type' => ilDBConstants::T_TEXT,
+ 'notnull' => true,
+ 'default' => ilObjectGroupAR::DISPLAY_WITH_TITLE,
+ 'length' => 255,
+ ]);
+ }
+
+ if (!$this->db->tableColumnExists($this->dataTableName(), 'toggleable_initially')) {
+ $this->db->addTableColumn($this->dataTableName(), 'toggleable_initially', [
+ 'type' => ilDBConstants::T_TEXT,
+ 'notnull' => true,
+ 'default' => ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN,
+ 'length' => 255,
+ ]);
+ }
+ }
+
+ public function step_4(): void
+ {
+ $table = $this->dataTableName();
+
+ if ($this->db->tableColumnExists($table, 'hide_title')) {
+ $this->db->modifyTableColumn($table, 'hide_title', [
+ 'default' => ilObjectGroupDisplayMigration::MIGRATED_MARKER,
+ ]);
+ }
+
+ if ($this->db->tableColumnExists($table, 'behaviour')) {
+ $this->db->modifyTableColumn($table, 'behaviour', [
+ 'default' => ilObjectGroupDisplayMigration::MIGRATED_MARKER,
+ ]);
+ }
+ }
+
+ public function step_5(): void
+ {
+ if ($this->db->tableExists('itgr_data') && !$this->db->tableExists('obgr_data')) {
+ $this->db->renameTable('itgr_data', 'obgr_data');
+ }
+
+ if ($this->db->tableExists('item_group_item') && !$this->db->tableExists('object_group_item')) {
+ $this->db->renameTable('item_group_item', 'object_group_item');
+ }
+
+ $assignment_table = $this->assignmentTableName();
+
+ if ($this->db->tableColumnExists($assignment_table, 'item_group_id')
+ && !$this->db->tableColumnExists($assignment_table, 'object_group_id')) {
+ $this->db->dropPrimaryKey($assignment_table);
+ $this->db->renameTableColumn($assignment_table, 'item_group_id', 'object_group_id');
+ }
+
+ if ($this->db->tableColumnExists($assignment_table, 'item_ref_id')
+ && !$this->db->tableColumnExists($assignment_table, 'object_ref_id')) {
+ $this->db->renameTableColumn($assignment_table, 'item_ref_id', 'object_ref_id');
+ }
+
+ if ($this->db->tableExists($assignment_table)
+ && $this->db->tableColumnExists($assignment_table, 'object_group_id')
+ && $this->db->tableColumnExists($assignment_table, 'object_ref_id')
+ && !$this->primaryKeyExists($assignment_table)) {
+ $this->db->addPrimaryKey($assignment_table, ['object_group_id', 'object_ref_id']);
+ }
+ }
+
+ private function primaryKeyExists(string $table): bool
+ {
+ $manager = $this->db->loadModule(ilDBConstants::MODULE_MANAGER);
+ $reverse = $this->db->loadModule(ilDBConstants::MODULE_REVERSE);
+
+ foreach ($manager->listTableConstraints($table) as $constraint) {
+ $info = $reverse->getTableConstraintDefinition($table, $constraint);
+ if ($info['primary'] ?? false) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private function dataTableName(): string
+ {
+ if ($this->db->tableExists('obgr_data')) {
+ return 'obgr_data';
+ }
+
+ return 'itgr_data';
+ }
+
+ private function assignmentTableName(): string
+ {
+ if ($this->db->tableExists('object_group_item')) {
+ return 'object_group_item';
+ }
+
+ return 'item_group_item';
+ }
+}
diff --git a/components/ILIAS/ItemGroup/classes/Setup/class.ilItemGroupDataTableColumnMigration.php b/components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupDataTableColumnMigration.php
similarity index 58%
rename from components/ILIAS/ItemGroup/classes/Setup/class.ilItemGroupDataTableColumnMigration.php
rename to components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupDataTableColumnMigration.php
index 8b45cb65ab08..00582e76f416 100644
--- a/components/ILIAS/ItemGroup/classes/Setup/class.ilItemGroupDataTableColumnMigration.php
+++ b/components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupDataTableColumnMigration.php
@@ -18,7 +18,7 @@
declare(strict_types=1);
-namespace ILIAS\ItemGroup\Setup;
+namespace ILIAS\ObjectGroup\Setup;
use ilDatabaseUpdateStepsExecutedObjective;
use ilDBConstants;
@@ -27,13 +27,13 @@
use ILIAS\Setup\Migration;
use RuntimeException;
-class ilItemGroupDataTableColumnMigration implements Migration
+class ilObjectGroupDataTableColumnMigration implements Migration
{
private ilDBInterface $db;
public function getLabel(): string
{
- return 'Removes item group data table columns hide_title and behaviour.';
+ return 'Removes object group data table columns hide_title and behaviour.';
}
public function getDefaultAmountOfStepsPerRun(): int
@@ -44,7 +44,7 @@ public function getDefaultAmountOfStepsPerRun(): int
public function getPreconditions(Environment $environment): array
{
return [
- new ilDatabaseUpdateStepsExecutedObjective(new ilItemGroupDBUpdateSteps())
+ new ilDatabaseUpdateStepsExecutedObjective(new ilObjectGroupDBUpdateSteps()),
];
}
@@ -59,43 +59,51 @@ public function step(Environment $environment): void
return;
}
- if ($this->db->tableColumnExists('itgr_data', 'hide_title')) {
- $this->db->dropTableColumn('itgr_data', 'hide_title');
+ $table = $this->dataTableName();
+
+ if ($this->db->tableColumnExists($table, 'hide_title')) {
+ $this->db->dropTableColumn($table, 'hide_title');
}
- if ($this->db->tableColumnExists('itgr_data', 'behaviour')) {
- $this->db->dropTableColumn('itgr_data', 'behaviour');
+ if ($this->db->tableColumnExists($table, 'behaviour')) {
+ $this->db->dropTableColumn($table, 'behaviour');
}
}
public function getRemainingAmountOfSteps(): int
{
if ($this->isDataMigrationRequired()) {
- throw new RuntimeException(sprintf('The %s migration must be executed first.', ilItemGroupDisplayMigration::class));
+ throw new RuntimeException(sprintf('The %s migration must be executed first.', ilObjectGroupDisplayMigration::class));
}
+ $table = $this->dataTableName();
+
return (int) (
- $this->db->tableColumnExists('itgr_data', 'hide_title')
- || $this->db->tableColumnExists('itgr_data', 'behaviour')
+ $this->db->tableColumnExists($table, 'hide_title')
+ || $this->db->tableColumnExists($table, 'behaviour')
);
}
private function isDataMigrationRequired(): bool
{
if (
- !$this->db->tableColumnExists('itgr_data', 'hide_title')
- || !$this->db->tableColumnExists('itgr_data', 'behaviour')
+ !$this->db->tableColumnExists($this->dataTableName(), 'hide_title')
+ || !$this->db->tableColumnExists($this->dataTableName(), 'behaviour')
) {
return false;
}
-
$result = $this->db->queryF(
- 'SELECT COUNT(id) AS cnt FROM itgr_data WHERE hide_title <> %s AND behaviour <> %s',
+ 'SELECT COUNT(id) AS cnt FROM ' . $this->dataTableName() . ' WHERE hide_title <> %s AND behaviour <> %s',
[ilDBConstants::T_INTEGER, ilDBConstants::T_INTEGER],
- [ilItemGroupDisplayMigration::MIGRATED_MARKER, ilItemGroupDisplayMigration::MIGRATED_MARKER]
+ [ilObjectGroupDisplayMigration::MIGRATED_MARKER, ilObjectGroupDisplayMigration::MIGRATED_MARKER]
);
return ($this->db->fetchObject($result)?->cnt ?? 0) > 0;
}
+
+ private function dataTableName(): string
+ {
+ return $this->db->tableExists('obgr_data') ? 'obgr_data' : 'itgr_data';
+ }
}
diff --git a/components/ILIAS/ItemGroup/classes/Setup/class.ilItemGroupDisplayMigration.php b/components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupDisplayMigration.php
similarity index 62%
rename from components/ILIAS/ItemGroup/classes/Setup/class.ilItemGroupDisplayMigration.php
rename to components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupDisplayMigration.php
index 69c35766aebc..ffba87a5d301 100644
--- a/components/ILIAS/ItemGroup/classes/Setup/class.ilItemGroupDisplayMigration.php
+++ b/components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupDisplayMigration.php
@@ -18,17 +18,17 @@
declare(strict_types=1);
-namespace ILIAS\ItemGroup\Setup;
+namespace ILIAS\ObjectGroup\Setup;
use ilDatabaseUpdateStepsExecutedObjective;
-use ilDBInterface;
use ilDBConstants;
-use ilItemGroupAR;
-use ilItemGroupBehaviour;
+use ilDBInterface;
+use ilObjectGroupAR;
+use ilObjectGroupBehaviour;
use ILIAS\Setup\Environment;
use ILIAS\Setup\Migration;
-class ilItemGroupDisplayMigration implements Migration
+class ilObjectGroupDisplayMigration implements Migration
{
public const MIGRATED_MARKER = -1;
@@ -36,7 +36,7 @@ class ilItemGroupDisplayMigration implements Migration
public function getLabel(): string
{
- return 'Migrate item group hide_title/behaviour to display/toggleable_initially.';
+ return 'Migrate object group hide_title/behaviour to display/toggleable_initially.';
}
public function getDefaultAmountOfStepsPerRun(): int
@@ -47,7 +47,7 @@ public function getDefaultAmountOfStepsPerRun(): int
public function getPreconditions(Environment $environment): array
{
return [
- new ilDatabaseUpdateStepsExecutedObjective(new ilItemGroupDBUpdateSteps())
+ new ilDatabaseUpdateStepsExecutedObjective(new ilObjectGroupDBUpdateSteps()),
];
}
@@ -62,8 +62,10 @@ public function step(Environment $environment): void
return;
}
+ $table = $this->dataTableName();
+
$result = $this->db->queryF(
- 'SELECT id, hide_title, behaviour FROM itgr_data WHERE hide_title <> %s AND behaviour <> %s LIMIT 1',
+ 'SELECT id, hide_title, behaviour FROM ' . $table . ' WHERE hide_title <> %s AND behaviour <> %s LIMIT 1',
[ilDBConstants::T_INTEGER, ilDBConstants::T_INTEGER],
[self::MIGRATED_MARKER, self::MIGRATED_MARKER]
);
@@ -76,7 +78,7 @@ public function step(Environment $environment): void
[$display, $toggleable_initially] = $this->mapLegacyValues((int) $row['hide_title'], (int) $row['behaviour']);
$this->db->update(
- 'itgr_data',
+ $table,
[
'display' => [ilDBConstants::T_TEXT, $display],
'toggleable_initially' => [ilDBConstants::T_TEXT, $toggleable_initially],
@@ -95,8 +97,10 @@ public function getRemainingAmountOfSteps(): int
return 0;
}
+ $table = $this->dataTableName();
+
$result = $this->db->queryF(
- 'SELECT COUNT(id) AS cnt FROM itgr_data WHERE hide_title <> %s AND behaviour <> %s',
+ 'SELECT COUNT(id) AS cnt FROM ' . $table . ' WHERE hide_title <> %s AND behaviour <> %s',
[ilDBConstants::T_INTEGER, ilDBConstants::T_INTEGER],
[self::MIGRATED_MARKER, self::MIGRATED_MARKER]
);
@@ -111,28 +115,38 @@ private function mapLegacyValues(int $hide_title, int $behaviour): array
{
return match (true) {
$hide_title === 1 => [
- ilItemGroupAR::DISPLAY_WITHOUT_TITLE,
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN,
+ ilObjectGroupAR::DISPLAY_WITHOUT_TITLE,
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN,
],
- $behaviour === ilItemGroupBehaviour::EXPANDABLE_CLOSED => [
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE,
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED,
+ $behaviour === ilObjectGroupBehaviour::EXPANDABLE_CLOSED => [
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE,
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED,
],
- $behaviour === ilItemGroupBehaviour::EXPANDABLE_OPEN => [
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE,
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN,
+ $behaviour === ilObjectGroupBehaviour::EXPANDABLE_OPEN => [
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE,
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN,
],
default => [
- ilItemGroupAR::DISPLAY_WITH_TITLE,
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN,
- ]
+ ilObjectGroupAR::DISPLAY_WITH_TITLE,
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN,
+ ],
};
}
private function columnsExist(): bool
{
- return
- $this->db->tableColumnExists('itgr_data', 'hide_title')
- && $this->db->tableColumnExists('itgr_data', 'behaviour');
+ $table = $this->dataTableName();
+
+ return $this->db->tableColumnExists($table, 'hide_title')
+ && $this->db->tableColumnExists($table, 'behaviour');
+ }
+
+ private function dataTableName(): string
+ {
+ if ($this->db->tableExists('obgr_data')) {
+ return 'obgr_data';
+ }
+
+ return 'itgr_data';
}
}
diff --git a/components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupRebrandMigration.php b/components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupRebrandMigration.php
new file mode 100644
index 000000000000..ed292c6de1a5
--- /dev/null
+++ b/components/ILIAS/ObjectGroup/classes/Setup/class.ilObjectGroupRebrandMigration.php
@@ -0,0 +1,702 @@
+ 'obj_add_new_pos_obgr',
+ 'obj_add_new_pos_grp_itgr' => 'obj_add_new_pos_grp_obgr',
+ 'obj_dis_creation_itgr' => 'obj_dis_creation_obgr',
+ ];
+
+ /**
+ * @var array, columns: list}>
+ */
+ private const array LEGACY_TARGETS = [
+ 'object_data_del' => [
+ 'pk' => ['obj_id'],
+ 'columns' => ['type'],
+ ],
+ 'il_news_item' => [
+ 'pk' => ['id'],
+ 'columns' => ['context_obj_type', 'context_sub_obj_type'],
+ ],
+ 'adv_md_record_objs' => [
+ 'pk' => ['record_id', 'obj_type', 'sub_type'],
+ 'columns' => ['obj_type'],
+ ],
+ 'adv_md_substitutions' => [
+ 'pk' => ['obj_type'],
+ 'columns' => ['obj_type'],
+ ],
+ 'didactic_tpl_sa' => [
+ 'pk' => ['id', 'obj_type'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_cert_template' => [
+ 'pk' => ['id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_custom_block' => [
+ 'pk' => ['id'],
+ 'columns' => ['context_obj_type', 'context_sub_obj_type'],
+ ],
+ 'obj_stat' => [
+ 'pk' => ['obj_id', 'yyyy', 'mm', 'dd', 'hh'],
+ 'columns' => ['obj_type'],
+ ],
+ 'obj_stat_log' => [
+ 'pk' => ['log_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'search_command_queue' => [
+ 'pk' => ['obj_id', 'obj_type', 'sub_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_annotation' => [
+ 'pk' => ['meta_annotation_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_classification' => [
+ 'pk' => ['meta_classification_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_context' => [
+ 'pk' => ['meta_context_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_contribute' => [
+ 'pk' => ['meta_contribute_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_coverage' => [
+ 'pk' => ['meta_coverage_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_description' => [
+ 'pk' => ['meta_description_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_educational' => [
+ 'pk' => ['meta_educational_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_end_usr_role' => [
+ 'pk' => ['meta_end_usr_role_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_entity' => [
+ 'pk' => ['meta_entity_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_format' => [
+ 'pk' => ['meta_format_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_general' => [
+ 'pk' => ['meta_general_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_identifier' => [
+ 'pk' => ['meta_identifier_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_identifier_' => [
+ 'pk' => ['meta_identifier__id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_keyword' => [
+ 'pk' => ['meta_keyword_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_language' => [
+ 'pk' => ['meta_language_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_lifecycle' => [
+ 'pk' => ['meta_lifecycle_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_location' => [
+ 'pk' => ['meta_location_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_lr_type' => [
+ 'pk' => ['meta_lr_type_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_meta_data' => [
+ 'pk' => ['meta_meta_data_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_meta_schema' => [
+ 'pk' => ['meta_meta_schema_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_or_composite' => [
+ 'pk' => ['meta_or_composite_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_relation' => [
+ 'pk' => ['meta_relation_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_requirement' => [
+ 'pk' => ['meta_requirement_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_rights' => [
+ 'pk' => ['meta_rights_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_tar' => [
+ 'pk' => ['meta_tar_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_taxon' => [
+ 'pk' => ['meta_taxon_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_taxon_path' => [
+ 'pk' => ['meta_taxon_path_id'],
+ 'columns' => ['obj_type'],
+ ],
+ 'il_meta_technical' => [
+ 'pk' => ['meta_technical_id'],
+ 'columns' => ['obj_type'],
+ ],
+ ];
+
+ private const array LEGACY_TEXT_COLUMNS = [
+ 'obj_type',
+ 'type',
+ 'sub_type',
+ 'context_obj_type',
+ 'context_sub_obj_type',
+ ];
+
+ protected ilDBInterface $db;
+
+ public function getLabel(): string
+ {
+ return 'Rebrand Item Group (itgr) to Object Group (obgr) in stored data.';
+ }
+
+ public function getDefaultAmountOfStepsPerRun(): int
+ {
+ return Migration::INFINITE;
+ }
+
+ public function getPreconditions(Environment $environment): array
+ {
+ return [
+ new ilDatabaseUpdateStepsExecutedObjective(new ilObjectGroupDBUpdateSteps()),
+ ];
+ }
+
+ public function prepare(Environment $environment): void
+ {
+ $this->db = $environment->getResource(Environment::RESOURCE_DATABASE);
+ }
+
+ public function step(Environment $environment): void
+ {
+ match (true) {
+ $this->remainingObjectData() > 0 => $this->stepObjectData(),
+ $this->remainingRbac() > 0 => $this->stepRbac(),
+ $this->remainingContainerSorting() > 0 => $this->stepContainerSorting(),
+ $this->remainingSettings() > 0 => $this->stepSettings(),
+ $this->remainingDesktopItem() > 0 => $this->stepDesktopItem(),
+ $this->remainingLegacy() > 0 => $this->stepLegacy(),
+ default => null,
+ };
+ }
+
+ public function getRemainingAmountOfSteps(): int
+ {
+ if (!isset($this->db)) {
+ return 0;
+ }
+
+ return
+ $this->remainingObjectData()
+ + $this->remainingRbac()
+ + $this->remainingContainerSorting()
+ + $this->remainingSettings()
+ + $this->remainingDesktopItem()
+ + $this->remainingLegacy();
+ }
+
+ private function remainingObjectData(): int
+ {
+ $result = $this->db->queryF(
+ 'SELECT COUNT(obj_id) AS cnt FROM object_data WHERE type = %s',
+ [ilDBConstants::T_TEXT],
+ [self::OLD_TYPE]
+ );
+ $count = (int) ($this->db->fetchObject($result)?->cnt ?? 0);
+
+ $typ_result = $this->db->queryF(
+ 'SELECT COUNT(obj_id) AS cnt FROM object_data WHERE type = %s AND title = %s',
+ [ilDBConstants::T_TEXT, ilDBConstants::T_TEXT],
+ ['typ', self::OLD_TYPE]
+ );
+ $typ_count = (int) ($this->db->fetchObject($typ_result)?->cnt ?? 0);
+
+ return $count + $typ_count;
+ }
+
+ private function stepObjectData(): void
+ {
+ $result = $this->db->queryF(
+ 'SELECT obj_id FROM object_data WHERE type = %s LIMIT 1',
+ [ilDBConstants::T_TEXT],
+ [self::OLD_TYPE]
+ );
+ $row = $this->db->fetchObject($result);
+ if ($row !== null) {
+ $this->db->update(
+ 'object_data',
+ ['type' => [ilDBConstants::T_TEXT, self::NEW_TYPE]],
+ ['obj_id' => [ilDBConstants::T_INTEGER, (int) $row->obj_id]]
+ );
+ return;
+ }
+
+ $typ_result = $this->db->queryF(
+ 'SELECT obj_id FROM object_data WHERE type = %s AND title = %s LIMIT 1',
+ [ilDBConstants::T_TEXT, ilDBConstants::T_TEXT],
+ ['typ', self::OLD_TYPE]
+ );
+ $typ_row = $this->db->fetchObject($typ_result);
+ if ($typ_row === null) {
+ return;
+ }
+
+ $this->db->update(
+ 'object_data',
+ [
+ 'title' => [ilDBConstants::T_TEXT, self::NEW_TYPE],
+ 'description' => [ilDBConstants::T_TEXT, 'Object Group'],
+ ],
+ ['obj_id' => [ilDBConstants::T_INTEGER, (int) $typ_row->obj_id]]
+ );
+ }
+
+ private function remainingRbac(): int
+ {
+ $ops_result = $this->db->queryF(
+ 'SELECT COUNT(ops_id) AS cnt FROM rbac_operations WHERE operation = %s',
+ [ilDBConstants::T_TEXT],
+ [$this->rbacCreateOperationOld()]
+ );
+ $ops_count = (int) ($this->db->fetchObject($ops_result)?->cnt ?? 0);
+
+ $template_result = $this->db->queryF(
+ 'SELECT COUNT(*) AS cnt FROM rbac_templates WHERE type = %s',
+ [ilDBConstants::T_TEXT],
+ [self::OLD_TYPE]
+ );
+ $template_count = (int) ($this->db->fetchObject($template_result)?->cnt ?? 0);
+
+ return $ops_count + $template_count;
+ }
+
+ private function stepRbac(): void
+ {
+ $result = $this->db->queryF(
+ 'SELECT ops_id FROM rbac_operations WHERE operation = %s LIMIT 1',
+ [ilDBConstants::T_TEXT],
+ [$this->rbacCreateOperationOld()]
+ );
+ $row = $this->db->fetchObject($result);
+ if ($row !== null) {
+ $this->db->update(
+ 'rbac_operations',
+ [
+ 'operation' => [ilDBConstants::T_TEXT, $this->rbacCreateOperationNew()],
+ 'description' => [ilDBConstants::T_TEXT, 'Create Object Group'],
+ ],
+ ['ops_id' => [ilDBConstants::T_INTEGER, (int) $row->ops_id]]
+ );
+ return;
+ }
+
+ $template_result = $this->db->queryF(
+ 'SELECT rol_id, ops_id, parent FROM rbac_templates WHERE type = %s LIMIT 1',
+ [ilDBConstants::T_TEXT],
+ [self::OLD_TYPE]
+ );
+ $template_row = $this->db->fetchObject($template_result);
+ if ($template_row === null) {
+ return;
+ }
+
+ $rol_id = (int) $template_row->rol_id;
+ $ops_id = (int) $template_row->ops_id;
+ $parent = (int) $template_row->parent;
+
+ if ($this->rbacTemplateRowExists($rol_id, $ops_id, $parent, self::NEW_TYPE)) {
+ $this->db->manipulateF(
+ 'DELETE FROM rbac_templates WHERE rol_id = %s AND ops_id = %s AND parent = %s AND type = %s',
+ [
+ ilDBConstants::T_INTEGER,
+ ilDBConstants::T_INTEGER,
+ ilDBConstants::T_INTEGER,
+ ilDBConstants::T_TEXT,
+ ],
+ [$rol_id, $ops_id, $parent, self::OLD_TYPE]
+ );
+ return;
+ }
+
+ $this->db->update(
+ 'rbac_templates',
+ ['type' => [ilDBConstants::T_TEXT, self::NEW_TYPE]],
+ [
+ 'rol_id' => [ilDBConstants::T_INTEGER, $rol_id],
+ 'ops_id' => [ilDBConstants::T_INTEGER, $ops_id],
+ 'parent' => [ilDBConstants::T_INTEGER, $parent],
+ 'type' => [ilDBConstants::T_TEXT, self::OLD_TYPE],
+ ]
+ );
+ }
+
+ private function rbacTemplateRowExists(int $rol_id, int $ops_id, int $parent, string $type): bool
+ {
+ $result = $this->db->queryF(
+ 'SELECT 1 FROM rbac_templates WHERE rol_id = %s AND ops_id = %s AND parent = %s AND type = %s LIMIT 1',
+ [
+ ilDBConstants::T_INTEGER,
+ ilDBConstants::T_INTEGER,
+ ilDBConstants::T_INTEGER,
+ ilDBConstants::T_TEXT,
+ ],
+ [$rol_id, $ops_id, $parent, $type]
+ );
+
+ return $this->db->fetchAssoc($result) !== null;
+ }
+
+ private function remainingContainerSorting(): int
+ {
+ $result = $this->db->queryF(
+ 'SELECT COUNT(*) AS cnt FROM container_sorting WHERE parent_type = %s',
+ [ilDBConstants::T_TEXT],
+ [self::OLD_TYPE]
+ );
+
+ return (int) ($this->db->fetchObject($result)?->cnt ?? 0);
+ }
+
+ private function stepContainerSorting(): void
+ {
+ $result = $this->db->queryF(
+ 'SELECT parent_id, parent_type, child_id FROM container_sorting WHERE parent_type = %s LIMIT 1',
+ [ilDBConstants::T_TEXT],
+ [self::OLD_TYPE]
+ );
+ $row = $this->db->fetchAssoc($result);
+ if ($row === null) {
+ return;
+ }
+
+ $this->db->update(
+ 'container_sorting',
+ ['parent_type' => [ilDBConstants::T_TEXT, self::NEW_TYPE]],
+ [
+ 'parent_id' => [ilDBConstants::T_INTEGER, (int) $row['parent_id']],
+ 'parent_type' => [ilDBConstants::T_TEXT, self::OLD_TYPE],
+ 'child_id' => [ilDBConstants::T_INTEGER, (int) $row['child_id']],
+ ]
+ );
+ }
+
+ private function remainingSettings(): int
+ {
+ $count = 0;
+ foreach (self::SETTINGS_KEY_MAP as $old_key => $_) {
+ $result = $this->db->queryF(
+ 'SELECT COUNT(*) AS cnt FROM settings WHERE keyword = %s',
+ [ilDBConstants::T_TEXT],
+ [$old_key]
+ );
+ $count += (int) ($this->db->fetchObject($result)?->cnt ?? 0);
+ }
+
+ return $count;
+ }
+
+ private function stepSettings(): void
+ {
+ foreach (self::SETTINGS_KEY_MAP as $old_key => $new_key) {
+ $result = $this->db->queryF(
+ 'SELECT module, value FROM settings WHERE keyword = %s LIMIT 1',
+ [ilDBConstants::T_TEXT],
+ [$old_key]
+ );
+ $row = $this->db->fetchAssoc($result);
+ if ($row === null) {
+ continue;
+ }
+
+ if ($this->settingsKeywordExists($new_key, $row['module'])) {
+ $this->db->manipulateF(
+ 'DELETE FROM settings WHERE module = %s AND keyword = %s',
+ [ilDBConstants::T_TEXT, ilDBConstants::T_TEXT],
+ [$row['module'], $old_key]
+ );
+ } else {
+ $this->db->manipulateF(
+ 'UPDATE settings SET keyword = %s WHERE module = %s AND keyword = %s',
+ [ilDBConstants::T_TEXT, ilDBConstants::T_TEXT, ilDBConstants::T_TEXT],
+ [$new_key, $row['module'], $old_key]
+ );
+ }
+ return;
+ }
+ }
+
+ private function settingsKeywordExists(string $keyword, string $module): bool
+ {
+ $result = $this->db->queryF(
+ 'SELECT 1 FROM settings WHERE module = %s AND keyword = %s LIMIT 1',
+ [ilDBConstants::T_TEXT, ilDBConstants::T_TEXT],
+ [$module, $keyword]
+ );
+
+ return $this->db->fetchAssoc($result) !== null;
+ }
+
+ private function remainingDesktopItem(): int
+ {
+ $result = $this->db->queryF(
+ 'SELECT COUNT(*) AS cnt FROM desktop_item WHERE type = %s',
+ [ilDBConstants::T_TEXT],
+ [self::OLD_TYPE]
+ );
+
+ return (int) ($this->db->fetchObject($result)?->cnt ?? 0);
+ }
+
+ private function stepDesktopItem(): void
+ {
+ $result = $this->db->queryF(
+ 'SELECT item_id, user_id FROM desktop_item WHERE type = %s LIMIT 1',
+ [ilDBConstants::T_TEXT],
+ [self::OLD_TYPE]
+ );
+ $row = $this->db->fetchAssoc($result);
+ if ($row === null) {
+ return;
+ }
+
+ $this->db->update(
+ 'desktop_item',
+ ['type' => [ilDBConstants::T_TEXT, self::NEW_TYPE]],
+ [
+ 'item_id' => [ilDBConstants::T_INTEGER, (int) $row['item_id']],
+ 'user_id' => [ilDBConstants::T_INTEGER, (int) $row['user_id']],
+ ]
+ );
+ }
+
+ private function remainingLegacy(): int
+ {
+ $count = 0;
+ foreach (self::LEGACY_TARGETS as $table => $spec) {
+ if (!$this->legacyTableReady($table, $spec['columns'])) {
+ continue;
+ }
+
+ $conditions = implode(
+ ' OR ',
+ array_map(
+ fn(string $column): string => "{$column} = {$this->db->quote(self::OLD_TYPE, ilDBConstants::T_TEXT)}",
+ $spec['columns']
+ )
+ );
+
+ $result = $this->db->query("SELECT COUNT(*) AS cnt FROM {$table} WHERE {$conditions}");
+ $count += (int) ($this->db->fetchObject($result)?->cnt ?? 0);
+ }
+
+ return $count;
+ }
+
+ private function stepLegacy(): void
+ {
+ foreach (self::LEGACY_TARGETS as $table => $spec) {
+ if (!$this->legacyTableReady($table, $spec['columns'])) {
+ continue;
+ }
+
+ $row = $this->fetchLegacyOne($table, $spec);
+ if ($row === null) {
+ continue;
+ }
+
+ if ($this->legacyTypeIsInPrimaryKey($spec) && $this->legacyDestinationExists($table, $spec, $row)) {
+ $this->db->manipulate(
+ "DELETE FROM {$table} WHERE {$this->legacySourceWhere($spec, $row)}"
+ );
+ return;
+ }
+
+ $assignments = [];
+ foreach ($spec['columns'] as $column) {
+ if ((string) $row[$column] !== self::OLD_TYPE) {
+ continue;
+ }
+ $assignments[] = "{$column} = {$this->db->quote(self::NEW_TYPE, ilDBConstants::T_TEXT)}";
+ }
+ if ($assignments === []) {
+ return;
+ }
+
+ $this->db->manipulate(
+ "UPDATE {$table} SET " . implode(', ', $assignments) . " WHERE {$this->legacySourceWhere($spec, $row)}"
+ );
+ return;
+ }
+ }
+
+ /**
+ * @param list $columns
+ */
+ private function legacyTableReady(string $table, array $columns): bool
+ {
+ if (!$this->db->tableExists($table)) {
+ return false;
+ }
+
+ foreach ($columns as $column) {
+ if ($this->db->tableColumnExists($table, $column)) {
+ continue;
+ }
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * @param array{pk: list, columns: list} $spec
+ * @return array|null
+ */
+ private function fetchLegacyOne(string $table, array $spec): ?array
+ {
+ $select = implode(
+ ', ',
+ array_values(
+ array_unique(
+ array_merge(
+ $spec['pk'],
+ $spec['columns']
+ )
+ )
+ )
+ );
+ $conditions = implode(
+ ' OR ',
+ array_map(
+ fn(string $column): string => "{$column} = {$this->db->quote(self::OLD_TYPE, ilDBConstants::T_TEXT)}",
+ $spec['columns']
+ )
+ );
+
+ $result = $this->db->query("SELECT {$select} FROM {$table} WHERE {$conditions} LIMIT 1");
+ $row = $this->db->fetchAssoc($result);
+
+ return $row === null ? null : $row;
+ }
+
+ /**
+ * @param array{pk: list, columns: list} $spec
+ */
+ private function legacyTypeIsInPrimaryKey(array $spec): bool
+ {
+ return array_intersect($spec['pk'], $spec['columns']) !== [];
+ }
+
+ /**
+ * @param array{pk: list, columns: list} $spec
+ * @param array $row
+ */
+ private function legacyDestinationExists(string $table, array $spec, array $row): bool
+ {
+ $where = [];
+ foreach ($spec['pk'] as $column) {
+ $value = $row[$column];
+ if (in_array($column, $spec['columns'], true) && (string) $value === self::OLD_TYPE) {
+ $value = self::NEW_TYPE;
+ }
+ $where[] = "{$column} = {$this->legacyQuoteColumn($column, $value)}";
+ }
+
+ $result = $this->db->query("SELECT 1 FROM {$table} WHERE " . implode(' AND ', $where) . ' LIMIT 1');
+
+ return $this->db->fetchAssoc($result) !== null;
+ }
+
+ /**
+ * @param array{pk: list, columns: list} $spec
+ * @param array $row
+ */
+ private function legacySourceWhere(array $spec, array $row): string
+ {
+ return implode(
+ ' AND ',
+ array_map(
+ fn(string $column): string => "{$column} = {$this->legacyQuoteColumn($column, $row[$column])}",
+ $spec['pk']
+ )
+ );
+ }
+
+ private function legacyQuoteColumn(string $column, mixed $value): string
+ {
+ return in_array($column, self::LEGACY_TEXT_COLUMNS, true)
+ ? $this->db->quote((string) $value, ilDBConstants::T_TEXT)
+ : $this->db->quote((int) $value, ilDBConstants::T_INTEGER);
+ }
+
+ private function rbacCreateOperationOld(): string
+ {
+ return 'create_' . self::OLD_TYPE;
+ }
+
+ private function rbacCreateOperationNew(): string
+ {
+ return 'create_' . self::NEW_TYPE;
+ }
+}
diff --git a/components/ILIAS/ItemGroup/classes/class.StandardGUIRequest.php b/components/ILIAS/ObjectGroup/classes/class.StandardGUIRequest.php
similarity index 97%
rename from components/ILIAS/ItemGroup/classes/class.StandardGUIRequest.php
rename to components/ILIAS/ObjectGroup/classes/class.StandardGUIRequest.php
index 54da42183b58..ff47b693d47b 100755
--- a/components/ILIAS/ItemGroup/classes/class.StandardGUIRequest.php
+++ b/components/ILIAS/ObjectGroup/classes/class.StandardGUIRequest.php
@@ -16,7 +16,7 @@
*
*********************************************************************/
-namespace ILIAS\ItemGroup;
+namespace ILIAS\ObjectGroup;
use ILIAS\Repository\BaseGUIRequest;
diff --git a/components/ILIAS/ItemGroup/classes/class.ilObjItemGroup.php b/components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroup.php
similarity index 84%
rename from components/ILIAS/ItemGroup/classes/class.ilObjItemGroup.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroup.php
index 5c2f7c2a0e00..488171e501af 100755
--- a/components/ILIAS/ItemGroup/classes/class.ilObjItemGroup.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroup.php
@@ -19,17 +19,17 @@
use ILIAS\ILIASObject\Properties\Translations\Language;
/**
- * Class ilObjItemGroup
+ * Class ilObjObjectGroup
* @author Alexander Killing
*/
-class ilObjItemGroup extends ilObject2
+class ilObjObjectGroup extends ilObject2
{
protected ilObjectDefinition $obj_def;
protected int $access_type;
protected int $access_begin;
protected int $access_end;
protected bool $access_visibility;
- protected ?ilItemGroupAR $item_data_ar = null;
+ protected ?ilObjectGroupAR $item_data_ar = null;
public function __construct(
int $a_id = 0,
@@ -46,7 +46,7 @@ public function __construct(
$this->obj_def = $objDefinition;
$this->db = $ilDB;
- $this->item_data_ar = new ilItemGroupAR();
+ $this->item_data_ar = new ilObjectGroupAR();
parent::__construct($a_id, $a_reference);
}
@@ -59,7 +59,7 @@ public function setId($a_id): void
public function initType(): void
{
- $this->type = "itgr";
+ $this->type = "obgr";
}
public function getDisplay(): string
@@ -104,29 +104,29 @@ public function setTileSize(int $a_val): void
public function getBehaviour(?bool $stored_value = null): int
{
- if ($this->getDisplay() !== ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE) {
- return ilItemGroupBehaviour::ALWAYS_OPEN;
+ if ($this->getDisplay() !== ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE) {
+ return ilObjectGroupBehaviour::ALWAYS_OPEN;
}
if (is_bool($stored_value)) {
- return $stored_value ? ilItemGroupBehaviour::EXPANDABLE_OPEN : ilItemGroupBehaviour::EXPANDABLE_CLOSED;
+ return $stored_value ? ilObjectGroupBehaviour::EXPANDABLE_OPEN : ilObjectGroupBehaviour::EXPANDABLE_CLOSED;
}
- return $this->getDisplayWithTitleAndToggleableInitially() === ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN
- ? ilItemGroupBehaviour::EXPANDABLE_OPEN
- : ilItemGroupBehaviour::EXPANDABLE_CLOSED;
+ return $this->getDisplayWithTitleAndToggleableInitially() === ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN
+ ? ilObjectGroupBehaviour::EXPANDABLE_OPEN
+ : ilObjectGroupBehaviour::EXPANDABLE_CLOSED;
}
protected function doRead(): void
{
- $this->item_data_ar = new ilItemGroupAR($this->getId());
+ $this->item_data_ar = new ilObjectGroupAR($this->getId());
}
public function getShowTitle(): bool
{
return in_array(
$this->getDisplay(),
- [ilItemGroupAR::DISPLAY_WITH_TITLE, ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE],
+ [ilObjectGroupAR::DISPLAY_WITH_TITLE, ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE],
true
);
}
@@ -178,7 +178,7 @@ protected function doDelete(): void
protected function doCloneObject(ilObject2 $new_obj, int $a_target_id, ?int $a_copy_id = null): void
{
- assert($new_obj instanceof ilObjItemGroup);
+ assert($new_obj instanceof ilObjObjectGroup);
$new_obj->setDisplay($this->getDisplay());
$new_obj->setDisplayWithTitleAndToggleableInitially($this->getDisplayWithTitleAndToggleableInitially());
$new_obj->setListPresentation($this->getListPresentation());
@@ -201,13 +201,12 @@ public function cloneDependencies(int $a_target_id, int $a_copy_id): bool
{
parent::cloneDependencies($a_target_id, $a_copy_id);
- $ig_items = new ilItemGroupItems($a_target_id);
- $ig_items->cloneItems($this->getRefId(), $a_copy_id);
+ (new ilObjectGroupItems($a_target_id))->cloneItems($this->getRefId(), $a_copy_id);
return true;
}
- public static function fixContainerItemGroupRefsAfterCloning(
+ public static function fixContainerObjectGroupRefsAfterCloning(
ilContainer $a_source_container,
int $a_copy_id
): void {
@@ -215,7 +214,7 @@ public static function fixContainerItemGroupRefsAfterCloning(
$ilLog = $DIC["ilLog"];
- $ilLog->info('Fix item group references in ' . $a_source_container->getType());
+ $ilLog->info('Fix object group references in ' . $a_source_container->getType());
$cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
$mappings = $cwo->getMappings();
diff --git a/components/ILIAS/ItemGroup/classes/class.ilObjItemGroupAccess.php b/components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroupAccess.php
similarity index 84%
rename from components/ILIAS/ItemGroup/classes/class.ilObjItemGroupAccess.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroupAccess.php
index fd8ea4242117..bd4292ea39e2 100755
--- a/components/ILIAS/ItemGroup/classes/class.ilObjItemGroupAccess.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroupAccess.php
@@ -17,10 +17,10 @@
*********************************************************************/
/**
- * Item group access class
+ * Object group access class
* @author Alexander Killing
*/
-class ilObjItemGroupAccess extends ilObjectAccess
+class ilObjObjectGroupAccess extends ilObjectAccess
{
protected ilObjUser $user;
protected ilLanguage $lng;
@@ -41,12 +41,12 @@ public static function _getCommands(): array
{
global $DIC;
- $DIC->language()->loadLanguageModule("itgr");
+ $DIC->language()->loadLanguageModule("obgr");
return [
["permission" => "read", "cmd" => "gotoParent", "lang_var" => "", "default" => true],
- ["permission" => "write", "cmd" => "addOrAssignObject", "lang_var" => "itgr_create_and_assign_object", "default" => false],
- ["permission" => "write", "cmd" => "listMaterials", "lang_var" => "itgr_assign_materials", "default" => false],
+ ["permission" => "write", "cmd" => "addOrAssignObject", "lang_var" => "obgr_create_and_assign_object", "default" => false],
+ ["permission" => "write", "cmd" => "listMaterials", "lang_var" => "obgr_assign_materials", "default" => false],
["permission" => "write", "cmd" => "edit", "lang_var" => "settings", "default" => false]
];
}
@@ -64,7 +64,7 @@ public static function _checkGoto(string $target): bool
$t_arr = explode("_", $target);
- if ($t_arr[0] != "itgr" || ((int) $t_arr[1]) <= 0) {
+ if (!in_array($t_arr[0], ["obgr", "itgr"], true) || ((int) $t_arr[1]) <= 0) {
return false;
}
diff --git a/components/ILIAS/ItemGroup/classes/class.ilObjItemGroupGUI.php b/components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroupGUI.php
similarity index 84%
rename from components/ILIAS/ItemGroup/classes/class.ilObjItemGroupGUI.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroupGUI.php
index 10e96e2a8055..3fe9e2b1d9a7 100755
--- a/components/ILIAS/ItemGroup/classes/class.ilObjItemGroupGUI.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroupGUI.php
@@ -18,23 +18,23 @@
use ILIAS\Data\Factory as DataFactory;
use ILIAS\ILIASObject\Creation\AddNewItemGUI;
-use ILIAS\ItemGroup\Items\Table\ItemsTable;
-use ILIAS\ItemGroup\StandardGUIRequest;
+use ILIAS\ObjectGroup\Objects\Table\ObjectsTable;
+use ILIAS\ObjectGroup\StandardGUIRequest;
use ILIAS\ILIASObject\Properties\Translations\TranslationGUI;
use ILIAS\UI\URLBuilder;
/**
- * User Interface class for item groups
+ * User Interface class for object groups
* @author Alexander Killing
- * @ilCtrl_Calls ilObjItemGroupGUI: ilPermissionGUI, ilDidacticTemplateGUI
- * @ilCtrl_Calls ilObjItemGroupGUI: ilCommonActionDispatcherGUI, ilObjectCopyGUI,
- * @ilCtrl_Calls ilObjItemGroupGUI: ILIAS\ILIASObject\Properties\Translations\TranslationGUI,
- * @ilCtrl_isCalledBy ilObjItemGroupGUI: ilRepositoryGUI, ilAdministrationGUI
+ * @ilCtrl_Calls ilObjObjectGroupGUI: ilPermissionGUI, ilDidacticTemplateGUI
+ * @ilCtrl_Calls ilObjObjectGroupGUI: ilCommonActionDispatcherGUI, ilObjectCopyGUI,
+ * @ilCtrl_Calls ilObjObjectGroupGUI: ILIAS\ILIASObject\Properties\Translations\TranslationGUI,
+ * @ilCtrl_isCalledBy ilObjObjectGroupGUI: ilRepositoryGUI, ilAdministrationGUI
*/
-class ilObjItemGroupGUI extends ilObject2GUI
+class ilObjObjectGroupGUI extends ilObject2GUI
{
- protected \ILIAS\ItemGroup\InternalGUIService $gui;
- protected StandardGUIRequest $ig_request;
+ protected \ILIAS\ObjectGroup\InternalGUIService $gui;
+ protected StandardGUIRequest $og_request;
protected ilTabsGUI $tabs;
protected ilHelpGUI $help;
private readonly DataFactory $data_factory;
@@ -55,8 +55,8 @@ public function __construct(
$this->locator = $DIC["ilLocator"];
$this->tree = $DIC->repositoryTree();
$this->help = $DIC["ilHelp"];
- $this->gui = $DIC->itemGroup()->internal()->gui();
- $this->ig_request = $this->gui
+ $this->gui = $DIC->objectGroup()->internal()->gui();
+ $this->og_request = $this->gui
->standardRequest();
$this->data_factory = new DataFactory();
}
@@ -65,13 +65,13 @@ protected function afterConstructor(): void
{
$lng = $this->lng;
- $lng->loadLanguageModule("itgr");
+ $lng->loadLanguageModule("obgr");
$this->ctrl->saveParameter($this, array("ref_id"));
}
final public function getType(): string
{
- return "itgr";
+ return "obgr";
}
public function executeCommand(): void
@@ -118,7 +118,7 @@ public function executeCommand(): void
$this->checkPermissionBool("write");
$this->prepareOutput();
$this->ctrl->setReturn($this, 'edit');
- $did = new ilDidacticTemplateGUI($this, $this->ig_request->getDidactivTemplateId());
+ $did = new ilDidacticTemplateGUI($this, $this->og_request->getDidactivTemplateId());
$this->ctrl->forwardCommand($did);
break;
@@ -154,61 +154,61 @@ protected function initEditCustomForm(ilPropertyFormGUI $form): void
$form->addItem($pres);
// display
- $display_radio_group = new ilRadioGroupInputGUI($this->lng->txt('itgr_display'), ilItemGroupAR::DISPLAY);
+ $display_radio_group = new ilRadioGroupInputGUI($this->lng->txt('obgr_display'), ilObjectGroupAR::DISPLAY);
$display_radio_group->setRequired(true);
$form->addItem($display_radio_group);
$no_title_option = new ilRadioOption(
- $this->lng->txt('itgr_display_without_title'),
- ilItemGroupAR::DISPLAY_WITHOUT_TITLE
+ $this->lng->txt('obgr_display_without_title'),
+ ilObjectGroupAR::DISPLAY_WITHOUT_TITLE
);
$display_radio_group->addOption($no_title_option);
$with_title_option = new ilRadioOption(
- $this->lng->txt('itgr_display_with_title'),
- ilItemGroupAR::DISPLAY_WITH_TITLE
+ $this->lng->txt('obgr_display_with_title'),
+ ilObjectGroupAR::DISPLAY_WITH_TITLE
);
$display_radio_group->addOption($with_title_option);
$with_title_and_toggleable_option = new ilRadioOption(
- $this->lng->txt('itgr_display_with_title_and_toggleable'),
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE
+ $this->lng->txt('obgr_display_with_title_and_toggleable'),
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE
);
$with_title_and_toggleable_option_radio_group = new ilRadioGroupInputGUI(
- $this->lng->txt('itgr_display_with_title_and_toggleable'),
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY
+ $this->lng->txt('obgr_display_with_title_and_toggleable'),
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY
);
$with_title_and_toggleable_option_radio_group->setRequired(true);
$with_title_and_toggleable_option_radio_group->addOption(
new ilRadioOption(
- $this->lng->txt('itgr_display_with_title_and_toggleable_initially_closed'),
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED
+ $this->lng->txt('obgr_display_with_title_and_toggleable_initially_closed'),
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED
)
);
$with_title_and_toggleable_option_radio_group->addOption(
new ilRadioOption(
- $this->lng->txt('itgr_display_with_title_and_toggleable_initially_open'),
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN
+ $this->lng->txt('obgr_display_with_title_and_toggleable_initially_open'),
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN
)
);
$with_title_and_toggleable_option->addSubItem($with_title_and_toggleable_option_radio_group);
$display_radio_group->addOption($with_title_and_toggleable_option);
// tile/list
- $lpres = new ilRadioGroupInputGUI($this->lng->txt('itgr_list_presentation'), "list_presentation");
+ $lpres = new ilRadioGroupInputGUI($this->lng->txt('obgr_list_presentation'), "list_presentation");
- $std_list = new ilRadioOption($this->lng->txt('itgr_list_default'), "");
- $std_list->setInfo($this->lng->txt('itgr_list_default_info'));
+ $std_list = new ilRadioOption($this->lng->txt('obgr_list_default'), "");
+ $std_list->setInfo($this->lng->txt('obgr_list_default_info'));
$lpres->addOption($std_list);
- $item_list = new ilRadioOption($this->lng->txt('itgr_list'), "list");
+ $item_list = new ilRadioOption($this->lng->txt('obgr_list'), "list");
$lpres->addOption($item_list);
- $tile_view = new ilRadioOption($this->lng->txt('itgr_tile'), "tile");
+ $tile_view = new ilRadioOption($this->lng->txt('obgr_tile'), "tile");
$lpres->addOption($tile_view);
// tile size
- $si = new ilRadioGroupInputGUI($this->lng->txt("itgr_tile_size"), "tile_size");
+ $si = new ilRadioGroupInputGUI($this->lng->txt("obgr_tile_size"), "tile_size");
$dummy_container = new ilContainer();
$this->lng->loadLanguageModule("cont");
foreach ($dummy_container->getTileSizes() as $key => $txt) {
@@ -275,7 +275,7 @@ public function listMaterials(): void
$this->tpl->setContent(
$this->ui_renderer->render(
- $this->configureItemsTable()->getComponents($this->getTableActionUrlBuilder())
+ $this->configureObjectsTable()->getComponents($this->getTableActionUrlBuilder())
)
);
}
@@ -298,12 +298,12 @@ public function resolveAddNewItemGUI(): AddNewItemGUI
public function executeTableAction(): void
{
$this->checkPermission('write');
- $this->configureItemsTable()->execute($this->getTableActionUrlBuilder());
+ $this->configureObjectsTable()->execute($this->getTableActionUrlBuilder());
}
- private function configureItemsTable(): ItemsTable
+ private function configureObjectsTable(): ObjectsTable
{
- return new ItemsTable(
+ return new ObjectsTable(
$this->ctrl,
$this->lng,
$this->tpl,
@@ -330,7 +330,7 @@ public function getCreatableObjectTypes(): array
$parent_gui_class = 'ilObj' . $this->obj_definition->getClassName($parent_type) . 'GUI';
$parent_gui = new $parent_gui_class('', $parent_ref_id, true, false);
$types = $parent_gui->getCreatableObjectTypes();
- foreach (array_merge(['itgr', 'sess' ], $this->obj_definition->getSideBlockTypes()) as $type_to_remove) {
+ foreach (array_merge(['obgr', 'sess' ], $this->obj_definition->getSideBlockTypes()) as $type_to_remove) {
unset($types[$type_to_remove]);
}
return $types;
@@ -349,7 +349,7 @@ protected function setTabs(): void
$lng = $this->lng;
$tree = $this->tree;
- $ilHelp->setScreenIdComponent("itgr");
+ $ilHelp->setScreenIdComponent("obgr");
$parent_ref_id = $tree->getParentId($this->object->getRefId());
$parent_obj_id = ilObject::_lookupObjId($parent_ref_id);
@@ -364,7 +364,7 @@ protected function setTabs(): void
if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
$ilTabs->addTab(
'materials',
- $lng->txt('itgr_materials'),
+ $lng->txt('obgr_materials'),
$this->ctrl->getLinkTarget($this, 'listMaterials')
);
@@ -448,7 +448,7 @@ public function gotoParent(): void
public function afterSaveCallback(ilObject $a_obj): void
{
// add new object to materials
- $items = new ilItemGroupItems($this->object->getRefId());
+ $items = new ilObjectGroupItems($this->object->getRefId());
$items->addItem($a_obj->getRefId());
$items->update();
}
@@ -458,20 +458,20 @@ public function afterSaveCallback(ilObject $a_obj): void
*/
protected function getEditFormCustomValues(array &$a_values): void
{
- /** @var ilObjItemGroup $object */
+ /** @var ilObjObjectGroup $object */
$object = $this->getObject();
- $a_values[ilItemGroupAR::DISPLAY] = $object->getDisplay();
- $a_values[ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY] = $object->getDisplayWithTitleAndToggleableInitially();
+ $a_values[ilObjectGroupAR::DISPLAY] = $object->getDisplay();
+ $a_values[ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY] = $object->getDisplayWithTitleAndToggleableInitially();
$a_values['list_presentation'] = $object->getListPresentation();
$a_values['tile_size'] = $object->getTileSize();
}
protected function updateCustom(ilPropertyFormGUI $form): void
{
- /** @var ilObjItemGroup $object */
+ /** @var ilObjObjectGroup $object */
$object = $this->getObject();
- $object->setDisplay($form->getInput(ilItemGroupAR::DISPLAY));
- $object->setDisplayWithTitleAndToggleableInitially($form->getInput(ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY));
+ $object->setDisplay($form->getInput(ilObjectGroupAR::DISPLAY));
+ $object->setDisplayWithTitleAndToggleableInitially($form->getInput(ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY));
$object->setListPresentation($form->getInput('list_presentation'));
$object->setTileSize($form->getInput('tile_size'));
}
@@ -517,7 +517,7 @@ public function save(): void
$this->ctrl->setParameter($this, 'new_type', '');
- $new_obj = new ilObjItemGroup();
+ $new_obj = new ilObjObjectGroup();
$new_obj->setType($this->requested_new_type);
$new_obj->processAutoRating();
$new_obj->setTitle($data['title']);
diff --git a/components/ILIAS/ItemGroup/classes/class.ilObjItemGroupListGUI.php b/components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroupListGUI.php
similarity index 87%
rename from components/ILIAS/ItemGroup/classes/class.ilObjItemGroupListGUI.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroupListGUI.php
index e6efe8ad8629..626369808b2d 100755
--- a/components/ILIAS/ItemGroup/classes/class.ilObjItemGroupListGUI.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjObjectGroupListGUI.php
@@ -20,10 +20,10 @@
use ILIAS\UI\Component\Modal\RoundTrip;
/**
- * Item group list gui class
+ * Object group list gui class
* @author Alexander Killing
*/
-class ilObjItemGroupListGUI extends ilObjectListGUI
+class ilObjObjectGroupListGUI extends ilObjectListGUI
{
protected bool $subitems_enabled;
@@ -37,7 +37,7 @@ public function __construct()
$this->ctrl = $DIC->ctrl();
$lng = $DIC->language();
- $lng->loadLanguageModule('itgr');
+ $lng->loadLanguageModule('obgr');
parent::__construct();
}
@@ -50,18 +50,18 @@ public function init(): void
$this->link_enabled = false;
$this->info_screen_enabled = false;
$this->subitems_enabled = true;
- $this->type = "itgr";
- $this->gui_class_name = "ilobjitemgroupgui";
+ $this->type = "obgr";
+ $this->gui_class_name = "ilobjobjectgroupgui";
// general commands array
- $this->commands = ilObjItemGroupAccess::_getCommands();
+ $this->commands = ilObjObjectGroupAccess::_getCommands();
}
public function initItem(int $ref_id, int $obj_id, string $type, string $title = '', string $description = ''): void
{
parent::initItem($ref_id, $obj_id, $type, $title, $description); // TODO: Change the autogenerated stub
- $this->add_new_object_modal = new ilObjItemGroupGUI($ref_id)->resolveAddNewItemGUI()->createModal();
+ $this->add_new_object_modal = new ilObjObjectGroupGUI($ref_id)->resolveAddNewItemGUI()->createModal();
}
public function enableSubscribe(bool $status): void
@@ -97,7 +97,7 @@ public function insertCommand(
): void {
if ($cmd === 'addOrAssignObject') {
$this->current_actions[] = $this->ui->factory()->button()->shy(
- $this->lng->txt('itgr_create_and_assign_object'),
+ $this->lng->txt('obgr_create_and_assign_object'),
'#'
)->withOnClick($this->add_new_object_modal->getShowSignal());
diff --git a/components/ILIAS/ItemGroup/classes/class.ilItemGroupAR.php b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupAR.php
similarity index 97%
rename from components/ILIAS/ItemGroup/classes/class.ilItemGroupAR.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjectGroupAR.php
index 0ebfcffefbad..1e030dd10778 100755
--- a/components/ILIAS/ItemGroup/classes/class.ilItemGroupAR.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupAR.php
@@ -17,11 +17,11 @@
*********************************************************************/
/**
- * Item group active record class
+ * Object group active record class
*
* @author Alexander Killing
*/
-class ilItemGroupAR extends ActiveRecord
+class ilObjectGroupAR extends ActiveRecord
{
public const DISPLAY = 'display';
public const DISPLAY_WITHOUT_TITLE = 'without_title';
@@ -33,7 +33,7 @@ class ilItemGroupAR extends ActiveRecord
public static function returnDbTableName(): string
{
- return 'itgr_data';
+ return 'obgr_data';
}
/**
diff --git a/components/ILIAS/ItemGroup/classes/class.ilItemGroupAppEventListener.php b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupAppEventListener.php
similarity index 78%
rename from components/ILIAS/ItemGroup/classes/class.ilItemGroupAppEventListener.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjectGroupAppEventListener.php
index 07be5ad48bac..4eca251b91e3 100644
--- a/components/ILIAS/ItemGroup/classes/class.ilItemGroupAppEventListener.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupAppEventListener.php
@@ -19,9 +19,9 @@
declare(strict_types=1);
/**
- * Cleans up item group references when objects are trashed or deleted.
+ * Cleans up object group references when objects are trashed or deleted.
*/
-class ilItemGroupAppEventListener implements ilAppEventListener
+class ilObjectGroupAppEventListener implements ilAppEventListener
{
public static function handleEvent(string $a_component, string $a_event, array $a_parameter): void
{
@@ -33,7 +33,7 @@ public static function handleEvent(string $a_component, string $a_event, array $
global $DIC;
match ($a_event) {
- 'toTrash', 'delete' => $DIC->itemGroup()->internal()->repo()->itemGroup()->removeItems([$ref_id]),
+ 'toTrash', 'delete' => $DIC->objectGroup()->internal()->repo()->objectGroup()->removeItems([$ref_id]),
default => null,
};
}
diff --git a/components/ILIAS/ItemGroup/classes/class.ilItemGroupBehaviour.php b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupBehaviour.php
similarity index 77%
rename from components/ILIAS/ItemGroup/classes/class.ilItemGroupBehaviour.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjectGroupBehaviour.php
index 8b267ac4e733..95ca858c8b86 100755
--- a/components/ILIAS/ItemGroup/classes/class.ilItemGroupBehaviour.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupBehaviour.php
@@ -17,10 +17,10 @@
*********************************************************************/
/**
- * Different types of behaviour for item groups
+ * Different types of behaviour for object groups
* @author Alexander Killing
*/
-class ilItemGroupBehaviour
+class ilObjectGroupBehaviour
{
public const ALWAYS_OPEN = 0;
public const EXPANDABLE_CLOSED = 1;
@@ -36,9 +36,9 @@ public static function getAll(): array
$lng = $DIC->language();
return array(
- self::ALWAYS_OPEN => $lng->txt("itgr_always_open"),
- self::EXPANDABLE_CLOSED => $lng->txt("itgr_expandable_closed"),
- self::EXPANDABLE_OPEN => $lng->txt("itgr_expandable_open")
+ self::ALWAYS_OPEN => $lng->txt("obgr_always_open"),
+ self::EXPANDABLE_CLOSED => $lng->txt("obgr_expandable_closed"),
+ self::EXPANDABLE_OPEN => $lng->txt("obgr_expandable_open")
);
}
}
diff --git a/components/ILIAS/ItemGroup/classes/class.ilItemGroupDataSet.php b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupDataSet.php
similarity index 52%
rename from components/ILIAS/ItemGroup/classes/class.ilItemGroupDataSet.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjectGroupDataSet.php
index c774bae3a701..eb0b60432f21 100755
--- a/components/ILIAS/ItemGroup/classes/class.ilItemGroupDataSet.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupDataSet.php
@@ -18,9 +18,9 @@
declare(strict_types=1);
-class ilItemGroupDataSet extends ilDataSet
+class ilObjectGroupDataSet extends ilDataSet
{
- protected ilObjItemGroup $current_obj;
+ protected ilObjObjectGroup $current_obj;
public function getSupportedVersions(): array
{
@@ -29,74 +29,76 @@ public function getSupportedVersions(): array
public function getXmlNamespace(string $a_entity, string $a_schema_version): string
{
- return "https://www.ilias.de/xml/Modules/ItemGroup/{$a_entity}";
+ return "https://www.ilias.de/xml/Modules/ObjectGroup/{$a_entity}";
}
protected function getTypes(string $a_entity, string $a_version): array
{
+ $object_types = match ($a_version) {
+ '4.3.0' => [
+ 'Id' => ilDBConstants::T_INTEGER,
+ 'Title' => ilDBConstants::T_TEXT,
+ 'Description' => ilDBConstants::T_TEXT,
+ ],
+ '5.3.0' => [
+ 'Id' => ilDBConstants::T_INTEGER,
+ 'HideTitle' => ilDBConstants::T_INTEGER,
+ 'Behaviour' => ilDBConstants::T_INTEGER,
+ 'ListPresentation' => ilDBConstants::T_TEXT,
+ 'TileSize' => ilDBConstants::T_INTEGER,
+ 'Title' => ilDBConstants::T_TEXT,
+ 'Description' => ilDBConstants::T_TEXT,
+ ],
+ '10.12' => [
+ 'Id' => ilDBConstants::T_INTEGER,
+ 'Display' => ilDBConstants::T_TEXT,
+ 'ToggleableInitially' => ilDBConstants::T_TEXT,
+ 'ListPresentation' => ilDBConstants::T_TEXT,
+ 'TileSize' => ilDBConstants::T_INTEGER,
+ 'Title' => ilDBConstants::T_TEXT,
+ 'Description' => ilDBConstants::T_TEXT,
+ ],
+ default => [],
+ };
+
return match ($a_entity) {
- 'itgr' => match ($a_version) {
- '4.3.0' => [
- 'Id' => ilDBConstants::T_INTEGER,
- 'Title' => ilDBConstants::T_TEXT,
- 'Description' => ilDBConstants::T_TEXT,
- ],
- '5.3.0' => [
- 'Id' => ilDBConstants::T_INTEGER,
- 'HideTitle' => ilDBConstants::T_INTEGER,
- 'Behaviour' => ilDBConstants::T_INTEGER,
- 'ListPresentation' => ilDBConstants::T_TEXT,
- 'TileSize' => ilDBConstants::T_INTEGER,
- 'Title' => ilDBConstants::T_TEXT,
- 'Description' => ilDBConstants::T_TEXT,
- ],
- '10.12' => [
- 'Id' => ilDBConstants::T_INTEGER,
- 'Display' => ilDBConstants::T_TEXT,
- 'ToggleableInitially' => ilDBConstants::T_TEXT,
- 'ListPresentation' => ilDBConstants::T_TEXT,
- 'TileSize' => ilDBConstants::T_INTEGER,
- 'Title' => ilDBConstants::T_TEXT,
- 'Description' => ilDBConstants::T_TEXT,
- ],
- default => [],
- },
- 'itgr_item' => match ($a_version) {
+ 'obgr' => $object_types,
+ 'obgr_item' => match ($a_version) {
'4.3.0', '5.3.0', '10.12' => [
- 'ItemGroupId' => ilDBConstants::T_INTEGER,
+ 'ObjectGroupId' => ilDBConstants::T_INTEGER,
'ItemId' => ilDBConstants::T_TEXT,
],
default => [],
},
+ default => [],
};
}
public function readData(string $a_entity, string $a_version, array $a_ids): void
{
$in_obj_id = $this->db->in('obj_id', $a_ids, false, ilDBConstants::T_INTEGER);
-
match ($a_entity) {
- 'itgr' => match ($a_version) {
+ 'obgr' => match ($a_version) {
'4.3.0' => $this->getDirectDataFromQuery(
"SELECT obj_id id, title, description, list_presentation, tile_size FROM object_data
WHERE {$in_obj_id}"
),
'5.3.0' => $this->getDirectDataFromQuery(
"SELECT obj_id id, title, description, hide_title, behaviour, list_presentation, tile_size FROM object_data
- INNER JOIN itgr_data ON object_data.obj_id = itgr_data.id
+ INNER JOIN obgr_data ON object_data.obj_id = obgr_data.id
WHERE {$in_obj_id}"
),
'10.12' => $this->getDirectDataFromQuery(
"SELECT obj_id id, title, description, list_presentation, tile_size, display, toggleable_initially FROM object_data
- INNER JOIN itgr_data ON object_data.obj_id = itgr_data.id
+ INNER JOIN obgr_data ON object_data.obj_id = obgr_data.id
WHERE {$in_obj_id}"
),
default => '',
},
- 'itgr_item' => match ($a_version) {
+ 'obgr_item' => match ($a_version) {
'4.3.0', '5.3.0', '10.12' => $this->getDirectDataFromQuery(
- "SELECT item_group_id itgr_id, item_ref_id item_id FROM item_group_item
- WHERE {$this->db->in('item_group_id', $a_ids, false, ilDBConstants::T_INTEGER)}"
+ "SELECT object_group_id, object_ref_id item_id FROM object_group_item
+ WHERE {$this->db->in('object_group_id', $a_ids, false, ilDBConstants::T_INTEGER)}"
),
default => null,
},
@@ -106,7 +108,7 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi
public function getXmlRecord(string $a_entity, string $a_version, array $a_set): array
{
- if ($a_entity === 'itgr_item') {
+ if ($a_entity === 'obgr_item') {
$a_set['ItemId'] = ilObject::_lookupObjId($a_set['ItemId']);
}
@@ -120,7 +122,7 @@ protected function getDependencies(
?array $a_ids = null
): array {
return match ($a_entity) {
- 'itgr' => ['itgr_item' => ['ids' => $a_rec['Id'] ?? []]],
+ 'obgr' => ['obgr_item' => ['ids' => $a_rec['Id'] ?? []]],
default => [],
};
}
@@ -132,18 +134,21 @@ public function importRecord(
ilImportMapping $a_mapping,
string $a_schema_version
): void {
- $a_rec = $this->stripTags($a_rec);
+ $a_rec = $this->normalizeImportedRecord($this->stripTags($a_rec));
+ $source_entity = $a_entity;
+ $a_entity = $this->exportEntity($a_entity);
switch ($a_entity) {
- case 'itgr':
+ case 'obgr':
$new_id = (int) ($a_mapping->getMapping('components/ILIAS/Container', 'objs', $a_rec['Id']) ?? 0);
if ($new_id !== 0) {
- /** @var ilObjItemGroup $newObj */
+ /** @var ilObjObjectGroup $newObj */
$newObj = ilObjectFactory::getInstanceByObjId($new_id, false);
+ $newObj->setType('obgr');
} else {
- $newObj = new ilObjItemGroup();
- $newObj->setType('itgr');
+ $newObj = new ilObjObjectGroup();
+ $newObj->setType('obgr');
$newObj->create(true);
}
@@ -155,10 +160,14 @@ public function importRecord(
$newObj->setDisplayWithTitleAndToggleableInitially($this->resolveBehaviour($a_rec));
$newObj->update();
$this->current_obj = $newObj;
- $a_mapping->addMapping('components/ILIAS/ItemGroup', 'itgr', $a_rec['Id'], (string) $newObj->getId());
+
+ if ($source_entity === 'itgr') {
+ $a_mapping->addMapping('components/ILIAS/ItemGroup', 'itgr', $a_rec['Id'], (string) $newObj->getId());
+ }
+ $a_mapping->addMapping('components/ILIAS/ObjectGroup', 'obgr', $a_rec['Id'], (string) $newObj->getId());
break;
- case 'itgr_item':
+ case 'obgr_item':
$obj_id = (int) ($a_mapping->getMapping('components/ILIAS/Container', 'objs', $a_rec['ItemId']) ?? 0);
if ($obj_id === 0) {
@@ -166,11 +175,11 @@ public function importRecord(
}
$ref_id = current(ilObject::_getAllReferences($obj_id));
- $itgri = new ilItemGroupItems();
- $itgri->setItemGroupId($this->current_obj->getId());
- $itgri->read();
- $itgri->addItem($ref_id);
- $itgri->update();
+ $ogi = new ilObjectGroupItems();
+ $ogi->setObjectGroupId($this->current_obj->getId());
+ $ogi->read();
+ $ogi->addItem($ref_id);
+ $ogi->update();
break;
}
}
@@ -179,15 +188,15 @@ private function resolveDisplay(array $a_set): string
{
if (isset($a_set['HideTitle'])) {
return match ($a_set['HideTitle']) {
- '1' => ilItemGroupAR::DISPLAY_WITHOUT_TITLE,
- default => ilItemGroupAR::DISPLAY_WITH_TITLE,
+ '1' => ilObjectGroupAR::DISPLAY_WITHOUT_TITLE,
+ default => ilObjectGroupAR::DISPLAY_WITH_TITLE,
};
}
$display = $a_set['Display'] ?? '';
return match ($display) {
- ilItemGroupAR::DISPLAY_WITHOUT_TITLE, ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE => $display,
- default => ilItemGroupAR::DISPLAY_WITH_TITLE,
+ ilObjectGroupAR::DISPLAY_WITHOUT_TITLE, ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE => $display,
+ default => ilObjectGroupAR::DISPLAY_WITH_TITLE,
};
}
@@ -195,15 +204,38 @@ private function resolveBehaviour(array $a_set): string
{
if (isset($a_set['Behaviour'])) {
return match ($a_set['Behaviour']) {
- '1' => ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN,
- default => ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED,
+ '1' => ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN,
+ default => ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED,
};
}
$toggleable_initially = $a_set['ToggleableInitially'] ?? '';
return match ($toggleable_initially) {
- ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN => $toggleable_initially,
- default => ilItemGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED,
+ ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_OPEN => $toggleable_initially,
+ default => ilObjectGroupAR::DISPLAY_WITH_TITLE_AND_TOGGLEABLE_INITIALLY_CLOSED,
+ };
+ }
+
+ private function exportEntity(string $entity): string
+ {
+ return match ($entity) {
+ 'itgr' => 'obgr',
+ 'itgr_item' => 'obgr_item',
+ default => $entity,
};
}
+
+ /**
+ * @param array $record
+ * @return array
+ */
+ private function normalizeImportedRecord(array $record): array
+ {
+ if (!isset($record['ObjectGroupId'])) {
+ $record['ObjectGroupId'] = $record['ItemGroupId'] ?? $record['ItgrId'] ?? null;
+ }
+
+ return $record;
+ }
+
}
diff --git a/components/ILIAS/ItemGroup/classes/class.ilItemGroupExporter.php b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupExporter.php
similarity index 65%
rename from components/ILIAS/ItemGroup/classes/class.ilItemGroupExporter.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjectGroupExporter.php
index d2b484797345..e4b3b3b81fb3 100755
--- a/components/ILIAS/ItemGroup/classes/class.ilItemGroupExporter.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupExporter.php
@@ -17,17 +17,17 @@
*********************************************************************/
/**
- * Exporter class for item groups
+ * Exporter class for object groups
*
* @author Alexander Killing
*/
-class ilItemGroupExporter extends ilXmlExporter
+class ilObjectGroupExporter extends ilXmlExporter
{
- private ilItemGroupDataSet $ds;
+ private ilObjectGroupDataSet $ds;
public function init(): void
{
- $this->ds = new ilItemGroupDataSet();
+ $this->ds = new ilObjectGroupDataSet();
$this->ds->initByExporter($this);
$this->ds->setDSPrefix("ds");
}
@@ -42,23 +42,26 @@ public function getXmlRepresentation(
public function getValidSchemaVersions(string $a_entity): array
{
- return array(
- "10.12" => array(
+ return [
+ "10.12" => [
"uses_dataset" => true,
"min" => "10.12",
- "max" => ""),
- "5.3.0" => array(
- "namespace" => "https://www.ilias.de/Modules/ItemGroup/itgr/5_3",
- "xsd_file" => "ilias_itgr_5_3.xsd",
+ "max" => "",
+ ],
+ "5.3.0" => [
+ "namespace" => "https://www.ilias.de/Modules/ObjectGroup/obgr/5_3",
+ "xsd_file" => "ilias_obgr_5_3.xsd",
"uses_dataset" => true,
"min" => "5.3.0",
- "max" => ""),
- "4.3.0" => array(
- "namespace" => "https://www.ilias.de/Modules/ItemGroup/itgr/4_3",
- "xsd_file" => "ilias_itgr_4_3.xsd",
+ "max" => "",
+ ],
+ "4.3.0" => [
+ "namespace" => "https://www.ilias.de/Modules/ObjectGroup/obgr/4_3",
+ "xsd_file" => "ilias_obgr_4_3.xsd",
"uses_dataset" => true,
"min" => "4.3.0",
- "max" => "")
- );
+ "max" => "",
+ ],
+ ];
}
}
diff --git a/components/ILIAS/ItemGroup/classes/class.ilItemGroupImporter.php b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupImporter.php
similarity index 85%
rename from components/ILIAS/ItemGroup/classes/class.ilItemGroupImporter.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjectGroupImporter.php
index 5129cd17ca54..f6f89b7f08fa 100755
--- a/components/ILIAS/ItemGroup/classes/class.ilItemGroupImporter.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupImporter.php
@@ -17,17 +17,17 @@
*********************************************************************/
/**
- * Importer class for item groups
+ * Importer class for object groups
*
* @author Alexander Killing
*/
-class ilItemGroupImporter extends ilXmlImporter
+class ilObjectGroupImporter extends ilXmlImporter
{
- protected ilItemGroupDataSet $ds;
+ protected ilObjectGroupDataSet $ds;
public function init(): void
{
- $this->ds = new ilItemGroupDataSet();
+ $this->ds = new ilObjectGroupDataSet();
$this->ds->setDSPrefix("ds");
}
diff --git a/components/ILIAS/ItemGroup/classes/class.ilItemGroupItems.php b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupItems.php
similarity index 61%
rename from components/ILIAS/ItemGroup/classes/class.ilItemGroupItems.php
rename to components/ILIAS/ObjectGroup/classes/class.ilObjectGroupItems.php
index 1b560917102b..7688ad34fc4d 100755
--- a/components/ILIAS/ItemGroup/classes/class.ilItemGroupItems.php
+++ b/components/ILIAS/ObjectGroup/classes/class.ilObjectGroupItems.php
@@ -17,12 +17,12 @@
*********************************************************************/
/**
- * Item group items.
+ * Object group items.
* This class is used to store the materials (items) that are assigned
- * to an item group. Main table used is item_group_item
+ * to an object group. Main table used is object_group_item
* @author Alexander Killing
*/
-class ilItemGroupItems
+class ilObjectGroupItems
{
protected ilDBInterface $db;
protected ilObjectDefinition $obj_def;
@@ -31,12 +31,12 @@ class ilItemGroupItems
protected ilAccessHandler $access;
public ilTree $tree;
public ilLanguage $lng;
- public int $item_group_id = 0;
- public int $item_group_ref_id = 0;
+ public int $object_group_id = 0;
+ public int $object_group_ref_id = 0;
public array $items = array();
public function __construct(
- int $a_item_group_ref_id = 0
+ int $a_object_group_ref_id = 0
) {
global $DIC;
@@ -48,34 +48,34 @@ public function __construct(
$this->obj_def = $DIC["objDefinition"];
$this->access = $DIC->access();
- $this->setItemGroupRefId($a_item_group_ref_id);
- if ($this->getItemGroupRefId() > 0) {
- $this->setItemGroupId(ilObject::_lookupObjId($a_item_group_ref_id));
+ $this->setObjectGroupRefId($a_object_group_ref_id);
+ if ($this->getObjectGroupRefId() > 0) {
+ $this->setObjectGroupId(ilObject::_lookupObjId($a_object_group_ref_id));
}
- if ($this->getItemGroupId() > 0) {
+ if ($this->getObjectGroupId() > 0) {
$this->read();
}
}
- public function setItemGroupId(int $a_val): void
+ public function setObjectGroupId(int $a_val): void
{
- $this->item_group_id = $a_val;
+ $this->object_group_id = $a_val;
}
- public function getItemGroupId(): int
+ public function getObjectGroupId(): int
{
- return $this->item_group_id;
+ return $this->object_group_id;
}
- public function setItemGroupRefId(int $a_val): void
+ public function setObjectGroupRefId(int $a_val): void
{
- $this->item_group_ref_id = $a_val;
+ $this->object_group_ref_id = $a_val;
}
- public function getItemGroupRefId(): int
+ public function getObjectGroupRefId(): int
{
- return $this->item_group_ref_id;
+ return $this->object_group_ref_id;
}
/**
@@ -91,17 +91,17 @@ public function getItems(): array
return $this->items;
}
- public function addItem(int $a_item_ref_id): void
+ public function addItem(int $a_object_ref_id): void
{
- if (!in_array($a_item_ref_id, $this->items)) {
- $this->items[] = $a_item_ref_id;
+ if (!in_array($a_object_ref_id, $this->items)) {
+ $this->items[] = $a_object_ref_id;
}
}
public function delete(): void
{
- $query = "DELETE FROM item_group_item " .
- "WHERE item_group_id = " . $this->db->quote($this->getItemGroupId(), 'integer');
+ $query = "DELETE FROM object_group_item " .
+ "WHERE object_group_id = " . $this->db->quote($this->getObjectGroupId(), 'integer');
$this->db->manipulate($query);
}
@@ -110,9 +110,9 @@ public function update(): void
$this->delete();
foreach ($this->items as $item) {
- $query = "INSERT INTO item_group_item (item_group_id,item_ref_id) " .
+ $query = "INSERT INTO object_group_item (object_group_id,object_ref_id) " .
"VALUES( " .
- $this->db->quote($this->getItemGroupId(), 'integer') . ", " .
+ $this->db->quote($this->getObjectGroupId(), 'integer') . ", " .
$this->db->quote($item, 'integer') . " " .
")";
$this->db->manipulate($query);
@@ -123,32 +123,32 @@ public function read(): void
{
$this->items = array();
$set = $this->db->query(
- "SELECT * FROM item_group_item " .
- " WHERE item_group_id = " . $this->db->quote($this->getItemGroupId(), "integer")
+ "SELECT * FROM object_group_item " .
+ " WHERE object_group_id = " . $this->db->quote($this->getObjectGroupId(), "integer")
);
while ($rec = $this->db->fetchAssoc($set)) {
- $this->items[] = $rec["item_ref_id"];
+ $this->items[] = $rec["object_ref_id"];
}
}
public function getAssignableItems(): array
{
- if ($this->getItemGroupRefId() <= 0) {
+ if ($this->getObjectGroupRefId() <= 0) {
return array();
}
$parent_node = $this->tree->getNodeData(
- $this->tree->getParentId($this->getItemGroupRefId())
+ $this->tree->getParentId($this->getObjectGroupRefId())
);
$materials = array();
$nodes = $this->tree->getChilds($parent_node["child"]);
foreach ($nodes as $node) {
- // filter side blocks and session, item groups and role folder
+ // filter side blocks and session, object groups and role folder
if ($node['child'] == $parent_node["child"] ||
$this->obj_def->isSideBlock($node['type']) ||
- in_array($node['type'], array('sess', 'itgr', 'rolf', 'adm'))) {
+ in_array($node['type'], array('sess', 'obgr', 'rolf', 'adm'))) {
continue;
}
@@ -177,7 +177,7 @@ public function getAssignableItems(): array
public function getValidItems(): array
{
- if ($this->getItemGroupRefId() <= 0) {
+ if ($this->getObjectGroupRefId() <= 0) {
return $this->items;
}
@@ -208,25 +208,25 @@ public function cloneItems(
): void {
$ilLog = $this->log;
- $ilLog->info('Begin cloning item group materials ... -' . $a_source_id . '-');
+ $ilLog->info('Begin cloning object group materials ... -' . $a_source_id . '-');
$cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
$mappings = $cwo->getMappings();
$new_items = array();
// check: is this a ref id!?
- $source_ig = new ilItemGroupItems($a_source_id);
- foreach ($source_ig->getValidItems() as $item_ref_id) {
- if (isset($mappings[$item_ref_id]) and $mappings[$item_ref_id]) {
- $ilLog->info('Clone item group item nr. ' . $item_ref_id);
- $new_items[] = $mappings[$item_ref_id];
+ $source_ig = new ilObjectGroupItems($a_source_id);
+ foreach ($source_ig->getValidItems() as $object_ref_id) {
+ if (isset($mappings[$object_ref_id]) and $mappings[$object_ref_id]) {
+ $ilLog->info('Clone object group item nr. ' . $object_ref_id);
+ $new_items[] = $mappings[$object_ref_id];
} else {
- $ilLog->info('No mapping found for item group item nr. ' . $item_ref_id);
+ $ilLog->info('No mapping found for object group item nr. ' . $object_ref_id);
}
}
$this->setItems($new_items);
$this->update();
- $ilLog->info('Finished cloning item group items ...');
+ $ilLog->info('Finished cloning object group items ...');
}
public static function _getItemsOfContainer(int $a_ref_id): array
@@ -236,19 +236,19 @@ public static function _getItemsOfContainer(int $a_ref_id): array
$ilDB = $DIC->database();
$tree = $DIC->repositoryTree();
- $itgr_ids = [];
- $itgr_nodes = $tree->getChildsByType($a_ref_id, 'itgr');
- foreach ($itgr_nodes as $node) {
- $itgr_ids[] = $node['obj_id'];
+ $obgr_ids = [];
+ $obgr_nodes = $tree->getChildsByType($a_ref_id, 'obgr');
+ foreach ($obgr_nodes as $node) {
+ $obgr_ids[] = $node['obj_id'];
}
- $query = "SELECT item_ref_id FROM item_group_item " .
- "WHERE " . $ilDB->in('item_group_id', $itgr_ids, false, 'integer');
+ $query = "SELECT object_ref_id FROM object_group_item " .
+ "WHERE " . $ilDB->in('object_group_id', $obgr_ids, false, 'integer');
$res = $ilDB->query($query);
$items = [];
while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
- $items[] = $row->item_ref_id;
+ $items[] = $row->object_ref_id;
}
$container_child_ref_ids = [];
@@ -259,26 +259,26 @@ public static function _getItemsOfContainer(int $a_ref_id): array
return array_values(array_intersect($items, $container_child_ref_ids));
}
- public static function getItemGroupsAssociatedWithItem(int $ref_id, int $filter_item_group_id = 0): array
+ public static function getObjectGroupsAssociatedWithItem(int $ref_id, int $filter_object_group_id = 0): array
{
global $DIC;
$database = $DIC->database();
- $item_groups = [];
+ $object_groups = [];
$statement = $database->queryF(
- 'SELECT ref_id, title FROM item_group_item '
- . 'LEFT JOIN object_data ON item_group_item.item_group_id = object_data.obj_id '
+ 'SELECT ref_id, title FROM object_group_item '
+ . 'LEFT JOIN object_data ON object_group_item.object_group_id = object_data.obj_id '
. 'LEFT JOIN object_reference ON object_data.obj_id = object_reference.obj_id '
- . 'WHERE item_ref_id = %s '
- . 'AND item_group_id != %s '
- . 'AND object_data.type = \'itgr\'',
+ . 'WHERE object_ref_id = %s '
+ . 'AND object_group_id != %s '
+ . 'AND object_data.type = \'obgr\'',
[ilDBConstants::T_INTEGER, ilDBConstants::T_INTEGER],
- [$ref_id, $filter_item_group_id]
+ [$ref_id, $filter_object_group_id]
);
while ($row = $database->fetchAssoc($statement)) {
- $item_groups[$row['ref_id']] = $row['title'];
+ $object_groups[$row['ref_id']] = $row['title'];
}
- return $item_groups;
+ return $object_groups;
}
}
diff --git a/components/ILIAS/ItemGroup/module.xml b/components/ILIAS/ObjectGroup/module.xml
similarity index 84%
rename from components/ILIAS/ItemGroup/module.xml
rename to components/ILIAS/ObjectGroup/module.xml
index aac8b7ea80c8..a04d560ad139 100755
--- a/components/ILIAS/ItemGroup/module.xml
+++ b/components/ILIAS/ObjectGroup/module.xml
@@ -1,10 +1,10 @@
+ id="obgr">
-