24 public function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
28 parent::__construct($a_parent_obj, $a_parent_cmd);
30 $this->lng->loadLanguageModule(
'rbac');
31 $this->lng->loadLanguageModule(
"orgu");
33 $this->ref_id = $a_ref_id;
35 $this->
setId(
'objpositionperm_' . $this->ref_id);
37 $tpl->addJavaScript(
'./Services/AccessControl/js/ilPermSelect.js');
39 $this->
setTitle($this->lng->txt(
'org_permission_settings'));
42 $this->
setFormAction($ilCtrl->getFormAction($a_parent_obj, $a_parent_cmd));
44 $this->
setRowTemplate(
"tpl.obj_position_perm_row.html",
"Modules/OrgUnit");
88 if (isset(
$row[
'show_select_all'])) {
89 $this->fillSelectAll(
$row);
93 if (isset(
$row[
'header_command'])) {
94 $this->fillHeaderCommand(
$row);
99 foreach (
$row as $permission) {
104 $position = $permission[
"position"];
105 $op_id = $permission[
"op_id"];
106 $operation = $permission[
"operation"];
107 $this->tpl->setCurrentBlock(
'position_td');
108 $this->tpl->setVariable(
'POSITION_ID', $position->getId());
109 $this->tpl->setVariable(
'PERM_ID', $op_id);
111 $this->tpl->setVariable(
'TXT_PERM', $this->
dic()->language()->txt(
'org_op_' 112 . $operation->getOperationString()));
113 $this->tpl->setVariable(
'PERM_LONG', $op_id);
115 if ($permission[
'permission_set']) {
116 $this->tpl->setVariable(
'PERM_CHECKED',
'checked="checked"');
118 if ($permission[
'from_template']) {
119 $this->tpl->setVariable(
'PERM_DISABLED',
'disabled="disabled"');
122 $this->tpl->parseCurrentBlock();
135 $operations = ilOrgUnitOperationQueries::getOperationsForContextName($this->
getObjType());
137 $from_templates = [];
138 foreach ($operations as $op) {
139 $ops_ids[] = $op->getOperationId();
142 foreach ($positions as $position) {
143 $ilOrgUnitPermission = ilOrgUnitPermissionQueries::getSetForRefId($this->
getRefId(), $position->getId());
145 $is_template = $ilOrgUnitPermission->isTemplate();
146 $from_templates[$position->getId()] = $is_template;
149 "op_id" => $op->getOperationId(),
151 "position" => $position,
152 "permission" => $ilOrgUnitPermission,
153 "permission_set" => $ilOrgUnitPermission->isOperationIdSelected($op->getOperationId()),
154 "from_template" => $is_template,
161 "show_select_all" =>
true,
162 "positions" => $positions,
164 "template" => $from_templates,
167 ->isPositionAccessActiveForObject($this->
getObjId())) {
169 "header_command" =>
true,
170 "positions" => $positions,
171 "template" => $from_templates,
188 foreach ($positions as $position) {
189 $this->
addColumn($position->getTitle(),
'',
'',
'',
false, $position->getDescription());
208 protected function fillSelectAll(
$row)
213 foreach (
$row[
"positions"] as $position) {
214 $this->tpl->setCurrentBlock(
'position_select_all');
215 $id = $position->getId();
216 $this->tpl->setVariable(
'JS_ROLE_ID',
$id);
217 $this->tpl->setVariable(
'JS_SUBID', 0);
218 $this->tpl->setVariable(
'JS_ALL_PERMS',
"['" . implode(
"','",
$row[
'ops']) .
"']");
219 $this->tpl->setVariable(
'JS_FORM_NAME', $this->
getFormName());
220 $this->tpl->setVariable(
'TXT_SEL_ALL', $this->lng->txt(
'select_all'));
222 $this->tpl->setVariable(
'ALL_DISABLED',
"disabled='disabled'");
224 $this->tpl->parseCurrentBlock();
232 protected function fillHeaderCommand(
$row)
237 foreach (
$row[
"positions"] as $position) {
238 $this->tpl->setCurrentBlock(
'header_command');
239 $this->tpl->setVariable(
'POSITION_ID', $position->getId());
240 $this->tpl->setVariable(
'HEADER_COMMAND_TXT', $this->
dic()
242 ->txt(
'positions_override_operations'));
244 $this->tpl->setVariable(
'HEADER_CHECKED',
"checked='checked'");
247 $this->tpl->parseCurrentBlock();
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
Class ilOrgUnitPermissionTableGUI.
static hasLocalSet($ref_id, $position_id)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
if(!array_key_exists('StateId', $_REQUEST)) $id
getFormName()
Get Form name.
setNoEntriesText($a_text)
Set text for an empty table.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static getInstance()
Get instance.
static get()
Override for correct on return value.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
static _lookupObjId($a_id)
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
ilOrgUnitPermissionTableGUI constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
initColumns(array $positions)
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.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
fillRow($a_set)
Standard Version of Fill Row.
const CMD_SAVE_POSITIONS_PERMISSIONS