ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
5 include_once './Services/Table/classes/class.ilTable2GUI.php';
6 include_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 $DIC;
33 
34  $ilCtrl = $DIC['ilCtrl'];
35  $lng = $DIC['lng'];
36 
37  $lng->loadLanguageModule('sysc');
38  $this->addColumn($this->lng->txt('title'), 'title', '60%');
39  $this->addColumn($this->lng->txt('last_update'), 'last_update_sort', '20%');
40  $this->addColumn($this->lng->txt('sysc_completed_num'), 'completed', '10%');
41  $this->addColumn($this->lng->txt('sysc_failed_num'), 'failed', '10%');
42  $this->addColumn($this->lng->txt('actions'), '', '10%');
43 
44  $this->setTitle($this->lng->txt('sysc_overview'));
45 
46  $this->setRowTemplate('tpl.syscheck_groups_row.html', 'Services/SystemCheck');
47  $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
48  }
49 
54  public function fillRow($row)
55  {
56  $this->tpl->setVariable('VAL_TITLE', $row['title']);
57 
58  $GLOBALS['DIC']['ilCtrl']->setParameter($this->getParentObject(), 'grp_id', $row['id']);
59  $this->tpl->setVariable(
60  'VAL_LINK',
61  $GLOBALS['DIC']['ilCtrl']->getLinkTarget($this->getParentObject(), 'showGroup')
62  );
63 
64  $this->tpl->setVariable('VAL_DESC', $row['description']);
65  $this->tpl->setVariable('VAL_LAST_UPDATE', $row['last_update']);
66  $this->tpl->setVariable('VAL_COMPLETED', $row['completed']);
67  $this->tpl->setVariable('VAL_FAILED', $row['failed']);
68 
69  switch ($row['status']) {
71  $this->tpl->setVariable('STATUS_CLASS', 'smallgreen');
72  break;
74  $this->tpl->setVariable('STATUS_CLASS', 'warning');
75  break;
76 
77  }
78 
79 
80  // Actions
81  include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
83  $list->setSelectionHeaderClass('small');
84  $list->setItemLinkClass('small');
85  $list->setId('sysc_' . $row['id']);
86  $list->setListTitle($this->lng->txt('actions'));
87 
88  $GLOBALS['DIC']['ilCtrl']->setParameter($this->getParentObject(), 'grp_id', $row['id']);
89  $list->addItem(
90  $this->lng->txt('show'),
91  '',
92  $GLOBALS['DIC']['ilCtrl']->getLinkTarget($this->getParentObject(), 'showGroup')
93  );
94  $this->tpl->setVariable('ACTIONS', $list->getHTML());
95  }
96 
97 
101  public function parse()
102  {
103  $data = array();
104  include_once './Services/SystemCheck/classes/class.ilSCGroups.php';
105  foreach (ilSCGroups::getInstance()->getGroups() as $group) {
106  $item = array();
107  $item['id'] = $group->getId();
108 
109 
110  include_once './Services/SystemCheck/classes/class.ilSCComponentTaskFactory.php';
111  $task_gui = ilSCComponentTaskFactory::getComponentTaskGUIForGroup($group->getId());
112 
113 
114  $item['title'] = $task_gui->getGroupTitle();
115  $item['description'] = $task_gui->getGroupDescription();
116  $item['status'] = $group->getStatus();
117 
118  include_once './Services/SystemCheck/classes/class.ilSCTasks.php';
119  $item['completed'] = ilSCTasks::lookupCompleted($group->getId());
120  $item['failed'] = ilSCTasks::lookupFailed($group->getId());
121 
122  $last_update = ilSCTasks::lookupLastUpdate($group->getId());
123  $item['last_update'] = ilDatePresentation::formatDate($last_update);
124  $item['last_update_sort'] = $last_update->get(IL_CAL_UNIX);
125  $data[] = $item;
126  }
127 
128  $this->setData($data);
129  }
130 }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
global $DIC
Definition: saml.php:7
const STATUS_FAILED
__construct($a_parent_obj, $a_parent_cmd="")
Constructor.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
getParentObject()
Get parent object.
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static lookupFailed($a_grp_id)
static lookupLastUpdate($a_grp_id)
Lookup last update of group tasks type $ilDB.
Class ilTable2GUI.
static getInstance()
Get singleton instance.
static getComponentTaskGUIForGroup($a_group_id, $a_task_id=null)
get task gui for group
setRowTemplate($a_template, $a_template_dir="")
Set row template.
$row
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
const STATUS_COMPLETED
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.
Table GUI for system check groups overview.
parse()
Parse system check groups.
static lookupCompleted($a_grp_id)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.