Skip to content

[LUI] Contact: Replacing LUI Tables with KS Tables (Mail Object Search) - #12159

Merged
mjansenDatabay merged 1 commit into
ILIAS-eLearning:trunkfrom
marvin-matuschek:12/ref/mail-search-object-tables
Oct 8, 2026
Merged

mjansenDatabay merged 1 commit into
ILIAS-eLearning:trunkfrom
marvin-matuschek:12/ref/mail-search-object-tables

Conversation

@marvin-matuschek

Copy link
Copy Markdown
Contributor

This PR replaces the LUI tables MailSearchObjectsTableGUI and MailSearchObjectMembershipsTableGUI with KS data tables. This also contains a refactoring of ilMailSearchObjectGUI to reduce complexity and improve security.

@marvin-matuschek marvin-matuschek changed the title Contact: Replacing LUI Tables with KS Tables (Mail Object Search) [LUI] Contact: Replacing LUI Tables with KS Tables (Mail Object Search) Oct 2, 2026
@mjansenDatabay mjansenDatabay self-assigned this Oct 2, 2026
@mjansenDatabay mjansenDatabay added bugfix php Pull requests that update Php code labels Oct 2, 2026

@mjansenDatabay mjansenDatabay left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you a lot for contributing to ILIAS.

this looks good except for some minor issues.

  • Please check: ilMailFormGUI::searchCoursesTo() still redirects to cmd=showMembers when the session key search_crs is set. executeCommand() now ignores every command except handleMailSearchObjectActions and cancel. Is that session path obsolete, or should it open the member table again?

Please implement the following changes:

  • Drop getRequestValue() and the unused $view property on ilMailSearchObjectGUI, if they are really not needed. Nothing in the new class seems to read them.
  • Pass $this->mailing_allowed into setMailingAllowed(). showMyObjects() and showMembers() repeat the same internal_mail check the constructor already stored.
  • TXT_MARKED_ENTRIES is written into tpl.mail_search_template.html, which no longer has that placeholder.
  • Use mail_select_{type} again where the old GUI did. showMembers() and shareObjects() always call $this->lng->txt('mail_select_crs'). Groups previously used mail_select_grp.
  • When mailObjects() or mailMembers() resolves to an empty id list, show the same info message as before and stay on the current view (mail_select_crs / mail_select_grp, or mail_select_one_entry on the member table). Both methods currently stage the unchanged draft and redirect to the mail form. shareObjects() and shareMembers() already keep the user on the page.
  • Make member row ids unique across the selected courses and groups. getRows() uses the user id alone. The same person in two selected objects becomes two records with one id, and the KS table selection is keyed by that id. The old table rendered one row per object, which is why the members_crs_grp column exists. A row id such as {obj_id}_{user_id} needs a matching split in resolveUserIds().
  • Rename $searchTpl in showMembers() to $search_tpl.
  • Restore the buddy-system row action from ilMailSearchObjectMembershipsTableGUI. In the mail context, when the buddy system is enabled, the row is another user, the relation is unlinked, and bs_allow_to_contact_me is set, the old table offered buddy_bs_btn_txt_unlinked_a and linked to ilBuddySystemGUI::request. The forward in executeCommand() is still there, and nothing links to it.
  • Keep the old per-row conditions on the KS actions via DataRow::withDisabledAction(). MailSearchObjectsTable always offers "list members". Previously that action existed only when doesExposeMembers() was true (can_send_mails still listed the row). "Mail members" on a row existed only when mailing_allowed and ilParticipants::canSendMailToMembers() were both true. The multi-action may stay. The handler already skips objects that cannot be mailed and rejects a member list when any selected object does not expose members.
  • Base the hidden-members caption on !doesExposeMembers(), and show the asterisk on that row again (the old caption_asterisk block appended * to the title). The new counter uses !$object->getShowMembers(). That marks a course or group for a user with write who is allowed to see the list, and it skips an inactive course whose member list is hidden from a normal member. tpl.mail_search_template.html still prints * {TXT_LIST_MEMBERS_NOT_AVAILABLE} only when that counter is greater than zero, and the row title no longer carries the asterisk.
  • Re-introduce the cancel button (e.g. as a "Tab Backlink Target") when navigating from the mail system (ref=mail) to the object lists. The link must call cancel() with view=myobjects, so returnToParent() is executed. A cancel link without that parameter redisplays showMyObjects(). In the workspace context (ref=wsp), the view keeps the existing back target to share and does not get this button.

Best regards,
Michael

Comment thread components/ILIAS/Contact/classes/class.ilMailSearchCoursesGUI.php Outdated
Comment thread components/ILIAS/Contact/classes/class.ilMailSearchGroupsGUI.php Outdated
@marvin-matuschek
marvin-matuschek force-pushed the 12/ref/mail-search-object-tables branch from 2987679 to 0359d1e Compare October 5, 2026 12:17
@mjansenDatabay
mjansenDatabay self-requested a review October 7, 2026 10:30
@marvin-matuschek
marvin-matuschek force-pushed the 12/ref/mail-search-object-tables branch 3 times, most recently from 82440d2 to ebd88aa Compare October 7, 2026 11:28
@marvin-matuschek
marvin-matuschek force-pushed the 12/ref/mail-search-object-tables branch from ebd88aa to 25282cd Compare October 7, 2026 13:27
…sTable and MailSearchObjectMembershipsTable

Co-authored-by: Michael Jansen <mjansen@databay.de>
Co-authored-by: Nadia Ahmad <nadia@sternenrauch.de>
@marvin-matuschek
marvin-matuschek force-pushed the 12/ref/mail-search-object-tables branch from 25282cd to a0306ed Compare October 8, 2026 09:32
@mjansenDatabay

Copy link
Copy Markdown
Contributor

Thx @marvin-matuschek and @playamongthestars ;-)

@mjansenDatabay
mjansenDatabay merged commit b90f1d2 into ILIAS-eLearning:trunk Oct 8, 2026
5 checks passed
@playamongthestars

Copy link
Copy Markdown

finally 🤣

@dsstrassner

Copy link
Copy Markdown
Contributor

finally 🤣

... 10 years later ...? 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants