5include_once(
"Services/Block/classes/class.ilBlockGUI.php");
27 $this->ctrl =
$DIC->ctrl();
28 $this->lng =
$DIC->language();
29 $this->
user = $DIC->user();
35 $lng->loadLanguageModule(
"task");
62 switch (
$_GET[
"cmd"]) {
76 $cmd = $ilCtrl->getCmd(
"getHTML");
87 $collector =
$DIC->task()->derived()->factory()->collector();
89 $this->tasks = $collector->getEntries($this->
user->getId());
91 if (count($this->tasks) > 0) {
93 $this->getListRowData();
94 parent::fillDataSection();
105 public function getListRowData()
110 foreach ($this->tasks as $task) {
112 "title" => $task->getTitle(),
113 "url" => $task->getUrl(),
114 "ref_id" => $task->getRefId(),
115 "wsp_id" => $task->getWspId(),
116 "deadline" => $task->getDeadline(),
117 "starting_time" => $task->getStartingTime()
132 $renderer =
$DIC->ui()->renderer();
136 $info_screen->setFormAction(
"#");
137 $info_screen->addSection(
$lng->txt(
""));
140 $info_screen->addProperty(
141 $lng->txt(
"task_task"),
145 if ($a_set[
"ref_id"] > 0) {
149 if (0 === $a_set[
'url']) {
152 $url = $a_set[
'url'];
156 $info_screen->addProperty(
157 $lng->txt(
"obj_" . $obj_type),
158 $renderer->render($link)
162 if ($a_set[
"wsp_id"] > 0) {
164 $obj_id = $wst->lookupObjectId($a_set[
"wsp_id"]);
167 if (0 === $a_set[
'url']) {
170 $url = $a_set[
'url'];
174 $info_screen->addProperty(
175 $lng->txt(
"obj_" . $obj_type),
176 $renderer->render($link)
180 if ($a_set[
"starting_time"] > 0) {
182 $info_screen->addProperty(
183 $lng->txt(
"task_start"),
188 if ($a_set[
"deadline"] > 0) {
190 $info_screen->addProperty(
191 $lng->txt(
"task_deadline"),
196 $modal =
$factory->modal()->roundtrip(
197 $lng->txt(
"task_details"),
198 $factory->legacy($info_screen->getHTML())
200 ->withCancelButtonLabel(
"close");
201 $button1 =
$factory->button()->shy($a_set[
"title"],
'#')
202 ->withOnClick($modal->getShowSignal());
204 $this->tpl->setVariable(
"TITLE", $renderer->render([$button1, $modal]));
214 return '<div class="small">' . ((int) count($this->tasks)) .
" " .
$lng->txt(
"task_derived_tasks") .
"</div>";
229 $collector =
$DIC->task()->derived()->factory()->collector();
231 $this->tasks = $collector->getEntries($this->
user->getId());
233 $this->getListRowData();
235 return parent::getHTMLNew();
249 if (
$data[
"ref_id"] > 0) {
252 if (
$data[
'url'] ==
"") {
262 if (
$data[
"wsp_id"] > 0) {
264 $obj_id = $wst->lookupObjectId(
$data[
"wsp_id"]);
266 if (
$data[
'url'] ==
"") {
276 if (
$data[
"starting_time"] > 0) {
283 ->withProperties($props);
285 if (
$data[
"deadline"] > 0) {
303 return $this->lng->txt(
"task_no_task_items");
An exception for terminatinating execution or to throw for unit testing.
This class represents a block method of a block.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
setData($a_data)
Set Data.
setPresentation(int $type)
Set presentation.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
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
static _getStaticLink( $a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
BlockGUI class for Tasks on PD.
isRepositoryObject()
Returns whether block has a corresponding repository object.bool
executeCommand()
execute command
static getScreenMode()
Get Screen Mode for current command.
__construct()
Constructor.
getNoItemFoundContent()
No item entry.
getOverview()
Get overview.
fillRow($a_set)
get flat list for personal desktop
fillDataSection()
Fill data section.
getListItemForData(array $data)
Get list item for data array.null|\ILIAS\UI\Component\Item\Item
Tree handler for personal workspace.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.