ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilSCGroupTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once './Services/Table/classes/class.ilTable2GUI.php';
6include_once './Services/SystemCheck/classes/class.ilSCTask.php';
7
14{
15
21 public function __construct($a_parent_obj, $a_parent_cmd = "")
22 {
23 $this->setId('sc_groups');
24 parent::__construct($a_parent_obj, $a_parent_cmd);
25 }
26
30 public function init()
31 {
32 global $ilCtrl, $lng;
33
34 $lng->loadLanguageModule('sysc');
35 $this->addColumn($this->lng->txt('title'),'title','60%');
36 $this->addColumn($this->lng->txt('last_update'),'last_update_sort','20%');
37 $this->addColumn($this->lng->txt('sysc_completed_num'),'completed','10%');
38 $this->addColumn($this->lng->txt('sysc_failed_num'),'failed','10%');
39 $this->addColumn($this->lng->txt('actions'),'','10%');
40
41 $this->setTitle($this->lng->txt('sysc_overview'));
42
43 $this->setRowTemplate('tpl.syscheck_groups_row.html','Services/SystemCheck');
44 $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
45 }
46
51 public function fillRow($row)
52 {
53 $this->tpl->setVariable('VAL_TITLE',$row['title']);
54
55 $GLOBALS['ilCtrl']->setParameter($this->getParentObject(),'grp_id', $row['id']);
56 $this->tpl->setVariable(
57 'VAL_LINK',
58 $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(),'showGroup')
59 );
60
61 $this->tpl->setVariable('VAL_DESC',$row['description']);
62 $this->tpl->setVariable('VAL_LAST_UPDATE',$row['last_update']);
63 $this->tpl->setVariable('VAL_COMPLETED',$row['completed']);
64 $this->tpl->setVariable('VAL_FAILED',$row['failed']);
65
66 switch($row['status'])
67 {
69 $this->tpl->setVariable('STATUS_CLASS', 'smallgreen');
70 break;
72 $this->tpl->setVariable('STATUS_CLASS', 'warning');
73 break;
74
75 }
76
77
78 // Actions
79 include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
80 $list = new ilAdvancedSelectionListGUI();
81 $list->setSelectionHeaderClass('small');
82 $list->setItemLinkClass('small');
83 $list->setId('sysc_'.$row['id']);
84 $list->setListTitle($this->lng->txt('actions'));
85
86 $GLOBALS['ilCtrl']->setParameter($this->getParentObject(),'grp_id', $row['id']);
87 $list->addItem(
88 $this->lng->txt('show'),
89 '',
90 $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(),'showGroup')
91 );
92 $this->tpl->setVariable('ACTIONS',$list->getHTML());
93 }
94
95
99 public function parse()
100 {
101 $data = array();
102 include_once './Services/SystemCheck/classes/class.ilSCGroups.php';
103 foreach(ilSCGroups::getInstance()->getGroups() as $group)
104 {
105 $item = array();
106 $item['id'] = $group->getId();
107
108
109 include_once './Services/SystemCheck/classes/class.ilSCComponentTaskFactory.php';
110 $task_gui = ilSCComponentTaskFactory::getComponentTaskByForGroup($group->getId());
111
112
113 $item['title'] = $task_gui->getGroupTitle();
114 $item['description'] = $task_gui->getGroupDescription();
115 $item['status'] = $group->getStatus();
116
117 include_once './Services/SystemCheck/classes/class.ilSCTasks.php';
118 $item['completed'] = ilSCTasks::lookupCompleted($group->getId());
119 $item['failed'] = ilSCTasks::lookupFailed($group->getId());
120
121 $last_update = ilSCTasks::lookupLastUpdate($group->getId());
122 $item['last_update'] = ilDatePresentation::formatDate($last_update);
123 $item['last_update_sort'] = $last_update->get(IL_CAL_UNIX);
124 $data[] = $item;
125 }
126
127 $this->setData($data);
128 }
129
130
131}
132?>
const IL_CAL_UNIX
User interface class for advanced drop-down selection lists.
static formatDate(ilDateTime $date)
Format a date @access public.
static getComponentTaskByForGroup($a_group_id, $a_task_id=null)
get task gui for group
Table GUI for system check groups overview.
__construct($a_parent_obj, $a_parent_cmd="")
Constructor.
parse()
Parse system check groups.
static getInstance()
Get singleton instance.
const STATUS_COMPLETED
const STATUS_FAILED
static lookupFailed($a_grp_id)
@global type $ilDB
static lookupCompleted($a_grp_id)
@global type $ilDB
static lookupLastUpdate($a_grp_id)
Lookup last update of group tasks @global type $ilDB.
Class ilTable2GUI.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40