ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilPublicSubmissionsTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
12{
13 protected $ass; // [ilExAssignment]
14
18 public function __construct($a_parent_obj, $a_parent_cmd, ilExAssignment $a_ass)
19 {
20 global $DIC;
21
22 $this->ctrl = $DIC->ctrl();
23 $this->lng = $DIC->language();
24 $ilCtrl = $DIC->ctrl();
25 $lng = $DIC->language();
26
27 $this->ass = $a_ass;
28
29 parent::__construct($a_parent_obj, $a_parent_cmd);
30 $this->setData($this->ass->getMemberListData());
31 $this->setTitle($lng->txt("exc_assignment") . ": " . $this->ass->getTitle());
32 $this->setTopCommands(true);
33 //$this->setLimit(9999);
34
35 $this->addColumn($this->lng->txt("name"), "name");
36 $this->addColumn($this->lng->txt("exc_submission"), "");
37
38 $this->setDefaultOrderField("name");
39 $this->setDefaultOrderDirection("asc");
40
41 $this->setEnableHeader(true);
42 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
43 $this->setRowTemplate("tpl.exc_public_submissions_row.html", "Modules/Exercise");
44 //$this->disable("footer");
45 $this->setEnableTitle(true);
46 }
47
51 protected function fillRow($member)
52 {
55
56 $member_id = $member["usr_id"];
57 if (!($mem_obj = ilObjectFactory::getInstanceByObjId($member_id, false))) {
58 return;
59 }
60
61 // name and login
62 $this->tpl->setVariable(
63 "TXT_NAME",
64 $member["name"]
65 );
66 $this->tpl->setVariable(
67 "TXT_LOGIN",
68 "[" . $member["login"] . "]"
69 );
70
71 // image
72 $this->tpl->setVariable(
73 "USR_IMAGE",
74 $mem_obj->getPersonalPicturePath("xxsmall")
75 );
76 $this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
77
78 $sub = new ilExSubmission($this->ass, $member_id);
79
80 // submission:
81 // see if files have been resubmmited after solved
82 $last_sub = $sub->getLastSubmission();
83 if ($last_sub) {
85 } else {
86 $last_sub = "---";
87 }
88
89 // nr of submitted files
90 $sub_cnt = count($sub->getFiles());
91
92 $this->tpl->setVariable("TXT_SUBMITTED_FILES", $lng->txt("exc_files_returned"));
93 $this->tpl->setVariable("VAL_SUBMITTED_FILES", $sub_cnt);
94
95 // download command
96 if ($sub_cnt > 0) {
97 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "member_id", $member_id);
98 $url = $ilCtrl->getLinkTargetByClass("ilExSubmissionFileGUI", "downloadReturned");
99 $ilCtrl->setParameterByClass("ilExSubmissionFileGUI", "member_id", "");
100
101 // #15126
102 $button = ilLinkButton::getInstance();
103 $button->setCaption("exc_download_files");
104 $button->setUrl($url);
105 $button->setOmitPreventDoubleSubmission(true);
106 $this->tpl->setVariable("BTN_DOWNLOAD", $button->render());
107 }
108
109 $this->tpl->parseCurrentBlock();
110 }
111}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
Exercise assignment.
Exercise submission //TODO: This class has to much static methods related to delivered "files".
static getInstance()
Factory.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
__construct($a_parent_obj, $a_parent_cmd, ilExAssignment $a_ass)
Constructor.
Class ilTable2GUI.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
setEnableHeader($a_enableheader)
Set Enable Header.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$url
$DIC
Definition: xapitoken.php:46