{"action":"created","comment":{"url":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/comments/204287616","pull_request_review_id":139338691,"id":204287616,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDI4NzYxNg==","diff_hunk":"@@ -55,33 +55,80 @@ public function definition() {\n \n         $this->standard_intro_elements(get_string('description', 'customcert'));\n \n-        $mform->addElement('header', 'options', get_string('options', 'customcert'));\n+        $optionsheader = $mform->createElement('header', 'options', get_string('options', 'customcert'));\n \n-        $mform->addElement('selectyesno', 'emailstudents', get_string('emailstudents', 'customcert'));\n-        $mform->setType('emailstudents', 0);\n-        $mform->addHelpButton('emailstudents', 'emailstudents', 'customcert');\n+        if (has_capability('mod/customcert:manageemailstudents', $this->get_context())) {\n+            $mform->addElement('selectyesno', 'emailstudents', get_string('emailstudents', 'customcert'));\n+            $mform->setDefault('emailstudents', get_config('customcert', 'emailstudents'));\n+            $mform->addHelpButton('emailstudents', 'emailstudents', 'customcert');\n+            $firstoption = 'emailstudents';\n+        } else {\n+            $mform->addElement('hidden', 'emailstudents', get_config('customcert', 'emailstudents'));","path":"mod_form.php","position":16,"original_position":16,"commit_id":"91676a78aca81f52f9a1a8ab16c3aa2ab92cc15a","original_commit_id":"91676a78aca81f52f9a1a8ab16c3aa2ab92cc15a","user":{"login":"abias","id":1092118,"node_id":"MDQ6VXNlcjEwOTIxMTg=","avatar_url":"https://avatars1.githubusercontent.com/u/1092118?v=4","gravatar_id":"","url":"https://api.github.com/users/abias","html_url":"https://github.com/abias","followers_url":"https://api.github.com/users/abias/followers","following_url":"https://api.github.com/users/abias/following{/other_user}","gists_url":"https://api.github.com/users/abias/gists{/gist_id}","starred_url":"https://api.github.com/users/abias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abias/subscriptions","organizations_url":"https://api.github.com/users/abias/orgs","repos_url":"https://api.github.com/users/abias/repos","events_url":"https://api.github.com/users/abias/events{/privacy}","received_events_url":"https://api.github.com/users/abias/received_events","type":"User","site_admin":false},"body":"Thanks for confirming my thoughts :)\r\nTo make it really bullet-proof, you could also check the capabilities again within data_postprocessing()","created_at":"2018-07-23T05:51:37Z","updated_at":"2018-07-23T05:51:38Z","html_url":"https://github.com/markn86/moodle-mod_customcert/pull/217#discussion_r204287616","pull_request_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/217","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/comments/204287616"},"html":{"href":"https://github.com/markn86/moodle-mod_customcert/pull/217#discussion_r204287616"},"pull_request":{"href":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/217"}},"in_reply_to_id":204042927},"pull_request":{"url":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/217","id":202450381,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyNDUwMzgx","html_url":"https://github.com/markn86/moodle-mod_customcert/pull/217","diff_url":"https://github.com/markn86/moodle-mod_customcert/pull/217.diff","patch_url":"https://github.com/markn86/moodle-mod_customcert/pull/217.patch","issue_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/issues/217","number":217,"state":"open","locked":false,"title":"Add possibility to selectively disable activity instance settings","user":{"login":"dmitriim","id":4626431,"node_id":"MDQ6VXNlcjQ2MjY0MzE=","avatar_url":"https://avatars2.githubusercontent.com/u/4626431?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitriim","html_url":"https://github.com/dmitriim","followers_url":"https://api.github.com/users/dmitriim/followers","following_url":"https://api.github.com/users/dmitriim/following{/other_user}","gists_url":"https://api.github.com/users/dmitriim/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriim/subscriptions","organizations_url":"https://api.github.com/users/dmitriim/orgs","repos_url":"https://api.github.com/users/dmitriim/repos","events_url":"https://api.github.com/users/dmitriim/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriim/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-19T05:42:28Z","updated_at":"2018-07-23T05:51:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbf98cc06659c3b743b290d4705a48a7b9f8ed5a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/217/commits","review_comments_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/217/comments","review_comment_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/comments{/number}","comments_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/issues/217/comments","statuses_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/statuses/91676a78aca81f52f9a1a8ab16c3aa2ab92cc15a","head":{"label":"dmitriim:MOODLE_35_STABLE-179","ref":"MOODLE_35_STABLE-179","sha":"91676a78aca81f52f9a1a8ab16c3aa2ab92cc15a","user":{"login":"dmitriim","id":4626431,"node_id":"MDQ6VXNlcjQ2MjY0MzE=","avatar_url":"https://avatars2.githubusercontent.com/u/4626431?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitriim","html_url":"https://github.com/dmitriim","followers_url":"https://api.github.com/users/dmitriim/followers","following_url":"https://api.github.com/users/dmitriim/following{/other_user}","gists_url":"https://api.github.com/users/dmitriim/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriim/subscriptions","organizations_url":"https://api.github.com/users/dmitriim/orgs","repos_url":"https://api.github.com/users/dmitriim/repos","events_url":"https://api.github.com/users/dmitriim/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriim/received_events","type":"User","site_admin":false},"repo":{"id":141214819,"node_id":"MDEwOlJlcG9zaXRvcnkxNDEyMTQ4MTk=","name":"moodle-mod_customcert","full_name":"dmitriim/moodle-mod_customcert","owner":{"login":"dmitriim","id":4626431,"node_id":"MDQ6VXNlcjQ2MjY0MzE=","avatar_url":"https://avatars2.githubusercontent.com/u/4626431?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitriim","html_url":"https://github.com/dmitriim","followers_url":"https://api.github.com/users/dmitriim/followers","following_url":"https://api.github.com/users/dmitriim/following{/other_user}","gists_url":"https://api.github.com/users/dmitriim/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriim/subscriptions","organizations_url":"https://api.github.com/users/dmitriim/orgs","repos_url":"https://api.github.com/users/dmitriim/repos","events_url":"https://api.github.com/users/dmitriim/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmitriim/moodle-mod_customcert","description":"Enables the creation of dynamically generated certificates with complete customisation via the web browser.","fork":true,"url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert","forks_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/forks","keys_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/teams","hooks_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/hooks","issue_events_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/issues/events{/number}","events_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/events","assignees_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/assignees{/user}","branches_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/branches{/branch}","tags_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/tags","blobs_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/statuses/{sha}","languages_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/languages","stargazers_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/stargazers","contributors_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/contributors","subscribers_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/subscribers","subscription_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/subscription","commits_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/contents/{+path}","compare_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/merges","archive_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/downloads","issues_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/issues{/number}","pulls_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/pulls{/number}","milestones_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/milestones{/number}","notifications_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/labels{/name}","releases_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/releases{/id}","deployments_url":"https://api.github.com/repos/dmitriim/moodle-mod_customcert/deployments","created_at":"2018-07-17T01:35:02Z","updated_at":"2018-07-17T01:35:05Z","pushed_at":"2018-07-20T13:03:06Z","git_url":"git://github.com/dmitriim/moodle-mod_customcert.git","ssh_url":"git@github.com:dmitriim/moodle-mod_customcert.git","clone_url":"https://github.com/dmitriim/moodle-mod_customcert.git","svn_url":"https://github.com/dmitriim/moodle-mod_customcert","homepage":"https://moodle.org/plugins/mod_customcert","size":925,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"MOODLE_35_STABLE"}},"base":{"label":"markn86:MOODLE_35_STABLE","ref":"MOODLE_35_STABLE","sha":"13c1998c494788dab253aadb100b44d4b5d2d87b","user":{"login":"markn86","id":783213,"node_id":"MDQ6VXNlcjc4MzIxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/783213?v=4","gravatar_id":"","url":"https://api.github.com/users/markn86","html_url":"https://github.com/markn86","followers_url":"https://api.github.com/users/markn86/followers","following_url":"https://api.github.com/users/markn86/following{/other_user}","gists_url":"https://api.github.com/users/markn86/gists{/gist_id}","starred_url":"https://api.github.com/users/markn86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markn86/subscriptions","organizations_url":"https://api.github.com/users/markn86/orgs","repos_url":"https://api.github.com/users/markn86/repos","events_url":"https://api.github.com/users/markn86/events{/privacy}","received_events_url":"https://api.github.com/users/markn86/received_events","type":"User","site_admin":false},"repo":{"id":6436976,"node_id":"MDEwOlJlcG9zaXRvcnk2NDM2OTc2","name":"moodle-mod_customcert","full_name":"markn86/moodle-mod_customcert","owner":{"login":"markn86","id":783213,"node_id":"MDQ6VXNlcjc4MzIxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/783213?v=4","gravatar_id":"","url":"https://api.github.com/users/markn86","html_url":"https://github.com/markn86","followers_url":"https://api.github.com/users/markn86/followers","following_url":"https://api.github.com/users/markn86/following{/other_user}","gists_url":"https://api.github.com/users/markn86/gists{/gist_id}","starred_url":"https://api.github.com/users/markn86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markn86/subscriptions","organizations_url":"https://api.github.com/users/markn86/orgs","repos_url":"https://api.github.com/users/markn86/repos","events_url":"https://api.github.com/users/markn86/events{/privacy}","received_events_url":"https://api.github.com/users/markn86/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/markn86/moodle-mod_customcert","description":"Enables the creation of dynamically generated certificates with complete customisation via the web browser.","fork":false,"url":"https://api.github.com/repos/markn86/moodle-mod_customcert","forks_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/forks","keys_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/teams","hooks_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/hooks","issue_events_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/issues/events{/number}","events_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/events","assignees_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/assignees{/user}","branches_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/branches{/branch}","tags_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/tags","blobs_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/git/refs{/sha}","trees_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/statuses/{sha}","languages_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/languages","stargazers_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/stargazers","contributors_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/contributors","subscribers_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/subscribers","subscription_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/subscription","commits_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/commits{/sha}","git_commits_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/git/commits{/sha}","comments_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/comments{/number}","issue_comment_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/issues/comments{/number}","contents_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/contents/{+path}","compare_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/merges","archive_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/downloads","issues_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/issues{/number}","pulls_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls{/number}","milestones_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/milestones{/number}","notifications_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/labels{/name}","releases_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/releases{/id}","deployments_url":"https://api.github.com/repos/markn86/moodle-mod_customcert/deployments","created_at":"2012-10-29T07:42:12Z","updated_at":"2018-07-13T14:44:56Z","pushed_at":"2018-07-20T13:03:07Z","git_url":"git://github.com/markn86/moodle-mod_customcert.git","ssh_url":"git@github.com:markn86/moodle-mod_customcert.git","clone_url":"https://github.com/markn86/moodle-mod_customcert.git","svn_url":"https://github.com/markn86/moodle-mod_customcert","homepage":"https://moodle.org/plugins/mod_customcert","size":939,"stargazers_count":23,"watchers_count":23,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"archived":false,"open_issues_count":49,"license":null,"forks":34,"open_issues":49,"watchers":23,"default_branch":"MOODLE_35_STABLE"}},"_links":{"self":{"href":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/217"},"html":{"href":"https://github.com/markn86/moodle-mod_customcert/pull/217"},"issue":{"href":"https://api.github.com/repos/markn86/moodle-mod_customcert/issues/217"},"comments":{"href":"https://api.github.com/repos/markn86/moodle-mod_customcert/issues/217/comments"},"review_comments":{"href":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/217/comments"},"review_comment":{"href":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/markn86/moodle-mod_customcert/pulls/217/commits"},"statuses":{"href":"https://api.github.com/repos/markn86/moodle-mod_customcert/statuses/91676a78aca81f52f9a1a8ab16c3aa2ab92cc15a"}},"author_association":"NONE"}}
{"actor":{"display_login":"abias"}}