Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Develop

Closes DHBWB-104

See merge request ILIAS/Plugins/UserDefaults!36
  • Loading branch information
Theodor Truffer committed May 23, 2019
2 parents b434a6a + f3a7f62 commit c407341
Show file tree
Hide file tree
Showing 19 changed files with 203 additions and 70 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog

## [1.4.0]
- ILIAS 5.4 support
- Remove ILIAS 5.2 support

## [1.3.19]
- Fix working on ILIAS 5.2
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,9 @@ As ILIAS administrator go to "Administration->Plugins" and install/activate the
### Some screenshots
TODO

### Dependencies
* ILIAS 5.2 or ILIAS 5.3
### Requirements
* ILIAS 5.3 or ILIAS 5.4
* PHP >=5.6
* [composer](https://getcomposer.org)
* [srag/activerecordconfig](https://packagist.org/packages/srag/activerecordconfig)
* [srag/dic](https://packagist.org/packages/srag/dic)
* [srag/librariesnamespacechanger](https://packagist.org/packages/srag/librariesnamespacechanger)
* [srag/removeplugindataconfirm](https://packagist.org/packages/srag/removeplugindataconfirm)

Please use it for further development!

### Adjustment suggestions
* Adjustment suggestions by pull requests
Expand Down
22 changes: 22 additions & 0 deletions classes/UserSetting/class.UserSettingsGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class UserSettingsGUI {
use UserDefaultsTrait;
const PLUGIN_CLASS_NAME = ilUserDefaultsPlugin::class;
const CMD_INDEX = 'configure';
const CMD_SEARCH_LOCAL_ROLES = 'searchLocalRoles';
const CMD_SEARCH_COURSES = 'searchCourses';
const CMD_SEARCH_CATEGORIES = 'searchCategories';
const CMD_CANCEL = 'cancel';
Expand Down Expand Up @@ -66,6 +67,7 @@ public function executeCommand() {
case self::CMD_INDEX:
$this->index();
break;
case self::CMD_SEARCH_LOCAL_ROLES:
case self::CMD_SEARCH_COURSES:
case self::CMD_SEARCH_CATEGORIES:
case self::CMD_CANCEL:
Expand Down Expand Up @@ -253,6 +255,26 @@ protected function searchCourses() {
self::output()->outputJSON($courses);
}

/**
*
*/
protected function searchLocalRoles() {
$local_roles = self::dic()->rbacreview()->getRolesByFilter(ilRbacReview::FILTER_NOT_INTERNAL);

$return_local_roles = array();
foreach($local_roles as $local_role) {

if(ilObject2::_lookupDeletedDate($local_role['parent'])) {
continue;
}

$return_local_roles[] = [ "id" => $local_role["obj_id"], "text" => self::dic()->objDataCache()->lookupTitle(self::dic()->objDataCache()->lookupObjId($local_role['parent']))." >> ".$local_role["title"] ];
}


self::output()->outputJSON($return_local_roles);
}


/**
*
Expand Down
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lang/ilias_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ form_button_cancel#:#Abbrechen
set_title#:#Titel
set_description#:#Beschreibung
set_global_role#:#Globale Rolle
set_assigned_local_roles#:#Einschreiben in Lokale Rollen
set_assigned_courses#:#Einschreiben in Kurse
set_assigned_groupes#:#Einschreiben in Gruppen
set_portfolio_template_id#:#Portfolio-Vorlage
Expand Down Expand Up @@ -59,6 +60,7 @@ check_negation_gobal#:#Negation
check_op_equals#:#Ist gleich
check_udf_operator#:#Vergleich
check_op_starts_with#:#Beginnt mit
role_placeholder#:#Rolle wählen
crs_placeholder#:#Kurse wählen
grp_placeholder#:#Gruppen wählen
orgu_placeholder#:#Organisationseinheit
Expand Down
2 changes: 2 additions & 0 deletions lang/ilias_en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ form_button_cancel#:#Cancel
set_title#:#Title
set_description#:#Description
set_global_role#:#Global Role
set_assigned_local_roles#:#Assign to Local Roles
set_assigned_courses#:#Assign to Courses
set_assigned_groupes#:#Assign to Groups
set_portfolio_template_id#:#Portfolio-Template
Expand Down Expand Up @@ -59,6 +60,7 @@ check_negation_gobal#:#Negation
check_op_equals#:#Is equals
check_udf_operator#:#Operator
check_op_starts_with#:#Starts with
role_placeholder#:#Choose Role
crs_placeholder#:#Choose Courses
grp_placeholder#:#Choose Groups
orgu_placeholder#:#Organisational unit
Expand Down
6 changes: 3 additions & 3 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require_once __DIR__ . "/vendor/srag/dic/src/PHPVersionChecker.php";

$id = 'usrdef';
$version = '1.3.19';
$ilias_min_version = '5.2';
$ilias_max_version = '5.3.999';
$version = '1.4.0';
$ilias_min_version = '5.3.0';
$ilias_max_version = '5.4.999';
$responsible = 'studer + raimann ag - Team Custom 1';
$responsible_mail = 'support-custom1@studer-raimann.ch';
4 changes: 4 additions & 0 deletions sql/dbupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,7 @@
<?php
\srag\Plugins\UserDefaults\UserSetting\UserSetting::updateDB();
?>
<#20>
<?php
\srag\Plugins\UserDefaults\UserSetting\UserSetting::updateDB();
?>
46 changes: 46 additions & 0 deletions src/Access/LocalRoles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace srag\Plugins\UserDefaults\Access;

use ilUserDefaultsPlugin;
use srag\DIC\UserDefaults\DICTrait;
use srag\Plugins\UserDefaults\Utils\UserDefaultsTrait;

/**
* Class LocalRoles
*
* @package srag\Plugins\UserDefaults\Access
*
* @author studer + raimann ag - Team Custom 1 <support-custom1@studer-raimann.ch>
*/
final class LocalRoles {

use DICTrait;
use UserDefaultsTrait;
const PLUGIN_CLASS_NAME = ilUserDefaultsPlugin::class;
const TYPE_LOCAL_ROLE = "role";
/**
* @var self
*/
protected static $instance = NULL;


/**
* @return self
*/
public static function getInstance()/*: self*/ {
if (self::$instance === NULL) {
self::$instance = new self();
}

return self::$instance;
}


/**
* LocalRole constructor
*/
private function __construct() {

}
}
Loading

0 comments on commit c407341

Please sign in to comment.