23 $this->exercise = $a_exercise;
24 $this->submission = $a_submission;
29 $this->tabs_gui = $ilTabs;
38 $class = $ilCtrl->getNextClass($this);
39 $cmd = $ilCtrl->getCmd(
"submissionScreenTeam");
41 if(!$this->assignment->hasTeam() ||
42 !$this->submission->canView())
46 $this->team = $this->submission->getTeam();
48 if(!$this->submission->isTutor())
51 $this->tabs_gui->activateTab(
"team");
56 case 'ilrepositorysearchgui':
57 $this->ctrl->setReturn($this,
'submissionScreenTeam');
58 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
61 $rep_search->setTitle($this->lng->txt(
"exc_team_member_add"));
62 $rep_search->setCallback($this,
'addTeamMemberActionObject');
63 $this->ctrl->forwardCommand($rep_search);
67 $this->{
$cmd.
"Object"}();
81 $team_members = $a_submission->
getTeam()->getMembers();
82 if(
sizeof($team_members))
85 foreach($team_members as $member_id)
88 include_once(
"./Services/User/classes/class.ilUserUtil.php");
97 $button->setCaption(
"exc_delete_team");
98 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"confirmDeleteTeam"));
99 $team .=
" ".$button->render();
106 $button->setCaption(
"exc_manage_team");
107 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"submissionScreenTeam"));
111 $button->setCaption(
"exc_team_log");
112 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"submissionScreenTeamLog"));
114 $team .=
" ".$button->render();
124 $team_info = $lng->txt(
"exc_no_team_yet_notice");
128 $team_info =
'<span class="warning">'.$lng->txt(
"exc_no_team_yet_notice").
'</span>';
134 $button->setPrimary(
true);
135 $button->setCaption(
"exc_create_team");
136 $button->setUrl($ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"createTeam"));
137 $team_info .=
" ".$button->render();
139 $team_info .=
'<div class="ilFormInfo">'.$lng->txt(
"exc_no_team_yet_info").
'</div>';
143 $team_info .=
'<div class="ilFormInfo">'.$lng->txt(
"exc_no_team_yet_info_tutor").
'</div>';
148 $team_info =
'<span class="warning">'.$lng->txt(
"exc_create_team_times_up_warning").
'</span>';
151 $a_info->
addProperty($lng->txt(
"exc_team_members"), $team_info);
157 $this->ctrl->returnToParent($this);
164 $ilTabs->addTab(
"team", $lng->txt(
"exc_team"),
165 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"submissionScreenTeam"));
167 $ilTabs->addTab(
"log", $lng->txt(
"exc_team_log"),
168 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"submissionScreenTeamLog"));
173 return (($this->submission->canSubmit() &&
174 !$this->submission->getAssignment()->getTeamTutor()) ||
175 $this->submission->isTutor());
190 if ($this->submission->getAssignment()->afterDeadlineStrict(
false))
197 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
202 'auto_complete_name' => $this->lng->txt(
'user'),
203 'submit_name' => $this->lng->txt(
'add'),
204 'add_search' =>
true,
205 'add_from_container' => $this->exercise->getRefId()
209 else if($this->submission->getAssignment()->getTeamTutor())
214 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamTableGUI.php";
217 "submissionScreenTeam",
219 $this->exercise->getRefId(),
224 $this->tpl->setContent(
$tbl->getHTML());
231 $this->ctrl->redirect(
"submissionScreenTeam");
234 if(!count($a_user_ids))
240 foreach($a_user_ids as $user_id)
242 if($this->team->addTeamMember($user_id, $this->exercise->getRefId()))
244 $new_users[] = $user_id;
247 if (!$this->exercise->members_obj->isAssigned($user_id))
249 $this->exercise->members_obj->assignMember($user_id);
259 if(
sizeof($new_users))
262 $this->exercise->processExerciseStatus(
264 $this->team->getMembers(),
265 $this->submission->hasSubmitted(),
266 $this->submission->validatePeerReviews()
272 $this->ctrl->redirect($this,
"submissionScreenTeam");
284 if(!$this->submission->isTutor())
286 $ids = (bool)$a_full_delete
287 ? $this->team->getMembers()
294 $this->ctrl->redirect($this,
"submissionScreenTeam");
306 $members = $this->team->getMembers();
307 if(
sizeof($members) <=
sizeof($ids))
309 if(
sizeof($members) == 1 && $members[0] == $ilUser->getId())
317 $this->ctrl->redirect($this,
"submissionScreenTeam");
321 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
323 $cgui->setFormAction($this->ctrl->getFormAction($this));
324 $cgui->setHeaderText($this->lng->txt(
"exc_team_member_remove_sure"));
325 $cgui->setConfirm($this->lng->txt(
"remove"),
"removeTeamMember");
326 $cgui->setCancel($this->lng->txt(
"cancel"), $this->submission->isTutor()
328 :
"submissionScreenTeam");
330 $files = $this->submission->getFiles();
332 include_once
"Services/User/classes/class.ilUserUtil.php";
339 if($file[
"owner_id"] == $id)
341 $details[] = $file[
"filetitle"];
347 $uname .=
": ".implode(
", ", $details);
349 $cgui->addItem(
"id[]", $id, $uname);
352 $tpl->setContent($cgui->getHTML());
359 $cancel_cmd = $this->submission->isTutor()
361 :
"submissionScreenTeam";
363 $ids = (bool)$a_full_delete
364 ? $this->team->getMembers()
371 $this->ctrl->redirect($this, $cancel_cmd);
374 $team_deleted = (bool)$a_full_delete;
377 $members = $this->team->getMembers();
378 if(
sizeof($members) <=
sizeof($ids))
380 if(
sizeof($members) == 1 && $members[0] == $ilUser->getId())
382 $team_deleted =
true;
387 $this->ctrl->redirect($this, $cancel_cmd);
392 foreach($ids as $user_id)
394 $this->team->removeTeamMember($user_id, $this->exercise->getRefId());
398 $this->exercise->processExerciseStatus(
407 $this->exercise->processExerciseStatus(
409 $this->team->getMembers(),
410 $this->submission->hasSubmitted(),
411 $this->submission->validatePeerReviews()
418 $this->ctrl->redirect($this, $cancel_cmd);
422 $this->ctrl->redirect($this,
"returnToParent");
428 $this->tabs_gui->activateTab(
"log");
430 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
434 $this->tpl->setContent(
$tbl->getHTML());
440 $this->assignment->getId(),
441 $this->submission->getUserId(),
450 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
452 $this->tpl->setContent(
$tbl->getHTML());
459 if($this->submission->canSubmit())
464 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
466 $form->setTitle($lng->txt(
"exc_team_assignment_adopt_user"));
467 $form->setFormAction($ilCtrl->getFormAction($this,
"createAdoptedTeam"));
472 $teams->addOption(
new ilRadioOption($lng->txt(
"exc_team_assignment_adopt_none_user"), -1));
476 include_once
"Services/User/classes/class.ilUserUtil.php";
481 foreach($item[
"user_team"] as $user_id)
485 if(array_key_exists($user_id, $current_map))
487 $members[$user_id] .=
" (".$lng->txt(
"exc_team_assignment_adopt_already_assigned").
")";
495 $members = implode(
"<br />", $members);
497 $option->setInfo($members);
500 $option->setDisabled(
true);
502 $teams->addOption($option);
505 $form->addItem($teams);
507 $form->addCommandButton(
"createAdoptedTeam", $lng->txt(
"save"));
508 $form->addCommandButton(
"returnToParent", $lng->txt(
"cancel"));
510 $tpl->setContent($form->getHTML());
517 if(!$this->exercise->members_obj->isAssigned($ilUser->getId()))
519 $this->exercise->members_obj->assignMember($ilUser->getId());
525 $ilCtrl->redirect($this,
"returnToParent");
532 if($this->submission->canSubmit())
534 $src_ass_id = (int)
$_POST[
"ass_adpt"];
547 $ilCtrl->redirect($this,
"returnToParent");
556 if(!strlen(trim(
$_POST[
'user_login'])))
563 $users = explode(
',',
$_POST[
'user_login']);
566 foreach($users as $user)
576 $user_ids[] = $user_id;
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents an option in a radio group.
createSingleMemberTeamObject()
List all log entries of team.
__construct(ilObjExercise $a_exercise, ilExSubmission $a_submission)
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.
const PRIVACY_MODE_RESPECT_USER_SETTING
static _lookupId($a_user_str)
Lookup id by login.
static adoptTeams($a_source_ass_id, $a_target_ass_id, $a_user_id=null, $a_exc_ref_id=null)
static getAdoptableTeamAssignments($a_exercise_id, $a_exclude_ass_id=null, $a_user_id=null)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
submissionScreenTeamLogObject()
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)
Default behaviour is:
submissionScreenTeamObject()
Displays a form which allows members to manage team uploads.
if(!is_array($argv)) $options
List all team members of an assignment.
getLastSubmission()
Get the date of the last submission of a user for the assignment.
addUserFromAutoCompleteObject()
Add user as member.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
removeTeamMemberObject($a_full_delete=false)
confirmDeleteTeamObject()
addProperty($a_name, $a_value, $a_link="")
add a property to current section
static getOverviewContent(ilInfoScreenGUI $a_info, ilExSubmission $a_submission)
confirmRemoveTeamMemberObject($a_full_delete=false)
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
addTeamMemberActionObject($a_user_ids=array())
createAdoptedTeamObject()
Confirmation screen class.