@@ -66,6 +66,13 @@ public function definition() {
66
66
$ mform ->addElement ('select ' , 'deliveryoption ' , get_string ('deliveryoptions ' , 'customcert ' ), $ deliveryoptions );
67
67
$ mform ->setDefault ('deliveryoption ' , certificate::DELIVERY_OPTION_INLINE );
68
68
69
+ if (has_capability ('mod/customcert:managekeeplocalcopy ' , $ this ->get_context ())) {
70
+ $ mform ->addElement ('selectyesno ' , 'keeplocalcopy ' , get_string ('keeplocalcopy ' , 'customcert ' ));
71
+ $ mform ->setDefault ('keeplocalcopy ' , get_config ('customcert ' , 'keeplocalcopy ' ));
72
+ $ mform ->addHelpButton ('keeplocalcopy ' , 'keeplocalcopy ' , 'customcert ' );
73
+ $ mform ->setType ('keeplocalcopy ' , PARAM_INT );
74
+ }
75
+
69
76
if (has_capability ('mod/customcert:manageemailstudents ' , $ this ->get_context ())) {
70
77
$ mform ->addElement ('selectyesno ' , 'emailstudents ' , get_string ('emailstudents ' , 'customcert ' ));
71
78
$ mform ->setDefault ('emailstudents ' , get_config ('customcert ' , 'emailstudents ' ));
@@ -207,6 +214,7 @@ public function validation($data, $files) {
207
214
*/
208
215
protected function get_options_elements_with_required_caps () {
209
216
return [
217
+ 'keeplocalcopy ' => 'mod/customcert:managekeeplocalcopy ' ,
210
218
'emailstudents ' => 'mod/customcert:manageemailstudents ' ,
211
219
'emailteachers ' => 'mod/customcert:manageemailteachers ' ,
212
220
'emailothers ' => 'mod/customcert:manageemailothers ' ,
0 commit comments