ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilExSubmissionTeamGUI Class Reference

Submission team. More...

+ Collaboration diagram for ilExSubmissionTeamGUI:

Public Member Functions

 __construct (ilObjExercise $a_exercise, ilExSubmission $a_submission)
 
 executeCommand ()
 
 returnToParentObject ()
 
 submissionScreenTeamObject ()
 Displays a form which allows members to manage team uploads. More...
 
 addTeamMemberActionObject ($a_user_ids=array())
 
 confirmDeleteTeamObject ()
 
 confirmRemoveTeamMemberObject ($a_full_delete=false)
 
 removeTeamMemberObject ($a_full_delete=false)
 
 submissionScreenTeamLogObject ()
 
 createSingleMemberTeamObject ()
 
 showTeamLogObject ()
 
 createTeamObject ()
 
 createAdoptedTeamObject ()
 
 addUserFromAutoCompleteObject ()
 Add user as member. More...
 

Static Public Member Functions

static getOverviewContent (ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
 
static handleTabs ()
 

Protected Member Functions

 canEditTeam ()
 

Protected Attributes

 $ctrl
 
 $tabs_gui
 
 $lng
 
 $tpl
 
 $toolbar
 
 $user
 
 $exercise
 
 $assignment
 
 $submission
 
 $team
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilExSubmissionTeamGUI::__construct ( ilObjExercise  $a_exercise,
ilExSubmission  $a_submission 
)

Definition at line 49 of file class.ilExSubmissionTeamGUI.php.

References $DIC, $ilCtrl, $lng, $tpl, ilExSubmission\getAssignment(), and user().

50  {
51  global $DIC;
52 
53  $this->toolbar = $DIC->toolbar();
54  $this->user = $DIC->user();
55  $ilCtrl = $DIC->ctrl();
56  $ilTabs = $DIC->tabs();
57  $lng = $DIC->language();
58  $tpl = $DIC["tpl"];
59 
60  $this->exercise = $a_exercise;
61  $this->submission = $a_submission;
62  $this->assignment = $a_submission->getAssignment();
63 
64  // :TODO:
65  $this->ctrl = $ilCtrl;
66  $this->tabs_gui = $ilTabs;
67  $this->lng = $lng;
68  $this->tpl = $tpl;
69  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

Member Function Documentation

◆ addTeamMemberActionObject()

ilExSubmissionTeamGUI::addTeamMemberActionObject (   $a_user_ids = array())

Definition at line 257 of file class.ilExSubmissionTeamGUI.php.

References canEditTeam(), and ilUtil\sendFailure().

Referenced by addUserFromAutoCompleteObject().

258  {
259  if (!$this->canEditTeam()) {
260  $this->ctrl->redirect("submissionScreenTeam");
261  }
262 
263  if (!count($a_user_ids)) {
264  ilUtil::sendFailure($this->lng->txt("no_checkbox"));
265  return false;
266  }
267 
268  $new_users = [];
269 
270  foreach ($a_user_ids as $user_id) {
271  if ($this->team->addTeamMember($user_id, $this->exercise->getRefId())) {
272  $new_users[] = $user_id;
273 
274  // #14277
275  if (!$this->exercise->members_obj->isAssigned($user_id)) {
276  $this->exercise->members_obj->assignMember($user_id);
277  }
278  } else {
279  // #11959
280  ilUtil::sendFailure($this->lng->txt("exc_members_already_assigned_team"), true);
281  }
282  }
283 
284  if (sizeof($new_users)) {
285  // re-evaluate complete team, as new member could have already submitted
286  $this->exercise->processExerciseStatus(
287  $this->assignment,
288  $this->team->getMembers(),
289  $this->submission->hasSubmitted(),
290  $this->submission->validatePeerReviews()
291  );
292  // :TODO: notification?
293  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
294  }
295 
296  $this->ctrl->redirect($this, "submissionScreenTeam");
297  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addUserFromAutoCompleteObject()

ilExSubmissionTeamGUI::addUserFromAutoCompleteObject ( )

Add user as member.

Definition at line 556 of file class.ilExSubmissionTeamGUI.php.

References $_POST, $user, $users, ilObjUser\_lookupId(), addTeamMemberActionObject(), ilUtil\sendFailure(), and submissionScreenTeamObject().

557  {
558  if (!strlen(trim($_POST['user_login']))) {
559  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'));
561  return false;
562  }
563 
564  $users = explode(',', $_POST['user_login']);
565 
566  $user_ids = array();
567  foreach ($users as $user) {
568  $user_id = ilObjUser::_lookupId($user);
569 
570  if (!$user_id) {
571  ilUtil::sendFailure($this->lng->txt('user_not_known'));
572  return $this->submissionScreenTeamObject();
573  }
574 
575  $user_ids[] = $user_id;
576  }
577 
578  return $this->addTeamMemberActionObject($user_ids);
579  }
static _lookupId($a_user_str)
Lookup id by login.
submissionScreenTeamObject()
Displays a form which allows members to manage team uploads.
$users
Definition: authpage.php:44
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
addTeamMemberActionObject($a_user_ids=array())
$_POST["username"]
+ Here is the call graph for this function:

◆ canEditTeam()

ilExSubmissionTeamGUI::canEditTeam ( )
protected

Definition at line 205 of file class.ilExSubmissionTeamGUI.php.

Referenced by addTeamMemberActionObject(), confirmRemoveTeamMemberObject(), removeTeamMemberObject(), and submissionScreenTeamObject().

206  {
207  return (($this->submission->canSubmit() &&
208  !$this->submission->getAssignment()->getTeamTutor()) ||
209  $this->submission->isTutor());
210  }
+ Here is the caller graph for this function:

◆ confirmDeleteTeamObject()

ilExSubmissionTeamGUI::confirmDeleteTeamObject ( )

Definition at line 299 of file class.ilExSubmissionTeamGUI.php.

References confirmRemoveTeamMemberObject().

300  {
301  $this->confirmRemoveTeamMemberObject(true);
302  }
confirmRemoveTeamMemberObject($a_full_delete=false)
+ Here is the call graph for this function:

◆ confirmRemoveTeamMemberObject()

ilExSubmissionTeamGUI::confirmRemoveTeamMemberObject (   $a_full_delete = false)

Definition at line 304 of file class.ilExSubmissionTeamGUI.php.

References $_GET, $_POST, $files, $id, $ilUser, $tpl, $user, canEditTeam(), ilUserUtil\getNamePresentation(), removeTeamMemberObject(), returnToParentObject(), and ilUtil\sendFailure().

Referenced by confirmDeleteTeamObject().

305  {
307  $tpl = $this->tpl;
308 
309  if (!$this->submission->isTutor()) {
310  $ids = [];
311  if ((bool) $a_full_delete) {
312  $ids = $this->team->getMembers();
313  } elseif (isset($_POST["id"]) && is_array($_POST["id"])) {
314  $ids = $_POST["id"];
315  }
316  $ids = array_filter(array_map('intval', $ids));
317 
318  if (0 === count($ids) && !$this->canEditTeam()) {
319  ilUtil::sendFailure($this->lng->txt("select_one"), true);
320  $this->ctrl->redirect($this, "submissionScreenTeam");
321  }
322  } else {
323  $ids = array_filter(array_map('intval', array($_GET["id"])));
324  if (0 === count($ids)) {
325  $this->returnToParentObject();
326  }
327  }
328 
329  $members = $this->team->getMembers();
330  if (sizeof($members) <= sizeof($ids)) {
331  if (sizeof($members) == 1 && $members[0] == $ilUser->getId()) {
332  // direct team deletion - no confirmation
333  return $this->removeTeamMemberObject($a_full_delete);
334  } else {
335  ilUtil::sendFailure($this->lng->txt("exc_team_at_least_one"), true);
336  $this->ctrl->redirect($this, "submissionScreenTeam");
337  }
338  }
339 
340  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
341  $cgui = new ilConfirmationGUI();
342  $cgui->setFormAction($this->ctrl->getFormAction($this));
343  $cgui->setHeaderText($this->lng->txt("exc_team_member_remove_sure"));
344  $cgui->setConfirm($this->lng->txt("remove"), "removeTeamMember");
345  $cgui->setCancel($this->lng->txt("cancel"), $this->submission->isTutor()
346  ? "returnToParent"
347  : "submissionScreenTeam");
348 
349  $files = $this->submission->getFiles();
350 
351  include_once "Services/User/classes/class.ilUserUtil.php";
352 
353  foreach ($ids as $id) {
354  $details = array();
355  foreach ($files as $file) {
356  if ($file["owner_id"] == $id) {
357  $details[] = $file["filetitle"];
358  }
359  }
360  $uname = ilUserUtil::getNamePresentation($id);
361  if (sizeof($details)) {
362  $uname .= ": " . implode(", ", $details);
363  }
364  $cgui->addItem("id[]", $id, $uname);
365  }
366 
367  $tpl->setContent($cgui->getHTML());
368  }
$files
Definition: metarefresh.php:49
$_GET["client_id"]
if(!array_key_exists('StateId', $_REQUEST)) $id
$ilUser
Definition: imgupload.php:18
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
removeTeamMemberObject($a_full_delete=false)
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createAdoptedTeamObject()

ilExSubmissionTeamGUI::createAdoptedTeamObject ( )

Definition at line 532 of file class.ilExSubmissionTeamGUI.php.

References $_POST, $ctrl, $ilCtrl, $ilUser, $lng, $user, ilExAssignmentTeam\adoptTeams(), and ilExAssignmentTeam\getTeamId().

533  {
536  $lng = $this->lng;
537 
538  if ($this->submission->canSubmit()) {
539  $src_ass_id = (int) $_POST["ass_adpt"];
540  if ($src_ass_id > 0) {
541  ilExAssignmentTeam::adoptTeams($src_ass_id, $this->assignment->getId(), $ilUser->getId(), $this->exercise->getRefId());
542  } else {
543  ilExAssignmentTeam::getTeamId($this->assignment->getId(), $ilUser->getId(), true);
544  }
545 
546  ilUtil::sendSuccess($lng->txt("settings_saved"), true);
547  }
548 
549  $ilCtrl->redirect($this, "returnToParent");
550  }
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
static adoptTeams($a_source_ass_id, $a_target_ass_id, $a_user_id=null, $a_exc_ref_id=null)
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ createSingleMemberTeamObject()

ilExSubmissionTeamGUI::createSingleMemberTeamObject ( )

Definition at line 447 of file class.ilExSubmissionTeamGUI.php.

References ilExAssignmentTeam\getTeamId(), and returnToParentObject().

448  {
450  $this->assignment->getId(),
451  $this->submission->getUserId(),
452  true
453  );
454  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
455  $this->returnToParentObject();
456  }
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
+ Here is the call graph for this function:

◆ createTeamObject()

ilExSubmissionTeamGUI::createTeamObject ( )

Definition at line 465 of file class.ilExSubmissionTeamGUI.php.

References $ctrl, $form, $id, $ilCtrl, $ilUser, $lng, PHPMailer\PHPMailer\$options, $tpl, $user, ilExAssignmentTeam\getAdoptableTeamAssignments(), ilExAssignmentTeam\getAssignmentTeamMap(), ilUserUtil\getNamePresentation(), ilExAssignmentTeam\getTeamId(), and ilRadioGroupInputGUI\setValue().

466  {
469  $lng = $this->lng;
470  $tpl = $this->tpl;
471 
472  if ($this->submission->canSubmit()) {
473  $options = ilExAssignmentTeam::getAdoptableTeamAssignments($this->assignment->getExerciseId(), $this->assignment->getId(), $ilUser->getId());
474  if (sizeof($options)) {
475  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
476  $form = new ilPropertyFormGUI();
477  $form->setTitle($lng->txt("exc_team_assignment_adopt_user"));
478  $form->setFormAction($ilCtrl->getFormAction($this, "createAdoptedTeam"));
479 
480  $teams = new ilRadioGroupInputGUI($lng->txt("exc_assignment"), "ass_adpt");
481  $teams->setValue(-1);
482 
483  $teams->addOption(new ilRadioOption($lng->txt("exc_team_assignment_adopt_none_user"), -1));
484 
485  $current_map = ilExAssignmentTeam::getAssignmentTeamMap($this->assignment->getId());
486 
487  include_once "Services/User/classes/class.ilUserUtil.php";
488  foreach ($options as $id => $item) {
489  $members = array();
490  $free = false;
491  foreach ($item["user_team"] as $user_id) {
492  $members[$user_id] = ilUserUtil::getNamePresentation($user_id);
493 
494  if (array_key_exists($user_id, $current_map)) {
495  $members[$user_id] .= " (" . $lng->txt("exc_team_assignment_adopt_already_assigned") . ")";
496  } else {
497  $free = true;
498  }
499  }
500  asort($members);
501  $members = implode("<br />", $members);
502  $option = new ilRadioOption($item["title"], $id);
503  $option->setInfo($members);
504  if (!$free) {
505  $option->setDisabled(true);
506  }
507  $teams->addOption($option);
508  }
509 
510  $form->addItem($teams);
511 
512  $form->addCommandButton("createAdoptedTeam", $lng->txt("save"));
513  $form->addCommandButton("returnToParent", $lng->txt("cancel"));
514 
515  $tpl->setContent($form->getHTML());
516  return;
517  }
518 
519  ilExAssignmentTeam::getTeamId($this->assignment->getId(), $ilUser->getId(), true);
520 
521  // #18046
522  if (!$this->exercise->members_obj->isAssigned($ilUser->getId())) {
523  $this->exercise->members_obj->assignMember($ilUser->getId());
524  }
525 
526  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
527  }
528 
529  $ilCtrl->redirect($this, "returnToParent");
530  }
This class represents an option in a radio group.
This class represents a property form user interface.
static getAssignmentTeamMap($a_ass_id)
Get team structure for assignment.
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
if(!array_key_exists('StateId', $_REQUEST)) $id
global $ilCtrl
Definition: ilias.php:18
static getAdoptableTeamAssignments($a_exercise_id, $a_exclude_ass_id=null, $a_user_id=null)
This class represents a property in a property form.
if(isset($_POST['submit'])) $form
$ilUser
Definition: imgupload.php:18
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
+ Here is the call graph for this function:

◆ executeCommand()

ilExSubmissionTeamGUI::executeCommand ( )

Definition at line 71 of file class.ilExSubmissionTeamGUI.php.

References $ctrl, $ilCtrl, and ilUserAutoComplete\PRIVACY_MODE_RESPECT_USER_SETTING.

72  {
74 
75  $class = $ilCtrl->getNextClass($this);
76  $cmd = $ilCtrl->getCmd("submissionScreenTeam");
77 
78  if (!$this->assignment->hasTeam() ||
79  !$this->submission->canView()) {
80  return;
81  }
82  $this->team = $this->submission->getTeam();
83 
84  if (!$this->submission->isTutor()) {
85  self::handleTabs();
86  $this->tabs_gui->activateTab("team");
87  }
88 
89  switch ($class) {
90  case 'ilrepositorysearchgui':
91  $this->ctrl->setReturn($this, 'submissionScreenTeam');
92  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
93  $rep_search = new ilRepositorySearchGUI();
94  if (!$this->submission->isTutor()) {
95  $rep_search->setPrivacyMode(ilUserAutoComplete::PRIVACY_MODE_RESPECT_USER_SETTING);
96  }
97  $rep_search->setTitle($this->lng->txt("exc_team_member_add"));
98  $rep_search->setCallback($this, 'addTeamMemberActionObject');
99  $this->ctrl->forwardCommand($rep_search);
100  break;
101 
102  default:
103  $this->{$cmd . "Object"}();
104  break;
105  }
106  }
global $ilCtrl
Definition: ilias.php:18

◆ getOverviewContent()

static ilExSubmissionTeamGUI::getOverviewContent ( ilInfoScreenGUI  $a_info,
ilExSubmission  $a_submission 
)
static

Definition at line 108 of file class.ilExSubmissionTeamGUI.php.

References $DIC, $ilCtrl, $lng, $state, $team, ilInfoScreenGUI\addProperty(), ilExSubmission\getAssignment(), ilLinkButton\getInstance(), ilExcAssMemberState\getInstanceByIds(), ilExSubmission\getLastSubmission(), ilUserUtil\getNamePresentation(), ilExSubmission\getTeam(), ilExSubmission\getUserId(), and ilExSubmission\hasSubmitted().

Referenced by ilExSubmissionGUI\getOverviewContent().

109  {
110  global $DIC;
111 
112  $lng = $DIC->language();
113  $ilCtrl = $DIC->ctrl();
114 
115  if (!$a_submission->getAssignment()->hasTeam()) {
116  return;
117  }
118 
119  $state = ilExcAssMemberState::getInstanceByIds($a_submission->getAssignment()->getId(), $a_submission->getUserId());
120 
121  $team_members = $a_submission->getTeam()->getMembers();
122  if (sizeof($team_members)) { // we have a team
123  $team = array();
124  foreach ($team_members as $member_id) {
125  //$team[] = ilObjUser::_lookupFullname($member_id);
126  include_once("./Services/User/classes/class.ilUserUtil.php");
127  $team[] = ilUserUtil::getNamePresentation($member_id, false, false, "", false);
128  }
129  $team = implode("; ", $team);
130 
131  if (!$a_submission->getAssignment()->getTeamTutor()) {
132  #23685
133  // any team member upload?
134  if (!$a_submission->getLastSubmission()) {
135  $button = ilLinkButton::getInstance();
136  $button->setCaption("exc_delete_team");
137  $button->setUrl($ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "confirmDeleteTeam"));
138  $team .= " " . $button->render();
139  }
140  $button = ilLinkButton::getInstance();
141  $button->setCaption("exc_manage_team");
142  $button->setUrl($ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "submissionScreenTeam"));
143  } else {
144  $button = ilLinkButton::getInstance();
145  $button->setCaption("exc_team_log");
146  $button->setUrl($ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "submissionScreenTeamLog"));
147  }
148  $team .= "<br><br>" . $button->render();
149 
150  $a_info->addProperty($lng->txt("exc_team_members"), $team);
151  } else {
152  //if($a_submission->getAssignment()->beforeDeadline()) // this was "for all users"
153  if (!$state->hasSubmissionEnded()) { // this is for current user/team -> no team creation, if no submission possible
154  if (!$a_submission->hasSubmitted()) {
155  $team_info = $lng->txt("exc_no_team_yet_notice");
156  } else {
157  $team_info = '<span class="warning">' . $lng->txt("exc_no_team_yet_notice") . '</span>';
158  }
159 
160  if (!$a_submission->getAssignment()->getTeamTutor()) {
161  $button = ilLinkButton::getInstance();
162  $button->setPrimary(true);
163  $button->setCaption("exc_create_team"); // team creation
164  $button->setUrl($ilCtrl->getLinkTargetByClass(array("ilExSubmissionGUI", "ilExSubmissionTeamGUI"), "createTeam"));
165  $team_info .= " " . $button->render();
166 
167  $team_info .= '<div class="ilFormInfo">' . $lng->txt("exc_no_team_yet_info") . '</div>';
168  } else {
169  $team_info .= '<div class="ilFormInfo">' . $lng->txt("exc_no_team_yet_info_tutor") . '</div>';
170  }
171  } else {
172  $team_info = '<span class="warning">' . $lng->txt("exc_create_team_times_up_warning") . '</span>';
173  }
174 
175  $a_info->addProperty($lng->txt("exc_team_members"), $team_info);
176  }
177  }
global $DIC
Definition: saml.php:7
static getInstanceByIds($a_ass_id, $a_user_id=0)
Get instance by IDs (recommended for consumer code)
global $ilCtrl
Definition: ilias.php:18
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
getLastSubmission()
Get the date of the last submission of a user for the assignment.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
addProperty($a_name, $a_value, $a_link="")
add a property to current section
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleTabs()

