ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDerivedTasksGUI Class Reference

Derived tasks list. More...

+ Inheritance diagram for ilDerivedTasksGUI:
+ Collaboration diagram for ilDerivedTasksGUI:

Public Member Functions

 __construct (?Container $di_container=null)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 

Protected Member Functions

 show ()
 Show list of tasks. More...
 

Protected Attributes

Container $dic
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $main_tpl
 
ilTaskService $task
 
ilObjUser $user
 
UIServices $ui
 
ilLanguage $lng
 
ilHelpGUI $help
 

Detailed Description

Derived tasks list.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 27 of file class.ilDerivedTasksGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilDerivedTasksGUI::__construct ( ?Container  $di_container = null)

Constructor.

Parameters
Container | null$dic

Definition at line 42 of file class.ilDerivedTasksGUI.php.

43 {
44 global $DIC;
45
46 if (is_null($di_container)) {
47 $di_container = $DIC;
48 }
49 $this->dic = $di_container;
50 $this->ctrl = $DIC->ctrl();
51 $this->main_tpl = $DIC->ui()->mainTemplate();
52 $this->task = $DIC->task();
53 $this->user = $DIC->user();
54 $this->ui = $DIC->ui();
55 $this->lng = $DIC->language();
56 $this->help = $DIC->help();
57
58 $this->help->setScreenIdComponent('task');
59 $this->lng->loadLanguageModule("task");
60 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilDerivedTasksGUI::executeCommand ( )

Execute command.

Definition at line 65 of file class.ilDerivedTasksGUI.php.

65 : void
66 {
70
71 $next_class = $ctrl->getNextClass($this);
72 $cmd = $ctrl->getCmd("show");
73
74 if ($cmd == "show") {
75 $this->$cmd();
76 }
78 }
getNextClass($a_gui_class=null)
@inheritDoc
getCmd(?string $fallback_command=null)
@inheritDoc
ilGlobalTemplateInterface $main_tpl
loadStandardTemplate()
This loads the standard template "tpl.adm_content.html" and "tpl.statusline.html" the CONTENT and STA...
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)

References $ctrl, $main_tpl, ilCtrl\getCmd(), ilCtrl\getNextClass(), ILIAS\UICore\GlobalTemplate\loadStandardTemplate(), and ILIAS\UICore\GlobalTemplate\printToStdout().

+ Here is the call graph for this function:

◆ show()

ilDerivedTasksGUI::show ( )
protected

Show list of tasks.

Definition at line 83 of file class.ilDerivedTasksGUI.php.

