Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #3

Merged
merged 3 commits into from
Jan 14, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion classes/UDFCheck/class.ilUDFCheck.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
require_once('./Customizing/global/plugins/Libraries/ActiveRecord/class.ActiveRecord.php');
if (is_file('./Services/ActiveRecord/class.ActiveRecord.php')) {
require_once('./Services/ActiveRecord/class.ActiveRecord.php');
} else {
require_once('./Customizing/global/plugins/Libraries/ActiveRecord/class.ActiveRecord.php');
}
require_once('./Services/User/classes/class.ilUserDefinedFields.php');

/**
Expand Down Expand Up @@ -294,6 +298,7 @@ public function sleep($field_name) {
return date(DATE_ISO8601, $this->{$field_name});
break;
}

return NULL;
}

Expand All @@ -311,6 +316,7 @@ public function wakeUp($field_name, $field_value) {
return strtotime($field_value);
break;
}

return NULL;
}

Expand Down
6 changes: 5 additions & 1 deletion classes/UserSetting/class.ilUserSetting.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
require_once('./Customizing/global/plugins/Libraries/ActiveRecord/class.ActiveRecord.php');
if (is_file('./Services/ActiveRecord/class.ActiveRecord.php')) {
require_once('./Services/ActiveRecord/class.ActiveRecord.php');
} else {
require_once('./Customizing/global/plugins/Libraries/ActiveRecord/class.ActiveRecord.php');
}
require_once('./Customizing/global/plugins/Services/EventHandling/EventHook/UserDefaults/classes/UDFCheck/class.ilUDFCheck.php');
require_once('./Modules/Portfolio/classes/class.ilObjPortfolio.php');
require_once('./Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php');
Expand Down
10 changes: 8 additions & 2 deletions classes/UserSetting/class.ilUserSettingsTableGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ protected function parseData() {
$xdglRequestList->limit($this->getOffset(), $this->getOffset() + $this->getLimit());
$xdglRequestList->orderBy('title');
$a_data = $xdglRequestList->getArray();
$img_on = ilUtil::img(ilUtil::getImagePath('icon_led_on_s.png'));
$img_off = ilUtil::img(ilUtil::getImagePath('icon_led_off_s.png'));
if(ilUserDefaultsPlugin::is55()) {
$img_on = ilUtil::img(ilUtil::getImagePath('icon_ok.svg'));
$img_off = ilUtil::img(ilUtil::getImagePath('icon_not_ok.svg'));
}else {
$img_on = ilUtil::img(ilUtil::getImagePath('icon_led_on_s.png'));
$img_off = ilUtil::img(ilUtil::getImagePath('icon_led_off_s.png'));
}

foreach ($a_data as $k => $d) {
$a_data[$k]['status_image'] = ($d['status'] == ilUserSetting::STATUS_ACTIVE ? $img_on : $img_off);
}
Expand Down
44 changes: 19 additions & 25 deletions classes/class.ilUserDefaultsPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,17 @@ public static function getInstance() {
* @param array array of event specific parameters
*/
public function handleEvent($a_component, $a_event, $a_parameter) {
if ($a_component == 'Modules/Course' AND $a_event == 'update') {


// $ilUser = new ilObjUser();
// $ilUser->setEmail('info@fschmid.ch');
// $ilUser->setPasswd('homer');
// $ilUser->setActive(1);
// $ilUser->setTimeLimitUnlimited(true);
// $ilUser->setFirstname('Fabian');
// $ilUser->setLastname('Schmid');
// $a_str = 'fschmid' . rand(100, 99999);
// $ilUser->create();
// $ilUser->setLogin($a_str);
// $ilUser->saveAsNew(false);
// ilUtil::sendInfo($a_str, true);
// /**
// * @var $ilUserSetting ilUserSetting
// */
// global $ilUser;
// foreach (ilUserSetting::where(array( 'status' => ilUserSetting::STATUS_ACTIVE ))->get() as $ilUserSetting) {
// $ilUserSetting->doAssignements($ilUser);
// }
}

if ($a_component == 'Services/User' AND $a_event == 'saveAsNew') {
// if ($a_component == 'Modules/Course' AND $a_event == 'update') {
// global $ilUser;
// /**
// * @var $ilUserSetting ilUserSetting
// */
// foreach (ilUserSetting::where(array( 'status' => ilUserSetting::STATUS_ACTIVE ))->get() as $ilUserSetting) {
//// $ilUserSetting->doAssignements($ilUser);
// }
// }

if ($a_component == 'Services/User' AND ($a_event == 'saveAsNew' OR $a_event == 'afterCreate')) {
/**
* @var $ilUser ilObjUser
*/
Expand Down Expand Up @@ -91,6 +77,14 @@ public function getPluginName() {
}


/**
* @return bool
*/
public static function is55() {
return ((int)str_ireplace('.', '', ILIAS_VERSION_NUMERIC)) >= 500;
}


public function updateLanguageFiles() {
ini_set('auto_detect_line_endings', true);
$path = substr(__FILE__, 0, strpos(__FILE__, 'classes')) . 'lang/';
Expand Down
4 changes: 2 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
$id = 'usrdef';
$version = '1.0.4';
$version = '1.0.5';
$ilias_min_version = '4.4';
$ilias_max_version = '4.4.99';
$ilias_max_version = '5.0.999';
$responsible = 'Fabian Schmid';
$responsible_mail = 'fs@studer-raimann.ch';
?>