Skip to content

Commit

Permalink
MDL-19488 - allow the creation of a "Public" feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
grabs committed Oct 13, 2011
1 parent 485ec59 commit e70dab0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mod/feedback/edit.php
Expand Up @@ -99,7 +99,7 @@
$savereturn = 'notsaved_name'; $savereturn = 'notsaved_name';
}else { }else {
//if the feedback is located on the frontpage then templates can be public //if the feedback is located on the frontpage then templates can be public
if($CFG->frontpage === $course->id && has_capability('mod/feedback:createpublictemplate', $context)) { if(SITEID === $course->id && has_capability('mod/feedback:createpublictemplate', $context)) {
$create_template_formdata->ispublic = isset($create_template_formdata->ispublic) ? 1 : 0; $create_template_formdata->ispublic = isset($create_template_formdata->ispublic) ? 1 : 0;
}else { }else {
$create_template_formdata->ispublic = 0; $create_template_formdata->ispublic = 0;
Expand Down
2 changes: 1 addition & 1 deletion mod/feedback/edit_form.php
Expand Up @@ -145,7 +145,7 @@ function set_form_elements(){
$elementgroup[] =& $mform->createElement('text', 'templatename', get_string('name', 'feedback'), array('size'=>'40', 'maxlength'=>'200')); $elementgroup[] =& $mform->createElement('text', 'templatename', get_string('name', 'feedback'), array('size'=>'40', 'maxlength'=>'200'));


//If the feedback is located on the frontpage the we can create public templates //If the feedback is located on the frontpage the we can create public templates
if($CFG->frontpage === $this->feedbackdata->course->id) { if(SITEID === $this->feedbackdata->course->id) {
if(has_capability('mod/feedback:createpublictemplate', $this->feedbackdata->context)) { if(has_capability('mod/feedback:createpublictemplate', $this->feedbackdata->context)) {
$elementgroup[] =& $mform->createElement('checkbox', 'ispublic', get_string('public', 'feedback'), get_string('public', 'feedback')); $elementgroup[] =& $mform->createElement('checkbox', 'ispublic', get_string('public', 'feedback'), get_string('public', 'feedback'));
} }
Expand Down
2 changes: 1 addition & 1 deletion mod/feedback/lib.php
Expand Up @@ -1228,7 +1228,7 @@ function feedback_get_template_list($course, $onlyownorpublic = '') {
$templates = $DB->get_records('feedback_template', array('course'=>$course->id), 'name'); $templates = $DB->get_records('feedback_template', array('course'=>$course->id), 'name');
break; break;
case 'public': case 'public':
$templates = $DB->get_records('feedback_template', array('course'=>$CFG->frontpage, 'ispublic'=>1), 'name'); $templates = $DB->get_records('feedback_template', array('course'=>SITEID, 'ispublic'=>1), 'name');
break; break;
} }
return $templates; return $templates;
Expand Down

0 comments on commit e70dab0

Please sign in to comment.