ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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...
 
 getOverview ()
 Get overview. More...
 
 getHTML ()
 
 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 ()
 
 checkOffset (int $offset)
 
 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="", ?RoundTrip $modal=null)
 
 getBlockCommands ()
 
 getHTML ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getViewControlsForPanel ()
 
 sortObject ()
 
 addSortOption (string $option, string $label, bool $active)
 
 setSortTarget (string $target)
 
 addPresentation (string $label, string $target, bool $active)
 
 getNoItemFoundContent ()
 

Static Public Member Functions

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

Static Public Attributes

static string $block_type = "pdtasks"
 

Protected Member Functions

 isRepositoryObject ()
 
 getListItemForData (array $data)
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. 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...
 
 getActionsForPanel ()
 
 send (string $output)
 Send. More...
 

Protected Attributes

array $tasks = []
 
- Protected Attributes inherited from ilBlockGUI
ILIAS UI Renderer $renderer
 
Factory $factory
 
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
 

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

ilPDTasksBlockGUI: ilColumnGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPDTasksBlockGUI::__construct ( )

Constructor.

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

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().

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  }
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...
ilLanguage $lng
setLimit(int $a_limit)
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
setTitle(string $a_title)
setPresentation(int $type)
+ 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.

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

83  {
84  $ilCtrl = $this->ctrl;
85 
86  $cmd = $ilCtrl->getCmd("getHTML");
87 
88  return $this->$cmd();
89  }
getCmd(?string $fallback_command=null)
+ Here is the call graph for this function:

◆ getBlockType()

ilPDTasksBlockGUI::getBlockType ( )

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

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

◆ getHTML()

ilPDTasksBlockGUI::getHTML ( )

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

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

126  : string
127  {
128  global $DIC;
129  $collector = $DIC->task()->derived()->factory()->collector();
130 
131  $this->tasks = $collector->getEntries($this->user->getId());
132 
133  $this->getListRowData();
134 
135  return parent::getHTML();
136  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ getListItemForData()

ilPDTasksBlockGUI::getListItemForData ( array  $data)
protected

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

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

141  : ?Item
142  {
143  $factory = $this->ui->factory();
144  $lng = $this->lng;
145 
146  $title = $data["title"];
147  $props = [];
148 
149  if ($data["ref_id"] > 0) {
150  $obj_id = ilObject::_lookupObjId($data["ref_id"]);
151  $obj_type = ilObject::_lookupType($obj_id);
152  $url = $data['url'] == "" ? ilLink::_getStaticLink($data["ref_id"]) : $data['url'];
153  $link = $url;
154  $title = $factory->link()->standard($data["title"], $link);
155  $props[$lng->txt("obj_" . $obj_type)] = ilObject::_lookupTitle($obj_id);
156  }
157 
158  if ($data["wsp_id"] > 0) {
159  $wst = new ilWorkspaceTree($this->user->getId());
160  $obj_id = $wst->lookupObjectId($data["wsp_id"]);
161  $obj_type = ilObject::_lookupType($obj_id);
162  $url = $data['url'] == "" ? ilLink::_getStaticLink($data["wsp_id"]) : $data['url'];
163  $link = $url;
164  $title = $factory->link()->standard($data["title"], $link);
165  $props[$lng->txt("obj_" . $obj_type)] = ilObject::_lookupTitle($obj_id);
166  }
167 
168  if ($data["starting_time"] > 0) {
169  $start = new ilDateTime($data["starting_time"], IL_CAL_UNIX);
170  $props[$lng->txt("task_start")] = ilDatePresentation::formatDate($start);
171  }
172 
173  $factory = $this->ui->factory();
174  $item = $factory->item()->standard($title)
175  ->withProperties($props);
176 
177  if ($data["deadline"] > 0) {
178  $end = new ilDateTime($data["deadline"], IL_CAL_UNIX);
179  //$props[$lng->txt("task_deadline")] =
180  // ilDatePresentation::formatDate($end);
181  $item = $item->withDescription(ilDatePresentation::formatDate($end));
182  }
183 
184 
185  return $item;
186  }
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...
ilLanguage $lng
Factory $factory
$url
Definition: shib_logout.php:66
const IL_CAL_UNIX
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
Common interface to all items.
Definition: Item.php:31
lookupObjectId(int $a_node_id)
Get object id for node id.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilPDTasksBlockGUI::getNoItemFoundContent ( )

No item entry.

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

References ILIAS\Repository\lng().

191  : string
192  {
193  return $this->lng->txt("task_no_task_items");
194  }
+ Here is the call graph for this function:

◆ getOverview()

ilPDTasksBlockGUI::getOverview ( )

Get overview.

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

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

116  : string
117  {
118  $lng = $this->lng;
119 
120  return '<div class="small">' . (count($this->tasks)) . " " . $lng->txt("task_derived_tasks") . "</div>";
121  }
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...
ilLanguage $lng
+ Here is the call graph for this function:

◆ getScreenMode()

static ilPDTasksBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

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

References IL_SCREEN_SIDE.

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

◆ isRepositoryObject()

ilPDTasksBlockGUI::isRepositoryObject ( )
protected

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.

◆ $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: