Showing course data even if there are any students see BT#7297

1.9.x
Julio Montoya 12 years ago
parent fa63c3fb50
commit 78c1db1032
  1. 101
      main/tracking/courseLog.php

@ -245,70 +245,80 @@ $form_search->addElement('style_submit_button', 'submit', get_lang('SearchUsers'
$form_search->display(); $form_search->display();
echo '</div>'; echo '</div>';
// BEGIN : form to remind inactive users $course_name = get_lang('Course').' '.$courseInfo['name'];
if (count($a_students) > 0) { if ($session_id) {
$form = new FormValidator('reminder_form', 'get', api_get_path(REL_CODE_PATH).'announcements/announcements.php');
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<span>{label} {element}</span>&nbsp;<button class="save" type="submit">'.get_lang('SendNotification').'</button>','since');
$options = array (
2 => '2 '.get_lang('Days'),
3 => '3 '.get_lang('Days'),
4 => '4 '.get_lang('Days'),
5 => '5 '.get_lang('Days'),
6 => '6 '.get_lang('Days'),
7 => '7 '.get_lang('Days'),
15 => '15 '.get_lang('Days'),
30 => '30 '.get_lang('Days'),
'never' => get_lang('Never')
);
$el = $form->addElement('select', 'since', '<img width="ICON_SIZE_SMALL" align="middle" src="'.api_get_path(WEB_IMG_PATH).'messagebox_warning.gif" border="0" />'.get_lang('RemindInactivesLearnersSince'), $options);
$el->setSelected(7);
$form->addElement('hidden', 'action', 'add');
$form->addElement('hidden', 'remindallinactives', 'true');
$course_name = get_lang('Course').' '.$courseInfo['name'];
if ($session_id) {
echo Display::page_subheader( echo Display::page_subheader(
Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id).' '. Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.api_get_session_name($session_id).' '.
Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_name
); );
} else { } else {
echo Display::page_subheader( echo Display::page_subheader(
Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name'] Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$courseInfo['name']
); );
} }
$teacherList = CourseManager::get_teacher_list_from_course_code_to_string( $teacherList = CourseManager::get_teacher_list_from_course_code_to_string(
$courseInfo['code'], $courseInfo['code'],
CourseManager::USER_SEPARATOR, ',',
false false
); );
$coaches = null; $coaches = null;
if (!empty($session_id)) { if (!empty($session_id)) {
$coaches = CourseManager::get_coachs_from_course_to_string( $coaches = CourseManager::get_coachs_from_course_to_string(
$session_id, $session_id,
$courseInfo['code'], $courseInfo['code'],
CourseManager::USER_SEPARATOR, ',',
false false
); );
} }
if (!empty($teacherList)) { if (!empty($teacherList)) {
echo Display::page_subheader2(get_lang('Teachers')); echo Display::page_subheader2(get_lang('Teachers'));
echo $teacherList; echo $teacherList;
} }
if (!empty($coaches)) { if (!empty($coaches)) {
echo Display::page_subheader2(get_lang('Coaches')); echo Display::page_subheader2(get_lang('Coaches'));
echo $coaches; echo $coaches;
}
$sessionList = SessionManager::get_session_by_course($courseInfo['code']);
if (!empty($sessionList)) {
echo Display::page_subheader2(get_lang('SessionList'));
$sessionToShow = array();
foreach ($sessionList as $session) {
$url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'].'&cidReq='.$courseInfo['code'];
$sessionToShow[] = Display::url($session['name'], $url);
} }
echo implode(', ', $sessionToShow);
}
echo Display::page_subheader2(get_lang('StudentList')); echo Display::page_subheader2(get_lang('StudentList'));
if (count($a_students) > 0) {
$form = new FormValidator('reminder_form', 'get', api_get_path(REL_CODE_PATH).'announcements/announcements.php');
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<span>{label} {element}</span>&nbsp;<button class="save" type="submit">'.get_lang('SendNotification').'</button>','since');
$options = array (
2 => '2 '.get_lang('Days'),
3 => '3 '.get_lang('Days'),
4 => '4 '.get_lang('Days'),
5 => '5 '.get_lang('Days'),
6 => '6 '.get_lang('Days'),
7 => '7 '.get_lang('Days'),
15 => '15 '.get_lang('Days'),
30 => '30 '.get_lang('Days'),
'never' => get_lang('Never')
);
$el = $form->addElement('select', 'since', '<img width="ICON_SIZE_SMALL" align="middle" src="'.api_get_path(WEB_IMG_PATH).'messagebox_warning.gif" border="0" />'.get_lang('RemindInactivesLearnersSince'), $options);
$el->setSelected(7);
$form->addElement('hidden', 'action', 'add');
$form->addElement('hidden', 'remindallinactives', 'true');
$extra_field_select = TrackingCourseLog::display_additional_profile_fields(); $extra_field_select = TrackingCourseLog::display_additional_profile_fields();
@ -420,19 +430,6 @@ if (count($a_students) > 0) {
echo "<div id='reporting_table'>"; echo "<div id='reporting_table'>";
$table->display(); $table->display();
echo "</div>"; echo "</div>";
$sessionList = SessionManager::get_session_by_course($courseInfo['code']);
if (!empty($sessionList)) {
echo Display::page_subheader2(get_lang('SessionList'));
$sessionToShow = array();
foreach ($sessionList as $session) {
$url = api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'].'&cidReq='.$courseInfo['code'];
$sessionToShow[] = Display::url($session['name'], $url);
}
echo implode(',', $sessionToShow);
}
} else { } else {
echo Display::display_warning_message(get_lang('NoUsersInCourse')); echo Display::display_warning_message(get_lang('NoUsersInCourse'));
} }

Loading…
Cancel
Save