Przeglądaj źródła

[svn r13574] add a "manual" reminder for inactive users

Eric Marguin 17 lat temu
rodzic
commit
bfe9a30ce5

+ 10 - 1
main/announcements/announcements.php

@@ -1,4 +1,4 @@
-<?php //$Id: announcements.php 13364 2007-09-30 07:06:37Z yannoo $
+<?php //$Id: announcements.php 13574 2007-10-26 13:34:37Z elixir_inter $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -247,6 +247,10 @@ if ($_SESSION['formelements'] and $_GET['originalresource'] == 'no')
 
 	$email_ann				= $form_elements['emailoption'];
 }
+if(!empty($_GET['remind_inactive']))
+{
+	$to[] = 'USER:'.intval($_GET['remind_inactive']);
+}
 /*
 -----------------------------------------------------------
 	Survey
@@ -994,6 +998,11 @@ if ($message == true)
 		if(isset($_GET['id']) && is_array($to)){
 			echo '&nbsp;';
 		}
+		elseif(isset($_GET['remind_inactive']))
+		{
+			$email_ann = '1';
+			echo '&nbsp;<script type="text/javascript">document.onload = "document.getElementById(\'recipient_list\').style.display=\'block\'";</script>';
+		}
 		else{
 			echo get_lang("Everybody");
 		}

+ 1 - 1
main/inc/lib/tracking.lib.php

@@ -141,7 +141,7 @@ class Tracking {
 			//If the last connection is > than 7 days, the text is red
 			//345600 = 7 days in seconds 
 			if ($currentTimestamp - $timestamp > 604800) {
-				return '<span style="color: #F00;">' . format_locale_date(get_lang('DateFormatLongWithoutDay'), strtotime($last_login_date)) . '</span>';
+				return '<span style="color: #F00;">' . format_locale_date(get_lang('DateFormatLongWithoutDay'), strtotime($last_login_date)) . ' <a href="'.api_get_path(REL_CLARO_PATH).'announcements/announcements.php?action=add&remind_inactive='.$student_id.'" title="'.get_lang('RemindInactiveUser').'"><img align="middle" src="'.api_get_path(WEB_IMG_PATH).'linphone.gif" /></a></span>';
 			} else {
 				return format_locale_date(get_lang('DateFormatLongWithoutDay'), strtotime($last_login_date));
 			}

+ 1 - 1
main/mySpace/myStudents.php

@@ -228,7 +228,7 @@ if(!empty($_GET['student']))
 	}
 	$avg_student_progress = round($avg_student_progress / $nb_courses,2);
 	$avg_student_score = round($avg_student_score / $nb_courses,2);
-	$last_connection_date = Tracking::get_last_connection_date($a_infosUser['user_id']);
+	$last_connection_date = Tracking::get_last_connection_date($a_infosUser['user_id'],true);
 	if($last_connection_date==''){
 		$last_connection_date=get_lang('NoConnexion');
 	}