@@ -346,16 +346,19 @@ public function submissionScreenTeamObject(): void
346346 $ this ->tpl ->setOnScreenMessage ('info ' , $ this ->lng ->txt ("exc_no_team_yet_info_tutor " ));
347347 }
348348
349- $ tbl = new ilExAssignmentTeamTableGUI (
350- $ this ,
351- "submissionScreenTeam " ,
352- ilExAssignmentTeamTableGUI::MODE_EDIT ,
353- $ this ->exercise ->getRefId (),
349+ $ table = $ this ->gui ->teamMembersTableBuilder (
354350 $ this ->team ,
355- $ read_only
356- );
351+ $ this ->exercise ->getRefId (),
352+ $ read_only ,
353+ $ this ,
354+ "submissionScreenTeam "
355+ )->getTable ();
357356
358- $ this ->tpl ->setContent ($ tbl ->getHTML ());
357+ if ($ table ->handleCommand ()) {
358+ return ;
359+ }
360+
361+ $ this ->tpl ->setContent ($ table ->render ());
359362 }
360363
361364 /**
@@ -409,27 +412,34 @@ public function addTeamMemberActionObject(
409412 */
410413 public function confirmDeleteTeamObject (): void
411414 {
412- $ this ->confirmRemoveTeamMemberObject (true );
415+ $ this ->confirmRemoveTeamMemberObject (0 , true );
416+ }
417+
418+ public function confirmRemoveTeamMember (int $ user_id ): void
419+ {
420+ $ this ->confirmRemoveTeamMemberObject ($ user_id );
413421 }
414422
415423 /**
416424 * @throws ilExcUnknownAssignmentTypeException
417425 */
418426 public function confirmRemoveTeamMemberObject (
427+ int $ a_user_id = 0 ,
419428 bool $ a_full_delete = false
420429 ): void {
421430 $ ilUser = $ this ->user ;
422431 $ tpl = $ this ->tpl ;
423432
424- if (!$ this ->submission ->isTutor ()) {
425- $ ids = $ a_full_delete ? $ this ->team ->getMembers () : $ this ->requested_team_ids ;
433+ $ ids = $ a_full_delete
434+ ? $ this ->team ->getMembers ()
435+ : ($ a_user_id > 0 ? [$ a_user_id ] : $ this ->requested_team_ids );
426436
437+ if (!$ this ->submission ->isTutor ()) {
427438 if ([] === $ ids ) {
428439 $ this ->tpl ->setOnScreenMessage ('failure ' , $ this ->lng ->txt ("select_one " ), true );
429440 $ this ->ctrl ->redirect ($ this , "submissionScreenTeam " );
430441 }
431442 } else {
432- $ ids = $ this ->requested_team_ids ;
433443 if ([] === $ ids ) {
434444 $ this ->tpl ->setOnScreenMessage ('failure ' , $ this ->lng ->txt ("select_one " ), true );
435445 $ this ->returnToParentObject ();
@@ -440,7 +450,7 @@ public function confirmRemoveTeamMemberObject(
440450 if (count ($ members ) <= count ($ ids )) {
441451 if (count ($ members ) == 1 && $ members [0 ] == $ ilUser ->getId ()) {
442452 // direct team deletion - no confirmation
443- $ this ->removeTeamMemberObject ($ a_full_delete );
453+ $ this ->removeTeamMemberObject ($ a_user_id , $ a_full_delete );
444454 return ;
445455 } else {
446456 $ this ->tpl ->setOnScreenMessage ('failure ' , $ this ->lng ->txt ("exc_team_at_least_one " ), true );
@@ -480,6 +490,7 @@ public function confirmRemoveTeamMemberObject(
480490 * @throws ilExcUnknownAssignmentTypeException
481491 */
482492 public function removeTeamMemberObject (
493+ int $ a_user_id = 0 ,
483494 bool $ a_full_delete = false
484495 ): void {
485496 $ ilUser = $ this ->user ;
@@ -491,6 +502,8 @@ public function removeTeamMemberObject(
491502 $ ids = [];
492503 if ($ a_full_delete ) {
493504 $ ids = $ this ->team ->getMembers ();
505+ } elseif ($ a_user_id > 0 ) {
506+ $ ids = [$ a_user_id ];
494507 } else {
495508 $ ids = $ this ->requested_team_ids ;
496509 }
0 commit comments