ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilSkillProfileTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
11 {
15  protected $ctrl;
16 
20  protected $access;
21 
25  protected $rbacsystem;
26 
30  public function __construct($a_parent_obj, $a_parent_cmd, $a_write_permission = false)
31  {
32  global $DIC;
33 
34  $this->ctrl = $DIC->ctrl();
35  $this->lng = $DIC->language();
36  $this->access = $DIC->access();
37  $this->rbacsystem = $DIC->rbac()->system();
38  $ilCtrl = $DIC->ctrl();
39  $lng = $DIC->language();
40 
41  parent::__construct($a_parent_obj, $a_parent_cmd);
42  $this->setData($this->getProfiles());
43  $this->setTitle($lng->txt("skmg_skill_profiles"));
44 
45  $this->addColumn("", "", "1px", true);
46  $this->addColumn($this->lng->txt("title"), "title");
47  $this->addColumn($this->lng->txt("context"));
48  $this->addColumn($this->lng->txt("users"));
49  $this->addColumn($this->lng->txt("roles"));
50  $this->addColumn($this->lng->txt("actions"));
51 
52  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
53  $this->setRowTemplate("tpl.skill_profile_row.html", "Services/Skill");
54 
55  $this->addMultiCommand("exportProfiles", $lng->txt("export"));
56  if ($a_write_permission) {
57  $this->addMultiCommand("confirmDeleteProfiles", $lng->txt("delete"));
58  }
59  //$this->addCommandButton("", $lng->txt(""));
60  }
61 
67  public function getProfiles()
68  {
70  }
71 
72 
76  protected function fillRow($a_set)
77  {
78  $lng = $this->lng;
79  $ilCtrl = $this->ctrl;
80 
81  $this->tpl->setCurrentBlock("cmd");
82  if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
83  $this->tpl->setVariable("CMD", $lng->txt("edit"));
84  $ilCtrl->setParameter($this->parent_obj, "sprof_id", $a_set["id"]);
85  $this->tpl->setVariable("CMD_HREF", $ilCtrl->getLinkTarget($this->parent_obj, "showLevels"));
86  $ilCtrl->setParameter($this->parent_obj, "sprof_id", $_GET["sprof_id"]);
87  $this->tpl->parseCurrentBlock();
88  }
89  $this->tpl->setVariable("ID", $a_set["id"]);
90  $this->tpl->setVariable("TITLE", $a_set["title"]);
91 
92  $profile_ref_id = ilSkillProfile::lookupRefId($a_set["id"]);
93  $profile_obj_id = ilContainerReference::_lookupObjectId($profile_ref_id);
94  $profile_obj_title = ilObject::_lookupTitle($profile_obj_id);
95  if ($profile_ref_id > 0) {
96  $this->tpl->setVariable(
97  "CONTEXT",
98  $lng->txt("skmg_context_local") . " (" . $profile_obj_title . ")"
99  );
100  } else {
101  $this->tpl->setVariable("CONTEXT", $lng->txt("skmg_context_global"));
102  }
103 
104  $this->tpl->setVariable("NUM_USERS", ilSkillProfile::countUsers($a_set["id"]));
105  $this->tpl->setVariable("NUM_ROLES", ilSkillProfile::countRoles($a_set["id"]));
106  }
107 }
static getProfiles()
Get profiles.
$_GET["client_id"]
TableGUI class for skill profiles.
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
global $DIC
Definition: goto.php:24
addMultiCommand($a_cmd, $a_text)
Add Command button.
static lookupRefId($a_id)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct(Container $dic, ilPlugin $plugin)
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.
static countUsers($a_profile_id)
Get assigned users.
__construct($a_parent_obj, $a_parent_cmd, $a_write_permission=false)
Constructor.
static countRoles(int $a_profile_id)
Count assigned roles of a profile.