static ilExSubmissionTeamGUI::handleTabs ( )
static

Definition at line 184 of file class.ilExSubmissionTeamGUI.php.

References $DIC, $ilCtrl, and $lng.

Referenced by ilExSubmissionBaseGUI\handleTabs().

185  {
186  global $DIC;
187 
188  $ilTabs = $DIC->tabs();
189  $ilCtrl = $DIC->ctrl();
190  $lng = $DIC->language();
191 
192  $ilTabs->addTab(
193  "team",
194  $lng->txt("exc_team"),
195  $ilCtrl->getLinkTargetByClass("ilExSubmissionTeamGUI", "submissionScreenTeam")
196  );
197 
198  $ilTabs->addTab(
199  "log",
200  $lng->txt("exc_team_log"),
201  $ilCtrl->getLinkTargetByClass("ilExSubmissionTeamGUI", "submissionScreenTeamLog")
202  );
203  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ removeTeamMemberObject()

ilExSubmissionTeamGUI::removeTeamMemberObject (   $a_full_delete = false)

Definition at line 370 of file class.ilExSubmissionTeamGUI.php.

References $_POST, $ilUser, $user, canEditTeam(), and ilUtil\sendFailure().

Referenced by confirmRemoveTeamMemberObject().

371  {
373 
374  $cancel_cmd = $this->submission->isTutor()
375  ? "returnToParent"
376  : "submissionScreenTeam";
377 
378  $ids = [];
379  if ((bool) $a_full_delete) {
380  $ids = $this->team->getMembers();
381  } elseif (isset($_POST["id"]) && is_array($_POST["id"])) {
382  $ids = $_POST["id"];
383  }
384  $ids = array_filter(array_map('intval', $ids));
385 
386  if (0 === count($ids) && !$this->canEditTeam()) {
387  ilUtil::sendFailure($this->lng->txt("select_one"), true);
388  $this->ctrl->redirect($this, $cancel_cmd);
389  }
390 
391  $team_deleted = (bool) $a_full_delete;
392  if (!$team_deleted) {
393  $members = $this->team->getMembers();
394  if (sizeof($members) <= sizeof($ids)) {
395  if (sizeof($members) == 1 && $members[0] == $ilUser->getId()) {
396  $team_deleted = true;
397  } else {
398  ilUtil::sendFailure($this->lng->txt("exc_team_at_least_one"), true);
399  $this->ctrl->redirect($this, $cancel_cmd);
400  }
401  }
402  }
403 
404  foreach ($ids as $user_id) {
405  $this->team->removeTeamMember($user_id, $this->exercise->getRefId());
406  }
407 
408  // reset ex team members, as any submission is not valid without team
409  $this->exercise->processExerciseStatus(
410  $this->assignment,
411  $ids,
412  false
413  );
414 
415  if (!$team_deleted) {
416  // re-evaluate complete team, as removed member might have had submitted
417  $this->exercise->processExerciseStatus(
418  $this->assignment,
419  $this->team->getMembers(),
420  $this->submission->hasSubmitted(),
421  $this->submission->validatePeerReviews()
422  );
423  }
424 
425  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
426  if (!$team_deleted) {
427  $this->ctrl->redirect($this, $cancel_cmd);
428  } else {
429  $this->ctrl->redirect($this, "returnToParent");
430  }
431  }
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ returnToParentObject()

ilExSubmissionTeamGUI::returnToParentObject ( )

Definition at line 179 of file class.ilExSubmissionTeamGUI.php.

Referenced by confirmRemoveTeamMemberObject(), and createSingleMemberTeamObject().

180  {
181  $this->ctrl->returnToParent($this);
182  }
+ Here is the caller graph for this function:

◆ showTeamLogObject()

ilExSubmissionTeamGUI::showTeamLogObject ( )

Definition at line 458 of file class.ilExSubmissionTeamGUI.php.

References $tbl.

459  {
460  include_once "Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
461  $tbl = new ilExAssignmentTeamLogTableGUI($this, "showTeamLog", $this->team);
462  $this->tpl->setContent($tbl->getHTML());
463  }
$tbl
Definition: example_048.php:81

◆ submissionScreenTeamLogObject()

ilExSubmissionTeamGUI::submissionScreenTeamLogObject ( )

Definition at line 433 of file class.ilExSubmissionTeamGUI.php.

References $tbl.

434  {
435  $this->tabs_gui->activateTab("log");
436 
437  include_once "Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
439  $this,
440  "submissionScreenTeamLog",
441  $this->team
442  );
443 
444  $this->tpl->setContent($tbl->getHTML());
445  }
$tbl
Definition: example_048.php:81

