ILIAS  release_8 Revision v8.24
ilPDTasksBlockGUI Class Reference

BlockGUI class for Tasks on PD. More...

+ Inheritance diagram for ilPDTasksBlockGUI:
+ Collaboration diagram for ilPDTasksBlockGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getBlockType ()
 
 executeCommand ()
 execute command More...
 
 fillDataSection ()
 Fill data section. More...
 
 fillRow (array $a_set)
 get flat list for personal desktop More...
 
 getOverview ()
 Get overview. More...
 
 getHTMLNew ()
 
 getNoItemFoundContent ()
 No item entry. More...
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 correctOffset ()
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 
 getBlockCommands ()
 
 getHTML ()
 
 fillHeaderCommands ()
 
 fillHeaderTitleBlock ()
 
 setDataSection (string $a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow (array $a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 
 setPreviousNextLinks ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 
 getNoItemFoundContent ()
 

Static Public Member Functions

static getScreenMode ()
 Get Screen Mode for current command. More...
 
static getScreenMode ()
 

Static Public Attributes

static string $block_type = "pdtasks"
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 getListItemForData (array $data)
 Get list item for data array.
Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item
More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 fillRowColor (string $a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getViewControls ()
 Get view controls. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 send (string $output)
 Send. More...
 

Protected Attributes

array $tasks = []
 
bool $new_rendering = true
 
- Protected Attributes inherited from ilBlockGUI
object $gui_object
 
ILIAS Block StandardGUIRequest $request
 
ILIAS Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 
bool $new_rendering = false
 

Additional Inherited Members

- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 
const PRES_MAIN_TILE = 4
 

Detailed Description

BlockGUI class for Tasks on PD.

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

@ilCtrl_IsCalledBy ilPDTasksBlockGUI: ilColumnGUI

Definition at line 28 of file class.ilPDTasksBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPDTasksBlockGUI::__construct ( )

Constructor.

Reimplemented from ilBlockGUI.

Definition at line 37 of file class.ilPDTasksBlockGUI.php.

38 {
39 global $DIC;
40
41 $this->ctrl = $DIC->ctrl();
42 $this->lng = $DIC->language();
43 $this->user = $DIC->user();
44 $lng = $DIC->language();
45
47
48 $this->setLimit(5);
49 $lng->loadLanguageModule("task");
50 $this->setTitle($lng->txt("task_derived_tasks"));
51
52 $this->setPresentation(self::PRES_SEC_LIST);
53 }
ilLanguage $lng
setTitle(string $a_title)
setPresentation(int $type)
setLimit(int $a_limit)
loadLanguageModule(string $a_module)
Load language module.
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...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilBlockGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), ilBlockGUI\setTitle(), ilLanguage\txt(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilPDTasksBlockGUI::executeCommand ( )

execute command

Definition at line 82 of file class.ilPDTasksBlockGUI.php.

83 {
84 $ilCtrl = $this->ctrl;
85
86 $cmd = $ilCtrl->getCmd("getHTML");
87
88 return $this->$cmd();
89 }
getCmd(string $fallback_command=null)
@inheritDoc

References ilBlockGUI\$ctrl, and ilCtrl\getCmd().

+ Here is the call graph for this function:

◆ fillDataSection()

ilPDTasksBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

Definition at line 94 of file class.ilPDTasksBlockGUI.php.

94 : void
95 {
96 global $DIC;
97 $collector = $DIC->task()->derived()->factory()->collector();
98
99 $this->tasks = $collector->getEntries($this->user->getId());
100
101 if (count($this->tasks) > 0) {
102 $this->setRowTemplate("tpl.pd_tasks.html", "Services/Tasks");
103 $this->getListRowData();
104 parent::fillDataSection();
105 } else {
106 $this->setEnableNumInfo(false);
107 $this->setDataSection($this->getOverview());
108 }
109 }
setDataSection(string $a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo(bool $a_enablenuminfo)
setRowTemplate(string $a_rowtemplatename, string $a_rowtemplatedir="")
Set Row Template Name.

References $DIC, getOverview(), ilBlockGUI\setDataSection(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setRowTemplate(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ fillRow()

ilPDTasksBlockGUI::fillRow ( array  $a_set)

get flat list for personal desktop

Reimplemented from ilBlockGUI.

Definition at line 137 of file class.ilPDTasksBlockGUI.php.

137 : void
138 {
139 global $DIC;
140
141 $factory = $DIC->ui()->factory();
142 $renderer = $DIC->ui()->renderer();
144
145 $info_screen = new ilInfoScreenGUI($this);
146 $info_screen->setFormAction("#");
147 $info_screen->addSection($lng->txt(""));
148 //$toolbar = new ilToolbarGUI();
149
150 $info_screen->addProperty(
151 $lng->txt("task_task"),
152 $a_set["title"]
153 );
154
155 if ($a_set["ref_id"] > 0) {
156 $obj_id = ilObject::_lookupObjId($a_set["ref_id"]);
157 $obj_type = ilObject::_lookupType($obj_id);
158
159 $url = 0 === $a_set['url'] ? ilLink::_getStaticLink($a_set["ref_id"]) : $a_set['url'];
160 $link = $factory->button()->shy(ilObject::_lookupTitle($obj_id), $url);
161
162 $info_screen->addProperty(
163 $lng->txt("obj_" . $obj_type),
164 $renderer->render($link)
165 );
166 }
167
168 if ($a_set["wsp_id"] > 0) {
169 $wst = new ilWorkspaceTree($this->user->getId());
170 $obj_id = $wst->lookupObjectId($a_set["wsp_id"]);
171 $obj_type = ilObject::_lookupType($obj_id);
172
173 $url = 0 === $a_set['url'] ? ilLink::_getStaticLink($a_set["wsp_id"]) : $a_set['url'];
174 $link = $factory->button()->shy(ilObject::_lookupTitle($obj_id), $url);
175
176 $info_screen->addProperty(
177 $lng->txt("obj_" . $obj_type),
178 $renderer->render($link)
179 );
180 }
181
182 if ($a_set["starting_time"] > 0) {
183 $start = new ilDateTime($a_set["starting_time"], IL_CAL_UNIX);
184 $info_screen->addProperty(
185 $lng->txt("task_start"),
187 );
188 }
189
190 if ($a_set["deadline"] > 0) {
191 $end = new ilDateTime($a_set["deadline"], IL_CAL_UNIX);
192 $info_screen->addProperty(
193 $lng->txt("task_deadline"),
195 );
196 }
197
198 $modal = $factory->modal()->roundtrip(
199 $lng->txt("task_details"),
200 $factory->legacy($info_screen->getHTML())
201 )
202 ->withCancelButtonLabel("close");
203 $button1 = $factory->button()->shy($a_set["title"], '#')
204 ->withOnClick($modal->getShowSignal());
205
206 $this->tpl->setVariable("TITLE", $renderer->render([$button1, $modal]));
207 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
Class ilInfoScreenGUI.
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$factory
Definition: metadata.php:75
$url

References $DIC, $factory, ilBlockGUI\$lng, $url, ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ilLanguage\txt(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getBlockType()

ilPDTasksBlockGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

Definition at line 58 of file class.ilPDTasksBlockGUI.php.

58 : string
59 {
60 return self::$block_type;
61 }

References $block_type.

◆ getHTMLNew()

ilPDTasksBlockGUI::getHTMLNew ( )

Reimplemented from ilBlockGUI.

Definition at line 228 of file class.ilPDTasksBlockGUI.php.

228 : string
229 {
230 global $DIC;
231 $collector = $DIC->task()->derived()->factory()->collector();
232
233 $this->tasks = $collector->getEntries($this->user->getId());
234
235 $this->getListRowData();
236
237 return parent::getHTMLNew();
238 }

References $DIC, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getListItemForData()

ilPDTasksBlockGUI::getListItemForData ( array  $data)
protected

Get list item for data array.

Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item

Reimplemented from ilBlockGUI.

Definition at line 243 of file class.ilPDTasksBlockGUI.php.

243 : ?Item
244 {
245 $factory = $this->ui->factory();
247
248 $title = $data["title"];
249 $props = [];
250
251 if ($data["ref_id"] > 0) {
252 $obj_id = ilObject::_lookupObjId($data["ref_id"]);
253 $obj_type = ilObject::_lookupType($obj_id);
254 $url = $data['url'] == "" ? ilLink::_getStaticLink($data["ref_id"]) : $data['url'];
255 $link = $url;
256 $title = $factory->link()->standard($data["title"], $link);
257 $props[$lng->txt("obj_" . $obj_type)] = ilObject::_lookupTitle($obj_id);
258 }
259
260 if ($data["wsp_id"] > 0) {
261 $wst = new ilWorkspaceTree($this->user->getId());
262 $obj_id = $wst->lookupObjectId($data["wsp_id"]);
263 $obj_type = ilObject::_lookupType($obj_id);
264 $url = $data['url'] == "" ? ilLink::_getStaticLink($data["wsp_id"]) : $data['url'];
265 $link = $url;
266 $title = $factory->link()->standard($data["title"], $link);
267 $props[$lng->txt("obj_" . $obj_type)] = ilObject::_lookupTitle($obj_id);
268 }
269
270 if ($data["starting_time"] > 0) {
271 $start = new ilDateTime($data["starting_time"], IL_CAL_UNIX);
272 $props[$lng->txt("task_start")] = ilDatePresentation::formatDate($start);
273 }
274
275 $factory = $this->ui->factory();
276 $item = $factory->item()->standard($title)
277 ->withProperties($props);
278
279 if ($data["deadline"] > 0) {
280 $end = new ilDateTime($data["deadline"], IL_CAL_UNIX);
281 //$props[$lng->txt("task_deadline")] =
282 // ilDatePresentation::formatDate($end);
283 $item = $item->withDescription(ilDatePresentation::formatDate($end));
284 }
285
286
287 return $item;
288 }
Common interface to all items.
Definition: Item.php:32

References ilBlockGUI\$data, $factory, ilBlockGUI\$lng, ilBlockGUI\$title, $url, ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ilLanguage\txt(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilPDTasksBlockGUI::getNoItemFoundContent ( )

No item entry.

Reimplemented from ilBlockGUI.

Definition at line 293 of file class.ilPDTasksBlockGUI.php.

293 : string
294 {
295 return $this->lng->txt("task_no_task_items");
296 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getOverview()

ilPDTasksBlockGUI::getOverview ( )

Get overview.

Definition at line 212 of file class.ilPDTasksBlockGUI.php.

212 : string
213 {
215
216 return '<div class="small">' . (count($this->tasks)) . " " . $lng->txt("task_derived_tasks") . "</div>";
217 }

References ilBlockGUI\$lng, and ilLanguage\txt().

Referenced by fillDataSection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDTasksBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Definition at line 74 of file class.ilPDTasksBlockGUI.php.

74 : string
75 {
76 return IL_SCREEN_SIDE;
77 }
const IL_SCREEN_SIDE

References IL_SCREEN_SIDE.

◆ isRepositoryObject()

ilPDTasksBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Reimplemented from ilBlockGUI.

Definition at line 66 of file class.ilPDTasksBlockGUI.php.

66 : bool
67 {
68 return false;
69 }

Field Documentation

◆ $block_type

string ilPDTasksBlockGUI::$block_type = "pdtasks"
static

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

Referenced by getBlockType().

◆ $new_rendering

bool ilPDTasksBlockGUI::$new_rendering = true
protected

Definition at line 223 of file class.ilPDTasksBlockGUI.php.

◆ $tasks

array ilPDTasksBlockGUI::$tasks = []
protected

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


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