53 $this->toolbar = $DIC->toolbar();
54 $this->
user = $DIC->user();
56 $ilTabs = $DIC->tabs();
57 $lng = $DIC->language();
60 $this->exercise = $a_exercise;
61 $this->submission = $a_submission;
66 $this->tabs_gui = $ilTabs;
75 $class =
$ilCtrl->getNextClass($this);
76 $cmd =
$ilCtrl->getCmd(
"submissionScreenTeam");
78 if (!$this->assignment->hasTeam() ||
79 !$this->submission->canView()) {
82 $this->team = $this->submission->getTeam();
84 if (!$this->submission->isTutor()) {
86 $this->tabs_gui->activateTab(
"team");
90 case 'ilrepositorysearchgui':
91 $this->ctrl->setReturn($this,
'submissionScreenTeam');
92 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
94 if (!$this->submission->isTutor()) {
97 $rep_search->setTitle($this->lng->txt(
"exc_team_member_add"));
98 $rep_search->setCallback($this,
'addTeamMemberActionObject');
99 $this->ctrl->forwardCommand($rep_search);
103 $this->{$cmd .
"Object"}();
112 $lng = $DIC->language();
119 $team_members = $a_submission->
getTeam()->getMembers();
120 if (
sizeof($team_members)) {
122 foreach ($team_members as $member_id) {
124 include_once(
"./Services/User/classes/class.ilUserUtil.php");
134 $button->setCaption(
"exc_delete_team");
135 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"confirmDeleteTeam"));
136 $team .=
" " . $button->render();
139 $button->setCaption(
"exc_manage_team");
140 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"submissionScreenTeam"));
143 $button->setCaption(
"exc_team_log");
144 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"submissionScreenTeamLog"));
146 $team .=
" " . $button->render();
152 $team_info =
$lng->txt(
"exc_no_team_yet_notice");
154 $team_info =
'<span class="warning">' .
$lng->txt(
"exc_no_team_yet_notice") .
'</span>';
159 $button->setPrimary(
true);
160 $button->setCaption(
"exc_create_team");
161 $button->setUrl(
$ilCtrl->getLinkTargetByClass(
array(
"ilExSubmissionGUI",
"ilExSubmissionTeamGUI"),
"createTeam"));
162 $team_info .=
" " . $button->render();
164 $team_info .=
'<div class="ilFormInfo">' .
$lng->txt(
"exc_no_team_yet_info") .
'</div>';
166 $team_info .=
'<div class="ilFormInfo">' .
$lng->txt(
"exc_no_team_yet_info_tutor") .
'</div>';
169 $team_info =
'<span class="warning">' .
$lng->txt(
"exc_create_team_times_up_warning") .
'</span>';
178 $this->ctrl->returnToParent($this);
185 $ilTabs = $DIC->tabs();
187 $lng = $DIC->language();
191 $lng->txt(
"exc_team"),
192 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"submissionScreenTeam")
197 $lng->txt(
"exc_team_log"),
198 $ilCtrl->getLinkTargetByClass(
"ilExSubmissionTeamGUI",
"submissionScreenTeamLog")
204 return (($this->submission->canSubmit() &&
205 !$this->submission->getAssignment()->getTeamTutor()) ||
206 $this->submission->isTutor());
221 if ($this->submission->getAssignment()->afterDeadlineStrict(
false)) {
223 } elseif (!$read_only) {
224 $add_search = $this->submission->isTutor();
226 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
231 'auto_complete_name' => $this->lng->txt(
'user'),
232 'submit_name' => $this->lng->txt(
'add'),
233 'add_search' => $add_search,
234 'add_from_container' => $this->exercise->getRefId()
237 } elseif ($this->submission->getAssignment()->getTeamTutor()) {
241 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamTableGUI.php";
244 "submissionScreenTeam",
246 $this->exercise->getRefId(),
251 $this->tpl->setContent(
$tbl->getHTML());
257 $this->ctrl->redirect(
"submissionScreenTeam");
260 if (!count($a_user_ids)) {
267 foreach ($a_user_ids as $user_id) {
268 if ($this->team->addTeamMember($user_id, $this->exercise->getRefId())) {
269 $new_users[] = $user_id;
272 if (!$this->exercise->members_obj->isAssigned($user_id)) {
273 $this->exercise->members_obj->assignMember($user_id);
281 if (
sizeof($new_users)) {
283 $this->exercise->processExerciseStatus(
285 $this->team->getMembers(),
286 $this->submission->hasSubmitted(),
287 $this->submission->validatePeerReviews()
293 $this->ctrl->redirect($this,
"submissionScreenTeam");
306 if (!$this->submission->isTutor()) {
308 if ((
bool) $a_full_delete) {
309 $ids = $this->team->getMembers();
310 } elseif (isset(
$_POST[
"id"]) && is_array(
$_POST[
"id"])) {
313 $ids = array_filter(array_map(
'intval', $ids));
317 $this->ctrl->redirect($this,
"submissionScreenTeam");
320 $ids = array_filter(array_map(
'intval',
array(
$_GET[
"id"])));
321 if (0 === count($ids)) {
326 $members = $this->team->getMembers();
327 if (
sizeof($members) <=
sizeof($ids)) {
328 if (
sizeof($members) == 1 && $members[0] ==
$ilUser->getId()) {
333 $this->ctrl->redirect($this,
"submissionScreenTeam");
337 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
339 $cgui->setFormAction($this->ctrl->getFormAction($this));
340 $cgui->setHeaderText($this->lng->txt(
"exc_team_member_remove_sure"));
341 $cgui->setConfirm($this->lng->txt(
"remove"),
"removeTeamMember");
342 $cgui->setCancel($this->lng->txt(
"cancel"), $this->submission->isTutor()
344 :
"submissionScreenTeam");
346 $files = $this->submission->getFiles();
348 include_once
"Services/User/classes/class.ilUserUtil.php";
350 foreach ($ids as
$id) {
353 if ($file[
"owner_id"] == $id) {
354 $details[] = $file[
"filetitle"];
358 if (
sizeof($details)) {
359 $uname .=
": " . implode(
", ", $details);
361 $cgui->addItem(
"id[]", $id, $uname);
364 $tpl->setContent($cgui->getHTML());
371 $cancel_cmd = $this->submission->isTutor()
373 :
"submissionScreenTeam";
376 if ((
bool) $a_full_delete) {
377 $ids = $this->team->getMembers();
378 } elseif (isset(
$_POST[
"id"]) && is_array(
$_POST[
"id"])) {
381 $ids = array_filter(array_map(
'intval', $ids));
385 $this->ctrl->redirect($this, $cancel_cmd);
388 $team_deleted = (bool) $a_full_delete;
389 if (!$team_deleted) {
390 $members = $this->team->getMembers();
391 if (
sizeof($members) <=
sizeof($ids)) {
392 if (
sizeof($members) == 1 && $members[0] ==
$ilUser->getId()) {
393 $team_deleted =
true;
396 $this->ctrl->redirect($this, $cancel_cmd);
401 foreach ($ids as $user_id) {
402 $this->team->removeTeamMember($user_id, $this->exercise->getRefId());
406 $this->exercise->processExerciseStatus(
412 if (!$team_deleted) {
414 $this->exercise->processExerciseStatus(
416 $this->team->getMembers(),
417 $this->submission->hasSubmitted(),
418 $this->submission->validatePeerReviews()
423 if (!$team_deleted) {
424 $this->ctrl->redirect($this, $cancel_cmd);
426 $this->ctrl->redirect($this,
"returnToParent");
432 $this->tabs_gui->activateTab(
"log");
434 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
437 "submissionScreenTeamLog",
441 $this->tpl->setContent(
$tbl->getHTML());
447 $this->assignment->getId(),
448 $this->submission->getUserId(),
457 include_once
"Modules/Exercise/classes/class.ilExAssignmentTeamLogTableGUI.php";
459 $this->tpl->setContent(
$tbl->getHTML());
469 if ($this->submission->canSubmit()) {
472 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
474 $form->setTitle(
$lng->txt(
"exc_team_assignment_adopt_user"));
475 $form->setFormAction(
$ilCtrl->getFormAction($this,
"createAdoptedTeam"));
480 $teams->addOption(
new ilRadioOption(
$lng->txt(
"exc_team_assignment_adopt_none_user"), -1));
484 include_once
"Services/User/classes/class.ilUserUtil.php";
488 foreach ($item[
"user_team"] as $user_id) {
491 if (array_key_exists($user_id, $current_map)) {
492 $members[$user_id] .=
" (" .
$lng->txt(
"exc_team_assignment_adopt_already_assigned") .
")";
498 $members = implode(
"<br />", $members);
500 $option->setInfo($members);
502 $option->setDisabled(
true);
504 $teams->addOption($option);
507 $form->addItem($teams);
509 $form->addCommandButton(
"createAdoptedTeam",
$lng->txt(
"save"));
510 $form->addCommandButton(
"returnToParent",
$lng->txt(
"cancel"));
519 if (!$this->exercise->members_obj->isAssigned(
$ilUser->getId())) {
520 $this->exercise->members_obj->assignMember(
$ilUser->getId());
526 $ilCtrl->redirect($this,
"returnToParent");
535 if ($this->submission->canSubmit()) {
536 $src_ass_id = (int)
$_POST[
"ass_adpt"];
537 if ($src_ass_id > 0) {
546 $ilCtrl->redirect($this,
"returnToParent");
555 if (!strlen(trim(
$_POST[
'user_login']))) {
572 $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
if(!array_key_exists('StateId', $_REQUEST)) $id
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()
submissionScreenTeamObject()
Displays a form which allows members to manage team uploads.
if(isset($_POST['submit'])) $form
List all team members of an assignment.
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:
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()
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Confirmation screen class.