30 return "il_orgu_positions";
37 public static function get(): array
57 public function delete():
void
60 throw new ilException(
'Cannot delete Core-Position');
72 $q =
"SELECT DISTINCT il_orgu_positions.id, il_orgu_positions.*
73 FROM il_orgu_positions
74 LEFT JOIN il_orgu_ua ON il_orgu_positions.id = il_orgu_ua.position_id
75 WHERE il_orgu_ua.user_id IS NOT NULL
76 OR il_orgu_positions.core_position = 1";
77 $database =
$GLOBALS[
'DIC']->database();
78 $st = $database->query($q);
82 while (
$data = $database->fetchAssoc($st)) {
83 $position =
new self();
84 $position->buildFromArray(
$data);
85 $positions[] = $position;
99 $q =
"SELECT DISTINCT il_orgu_positions.id, il_orgu_positions.*
100 FROM il_orgu_positions
101 LEFT JOIN il_orgu_ua ON il_orgu_positions.id = il_orgu_ua.position_id AND il_orgu_ua.orgu_id = %s
102 WHERE il_orgu_ua.user_id IS NOT NULL
103 OR core_position = 1";
104 $database =
$GLOBALS[
'DIC']->database();
105 $st = $database->queryF($q, array(
'integer'), array($orgu_ref_id));
107 $positions = array();
109 while (
$data = $database->fetchAssoc($st)) {
110 $position =
new self();
111 $position->buildFromArray(
$data);
112 $positions[] = $position;
183 foreach ($this->authorities as $authority) {
184 $return[] = $authority->__toArray();
212 $authority->delete();
216 foreach ($ilOrgUnitUserAssignmentQueries->getUserAssignmentsOfPosition($this->getId()) as $assignment) {
217 $assignment->delete();
298 $authority->setPositionId($this->
getId());
299 if ($authority->getId()) {
300 $authority->update();
302 $authority->create();
304 $ids[] = $authority->getId();
306 if (
count($ids) > 0) {
310 'position_id' => $this->
getId(),
311 ), array(
'id' =>
'NOT IN',
'position_id' =>
'='))->
get() as $authority
313 $authority->delete();
317 if (
count($ids) === 0) {
320 'position_id' => $this->
getId(),
321 ))->
get() as $authority
323 $authority->delete();
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
static where($where, $operator=null)
static flush($class_name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setDescription(string $description)
getDependentAuthorities()
static getCorePositionId(int $core_identifier)
setCorePosition(bool $core_position)
const CORE_POSITION_EMPLOYEE
deleteWithAllDependencies()
This deletes the Position, it's Authorities, dependent Authorities and all User-Assignements!
static getCorePosition(int $core_identifier)
const CORE_POSITION_SUPERIOR
setCoreIdentifier(int $core_identifier)
static returnDbTableName()
static getActiveForPosition(int $orgu_ref_id)
setAuthorities(array $authorities)
get(string $key, Refinery\Transformation $t)
Get passed parameter, if not data passed, get key from http request.