adding a little bit of code information

notification of user who have never been active yet
feature: https://support.dokeos.com/issues/5453
skala
Patrick Cool 15 years ago
parent 7d290f9626
commit f7e6e3d866
  1. 1659
      documentation/changelog.html
  2. 17
      main/announcements/announcements.php
  3. 10
      main/inc/lib/tracking.lib.php

File diff suppressed because it is too large Load Diff

@ -1015,15 +1015,28 @@ if ($display_form == true) {
$content_to_modify = sprintf(get_lang('RemindInactiveLearnersMailContent'),api_get_setting('siteName'), 7);
$title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'),api_get_setting('siteName'));
} elseif (isset($_GET['remindallinactives']) && $_GET['remindallinactives']=='true') {
// we want to remind inactive users. The $_GET['since'] parameter determines which users have to be warned (i.e the users who have been inactive for x days or more
$since = isset($_GET['since']) ? intval($_GET['since']) : 6;
// getting the users who have to be reminded
$to = Tracking :: get_inactives_students_in_course($_course['id'],$since, $_SESSION['id_session']);
// setting the variables for the form elements: the users who need to receive the message
foreach($to as &$user) {
$user = 'USER:'.$user;
}
// setting the variables for the form elements: the 'visible to' form element has to be expanded
$_SESSION['select_groupusers']="show";
// setting the variables for the form elements: the message has to be sent by email
$email_ann = '1';
$content_to_modify = sprintf(get_lang('RemindInactiveLearnersMailContent'),api_get_setting('siteName'),$since);
$title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'),api_get_setting('siteName'));
// setting the variables for the form elements: the title of the email
$title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'),api_get_setting('siteName'),' > ',$_course['name']);
// setting the variables for the form elements: the message of the email
$content_to_modify = sprintf(get_lang('RemindInactiveLearnersMailContent'),api_get_setting('siteName'),' > ',$_course['name'],$since);
// when we want to remind the users who have never been active then we have a different subject and content for the announcement
if ($_GET['since'] == 'never') {
$title_to_modify = get_lang('NoActivityYetTitle');
$content_to_modify = get_lang('NoActivityYetContent');
}
} else {
echo get_lang("Everybody");
}

@ -1213,6 +1213,7 @@ class Tracking {
{
$tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
$tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$table_course_rel_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$inner = '';
if($session_id!=0)
{
@ -1226,6 +1227,15 @@ class Tracking {
HAVING DATE_SUB( NOW(), INTERVAL '.$since.' DAY) > max_date ';
//HAVING DATE_ADD(max_date, INTERVAL '.$since.' DAY) < NOW() ';
if ($since == 'never') {
$sql = 'SELECT course_user.user_id FROM '.$table_course_rel_user.' course_user
LEFT JOIN '. $tbl_track_login.' stats_login
ON course_user.user_id = stats_login.user_id'.
$inner.'
WHERE course_user.course_code = \''.Database::escape_string($course_code).'\'
AND stats_login.login_course_date IS NULL
GROUP BY course_user.user_id';
}
$rs = api_sql_query($sql,__FILE__,__LINE__);
$inactive_users = array();
while($user = Database::fetch_array($rs))

Loading…
Cancel
Save