Skip to content

Commit

Permalink
MDL-10639 - Removed "Export" column - export all available outcomes
Browse files Browse the repository at this point in the history
  • Loading branch information
scyrma committed Feb 26, 2008
1 parent e5f7002 commit 2078287
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 28 deletions.
10 changes: 7 additions & 3 deletions grade/edit/outcome/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

$courseid = optional_param('id', 0, PARAM_INT);
$action = optional_param('action', '', PARAM_ALPHA);
$export = required_param('export', PARAM_INT);

/// Make sure they can even access this course
if ($courseid) {
Expand Down Expand Up @@ -42,9 +41,14 @@
$header = array('outcome_name', 'outcome_shortname', 'outcome_description', 'scale_name', 'scale_items', 'scale_description');
echo format_csv($header, ';', '"');

foreach($export as $outcome_id) {
$outcomes = array();
if ( $courseid ) {
$outcomes = array_merge(grade_outcome::fetch_all_global(), grade_outcome::fetch_all_local($courseid));
} else {
$outcomes = grade_outcome::fetch_all_global();
}

$outcome = grade_outcome::fetch(array('id' => $outcome_id));
foreach($outcomes as $outcome) {

$line = array();

Expand Down
38 changes: 13 additions & 25 deletions grade/edit/outcome/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,10 @@
$strcustomoutcomes = get_string('outcomescustom', 'grades');
$strdelete = get_string('delete');
$stredit = get_string('edit');
$srtcreatenewoutcome = get_string('outcomecreate', 'grades');
$strcreatenewoutcome = get_string('outcomecreate', 'grades');
$stritems = get_string('items', 'grades');
$strcourses = get_string('courses');
$stredit = get_string('edit');
$strexport = get_string('export', 'grades');

switch ($action) {
case 'delete':
Expand Down Expand Up @@ -182,15 +181,12 @@
}
$line[] = $buttons;

$buttons = '<input type="checkbox" name="export[]" value="'. $outcome->id .'">';
$line[] = $buttons;

$data[] = $line;
}
$table = new object();
$table->head = array($strfullname, $strshortname, $strscale, $stritems, $stredit, $strexport);
$table->size = array('30%', '18%', '18%', '18%', '8%', '8%' );
$table->align = array('left', 'left', 'left', 'center', 'center', 'center');
$table->head = array($strfullname, $strshortname, $strscale, $stritems, $stredit);
$table->size = array('30%', '20%', '20%', '20%', '10%' );
$table->align = array('left', 'left', 'left', 'center', 'center');
$table->width = '90%';
$table->data = $data;
$return .= print_table($table, true);
Expand Down Expand Up @@ -242,35 +238,27 @@
}
$line[] = $buttons;

$buttons = '<input type="checkbox" name="export[]" value="'. $outcome->id .'">';
$line[] = $buttons;

$data[] = $line;
}
$table = new object();
$table->head = array($strfullname, $strshortname, $strscale, $strcourses, $stritems, $stredit, $strexport);
$table->size = array('30%', '19%', '19%', '8%', '8%', '8%', '8%');
$table->align = array('left', 'left', 'left', 'center', 'center', 'center', 'center');
$table->head = array($strfullname, $strshortname, $strscale, $strcourses, $stritems, $stredit);
$table->size = array('30%', '20%', '20%', '10%', '10%', '10%');
$table->align = array('left', 'left', 'left', 'center', 'center', 'center');
$table->width = '90%';
$table->data = $data;
$return .= print_table($table, true);
$outcomes_tables[] = $return;
}

if ( !empty($outcomes_tables) ) {
print('<form action="export.php" method="post">' ."\n");
foreach($outcomes_tables as $table) {
print($table);
}
echo '<div class="buttons">';
echo "<input type=\"hidden\" name=\"sesskey\" value=\"$USER->sesskey\" />";
print('<input type="submit" value="'. get_string('exportselectedoutcomes', 'grades') .'" name="export_outcomes">');
echo '</form>';
echo '</div>';
foreach($outcomes_tables as $table) {
print($table);
}

echo '<div class="buttons">';
print_single_button('edit.php', array('courseid'=>$courseid), $srtcreatenewoutcome);
print_single_button('edit.php', array('courseid'=>$courseid), $strcreatenewoutcome);
if ( !empty($outcomes_tables) ) {
print_single_button('export.php', array('id'=>$courseid, 'sesskey'=>sesskey()), get_string('exportalloutcomes', 'grades'));
}
echo '</div>';

$upload_form->display();
Expand Down

0 comments on commit 2078287

Please sign in to comment.