From 98e60471196d7a3d943b09dc033f5adb199167be Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 22 Jul 2012 00:10:07 -0500 Subject: [PATCH] Applied removal of gradebook options when gradebook is disabled, to assessment tool - refs #5034 --- main/attendance/attendance_add.php | 28 ++++++++++++----------- main/attendance/attendance_edit.php | 35 +++++++++++++++-------------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/main/attendance/attendance_add.php b/main/attendance/attendance_add.php index e1a035f7c9..9ef0e5a4aa 100644 --- a/main/attendance/attendance_add.php +++ b/main/attendance/attendance_add.php @@ -35,22 +35,24 @@ $form->add_html_editor('description', get_lang('Description'), false, false, arr // Adavanced Parameters $advanced = ' '.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').''; -$form -> addElement('advanced_settings',$advanced); +if (Gradebook::is_active()) { + $form -> addElement('advanced_settings',$advanced); -$form->addElement('html',''); +} $form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"'); -$form->display(); \ No newline at end of file +$form->display(); diff --git a/main/attendance/attendance_edit.php b/main/attendance/attendance_edit.php index b5717a357b..89ba73821a 100644 --- a/main/attendance/attendance_edit.php +++ b/main/attendance/attendance_edit.php @@ -38,29 +38,30 @@ $form->add_html_editor('description', get_lang('Description'), false, false, arr // Adavanced Parameters -if (!empty($attendance_qualify_title) || !empty($attendance_weight)) { - $advanced = ' '.Display::return_icon('div_hide.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').''; - $form -> addElement('advanced_settings',$advanced); +if (Gradebook::is_active()) { + if (!empty($attendance_qualify_title) || !empty($attendance_weight)) { + $advanced = ' '.Display::return_icon('div_hide.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').''; + $form->addElement('advanced_settings',$advanced); $form->addElement('html','
'); $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),array('checked'=>'true','onclick'=>'javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}')); - $form -> addElement('html','
'); -} else { + $form->addElement('html','
'); + } else { $advanced = ' '.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').''; - $form -> addElement('advanced_settings',$advanced); + $form->addElement('advanced_settings',$advanced); $form->addElement('html',''); + $form->addElement('html',''); + $form->addElement('html','
'); +} $form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"'); // set default values @@ -72,4 +73,4 @@ $default['attendance_weight'] = $attendance_weight; $link_info = is_resource_in_course_gradebook(api_get_course_id(), 7, $attendance_id, api_get_session_id()); $default['category_id'] = $link_info['category_id']; $form->setDefaults($default); -$form->display(); \ No newline at end of file +$form->display();