Bug #3646 and Issue #306 - User profile and Platform administrator's tools (Part 5): Fixing person name order and sorting to be dependable on the internationalization settings.

skala
Ivan Tcholakov 16 years ago
parent 6fd0b54690
commit ed64d52dac
  1. 25
      main/admin/course_information.php
  2. 10
      main/admin/session_add.php
  3. 592
      main/admin/session_list.php
  4. 6
      main/auth/lost_password.lib.php
  5. 4
      main/auth/my_progress.php

@ -103,6 +103,7 @@ $table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_user = Database :: get_main_table(TABLE_MAIN_USER); $table_user = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT *,cu.status as course_status FROM $table_course_user cu, $table_user u WHERE cu.user_id = u.user_id AND cu.course_code = '".$code."'"; $sql = "SELECT *,cu.status as course_status FROM $table_course_user cu, $table_user u WHERE cu.user_id = u.user_id AND cu.course_code = '".$code."'";
$res = api_sql_query($sql,__FILE__,__LINE__); $res = api_sql_query($sql,__FILE__,__LINE__);
$is_western_name_order = api_is_western_name_order();
if (mysql_num_rows($res) > 0) if (mysql_num_rows($res) > 0)
{ {
$users = array (); $users = array ();
@ -110,8 +111,16 @@ if (mysql_num_rows($res) > 0)
{ {
$user = array (); $user = array ();
$user[] = $obj->official_code; $user[] = $obj->official_code;
$user[] = $obj->firstname; if ($is_western_name_order)
$user[] = $obj->lastname; {
$user[] = $obj->firstname;
$user[] = $obj->lastname;
}
else
{
$user[] = $obj->lastname;
$user[] = $obj->firstname;
}
$user[] = Display :: encrypted_mailto_link($obj->email, $obj->email); $user[] = Display :: encrypted_mailto_link($obj->email, $obj->email);
$user[] = $obj->course_status == 5 ? get_lang('Student') : get_lang('Teacher'); $user[] = $obj->course_status == 5 ? get_lang('Student') : get_lang('Teacher');
$user[] = '<a href="user_information.php?user_id='.$obj->user_id.'">'.Display::return_icon('synthese_view.gif',get_lang('UserInfo')).'</a>'; $user[] = '<a href="user_information.php?user_id='.$obj->user_id.'">'.Display::return_icon('synthese_view.gif',get_lang('UserInfo')).'</a>';
@ -121,8 +130,16 @@ if (mysql_num_rows($res) > 0)
$table->set_additional_parameters(array ('code' => $code)); $table->set_additional_parameters(array ('code' => $code));
$table->set_other_tables(array('usage_table','class_table')); $table->set_other_tables(array('usage_table','class_table'));
$table->set_header(0,get_lang('OfficialCode'), true); $table->set_header(0,get_lang('OfficialCode'), true);
$table->set_header(1,get_lang('FirstName'), true); if ($is_western_name_order)
$table->set_header(2,get_lang('LastName'), true); {
$table->set_header(1,get_lang('FirstName'), true);
$table->set_header(2,get_lang('LastName'), true);
}
else
{
$table->set_header(1,get_lang('LastName'), true);
$table->set_header(2,get_lang('FirstName'), true);
}
$table->set_header(3,get_lang('Email'), true); $table->set_header(3,get_lang('Email'), true);
$table->set_header(4,get_lang('Status'), true); $table->set_header(4,get_lang('Status'), true);
$table->set_header(5,'', false); $table->set_header(5,'', false);

@ -162,8 +162,9 @@ $sql = 'SELECT COUNT(1) FROM '.$tbl_user.' WHERE status=1';
$rs = api_sql_query($sql, __FILE__, __LINE__); $rs = api_sql_query($sql, __FILE__, __LINE__);
$count_users = Database::result($rs, 0, 0); $count_users = Database::result($rs, 0, 0);
if (intval($count_users)<50) { if (intval($count_users)<50) {
$sql="SELECT user_id,lastname,firstname,username FROM $tbl_user WHERE status='1' ORDER BY lastname,firstname,username"; $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
$sql="SELECT user_id,lastname,firstname,username FROM $tbl_user WHERE status='1'".$order_clause;
global $_configuration; global $_configuration;
if ($_configuration['multiple_access_urls']==true) { if ($_configuration['multiple_access_urls']==true) {
$tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
@ -171,8 +172,7 @@ if (intval($count_users)<50) {
if ($access_url_id != -1){ if ($access_url_id != -1){
$sql = 'SELECT username, lastname, firstname FROM '.$tbl_user.' user $sql = 'SELECT username, lastname, firstname FROM '.$tbl_user.' user
INNER JOIN '.$tbl_user_rel_access_url.' url_user ON (url_user.user_id=user.user_id) INNER JOIN '.$tbl_user_rel_access_url.' url_user ON (url_user.user_id=user.user_id)
WHERE access_url_id = '.$access_url_id.' AND status=1 WHERE access_url_id = '.$access_url_id.' AND status=1'.$order_clause;
ORDER BY lastname, firstname, username';
} }
} }
@ -182,7 +182,7 @@ if (intval($count_users)<50) {
<select name="coach_username" value="true" style="width:250px;"> <select name="coach_username" value="true" style="width:250px;">
<option value="0"><?php get_lang('None'); ?></option> <option value="0"><?php get_lang('None'); ?></option>
<?php foreach($Coaches as $enreg): ?> <?php foreach($Coaches as $enreg): ?>
<option value="<?php echo $enreg['username']; ?>" <?php if($sent && $enreg['user_id'] == $id_coach) echo 'selected="selected"'; ?>><?php echo $enreg['firstname'].' '.$enreg['lastname'].' ('.$enreg['username'].')'; ?></option> <option value="<?php echo $enreg['username']; ?>" <?php if($sent && $enreg['user_id'] == $id_coach) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option>
<?php endforeach; ?> <?php endforeach; ?>
</select> </select>
<?php <?php

@ -1,300 +1,300 @@
<?php <?php
/* For licensing terms, see /dokeos_license.txt */ /* For licensing terms, see /dokeos_license.txt */
$language_file='admin'; $language_file='admin';
$cidReset=true; $cidReset=true;
include('../inc/global.inc.php'); include('../inc/global.inc.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
require_once (api_get_path(LIBRARY_PATH).'sessionmanager.lib.php'); require_once (api_get_path(LIBRARY_PATH).'sessionmanager.lib.php');
api_protect_admin_script(true); api_protect_admin_script(true);
$htmlHeadXtra[] = '<script language="javascript"> $htmlHeadXtra[] = '<script language="javascript">
function selectAll(idCheck,numRows,action) { function selectAll(idCheck,numRows,action) {
for(i=0;i<numRows;i++) { for(i=0;i<numRows;i++) {
idcheck = document.getElementById(idCheck+"_"+i); idcheck = document.getElementById(idCheck+"_"+i);
if (action == "true"){ if (action == "true"){
idcheck.checked = true; idcheck.checked = true;
} else { } else {
idcheck.checked = false; idcheck.checked = false;
} }
} }
} }
</script> </script>
'; ';
$tbl_session=Database::get_main_table(TABLE_MAIN_SESSION); $tbl_session=Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_course=Database::get_main_table(TABLE_MAIN_SESSION_COURSE); $tbl_session_rel_course=Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_course_rel_user=Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); $tbl_session_rel_course_rel_user=Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session_rel_user=Database::get_main_table(TABLE_MAIN_SESSION_USER); $tbl_session_rel_user=Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER); $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$page=intval($_GET['page']); $page=intval($_GET['page']);
$action=$_REQUEST['action']; $action=$_REQUEST['action'];
$sort=in_array($_GET['sort'],array('name','nbr_courses','date_start','date_end'))?$_GET['sort']:'name'; $sort=in_array($_GET['sort'],array('name','nbr_courses','date_start','date_end'))?$_GET['sort']:'name';
$idChecked = $_REQUEST['idChecked']; $idChecked = $_REQUEST['idChecked'];
if ($action == 'delete') { if ($action == 'delete') {
SessionManager::delete_session($idChecked); SessionManager::delete_session($idChecked);
header('Location: '.api_get_self().'?sort='.$sort); header('Location: '.api_get_self().'?sort='.$sort);
exit(); exit();
} }
$interbreadcrumb[]=array("url" => "index.php","name" => get_lang('PlatformAdmin')); $interbreadcrumb[]=array("url" => "index.php","name" => get_lang('PlatformAdmin'));
if (isset ($_GET['search']) && $_GET['search'] == 'advanced') { if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
$interbreadcrumb[] = array ("url" => 'session_list.php', "name" => get_lang('SessionList')); $interbreadcrumb[] = array ("url" => 'session_list.php', "name" => get_lang('SessionList'));
$tool_name = get_lang('SearchASession'); $tool_name = get_lang('SearchASession');
Display :: display_header($tool_name); Display :: display_header($tool_name);
$form = new FormValidator('advanced_search','get'); $form = new FormValidator('advanced_search','get');
$form->addElement('header', '', $tool_name); $form->addElement('header', '', $tool_name);
$active_group = array(); $active_group = array();
$active_group[] = $form->createElement('checkbox','active','',get_lang('Active')); $active_group[] = $form->createElement('checkbox','active','',get_lang('Active'));
$active_group[] = $form->createElement('checkbox','inactive','',get_lang('Inactive')); $active_group[] = $form->createElement('checkbox','inactive','',get_lang('Inactive'));
$form->addGroup($active_group,'',get_lang('ActiveSession'),'<br/>',false); $form->addGroup($active_group,'',get_lang('ActiveSession'),'<br/>',false);
$form->addElement('style_submit_button', 'submit',get_lang('Search'),'class="search"'); $form->addElement('style_submit_button', 'submit',get_lang('Search'),'class="search"');
$defaults['active'] = 1; $defaults['active'] = 1;
$defaults['inactive'] = 1; $defaults['inactive'] = 1;
$form->setDefaults($defaults); $form->setDefaults($defaults);
$form->display(); $form->display();
} else { } else {
$limit = 20; $limit=20;
$from = $page * $limit; $from=$page * $limit;
//if user is crfp admin only list its sessions //if user is crfp admin only list its sessions
if(!api_is_platform_admin()) { if(!api_is_platform_admin()) {
$where = 'WHERE session_admin_id='.intval($_user['user_id']); $where = 'WHERE session_admin_id='.intval($_user['user_id']);
$where .= (empty($_REQUEST['keyword']) ? " " : " AND name LIKE '%".addslashes($_REQUEST['keyword'])."%'"); $where .= (empty($_REQUEST['keyword']) ? " " : " AND name LIKE '%".addslashes($_REQUEST['keyword'])."%'");
} }
else { else {
$where .= (empty($_REQUEST['keyword']) ? " " : " WHERE name LIKE '%".addslashes($_REQUEST['keyword'])."%'"); $where .= (empty($_REQUEST['keyword']) ? " " : " WHERE name LIKE '%".addslashes($_REQUEST['keyword'])."%'");
} }
if(trim($where) == ''){ if(trim($where) == ''){
$and=" WHERE id_coach=user_id"; $and=" WHERE id_coach=user_id";
} else { } else {
$and=" AND id_coach=user_id"; $and=" AND id_coach=user_id";
} }
if (isset($_REQUEST['active']) && !isset($_REQUEST['inactive']) ){ if(isset($_REQUEST['active']) && !isset($_REQUEST['inactive']) ){
$and .= ' AND ( (session.date_start <= CURDATE() AND session.date_end >= CURDATE()) OR session.date_start="0000-00-00" ) '; $and .= ' AND ( (session.date_start <= CURDATE() AND session.date_end >= CURDATE()) OR session.date_start="0000-00-00" ) ';
$cond_url = '&amp;active='.Security::remove_XSS($_REQUEST['active']); $cond_url = '&amp;active='.Security::remove_XSS($_REQUEST['active']);
} }
if (!isset($_REQUEST['active']) && isset($_REQUEST['inactive']) ){ if(!isset($_REQUEST['active']) && isset($_REQUEST['inactive']) ){
$and .= ' AND ( (session.date_start > CURDATE() OR session.date_end < CURDATE()) AND session.date_start<>"0000-00-00" ) '; $and .= ' AND ( (session.date_start > CURDATE() OR session.date_end < CURDATE()) AND session.date_start<>"0000-00-00" ) ';
$cond_url = '&amp;inactive='.Security::remove_XSS($_REQUEST['inactive']); $cond_url = '&amp;inactive='.Security::remove_XSS($_REQUEST['inactive']);
} }
$query= "SELECT id,name,nbr_courses,date_start,date_end, firstname, lastname $query= "SELECT id,name,nbr_courses,date_start,date_end, firstname, lastname
FROM $tbl_session, $tbl_user FROM $tbl_session, $tbl_user
$where $where
$and $and
ORDER BY $sort ORDER BY $sort
LIMIT $from,".($limit+1); LIMIT $from,".($limit+1);
//query which allows me to get a record without taking into account the page //query which allows me to get a record without taking into account the page
$query_rows= "SELECT count(*) as total_rows $query_rows= "SELECT count(*) as total_rows
FROM $tbl_session, $tbl_user FROM $tbl_session, $tbl_user
$where $where
$and $and
ORDER BY $sort"; ORDER BY $sort";
//filtering the session list by access_url //filtering the session list by access_url
if ($_configuration['multiple_access_urls']==true){ if ($_configuration['multiple_access_urls']==true){
$table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
$access_url_id = api_get_current_access_url_id(); $access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) { if ($access_url_id != -1) {
$and.= " AND access_url_id = $access_url_id AND $table_access_url_rel_session.session_id = $tbl_session.id"; $and.= " AND access_url_id = $access_url_id AND $table_access_url_rel_session.session_id = $tbl_session.id";
$query= "SELECT id,name,nbr_courses,date_start,date_end, firstname, lastname $query= "SELECT id,name,nbr_courses,date_start,date_end, firstname, lastname
FROM $tbl_session, $tbl_user, $table_access_url_rel_session FROM $tbl_session, $tbl_user, $table_access_url_rel_session
$where $where
$and $and
ORDER BY $sort ORDER BY $sort
LIMIT $from,".($limit+1); LIMIT $from,".($limit+1);
$query_rows= "SELECT count(*) as total_rows $query_rows= "SELECT count(*) as total_rows
FROM $tbl_session, $tbl_user,$table_access_url_rel_session FROM $tbl_session, $tbl_user,$table_access_url_rel_session
$where $where
$and $and
ORDER BY $sort"; ORDER BY $sort";
} }
} }
$result_rows = api_sql_query($query_rows,__FILE__,__LINE__); $result_rows = api_sql_query($query_rows,__FILE__,__LINE__);
$recorset = Database::fetch_array($result_rows); $recorset = Database::fetch_array($result_rows);
$num = $recorset['total_rows']; $num = $recorset['total_rows'];
$result = api_sql_query($query,__FILE__,__LINE__); $result=api_sql_query($query,__FILE__,__LINE__);
$Sessions = api_store_result($result); $Sessions=api_store_result($result);
$nbr_results = sizeof($Sessions); $nbr_results=sizeof($Sessions);
$tool_name = get_lang('SessionList'); $tool_name = get_lang('SessionList');
Display::display_header($tool_name); Display::display_header($tool_name);
//api_display_tool_title($tool_name); //api_display_tool_title($tool_name);
if (!empty($_GET['warn'])) { if (!empty($_GET['warn'])) {
Display::display_warning_message(urldecode($_GET['warn']),false); Display::display_warning_message(urldecode($_GET['warn']),false);
} }
if(isset($_GET['action'])) { if(isset($_GET['action'])) {
Display::display_normal_message(stripslashes($_GET['message']),false); Display::display_normal_message(stripslashes($_GET['message']),false);
} }
?> ?>
<div class="actions"> <div class="actions">
<?php <?php
echo '<div style="float:right;"> echo '<div style="float:right;">
<a href="'.api_get_path(WEB_CODE_PATH).'admin/session_add.php">'.Display::return_icon('view_more_stats.gif',get_lang('AddSession')).get_lang('AddSession').'</a> <a href="'.api_get_path(WEB_CODE_PATH).'admin/session_add.php">'.Display::return_icon('view_more_stats.gif',get_lang('AddSession')).get_lang('AddSession').'</a>
</div>'; </div>';
?> ?>
<form method="POST" action="session_list.php"> <form method="POST" action="session_list.php">
<input type="text" name="keyword" value="<?php echo Security::remove_XSS($_GET['keyword']); ?>"/> <input type="text" name="keyword" value="<?php echo Security::remove_XSS($_GET['keyword']); ?>"/>
<button class="search" type="submit" name="name" value="<?php echo get_lang('Search') ?>"><?php echo get_lang('Search') ?></button> <button class="search" type="submit" name="name" value="<?php echo get_lang('Search') ?>"><?php echo get_lang('Search') ?></button>
<a href="session_list.php?search=advanced"><?php echo get_lang('AdvancedSearch'); ?></a> <a href="session_list.php?search=advanced"><?php echo get_lang('AdvancedSearch'); ?></a>
</form> </form>
<form method="post" action="<?php echo api_get_self(); ?>?action=delete&sort=<?php echo $sort; ?>" onsubmit="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;"> <form method="post" action="<?php echo api_get_self(); ?>?action=delete&sort=<?php echo $sort; ?>" onsubmit="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;">
</div><br /> </div><br />
<div align="left"> <div align="left">
<?php <?php
if(count($Sessions)==0 && isset($_POST['keyword'])) { if(count($Sessions)==0 && isset($_POST['keyword'])) {
echo get_lang('NoSearchResults'); echo get_lang('NoSearchResults');
echo ' </div>'; echo ' </div>';
} else { } else {
if ($num > $limit) { if($num>$limit){
if ($page) { if($page) {
?> ?>
<a href="<?php echo api_get_self(); ?>?page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>&keyword=<?php echo $_REQUEST['keyword']; ?><?php echo @$cond_url; ?>"><?php echo get_lang('Previous'); ?></a> <a href="<?php echo api_get_self(); ?>?page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>&keyword=<?php echo $_REQUEST['keyword']; ?><?php echo @$cond_url; ?>"><?php echo get_lang('Previous'); ?></a>
<?php <?php
} else { } else {
echo get_lang('Previous'); echo get_lang('Previous');
} }
?> ?>
| |
<?php <?php
if($nbr_results > $limit) { if($nbr_results > $limit) {
?> ?>
<a href="<?php echo api_get_self(); ?>?page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>&keyword=<?php echo $_REQUEST['keyword']; ?><?php echo @$cond_url; ?>"><?php echo get_lang('Next'); ?></a> <a href="<?php echo api_get_self(); ?>?page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>&keyword=<?php echo $_REQUEST['keyword']; ?><?php echo @$cond_url; ?>"><?php echo get_lang('Next'); ?></a>
<?php <?php
} else { } else {
echo get_lang('Next'); echo get_lang('Next');
} }
} }
?> ?>
</div> </div>
<br /> <br />
<table class="data_table" width="100%"> <table class="data_table" width="100%">
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<th><a href="<?php echo api_get_self(); ?>?sort=name"><?php echo get_lang('NameOfTheSession'); ?></a></th> <th><a href="<?php echo api_get_self(); ?>?sort=name"><?php echo get_lang('NameOfTheSession'); ?></a></th>
<th><a href="<?php echo api_get_self(); ?>?sort=nbr_courses"><?php echo get_lang('NumberOfCourses'); ?></a></th> <th><a href="<?php echo api_get_self(); ?>?sort=nbr_courses"><?php echo get_lang('NumberOfCourses'); ?></a></th>
<th><a href="<?php echo api_get_self(); ?>?sort=date_start"><?php echo get_lang('StartDate'); ?></a></th> <th><a href="<?php echo api_get_self(); ?>?sort=date_start"><?php echo get_lang('StartDate'); ?></a></th>
<th><a href="<?php echo api_get_self(); ?>?sort=date_end"><?php echo get_lang('EndDate'); ?></a></th> <th><a href="<?php echo api_get_self(); ?>?sort=date_end"><?php echo get_lang('EndDate'); ?></a></th>
<th><a href="<?php echo api_get_self(); ?>?sort=coach_name"><?php echo get_lang('Coach'); ?></a></th> <th><a href="<?php echo api_get_self(); ?>?sort=coach_name"><?php echo get_lang('Coach'); ?></a></th>
<th><?php echo get_lang('Actions'); ?></th> <th><?php echo get_lang('Actions'); ?></th>
</tr> </tr>
<?php <?php
$i=0; $i=0;
$x=0; $x=0;
foreach ($Sessions as $key=>$enreg) { foreach ($Sessions as $key=>$enreg) {
if($key == $limit) { if($key == $limit) {
break; break;
} }
$sql = 'SELECT COUNT(course_code) FROM '.$tbl_session_rel_course.' WHERE id_session='.intval($enreg['id']); $sql = 'SELECT COUNT(course_code) FROM '.$tbl_session_rel_course.' WHERE id_session='.intval($enreg['id']);
$rs = api_sql_query($sql, __FILE__, __LINE__); $rs = api_sql_query($sql, __FILE__, __LINE__);
list($nb_courses) = Database::fetch_array($rs); list($nb_courses) = Database::fetch_array($rs);
?> ?>
<tr class="<?php echo $i?'row_odd':'row_even'; ?>"> <tr class="<?php echo $i?'row_odd':'row_even'; ?>">
<td><input type="checkbox" id="idChecked_<?php echo $x; ?>" name="idChecked[]" value="<?php echo $enreg['id']; ?>"></td> <td><input type="checkbox" id="idChecked_<?php echo $x; ?>" name="idChecked[]" value="<?php echo $enreg['id']; ?>"></td>
<td><a href="resume_session.php?id_session=<?php echo $enreg['id']; ?>"><?php echo api_htmlentities($enreg['name'],ENT_QUOTES,$charset); ?></a></td> <td><a href="resume_session.php?id_session=<?php echo $enreg['id']; ?>"><?php echo api_htmlentities($enreg['name'],ENT_QUOTES,$charset); ?></a></td>
<td><a href="session_course_list.php?id_session=<?php echo $enreg['id']; ?>"><?php echo $nb_courses; ?> cours</a></td> <td><a href="session_course_list.php?id_session=<?php echo $enreg['id']; ?>"><?php echo $nb_courses; ?> cours</a></td>
<td><?php echo api_htmlentities($enreg['date_start'],ENT_QUOTES,$charset); ?></td> <td><?php echo api_htmlentities($enreg['date_start'],ENT_QUOTES,$charset); ?></td>
<td><?php echo api_htmlentities($enreg['date_end'],ENT_QUOTES,$charset); ?></td> <td><?php echo api_htmlentities($enreg['date_end'],ENT_QUOTES,$charset); ?></td>
<td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset).' '.api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td> <td><?php echo api_htmlentities(api_get_person_name($enreg['firstname'], $enreg['lastname']),ENT_QUOTES,$charset); ?></td>
<td> <td>
<a href="add_users_to_session.php?page=session_list.php&id_session=<?php echo $enreg['id']; ?>"><?php Display::display_icon('add_user_big.gif', get_lang('SubscribeUsersToSession')); ?></a> <a href="add_users_to_session.php?page=session_list.php&id_session=<?php echo $enreg['id']; ?>"><?php Display::display_icon('add_user_big.gif', get_lang('SubscribeUsersToSession')); ?></a>
<a href="add_courses_to_session.php?page=session_list.php&id_session=<?php echo $enreg['id']; ?>"><?php Display::display_icon('synthese_view.gif', get_lang('SubscribeCoursesToSession')); ?></a> <a href="add_courses_to_session.php?page=session_list.php&id_session=<?php echo $enreg['id']; ?>"><?php Display::display_icon('synthese_view.gif', get_lang('SubscribeCoursesToSession')); ?></a>
<a href="session_edit.php?page=session_list.php&id=<?php echo $enreg['id']; ?>"><?php Display::display_icon('edit.gif', get_lang('Edit')); ?></a> <a href="session_edit.php?page=session_list.php&id=<?php echo $enreg['id']; ?>"><?php Display::display_icon('edit.gif', get_lang('Edit')); ?></a>
<a href="<?php echo api_get_self(); ?>?sort=<?php echo $sort; ?>&action=delete&idChecked=<?php echo $enreg['id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;"><?php Display::display_icon('delete.gif', get_lang('Delete')); ?></a> <a href="<?php echo api_get_self(); ?>?sort=<?php echo $sort; ?>&action=delete&idChecked=<?php echo $enreg['id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;"><?php Display::display_icon('delete.gif', get_lang('Delete')); ?></a>
</td> </td>
</tr> </tr>
<?php <?php
$i=$i ? 0 : 1; $i=$i ? 0 : 1;
$x++; $x++;
} }
unset($Sessions); unset($Sessions);
?> ?>
</table> </table>
<br /> <br />
<div align="left"> <div align="left">
<?php <?php
if ($num > $limit) { if($num>$limit) {
if ($page) if($page)
{ {
?> ?>
<a href="<?php echo api_get_self(); ?>?page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>&keyword=<?php echo $_REQUEST['keyword']; ?><?php echo @$cond_url; ?>"><?php echo get_lang('Previous'); ?></a> <a href="<?php echo api_get_self(); ?>?page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>&keyword=<?php echo $_REQUEST['keyword']; ?><?php echo @$cond_url; ?>"><?php echo get_lang('Previous'); ?></a>
<?php <?php
} }
else else
{ {
echo get_lang('Previous'); echo get_lang('Previous');
} }
?> ?>
| |
<?php <?php
if($nbr_results > $limit) if($nbr_results > $limit)
{ {
?> ?>
<a href="<?php echo api_get_self(); ?>?page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>&keyword=<?php echo $_REQUEST['keyword']; ?><?php echo @$cond_url; ?>"><?php echo get_lang('Next'); ?></a> <a href="<?php echo api_get_self(); ?>?page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>&keyword=<?php echo $_REQUEST['keyword']; ?><?php echo @$cond_url; ?>"><?php echo get_lang('Next'); ?></a>
<?php <?php
} }
else else
{ {
echo get_lang('Next'); echo get_lang('Next');
} }
} }
?> ?>
</div> </div>
<br /> <br />
<a href="javascript: void(0);" onclick="javascript: selectAll('idChecked',<?php echo $x; ?>,'true');return false;"><?php echo get_lang('SelectAll') ?></a>&nbsp;-&nbsp; <a href="javascript: void(0);" onclick="javascript: selectAll('idChecked',<?php echo $x; ?>,'true');return false;"><?php echo get_lang('SelectAll') ?></a>&nbsp;-&nbsp;
<a href="javascript: void(0);" onclick="javascript: selectAll('idChecked',<?php echo $x; ?>,'false');return false;"><?php echo get_lang('UnSelectAll') ?></a> <a href="javascript: void(0);" onclick="javascript: selectAll('idChecked',<?php echo $x; ?>,'false');return false;"><?php echo get_lang('UnSelectAll') ?></a>
<select name="action"> <select name="action">
<option value="delete"><?php echo get_lang('DeleteSelectedSessions'); ?></option> <option value="delete"><?php echo get_lang('DeleteSelectedSessions'); ?></option>
</select> </select>
<button class="save" type="submit" name="name" value="<?php echo get_lang('Ok') ?>"><?php echo get_lang('Ok') ?></button> <button class="save" type="submit" name="name" value="<?php echo get_lang('Ok') ?>"><?php echo get_lang('Ok') ?></button>
<?php } ?> <?php } ?>
</table> </table>
<?php <?php
} }
Display::display_footer(); Display::display_footer();
?> ?>

@ -10,7 +10,7 @@
function get_email_headers() function get_email_headers()
{ {
global $charset; global $charset;
$emailHeaders = "From: \"".addslashes(api_get_setting('administratorSurname')." ".api_get_setting('administratorName'))."\" <".api_get_setting('emailAdministrator').">\n"; $emailHeaders = "From: \"".addslashes(api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS))."\" <".api_get_setting('emailAdministrator').">\n";
$emailHeaders .= "Reply-To: ".api_get_setting('emailAdministrator')."\n"; $emailHeaders .= "Reply-To: ".api_get_setting('emailAdministrator')."\n";
$emailHeaders .= "Return-Path: ".api_get_setting('emailAdministrator')."\n"; $emailHeaders .= "Return-Path: ".api_get_setting('emailAdministrator')."\n";
$emailHeaders .= "X-Sender: ".api_get_setting('emailAdministrator')."\n"; $emailHeaders .= "X-Sender: ".api_get_setting('emailAdministrator')."\n";
@ -85,7 +85,7 @@ function send_password_to_user($user)
$emailBody = get_lang('YourAccountParam')." ".$portal_url."\n\n$userAccountList"; $emailBody = get_lang('YourAccountParam')." ".$portal_url."\n\n$userAccountList";
// SEND MESSAGE // SEND MESSAGE
$emailTo = $user[0]["email"]; $emailTo = $user[0]["email"];
$sender_name = api_get_setting('administratorName').' '.api_get_setting('administratorSurname'); $sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
$email_admin = api_get_setting('emailAdministrator'); $email_admin = api_get_setting('emailAdministrator');
if (@api_mail('', $emailTo, $emailSubject, $emailBody, $sender_name,$email_admin)==1) { if (@api_mail('', $emailTo, $emailSubject, $emailBody, $sender_name,$email_admin)==1) {
@ -116,7 +116,7 @@ function handle_encrypted_password($user)
$emailBody .= "-----------------------------------------------\n".$userAccountList."\n-----------------------------------------------\n\n"; $emailBody .= "-----------------------------------------------\n".$userAccountList."\n-----------------------------------------------\n\n";
$emailBody .=get_lang('PasswordEncryptedForSecurity'); $emailBody .=get_lang('PasswordEncryptedForSecurity');
$emailBody .="\n\n".get_lang('Formula').",\n".get_lang('PlataformAdmin'); $emailBody .="\n\n".get_lang('Formula').",\n".get_lang('PlataformAdmin');
$sender_name = api_get_setting('administratorName').' '.api_get_setting('administratorSurname'); $sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
$email_admin = api_get_setting('emailAdministrator'); $email_admin = api_get_setting('emailAdministrator');
if (@api_mail('', $emailTo, $emailSubject, $emailBody, $sender_name,$email_admin)==1) if (@api_mail('', $emailTo, $emailSubject, $emailBody, $sender_name,$email_admin)==1)

@ -190,12 +190,12 @@ foreach($Courses as $enreg)
if($session_course_coach_id!=0) if($session_course_coach_id!=0)
{ {
$coach_infos = UserManager :: get_user_info_by_id($session_course_coach_id); $coach_infos = UserManager :: get_user_info_by_id($session_course_coach_id);
$a_infosCours['tutor_name'] = $coach_infos['firstname'].' '.$coach_infos['lastname']; $a_infosCours['tutor_name'] = api_get_person_name($coach_infos['firstname'], $coach_infos['lastname']);
} }
else if($session_coach_id!=0) else if($session_coach_id!=0)
{ {
$coach_infos = UserManager :: get_user_info_by_id($session_coach_id); $coach_infos = UserManager :: get_user_info_by_id($session_coach_id);
$a_infosCours['tutor_name'] = $coach_infos['firstname'].' '.$coach_infos['lastname']; $a_infosCours['tutor_name'] = api_get_person_name($coach_infos['firstname'], $coach_infos['lastname']);
} }
} }
} // end if(api_get_setting('use_session_mode')=='true') } // end if(api_get_setting('use_session_mode')=='true')

Loading…
Cancel
Save