ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
4include_once("./Services/Table/classes/class.ilTable2GUI.php");
5include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
6
16{
17
21 function __construct($a_parent_obj, $a_parent_cmd, $a_exc, $a_ass_id)
22 {
23 global $ilCtrl, $lng, $ilAccess, $lng;
24
25 $this->exc = $a_exc;
26 $this->exc_id = $this->exc->getId();
27
28 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
29
30 $this->ass_id = $a_ass_id;
31
32 parent::__construct($a_parent_obj, $a_parent_cmd);
33 $this->setData(ilExAssignment::getMemberListData($this->exc_id, $this->ass_id));
34 $this->setTitle($lng->txt("exc_assignment").": ".
36 $this->setTopCommands(true);
37 //$this->setLimit(9999);
38
39 $this->addColumn($this->lng->txt("name"), "name");
40 $this->addColumn($this->lng->txt("exc_submission"), "");
41
42 $this->setDefaultOrderField("name");
43 $this->setDefaultOrderDirection("asc");
44
45 $this->setEnableHeader(true);
46 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
47 $this->setRowTemplate("tpl.exc_public_submissions_row.html", "Modules/Exercise");
48 //$this->disable("footer");
49 $this->setEnableTitle(true);
50 }
51
55 protected function fillRow($member)
56 {
57 global $lng, $ilCtrl;
58
59 include_once "./Services/Object/classes/class.ilObjectFactory.php";
60 $member_id = $member["usr_id"];
61 if(!($mem_obj = ilObjectFactory::getInstanceByObjId($member_id,false)))
62 {
63 continue;
64 }
65
66 // name and login
67 $this->tpl->setVariable("TXT_NAME",
68 $member["name"]);
69 $this->tpl->setVariable("TXT_LOGIN",
70 "[".$member["login"]."]");
71
72 // image
73 $this->tpl->setVariable("USR_IMAGE",
74 $mem_obj->getPersonalPicturePath("xxsmall"));
75 $this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
76
77 // submission:
78 // see if files have been resubmmited after solved
79 $last_sub =
80 ilExAssignment::getLastSubmission($this->ass_id, $member_id);
81 if ($last_sub)
82 {
84 }
85 else
86 {
87 $last_sub = "---";
88 }
89
90 // nr of submitted files
91 $this->tpl->setVariable("TXT_SUBMITTED_FILES",
92 $lng->txt("exc_files_returned"));
93 $sub_cnt = count(ilExAssignment::getDeliveredFiles($this->exc_id, $this->ass_id, $member_id));
94 $this->tpl->setVariable("VAL_SUBMITTED_FILES",
95 $sub_cnt);
96
97 // download command
98 $ilCtrl->setParameter($this->parent_obj, "member_id", $member_id);
99 if ($sub_cnt > 0)
100 {
101 // #15126
102 include_once("./Services/UIComponent/Button/classes/class.ilLinkButton.php");
103 $button = ilLinkButton::getInstance();
104 $button->setCaption("exc_download_files");
105 $button->setUrl($ilCtrl->getLinkTarget($this->parent_obj, "downloadReturned"));
106 $button->setOmitPreventDoubleSubmission(true);
107 $this->tpl->setVariable("BTN_DOWNLOAD", $button->render());
108 }
109
110 $this->tpl->parseCurrentBlock();
111 }
112
113}
114?>
const IL_CAL_DATETIME
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static getLastSubmission($a_ass_id, $a_user_id)
Get the date of the last submission of a user for the assignment.
getMemberListData($a_exc_id, $a_ass_id)
get member list data
getDeliveredFiles($a_exc_id, $a_ass_id, $a_user_id, $a_filter_empty_filename=false)
was: getDeliveredFiles($a_member_id)
static lookupTitle($a_id)
Lookup title.
static getInstance()
Factory.
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, $a_exc, $a_ass_id)
Constructor.
Class ilTable2GUI.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40