◆ submissionScreenTeamObject()

ilExSubmissionTeamGUI::submissionScreenTeamObject ( )

Displays a form which allows members to manage team uploads.

public

Definition at line 217 of file class.ilExSubmissionTeamGUI.php.

References $tbl, $team, $toolbar, canEditTeam(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ilExAssignmentTeamTableGUI\MODE_EDIT, and ilUtil\sendInfo().

Referenced by addUserFromAutoCompleteObject().

218  {
219  $ilToolbar = $this->toolbar;
220 
221  // #13414
222  $read_only = !$this->canEditTeam();
223 
224  if ($this->submission->getAssignment()->afterDeadlineStrict(false)) {
225  ilUtil::sendInfo($this->lng->txt("exercise_time_over"));
226  } elseif (!$read_only) {
227  $add_search = $this->submission->isTutor();
228  // add member
229  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
231  $this,
232  $ilToolbar,
233  array(
234  'auto_complete_name' => $this->lng->txt('user'),
235  'submit_name' => $this->lng->txt('add'),
236  'add_search' => $add_search,
237  'add_from_container' => $this->exercise->getRefId()
238  )
239  );
240  } elseif ($this->submission->getAssignment()->getTeamTutor()) {
241  ilUtil::sendInfo($this->lng->txt("exc_no_team_yet_info_tutor"));
242  }
243 
244  include_once "Modules/Exercise/classes/class.ilExAssignmentTeamTableGUI.php";
246  $this,
247  "submissionScreenTeam",
249  $this->exercise->getRefId(),
250  $this->team,
251  $read_only
252  );
253 
254  $this->tpl->setContent($tbl->getHTML());
255  }
$tbl
Definition: example_048.php:81
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
List all team members of an assignment.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $assignment

ilExSubmissionTeamGUI::$assignment
protected

Definition at line 45 of file class.ilExSubmissionTeamGUI.php.

◆ $ctrl

ilExSubmissionTeamGUI::$ctrl
protected

◆ $exercise

ilExSubmissionTeamGUI::$exercise
protected

Definition at line 44 of file class.ilExSubmissionTeamGUI.php.

◆ $lng

ilExSubmissionTeamGUI::$lng
protected

◆ $submission

ilExSubmissionTeamGUI::$submission
protected

Definition at line 46 of file class.ilExSubmissionTeamGUI.php.

◆ $tabs_gui

ilExSubmissionTeamGUI::$tabs_gui
protected

Definition at line 22 of file class.ilExSubmissionTeamGUI.php.

◆ $team

ilExSubmissionTeamGUI::$team
protected

◆ $toolbar

ilExSubmissionTeamGUI::$toolbar
protected

Definition at line 37 of file class.ilExSubmissionTeamGUI.php.

Referenced by submissionScreenTeamObject().

◆ $tpl

ilExSubmissionTeamGUI::$tpl
protected

◆ $user


The documentation for this class was generated from the following file: