{"action":"created","comment":{"url":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/comments/70619307","id":70619307,"diff_hunk":"@@ -0,0 +1,150 @@\n+<?php<?php\n+/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */\n+\n+\n+/**\n+* Class\t\tilMarkCoursesWBDRelevantJob\n+*\n+* CronJob:\tMArks courses as wbd relevant if the end date is >= th date entered in udf field \"WBD Punkte nachmelden ab\"\n+*\n+* @author Stefan Hecken <stefan.hecken@concepts-and-training.de>\n+* @version $Id$\n+*/\n+\n+require_once(\"Services/Cron/classes/class.ilCronManager.php\");\n+require_once(\"Services/Cron/classes/class.ilCronJob.php\");\n+require_once(\"Services/Cron/classes/class.ilCronJobResult.php\");\n+require_once(\"Services/GEV/Utils/classes/class.gevSettings.php\");\n+require_once(\"Services/GEV/WBD/classes/class.gevWBD.php\");\n+\n+class ilMarkCoursesWBDRelevantJob extends ilCronJob {\n+\tconst CREATOR_ID = \"-333\";\n+\n+\tprivate $gIldb;\n+\tprivate $gLog;\n+\tprivate $gLng;\n+\tprivate $gRbacadmin;\n+\n+\tpublic function __construct() {\n+\t\tglobal $ilDB, $ilLog, $lng, $rbacadmin;\n+\n+\t\t$this->gDB = $ilDB;\n+\t\t$this->gLog = $ilLog;\n+\t\t$this->gLng = $lng;\n+\t\t$this->gRbacadmin = $rbacadmin;\n+\t\t$this->settings = gevSettings::getInstance();\n+\t}\n+\n+\t/**\n+\t * Implementation of abstract function from ilCronJob\n+\t * @return\tstring\n+\t */\n+\tpublic function getId() {\n+\t\treturn \"gev_mark_courses_wbd_relevant\";\n+\t}\n+\t\n+\t/**\n+\t * Implementation of abstract function from ilCronJob\n+\t * @return\tstring\n+\t */\n+\tpublic function getTitle() {\n+\t\treturn \"Setzt Trainings auf WBD relevant.\";\n+\t}\n+\n+\tpublic function getDescription() {\n+\t\treturn \"Wenn beim Benutzer das UDF Feld 'WBD Punkte nachmelden ab' einen Wert besitzt, werden alle Trainings deren Enddatum >= ist auf WBD relevant gestzt\";\n+\t}\n+\n+\t/**\n+\t * Implementation of abstract function from ilCronJob\n+\t * @return\tbool\n+\t */\n+\tpublic function hasAutoActivation() {\n+\t\treturn true;\n+\t}\n+\t\n+\t/**\n+\t * Implementation of abstract function from ilCronJob\n+\t * @return\tbool\n+\t */\n+\tpublic function hasFlexibleSchedule() {\n+\t\treturn false;\n+\t}\n+\t\n+\t/**\n+\t * Implementation of abstract function from ilCronJob\n+\t * @return\tint\n+\t */\n+\tpublic function getDefaultScheduleType() {\n+\t\treturn ilCronJob::SCHEDULE_TYPE_DAILY;\n+\t}\n+\t\n+\t/**\n+\t * Implementation of abstract function from ilCronJob\n+\t * @return\tint\n+\t */\n+\tpublic function getDefaultScheduleValue() {\n+\t\treturn 1;\n+\t}\n+\n+\t/**\n+\t * Implementation of abstract function from ilCronJob\n+\t * @return\tilCronJobResult\n+\t */\n+\tpublic function run() {\n+\t\t$cron_result = new ilCronJobResult();\n+\t\t$this->gLog->write(\"### ilMarkCoursesWBDRelevantJob: STARTING ###\");\n+\t\t$user_vals = $this->getUserWithEnteredDate();\n+\n+\t\tif(count($user_vals) == 0) {\n+\t\t\t$this->gLog->write(\"### ilMarkCoursesWBDRelevantJob: no user found ###\");\n+\t\t}\n+\n+\t\tforeach ($user_vals as $user_val) {\n+\t\t\tilCronManager::ping($this->getId());\n+\t\t\t$this->gLog->write(\"### ilMarkCoursesWBDRelevantJob: set for: $user_val ###\");\n+\t\t\t$this->updateTrainings($user_val);\n+\t\t\tilCronManager::ping($this->getId());\n+\t\t}\n+\n+\t\t$this->gLog->write(\"### ilMarkCoursesWBDRelevantJob: FINISHED ###\");\n+\n+\t\t$cron_result->setStatus(ilCronJobResult::STATUS_OK);\n+\t\treturn $cron_result;\n+\t}\n+\n+\t/**\n+\t * Get all user_ids where udf field has been a value\n+\t * @return [int] $ret\n+\t */\n+\tprivate function getUserWithEnteredDate() {\n+\t\t$ret = array();\n+\t\t$field_id = $this->settings->getUDFFieldId(gevWBD::USR_WBD_REPORT_POINTS_FROM);\n+\n+\t\t$select = \"SELECT ud.usr_id, udt.value\\n\"\n+\t\t\t\t.\" FROM usr_data ud\\n\"\n+\t\t\t\t.\" JOIN udf_text udt ON udt.usr_id = ud.usr_id\\n\"\n+\t\t\t\t.\" WHERE udt.value IS NOT NULL\\n\"\n+\t\t\t\t.\"    AND udt.field_id = \".$this->gDB->quote($field_id, \"integer\");\n+\n+\t\t$res = $this->gDB->query($select);\n+\t\twhile($rec = $this->gDB->fetchAssoc($res)) {\n+\t\t\t$ret[] = array(\"user_id\" => $rec[\"usr_id\"]\n+\t\t\t\t\t\t, \"value\" => $rec[\"value\"]);\n+\t\t\tilCronManager::ping($this->getId());\n+\t\t}\n+\t\treturn $ret;\n+\t}\n+\n+\t/**\n+\t * @param int $user_id\n+\t */\n+\tprivate function updateTrainings($user_val) {\n+\t\t$wbd = gevWBD::getInstance($user_val[\"user_id\"]);\n+\n+\t\tif($user_val[\"value\"]) {","path":"Customizing/global/plugins/Services/Cron/CronHook/MarkCoursesWBDRelevant/classes/class.ilMarkCoursesWBDRelevantJob.php","position":145,"original_position":145,"commit_id":"787c2a184eb9d5d46b735f4607117092dc65acfd","original_commit_id":"787c2a184eb9d5d46b735f4607117092dc65acfd","user":{"login":"klees","id":10611082,"avatar_url":"https://avatars.githubusercontent.com/u/10611082?v=3","gravatar_id":"","url":"https://api.github.com/users/klees","html_url":"https://github.com/klees","followers_url":"https://api.github.com/users/klees/followers","following_url":"https://api.github.com/users/klees/following{/other_user}","gists_url":"https://api.github.com/users/klees/gists{/gist_id}","starred_url":"https://api.github.com/users/klees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klees/subscriptions","organizations_url":"https://api.github.com/users/klees/orgs","repos_url":"https://api.github.com/users/klees/repos","events_url":"https://api.github.com/users/klees/events{/privacy}","received_events_url":"https://api.github.com/users/klees/received_events","type":"User","site_admin":false},"body":"Diesen Wert gibt es hier immer, oder?","created_at":"2016-07-13T12:57:35Z","updated_at":"2016-07-13T12:57:35Z","html_url":"https://github.com/conceptsandtraining/ILIAS/pull/478#discussion_r70619307","pull_request_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/478","_links":{"self":{"href":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/comments/70619307"},"html":{"href":"https://github.com/conceptsandtraining/ILIAS/pull/478#discussion_r70619307"},"pull_request":{"href":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/478"}}},"pull_request":{"url":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/478","id":75784111,"html_url":"https://github.com/conceptsandtraining/ILIAS/pull/478","diff_url":"https://github.com/conceptsandtraining/ILIAS/pull/478.diff","patch_url":"https://github.com/conceptsandtraining/ILIAS/pull/478.patch","issue_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/issues/478","number":478,"state":"open","locked":false,"title":"gev2: 2354 mark passed trainings as wbd relevant if date is entered i…","user":{"login":"shecken","id":12557020,"avatar_url":"https://avatars.githubusercontent.com/u/12557020?v=3","gravatar_id":"","url":"https://api.github.com/users/shecken","html_url":"https://github.com/shecken","followers_url":"https://api.github.com/users/shecken/followers","following_url":"https://api.github.com/users/shecken/following{/other_user}","gists_url":"https://api.github.com/users/shecken/gists{/gist_id}","starred_url":"https://api.github.com/users/shecken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shecken/subscriptions","organizations_url":"https://api.github.com/users/shecken/orgs","repos_url":"https://api.github.com/users/shecken/repos","events_url":"https://api.github.com/users/shecken/events{/privacy}","received_events_url":"https://api.github.com/users/shecken/received_events","type":"User","site_admin":false},"body":"…n user preferences","created_at":"2016-06-30T09:07:42Z","updated_at":"2016-07-13T12:57:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec4edd3f50dcf5742be902528795f36469f3a85a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/478/commits","review_comments_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/478/comments","review_comment_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/issues/478/comments","statuses_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/statuses/787c2a184eb9d5d46b735f4607117092dc65acfd","head":{"label":"shecken:4_4_generali_2354","ref":"4_4_generali_2354","sha":"787c2a184eb9d5d46b735f4607117092dc65acfd","user":{"login":"shecken","id":12557020,"avatar_url":"https://avatars.githubusercontent.com/u/12557020?v=3","gravatar_id":"","url":"https://api.github.com/users/shecken","html_url":"https://github.com/shecken","followers_url":"https://api.github.com/users/shecken/followers","following_url":"https://api.github.com/users/shecken/following{/other_user}","gists_url":"https://api.github.com/users/shecken/gists{/gist_id}","starred_url":"https://api.github.com/users/shecken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shecken/subscriptions","organizations_url":"https://api.github.com/users/shecken/orgs","repos_url":"https://api.github.com/users/shecken/repos","events_url":"https://api.github.com/users/shecken/events{/privacy}","received_events_url":"https://api.github.com/users/shecken/received_events","type":"User","site_admin":false},"repo":{"id":44175140,"name":"ILIAS","full_name":"shecken/ILIAS","owner":{"login":"shecken","id":12557020,"avatar_url":"https://avatars.githubusercontent.com/u/12557020?v=3","gravatar_id":"","url":"https://api.github.com/users/shecken","html_url":"https://github.com/shecken","followers_url":"https://api.github.com/users/shecken/followers","following_url":"https://api.github.com/users/shecken/following{/other_user}","gists_url":"https://api.github.com/users/shecken/gists{/gist_id}","starred_url":"https://api.github.com/users/shecken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shecken/subscriptions","organizations_url":"https://api.github.com/users/shecken/orgs","repos_url":"https://api.github.com/users/shecken/repos","events_url":"https://api.github.com/users/shecken/events{/privacy}","received_events_url":"https://api.github.com/users/shecken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shecken/ILIAS","description":"","fork":true,"url":"https://api.github.com/repos/shecken/ILIAS","forks_url":"https://api.github.com/repos/shecken/ILIAS/forks","keys_url":"https://api.github.com/repos/shecken/ILIAS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shecken/ILIAS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shecken/ILIAS/teams","hooks_url":"https://api.github.com/repos/shecken/ILIAS/hooks","issue_events_url":"https://api.github.com/repos/shecken/ILIAS/issues/events{/number}","events_url":"https://api.github.com/repos/shecken/ILIAS/events","assignees_url":"https://api.github.com/repos/shecken/ILIAS/assignees{/user}","branches_url":"https://api.github.com/repos/shecken/ILIAS/branches{/branch}","tags_url":"https://api.github.com/repos/shecken/ILIAS/tags","blobs_url":"https://api.github.com/repos/shecken/ILIAS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shecken/ILIAS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shecken/ILIAS/git/refs{/sha}","trees_url":"https://api.github.com/repos/shecken/ILIAS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shecken/ILIAS/statuses/{sha}","languages_url":"https://api.github.com/repos/shecken/ILIAS/languages","stargazers_url":"https://api.github.com/repos/shecken/ILIAS/stargazers","contributors_url":"https://api.github.com/repos/shecken/ILIAS/contributors","subscribers_url":"https://api.github.com/repos/shecken/ILIAS/subscribers","subscription_url":"https://api.github.com/repos/shecken/ILIAS/subscription","commits_url":"https://api.github.com/repos/shecken/ILIAS/commits{/sha}","git_commits_url":"https://api.github.com/repos/shecken/ILIAS/git/commits{/sha}","comments_url":"https://api.github.com/repos/shecken/ILIAS/comments{/number}","issue_comment_url":"https://api.github.com/repos/shecken/ILIAS/issues/comments{/number}","contents_url":"https://api.github.com/repos/shecken/ILIAS/contents/{+path}","compare_url":"https://api.github.com/repos/shecken/ILIAS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shecken/ILIAS/merges","archive_url":"https://api.github.com/repos/shecken/ILIAS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shecken/ILIAS/downloads","issues_url":"https://api.github.com/repos/shecken/ILIAS/issues{/number}","pulls_url":"https://api.github.com/repos/shecken/ILIAS/pulls{/number}","milestones_url":"https://api.github.com/repos/shecken/ILIAS/milestones{/number}","notifications_url":"https://api.github.com/repos/shecken/ILIAS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shecken/ILIAS/labels{/name}","releases_url":"https://api.github.com/repos/shecken/ILIAS/releases{/id}","deployments_url":"https://api.github.com/repos/shecken/ILIAS/deployments","created_at":"2015-10-13T12:36:44Z","updated_at":"2016-05-23T09:35:12Z","pushed_at":"2016-07-13T12:48:36Z","git_url":"git://github.com/shecken/ILIAS.git","ssh_url":"git@github.com:shecken/ILIAS.git","clone_url":"https://github.com/shecken/ILIAS.git","svn_url":"https://github.com/shecken/ILIAS","homepage":"","size":580672,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"release_5-1"}},"base":{"label":"conceptsandtraining:4_4_generali","ref":"4_4_generali","sha":"6bd4ce3b13836c457c4c6e9a5cb0d2c283a0e30b","user":{"login":"conceptsandtraining","id":7535875,"avatar_url":"https://avatars.githubusercontent.com/u/7535875?v=3","gravatar_id":"","url":"https://api.github.com/users/conceptsandtraining","html_url":"https://github.com/conceptsandtraining","followers_url":"https://api.github.com/users/conceptsandtraining/followers","following_url":"https://api.github.com/users/conceptsandtraining/following{/other_user}","gists_url":"https://api.github.com/users/conceptsandtraining/gists{/gist_id}","starred_url":"https://api.github.com/users/conceptsandtraining/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conceptsandtraining/subscriptions","organizations_url":"https://api.github.com/users/conceptsandtraining/orgs","repos_url":"https://api.github.com/users/conceptsandtraining/repos","events_url":"https://api.github.com/users/conceptsandtraining/events{/privacy}","received_events_url":"https://api.github.com/users/conceptsandtraining/received_events","type":"Organization","site_admin":false},"repo":{"id":39509518,"name":"ILIAS","full_name":"conceptsandtraining/ILIAS","owner":{"login":"conceptsandtraining","id":7535875,"avatar_url":"https://avatars.githubusercontent.com/u/7535875?v=3","gravatar_id":"","url":"https://api.github.com/users/conceptsandtraining","html_url":"https://github.com/conceptsandtraining","followers_url":"https://api.github.com/users/conceptsandtraining/followers","following_url":"https://api.github.com/users/conceptsandtraining/following{/other_user}","gists_url":"https://api.github.com/users/conceptsandtraining/gists{/gist_id}","starred_url":"https://api.github.com/users/conceptsandtraining/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conceptsandtraining/subscriptions","organizations_url":"https://api.github.com/users/conceptsandtraining/orgs","repos_url":"https://api.github.com/users/conceptsandtraining/repos","events_url":"https://api.github.com/users/conceptsandtraining/events{/privacy}","received_events_url":"https://api.github.com/users/conceptsandtraining/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/conceptsandtraining/ILIAS","description":"ILIAS - Open Source e-Learning","fork":true,"url":"https://api.github.com/repos/conceptsandtraining/ILIAS","forks_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/forks","keys_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/teams","hooks_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/hooks","issue_events_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/issues/events{/number}","events_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/events","assignees_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/assignees{/user}","branches_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/branches{/branch}","tags_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/tags","blobs_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/git/refs{/sha}","trees_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/statuses/{sha}","languages_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/languages","stargazers_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/stargazers","contributors_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/contributors","subscribers_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/subscribers","subscription_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/subscription","commits_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/commits{/sha}","git_commits_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/git/commits{/sha}","comments_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/comments{/number}","issue_comment_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/issues/comments{/number}","contents_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/contents/{+path}","compare_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/merges","archive_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/downloads","issues_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/issues{/number}","pulls_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls{/number}","milestones_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/milestones{/number}","notifications_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/labels{/name}","releases_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/releases{/id}","deployments_url":"https://api.github.com/repos/conceptsandtraining/ILIAS/deployments","created_at":"2015-07-22T14:04:03Z","updated_at":"2015-07-22T14:04:51Z","pushed_at":"2016-07-13T12:49:00Z","git_url":"git://github.com/conceptsandtraining/ILIAS.git","ssh_url":"git@github.com:conceptsandtraining/ILIAS.git","clone_url":"https://github.com/conceptsandtraining/ILIAS.git","svn_url":"https://github.com/conceptsandtraining/ILIAS","homepage":"http://www.ilias.de","size":585269,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"release_5-0"}},"_links":{"self":{"href":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/478"},"html":{"href":"https://github.com/conceptsandtraining/ILIAS/pull/478"},"issue":{"href":"https://api.github.com/repos/conceptsandtraining/ILIAS/issues/478"},"comments":{"href":"https://api.github.com/repos/conceptsandtraining/ILIAS/issues/478/comments"},"review_comments":{"href":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/478/comments"},"review_comment":{"href":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/conceptsandtraining/ILIAS/pulls/478/commits"},"statuses":{"href":"https://api.github.com/repos/conceptsandtraining/ILIAS/statuses/787c2a184eb9d5d46b735f4607117092dc65acfd"}}}}
{"actor":{"display_login":"klees"}}