83 : void
84 {
85 $ui = $this->ui;
88
89 $main_tpl->setTitle($lng->txt("task_derived_tasks"));
90 $main_tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_task.svg"));
91 $this->help->setScreenId('derived_tasks');
92
93 $f = $ui->factory();
95
96 $collector = $this->task->derived()->factory()->collector();
97
98 $entries = $collector->getEntries($this->user->getId());
99
100 $list_items_with_deadline = [];
101 $list_items_without_deadline = [];
102
103 // item groups from tasks
104 foreach ($entries as $i) {
105 $props = [];
106
107 $title = $i->getTitle();
108 $link = '';
109
110 if ($i->getRefId() > 0) {
111 $obj_id = ilObject::_lookupObjId($i->getRefId());
112 $obj_type = ilObject::_lookupType($obj_id);
113 $props[$lng->txt("obj_" . $obj_type)] = ilObject::_lookupTitle($obj_id);
114
115 $link = ilLink::_getStaticLink($i->getRefId());
116 }
117
118 if ($i->getWspId() > 0) {
119 $wst = new ilWorkspaceTree($this->user->getId());
120 $obj_id = $wst->lookupObjectId($i->getWspId());
121 $obj_type = ilObject::_lookupType($obj_id);
122 $props[$lng->txt("obj_" . $obj_type)] = ilObject::_lookupTitle($obj_id);
123 }
124
125 if (strlen($i->getUrl()) > 0) {
126 $link = $i->getUrl();
127 }
128
129 if (strlen($link) > 0) {
130 $title = $f->button()->shy($title, $link);
131 }
132
133 if ($i->getStartingTime() > 0) {
134 $start = new ilDateTime($i->getStartingTime(), IL_CAL_UNIX);
135 $props[$lng->txt("task_start")] = ilDatePresentation::formatDate($start);
136 }
137 if ($i->getDeadline() > 0) {
138 $end = new ilDateTime($i->getDeadline(), IL_CAL_UNIX);
139 $props[$lng->txt("task_deadline")] = ilDatePresentation::formatDate($end);
140 }
141 $item = $f->item()->standard($title)->withProperties($props);
142 if ($i->getDeadline() > 0) {
143 $list_items_with_deadline[] = $item;
144 } else {
145 $list_items_without_deadline[] = $item;
146 }
147 }
148
149 // output list panel or info message
150 if (count($list_items_with_deadline) > 0 || count($list_items_without_deadline) > 0) {
151 $panels = [];
152
153 if (count($list_items_with_deadline) > 0) {
154 $panels[] = $f->panel()->listing()->standard(
155 $lng->txt("task_tasks_with_deadline"),
156 [$f->item()->group("", $list_items_with_deadline)]
157 );
158 }
159 if (count($list_items_without_deadline) > 0) {
160 $panels[] = $f->panel()->listing()->standard(
161 $lng->txt("task_tasks_without_deadline"),
162 [$f->item()->group("", $list_items_without_deadline)]
163 );
164 }
165
166
167 $main_tpl->setContent($renderer->render($panels));
168 } else {
169 $this->main_tpl->setOnScreenMessage('info', $lng->txt("task_no_tasks"));
170 }
171 }
$renderer
renderer()
Get a renderer for UI components.
Definition: UIServices.php:44
factory()
Get the factory that crafts UI components.
Definition: UIServices.php:36
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setContent(string $a_html)
Sets content for standard template.

References Vendor\Package\$f, $lng, $main_tpl, $renderer, $ui, ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ILIAS\DI\UIServices\factory(), ilDatePresentation\formatDate(), ilUtil\getImagePath(), ILIAS\Repository\help(), IL_CAL_UNIX, ILIAS\DI\UIServices\renderer(), ILIAS\UICore\GlobalTemplate\setContent(), ILIAS\UICore\GlobalTemplate\setTitle(), ILIAS\UICore\GlobalTemplate\setTitleIcon(), ilLanguage\txt(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilDerivedTasksGUI::$ctrl
protected

Definition at line 30 of file class.ilDerivedTasksGUI.php.

Referenced by executeCommand().

◆ $dic

Container ilDerivedTasksGUI::$dic
protected

Definition at line 29 of file class.ilDerivedTasksGUI.php.

◆ $help

ilHelpGUI ilDerivedTasksGUI::$help
protected

Definition at line 36 of file class.ilDerivedTasksGUI.php.

◆ $lng

ilLanguage ilDerivedTasksGUI::$lng
protected

Definition at line 35 of file class.ilDerivedTasksGUI.php.

Referenced by show().

◆ $main_tpl

ilGlobalTemplateInterface ilDerivedTasksGUI::$main_tpl
protected

Definition at line 31 of file class.ilDerivedTasksGUI.php.

Referenced by executeCommand(), and show().

◆ $task

ilTaskService ilDerivedTasksGUI::$task
protected

Definition at line 32 of file class.ilDerivedTasksGUI.php.

◆ $ui

UIServices ilDerivedTasksGUI::$ui
protected

Definition at line 34 of file class.ilDerivedTasksGUI.php.

Referenced by show().

◆ $user

ilObjUser ilDerivedTasksGUI::$user
protected

Definition at line 33 of file class.ilDerivedTasksGUI.php.


The documentation for this class was generated from the following file: