ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ($a_set)
 get flat list for personal desktop More...
 
 getOverview ()
 Get overview. More...
 
 getHTMLNew ()
 
- Public Member Functions inherited from ilBlockGUI
 getBlockType ()
 
 __construct ()
 Constructor. More...
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setPresentation (int $type)
 Set presentation. More...
 
 getPresentation ()
 Get presentation type. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands (bool $a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 getHTML ()
 Get HTML. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($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 ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 Get HTML. More...
 

Static Public Member Functions

static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "pdtasks"
 

Protected Member Functions

 isRepositoryObject ()
 
 getListItemForData (array $data)
 
 getNoItemFoundContent ()
 No item entry. More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 initCommands ()
 Init commands. More...
 
 fillRowColor ($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...
 
 getNoItemFoundContent ()
 No item entry. More...
 

Protected Attributes

 $tasks = []
 
 $new_rendering = true
 
- Protected Attributes inherited from ilBlockGUI
 $ui
 
 $data = array()
 
 $enablenuminfo = true
 
 $footer_links = array()
 
 $block_id = 0
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $title = ""
 
 $admincommands = false
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 
 $presentation
 
 $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
 

Detailed Description

BlockGUI class for Tasks on PD.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

ilPDTasksBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPDTasksBlockGUI::__construct ( )

Constructor.

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

References $DIC, ilBlockGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), ilBlockGUI\setTitle(), and user().

24  {
25  global $DIC;
26 
27  $this->ctrl = $DIC->ctrl();
28  $this->lng = $DIC->language();
29  $this->user = $DIC->user();
30  $lng = $DIC->language();
31 
33 
34  $this->setLimit(5);
35  $lng->loadLanguageModule("task");
36  $this->setTitle($lng->txt("task_derived_tasks"));
37 
38  $this->setPresentation(self::PRES_SEC_LIST);
39  }
user()
Definition: user.php:4
setTitle($a_title)
Set Title.
setLimit($a_limit)
Set Limit.
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
setPresentation(int $type)
Set presentation.
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilPDTasksBlockGUI::executeCommand ( )

execute command

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

References ilBlockGUI\$ctrl, and $ilCtrl.

73  {
75 
76  $cmd = $ilCtrl->getCmd("getHTML");
77 
78  return $this->$cmd();
79  }
global $ilCtrl
Definition: ilias.php:18

◆ fillDataSection()

ilPDTasksBlockGUI::fillDataSection ( )

Fill data section.

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

References ilBlockGUI\$data, $DIC, getOverview(), ilBlockGUI\setData(), ilBlockGUI\setDataSection(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setRowTemplate(), and user().

85  {
86  global $DIC;
87  $collector = $DIC->task()->derived()->factory()->collector();
88 
89  $this->tasks = $collector->getEntries($this->user->getId());
90 
91  if (count($this->tasks) > 0) {
92  $this->setRowTemplate("tpl.pd_tasks.html", "Services/Tasks");
93  $this->getListRowData();
94  parent::fillDataSection();
95  } else {
96  $this->setEnableNumInfo(false);
97  $this->setDataSection($this->getOverview());
98  }
99  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
user()
Definition: user.php:4
$DIC
Definition: xapitoken.php:46
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
+ Here is the call graph for this function:

◆ fillRow()

ilPDTasksBlockGUI::fillRow (   $a_set)

get flat list for personal desktop

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

References $DIC, $factory, ilBlockGUI\$lng, $url, ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ilWorkspaceTree\lookupObjectId(), and user().

128  {
129  global $DIC;
130 
131  $factory = $DIC->ui()->factory();
132  $renderer = $DIC->ui()->renderer();
133  $lng = $this->lng;
134 
135  $info_screen = new ilInfoScreenGUI($this);
136  $info_screen->setFormAction("#");
137  $info_screen->addSection($lng->txt(""));
138  //$toolbar = new ilToolbarGUI();
139 
140  $info_screen->addProperty(
141  $lng->txt("task_task"),
142  $a_set["title"]
143  );
144 
145  if ($a_set["ref_id"] > 0) {
146  $obj_id = ilObject::_lookupObjId($a_set["ref_id"]);
147  $obj_type = ilObject::_lookupType($obj_id);
148 
149  if (0 === $a_set['url']) {
150  $url = ilLink::_getStaticLink($a_set["ref_id"]);
151  } else {
152  $url = $a_set['url'];
153  }
154  $link = $factory->button()->shy(ilObject::_lookupTitle($obj_id), $url);
155 
156  $info_screen->addProperty(
157  $lng->txt("obj_" . $obj_type),
158  $renderer->render($link)
159  );
160  }
161 
162  if ($a_set["wsp_id"] > 0) {
163  $wst = new ilWorkspaceTree($this->user->getId());
164  $obj_id = $wst->lookupObjectId($a_set["wsp_id"]);
165  $obj_type = ilObject::_lookupType($obj_id);
166 
167  if (0 === $a_set['url']) {
168  $url = ilLink::_getStaticLink($a_set["wsp_id"]);
169  } else {
170  $url = $a_set['url'];
171  }
172  $link = $factory->button()->shy(ilObject::_lookupTitle($obj_id), $url);
173 
174  $info_screen->addProperty(
175  $lng->txt("obj_" . $obj_type),
176  $renderer->render($link)
177  );
178  }
179 
180  if ($a_set["starting_time"] > 0) {
181  $start = new ilDateTime($a_set["starting_time"], IL_CAL_UNIX);
182  $info_screen->addProperty(
183  $lng->txt("task_start"),
185  );
186  }
187 
188  if ($a_set["deadline"] > 0) {
189  $end = new ilDateTime($a_set["deadline"], IL_CAL_UNIX);
190  $info_screen->addProperty(
191  $lng->txt("task_deadline"),
193  );
194  }
195 
196  $modal = $factory->modal()->roundtrip(
197  $lng->txt("task_details"),
198  $factory->legacy($info_screen->getHTML())
199  )
200  ->withCancelButtonLabel("close");
201  $button1 = $factory->button()->shy($a_set["title"], '#')
202  ->withOnClick($modal->getShowSignal());
203 
204  $this->tpl->setVariable("TITLE", $renderer->render([$button1, $modal]));
205  }
Class ilInfoScreenGUI.
static _lookupTitle($a_id)
lookup object title
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
user()
Definition: user.php:4
Tree handler for personal workspace.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
lookupObjectId($a_node_id)
Get object id for node id.
$DIC
Definition: xapitoken.php:46
$url
$factory
Definition: metadata.php:58
+ Here is the call graph for this function:

◆ getBlockType()

ilPDTasksBlockGUI::getBlockType ( )

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

44  : string
45  {
46  return self::$block_type;
47  }

◆ getHTMLNew()

ilPDTasksBlockGUI::getHTMLNew ( )

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

References $DIC, and user().

226  : string
227  {
228  global $DIC;
229  $collector = $DIC->task()->derived()->factory()->collector();
230 
231  $this->tasks = $collector->getEntries($this->user->getId());
232 
233  $this->getListRowData();
234 
235  return parent::getHTMLNew();
236  }
user()
Definition: user.php:4
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getListItemForData()

ilPDTasksBlockGUI::getListItemForData ( array  $data)
protected

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

References $factory, ilBlockGUI\$lng, ilBlockGUI\$title, $url, ilLink\_getStaticLink(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ilWorkspaceTree\lookupObjectId(), ui(), and user().

242  {
243  $factory = $this->ui->factory();
244  $lng = $this->lng;
245 
246  $title = $data["title"];
247  $props = [];
248 
249  if ($data["ref_id"] > 0) {
250  $obj_id = ilObject::_lookupObjId($data["ref_id"]);
251  $obj_type = ilObject::_lookupType($obj_id);
252  if ($data['url'] == "") {
253  $url = ilLink::_getStaticLink($data["ref_id"]);
254  } else {
255  $url = $data['url'];
256  }
257  $link = $url;
258  $title = $factory->link()->standard($data["title"], $link);
259  $props[$lng->txt("obj_" . $obj_type)] = ilObject::_lookupTitle($obj_id);
260  }
261 
262  if ($data["wsp_id"] > 0) {
263  $wst = new ilWorkspaceTree($this->user->getId());
264  $obj_id = $wst->lookupObjectId($data["wsp_id"]);
265  $obj_type = ilObject::_lookupType($obj_id);
266  if ($data['url'] == "") {
267  $url = ilLink::_getStaticLink($data["wsp_id"]);
268  } else {
269  $url = $data['url'];
270  }
271  $link = $url;
272  $title = $factory->link()->standard($data["title"], $link);
273  $props[$lng->txt("obj_" . $obj_type)] = ilObject::_lookupTitle($obj_id);
274  }
275 
276  if ($data["starting_time"] > 0) {
277  $start = new ilDateTime($data["starting_time"], IL_CAL_UNIX);
278  $props[$lng->txt("task_start")] = ilDatePresentation::formatDate($start);
279  }
280 
281  $factory = $this->ui->factory();
282  $item = $factory->item()->standard($title)
283  ->withProperties($props);
284 
285  if ($data["deadline"] > 0) {
286  $end = new ilDateTime($data["deadline"], IL_CAL_UNIX);
287  //$props[$lng->txt("task_deadline")] =
288  // ilDatePresentation::formatDate($end);
289  $item = $item->withDescription(ilDatePresentation::formatDate($end));
290  }
291 
292 
293  return $item;
294  }
static _lookupTitle($a_id)
lookup object title
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
user()
Definition: user.php:4
Tree handler for personal workspace.
static _lookupObjId($a_id)
Common interface to all items.
Definition: Item.php:10
ui()
Definition: ui.php:5
static _lookupType($a_id, $a_reference=false)
lookup object type
lookupObjectId($a_node_id)
Get object id for node id.
$url
$factory
Definition: metadata.php:58
+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilPDTasksBlockGUI::getNoItemFoundContent ( )
protected

No item entry.

Returns
string

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

301  : string
302  {
303  return $this->lng->txt("task_no_task_items");
304  }

◆ getOverview()

ilPDTasksBlockGUI::getOverview ( )

Get overview.

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

References ilBlockGUI\$lng.

Referenced by fillDataSection().

211  {
212  $lng = $this->lng;
213 
214  return '<div class="small">' . ((int) count($this->tasks)) . " " . $lng->txt("task_derived_tasks") . "</div>";
215  }
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilPDTasksBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

References $_GET, and IL_SCREEN_SIDE.

61  {
62  switch ($_GET["cmd"]) {
63  default:
64  return IL_SCREEN_SIDE;
65  break;
66  }
67  }
$_GET["client_id"]
const IL_SCREEN_SIDE

◆ isRepositoryObject()

ilPDTasksBlockGUI::isRepositoryObject ( )
protected

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

52  : bool
53  {
54  return false;
55  }

Field Documentation

◆ $block_type

ilPDTasksBlockGUI::$block_type = "pdtasks"
static

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

◆ $new_rendering

ilPDTasksBlockGUI::$new_rendering = true
protected

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

◆ $tasks

ilPDTasksBlockGUI::$tasks = []
protected

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


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