Display a button to run aggregation process

This commit is contained in:
David Mudrak 2010-01-04 18:11:02 +00:00
parent f8236f649b
commit e807e9a342
2 changed files with 28 additions and 1 deletions

View File

@ -341,3 +341,13 @@
border: 1px solid #ddd;
}
/**
* Misc
*/
.mod-workshop div.buttonsbar {
text-align: center;
}
.mod-workshop div.buttonwithhelp div {
display: inline;
}

View File

@ -158,7 +158,7 @@ case workshop::PHASE_ASSESSMENT:
case workshop::PHASE_EVALUATION:
$pagingvar = 'page';
$page = optional_param($pagingvar, 0, PARAM_INT);
$perpage = 1000; // todo let the user modify this
$perpage = 10; // todo let the user modify this
$groups = ''; // todo let the user choose the group
$sortby = 'totalgrade'; // todo let the user choose the column to sort by
$sorthow = 'DESC'; // todo detto
@ -168,6 +168,23 @@ case workshop::PHASE_EVALUATION:
$showauthornames = has_capability('mod/workshop:viewauthornames', $PAGE->context);
$showreviewernames = has_capability('mod/workshop:viewreviewernames', $PAGE->context);
if (has_capability('mod/workshop:overridegrades', $PAGE->context)) {
$form = new html_form();
$form->url = $workshop->aggregate_url();
$form->button = new html_button();
$form->button->text = get_string('aggregategrades', 'workshop');
$form->method = 'post';
$helpicon = new moodle_help_icon();
$helpicon->page = 'aggregate';
$helpicon->text = get_string('aggregategrades', 'workshop');
$helpicon->module = 'workshop';
echo $OUTPUT->box_start('buttonsbar');
echo $OUTPUT->box($OUTPUT->button($form) . $OUTPUT->help_icon($helpicon), 'buttonwithhelp');
echo $OUTPUT->box_end();
}
// prepare paging bar
$pagingbar = new moodle_paging_bar();
$pagingbar->totalcount = $data->totalcount;