diff --git a/grade/edit/outcome/index.php b/grade/edit/outcome/index.php index a7e2c518efe..efdcc0f4af5 100644 --- a/grade/edit/outcome/index.php +++ b/grade/edit/outcome/index.php @@ -100,8 +100,22 @@ switch ($action) { break; } - //TODO: add confirmation - $outcome->delete(); + $deleteconfirmed = optional_param('deleteconfirmed', 0, PARAM_BOOL); + + if(!$deleteconfirmed){ + print_header(get_string('outcomedelete', 'grades')); + notice_yesno(get_string('outcomeconfirmdelete', 'grades', $outcome->fullname), + "index.php?id={$courseid}", "index.php?id={$courseid}", + array('outcomeid' => $outcome->id, + 'action'=> 'delete', + 'sesskey' => $USER->sesskey, + 'deleteconfirmed'=> 1) + ); + print_footer(); + die; + }else{ + $outcome->delete(); + } break; } diff --git a/lang/en_utf8/grades.php b/lang/en_utf8/grades.php index e920164c05e..ce56f56d18d 100644 --- a/lang/en_utf8/grades.php +++ b/lang/en_utf8/grades.php @@ -342,7 +342,9 @@ $string['options'] = 'Options'; $string['outcome'] = 'Outcome'; $string['outcomecategory'] = 'Create outcomes in category'; $string['outcomecategorynew'] = 'New category'; +$string['outcomeconfirmdelete'] = 'Are you sure you wish to delete the outcome \"$a\"?'; $string['outcomecreate'] = 'Add a new outcome'; +$string['outcomedelete'] = 'Delete Outcome'; $string['outcomeidhelp'] = 'The outcome this grade item represents.'; $string['outcomeitem'] = 'Outcome item'; $string['outcomeitemsedit'] = 'Edit outcome item';