24 public function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
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 $objdefinition = $this->
dic()[
'objDefinition'];
100 $is_plugin = $objdefinition->isPlugin($this->
getObjType());
102 foreach ($row as $permission) {
107 $position = $permission[
"position"];
108 $op_id = $permission[
"op_id"];
109 $operation = $permission[
"operation"];
110 $this->tpl->setCurrentBlock(
'position_td');
111 $this->tpl->setVariable(
'POSITION_ID', $position->getId());
112 $this->tpl->setVariable(
'PERM_ID', $op_id);
117 $label = $this->
dic()->language()->txt(
'org_op_' . $operation->getOperationString());
120 $this->tpl->setVariable(
'TXT_PERM', $label);
121 $this->tpl->setVariable(
'PERM_LONG', $op_id);
123 if ($permission[
'permission_set']) {
124 $this->tpl->setVariable(
'PERM_CHECKED',
'checked="checked"');
126 if ($permission[
'from_template']) {
127 $this->tpl->setVariable(
'PERM_DISABLED',
'disabled="disabled"');
130 $this->tpl->parseCurrentBlock();
143 $operations = ilOrgUnitOperationQueries::getOperationsForContextName($this->
getObjType());
145 $from_templates = [];
146 foreach ($operations as $op) {
147 $ops_ids[] = $op->getOperationId();
150 foreach ($positions as $position) {
151 $ilOrgUnitPermission = ilOrgUnitPermissionQueries::getSetForRefId($this->
getRefId(), $position->getId());
153 $is_template = $ilOrgUnitPermission->isTemplate();
154 $from_templates[$position->getId()] = $is_template;
157 "op_id" => $op->getOperationId(),
159 "position" => $position,
160 "permission" => $ilOrgUnitPermission,
161 "permission_set" => $ilOrgUnitPermission->isOperationIdSelected($op->getOperationId()),
162 "from_template" => $is_template,
169 "show_select_all" =>
true,
170 "positions" => $positions,
172 "template" => $from_templates,
175 ->isPositionAccessActiveForObject($this->
getObjId())
178 "header_command" =>
true,
179 "positions" => $positions,
180 "template" => $from_templates,
197 foreach ($positions as $position) {
198 $this->
addColumn($position->getTitle(),
'',
'',
'',
false, $position->getDescription());
217 protected function fillSelectAll($row)
222 foreach ($row[
"positions"] as $position) {
223 $this->tpl->setCurrentBlock(
'position_select_all');
224 $id = $position->getId();
225 $this->tpl->setVariable(
'JS_ROLE_ID', $id);
226 $this->tpl->setVariable(
'JS_SUBID', 0);
227 $this->tpl->setVariable(
'JS_ALL_PERMS',
"['" . implode(
"','", $row[
'ops']) .
"']");
228 $this->tpl->setVariable(
'JS_FORM_NAME', $this->
getFormName());
229 $this->tpl->setVariable(
'TXT_SEL_ALL', $this->lng->txt(
'select_all'));
230 if ($row[
"template"][$id]) {
231 $this->tpl->setVariable(
'ALL_DISABLED',
"disabled='disabled'");
233 $this->tpl->parseCurrentBlock();
241 protected function fillHeaderCommand($row)
246 foreach ($row[
"positions"] as $position) {
247 $this->tpl->setCurrentBlock(
'header_command');
248 $this->tpl->setVariable(
'POSITION_ID', $position->getId());
249 $this->tpl->setVariable(
'HEADER_COMMAND_TXT', $this->
dic()
251 ->txt(
'positions_override_operations'));
253 $this->tpl->setVariable(
'HEADER_CHECKED',
"checked='checked'");
256 $this->tpl->parseCurrentBlock();
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
Class ilOrgUnitPermissionTableGUI.
static lookupTxtById($plugin_id, $lang_var)
static hasLocalSet($ref_id, $position_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)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
ilOrgUnitPermissionTableGUI constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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)
__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.
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