skala
Julio Montoya 14 years ago
commit 73850d292f
  1. 16
      main/install/install.lib.php
  2. 125
      main/resourcelinker/resourcelinker.inc.php
  3. 12
      main/resourcelinker/resourcelinker.php
  4. 4
      main/search/NOTES
  5. 28
      main/tracking/courseLogCSV.php
  6. 50
      main/tracking/course_access_details.php
  7. 60
      main/tracking/logins_details.php
  8. 34
      main/tracking/personnalLog.php
  9. 65
      main/tracking/toolaccess_details.php
  10. 14
      main/tracking/userLog.php
  11. 40
      main/tracking/userlogCSV.php
  12. 6
      tests/main/inc/lib/stats.lib.inc.test.php

@ -27,7 +27,7 @@ define('SYSTEM_CONFIG_FILENAME', 'configuration.dist.php');
* @author Ivan Tcholakov, 2010;
*/
function is_already_installed_system() {
global $new_version;
global $new_version, $_configuration;
if (empty($new_version)) {
return true; // Must be initialized.
@ -427,7 +427,7 @@ function get_config_param($param, $updatePath = '') {
$updateFromConfigFile = 'claroline/inc/conf/claro_main.conf.php';
} else {
// Give up recovering.
error_log('Could not find config file in '.$updatePath.' in get_config_param()', 0);
error_log('Notice: Could not find previous config file at '.$updatePath.'main/inc/conf/configuration.php nor at '.$updatePath.'claroline/inc/conf/claro_main.conf.php in get_config_param(). Will start new config (in '.__FILE__.', line '.__LINE__.')', 0);
return null;
}
}
@ -1830,15 +1830,15 @@ function display_configuration_settings_form($installType, $urlForm, $languageFo
<tr>
<td><?php echo get_lang("EncryptMethodUserPass"); ?> :</td>
<?php if ($installType == 'update'): ?>
<?php if ($installType == 'update'){ ?>
<td><input type="hidden" name="encryptPassForm" value="<?php echo $encryptPassForm; ?>" /><?php echo $encryptPassForm; ?></td>
<?php else: ?>
<?php }else{ ?>
<td>
<input class="checkbox" type="radio" name="encryptPassForm" value="md5" id="encryptPass0" <?php echo $encryptPassForm === 1 ? 'checked="checked" ' : ''; ?>/> <label for="encryptPass0"><?php echo 'md5'; ?></label>
<input class="checkbox" type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" <?php echo $encryptPassForm == 'sha1' ? '' : 'checked="checked" '; ?>/> <label for="encryptPass1"><?php echo 'sha1'; ?></label>
<input class="checkbox" type="radio" name="encryptPassForm" value="none" id="encryptPass2" <?php echo $encryptPassForm === 0 ? '' : 'checked="checked" '; ?>/> <label for="encryptPass2"><?php echo get_lang('None'); ?></label>
<input class="checkbox" type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" <?php echo ($encryptPassForm == 'sha1') ? 'checked="checked" ': ''; ?>/> <label for="encryptPass1"><?php echo 'sha1'; ?></label>
<input class="checkbox" type="radio" name="encryptPassForm" value="md5" id="encryptPass0" <?php echo $encryptPassForm == 1 ? 'checked="checked" ' : ''; ?>/> <label for="encryptPass0"><?php echo 'md5'; ?></label>
<input class="checkbox" type="radio" name="encryptPassForm" value="none" id="encryptPass2" <?php echo $encryptPassForm === '0' or $encryptPassForm === 0 ? 'checked="checked" ':''; ?>/> <label for="encryptPass2"><?php echo get_lang('None'); ?></label>
</td>
<?php endif; ?>
<?php } ?>
</tr>
<tr>

@ -250,48 +250,49 @@ function display_addedresource_link($type, $id, $style='')
switch ($type)
{
case 'Agenda':
$TABLEAGENDA = $_course['dbNameGlu'].'calendar_event';
$result = Database::query("SELECT * FROM `$TABLEAGENDA` WHERE id=$id");
$TABLEAGENDA = Database::get_course_table(TABLE_AGENDA,$_course['dbName']);
$result = Database::query("SELECT * FROM $TABLEAGENDA WHERE id=$id");
$myrow = Database::fetch_array($result);
echo '<img src="../img/agenda.gif" align="middle" /> <a href="../calendar/agenda.php"'.$styling.'>'.$myrow['title']."</a><br />\n";
break;
case 'Ad_Valvas':
$tbl_announcement = $_course['dbNameGlu'].'announcement';
$result = Database::query("SELECT * FROM `$tbl_announcement` WHERE id=$id");
$tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT,$_course['dbName']);
$result = Database::query("SELECT * FROM $tbl_announcement WHERE id=$id");
$myrow = Database::fetch_array($result);
echo '<img src="../img/valves.gif" align="middle" /> <a href="../announcements/announcements.php"'.$styling.'>'.$myrow['title']."</a><br />\n";
break;
case 'Link':
$TABLETOOLLINK = $_course['dbNameGlu'].'link';
$result = Database::query("SELECT * FROM `$TABLETOOLLINK` WHERE id=$id");
case 'Link':Database::get_course_table(TABLE_LINK,$_course['dbName']);
$result = Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id");
$myrow = Database::fetch_array($result);
echo '<img src="../img/links.gif" align="middle" /> <a href="#" onclick="javascript:window.open(\'../link/link_goto.php?link_id='.$myrow['id'].'&amp;link_url='.urlencode($myrow['url'])."','MyWindow','width=500,height=400,top='+((screen.height-400)/2)+',left='+((screen.width-500)/2)+',scrollbars=1,resizable=1,menubar=1'); return false;\"".$styling.'>'.$myrow['title']."</a><br />\n";
break;
case 'Exercise':
$TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
$result = Database::query("SELECT * FROM `$TBL_EXERCICES` WHERE id=$id");
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST,$_course['dbName']);
$result = Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id");
$myrow = Database::fetch_array($result);
echo '<img src="../img/quiz.gif" align="middle" /> <a href="../exercice/exercice_submit.php?exerciseId='.$myrow['id'].'"'.$styling.'>'.$myrow['title']."</a><br />\n";
break;
case 'Forum':
$TBL_FORUMS = $_course['dbNameGlu'].'bb_forums';
$result = Database::query("SELECT * FROM `$TBL_FORUMS` WHERE forum_id=$id");
$TBL_FORUMS = Database::get_course_table(TABLE_FORUM,$_course['dbName']);
$result = Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id");
$myrow = Database::fetch_array($result);
echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewforum.php?forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow['forum_name']."</a><br />\n";
break;
case 'Thread': //=topics
//deprecated
$tbl_posts = $_course['dbNameGlu'].'bb_posts';
$tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text';
$TBL_FORUMS = $_course['dbNameGlu'].'bb_forums';
$result = Database::query("SELECT * FROM `$tbl_posts` posts, `$TBL_FORUMS` forum WHERE forum.forum_id=posts.forum_id and post_id=$id");
$result = Database::query("SELECT * FROM $tbl_posts posts, $TBL_FORUMS forum WHERE forum.forum_id=posts.forum_id and post_id=$id");
$myrow = Database::fetch_array($result);
// grabbing the title of the post
$sql_title = "SELECT * FROM `$tbl_posts_text` WHERE post_id=".$myrow["post_id"];
$sql_title = "SELECT * FROM $tbl_posts_text WHERE post_id=".$myrow["post_id"];
$result_title = Database::query($sql_title);
$myrow_title = Database::fetch_array($result_title);
echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$myrow['topic_id'].'&amp;forum='.$myrow['forum_id'].'&amp;md5='.$myrow['md5'].'"'.$styling.'>'.$myrow_title['post_title']."</a><br />\n";
break;
case 'Post':
//deprecated
$tbl_post = Database::get_course_table(TABLE_FORUM_POST);
$tbl_post_text = Database::get_course_table(TOOL_FORUM_POST_TEXT_TABLE);
$sql = "SELECT * FROM $tbl_post p, $tbl_post_text t WHERE p.post_id = t.post_id AND p.post_id = $id";
@ -300,8 +301,8 @@ function display_addedresource_link($type, $id, $style='')
echo '<img src="../img/forum.gif" align="middle" /> <a href="../phpbb/viewtopic.php?topic='.$post->topic_id.'&amp;forum='.$post->forum_id.'"'.$styling.'>'.$post->post_title."</a><br />\n";
break;
case 'Document':
$dbTable = $_course['dbNameGlu'].'document';
$result = Database::query("SELECT * FROM `$dbTable` WHERE id=$id");
$dbTable = Database::get_course_table(TABLE_DOCUMENT,$_course['dbName']);
$result = Database::query("SELECT * FROM $dbTable WHERE id=$id");
$myrow = Database::fetch_array($result);
$pathname = explode('/',$myrow['path']); // making a correct name for the link
$last = count($pathname) - 1; // making a correct name for the link
@ -352,8 +353,8 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
switch ($type)
{
case "Agenda":
$TABLEAGENDA = $_course['dbNameGlu']."calendar_event";
$result = Database::query("SELECT * FROM `$TABLEAGENDA` WHERE id=$id");
$TABLEAGENDA = Database::get_course_table(TABLE_AGENDA,$_course['dbName']);
$result = Database::query("SELECT * FROM $TABLEAGENDA WHERE id=$id");
$myrow=Database::fetch_array($result);
$sql="select * from $tbl_learnpath_item where id=$id_in_path";
@ -401,8 +402,8 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
break;
case "Ad_Valvas":
$tbl_announcement = $_course['dbNameGlu']."announcement";
$result = Database::query("SELECT * FROM `$tbl_announcement` WHERE id=$id");
$tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT,$_course['dbName']);
$result = Database::query("SELECT * FROM $tbl_announcement WHERE id=$id");
$myrow=Database::fetch_array($result);
$sql="select * from $tbl_learnpath_item where id=$id_in_path";
@ -460,8 +461,8 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
break;
case "Link" :
$TABLETOOLLINK = $_course['dbNameGlu']."link";
$result= Database::query("SELECT * FROM `$TABLETOOLLINK` WHERE id=$id");
$TABLETOOLLINK = Database::get_course_table(TABLE_LINK,$_course['dbName']);
$result= Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id");
$myrow=Database::fetch_array($result);
$sql="select * from $tbl_learnpath_item where id=$id_in_path";
@ -518,8 +519,8 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
break;
case "Exercise":
$TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
$result= Database::query("SELECT * FROM `$TBL_EXERCICES` WHERE id=$id");
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST,$_course['dbName']);
$result= Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id");
$myrow=Database::fetch_array($result);
if ($builder=='builder') { $origin='builder'; }
@ -573,9 +574,9 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
break;
case "HotPotatoes":
$TBL_DOCUMENT = $_course['dbNameGlu'].'document';
$TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT,$_course['dbName']);
$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
$result = Database::query("SELECT * FROM `".$TBL_DOCUMENT."` WHERE id=$id");
$result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE id=$id");
$myrow= Database::fetch_array($result);
$path=$myrow["path"];
$name=GetQuizName($path,$documentPath);
@ -631,8 +632,8 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
break;
case "Forum":
$TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
$result= Database::query("SELECT * FROM `$TBL_FORUMS` WHERE forum_id=$id");
$TBL_FORUMS = Database::get_course_table(TABLE_FORUM,$_course['dbName']);
$result= Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id");
$myrow=Database::fetch_array($result);
$sql="select * from $tbl_learnpath_item where id=$id_in_path";
@ -681,10 +682,11 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
break;
case "Thread": //forum post
//deprecated
$tbl_topics = $_course['dbNameGlu'].'bb_topics';
$tbl_posts = $_course['dbNameGlu'].'bb_posts';
$TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
$sql="SELECT * FROM `$tbl_topics` where topic_id=$id";
$sql="SELECT * FROM $tbl_topics where topic_id=$id";
$result= Database::query($sql);
$myrow=Database::fetch_array($result);
@ -733,13 +735,14 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
break;
case "Post":
//deprecated
$tbl_posts = $_course['dbNameGlu'].'bb_posts';
$tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text';
$TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
$result= Database::query("SELECT * FROM `$tbl_posts` where post_id=$id");
$result= Database::query("SELECT * FROM $tbl_posts where post_id=$id");
$myrow=Database::fetch_array($result);
// grabbing the title of the post
$sql_titel="SELECT * FROM `$tbl_posts_text` WHERE post_id=".$myrow["post_id"];
$sql_titel="SELECT * FROM $tbl_posts_text WHERE post_id=".$myrow["post_id"];
$result_titel=Database::query($sql_titel);
$myrow_titel=Database::fetch_array($result_titel);
@ -796,8 +799,8 @@ function display_addedresource_link_in_learnpath($type, $id, $completed, $id_in_
break;
case "Document":
$dbTable = $_course['dbNameGlu']."document";
$result=Database::query("SELECT * FROM `$dbTable` WHERE id=$id");
$dbTable = Database::get_course_table(TABLE_DOCUMENT,$_course['dbName']);
$result=Database::query("SELECT * FROM $dbTable WHERE id=$id");
$myrow=Database::fetch_array($result);
$pathname=explode("/",$myrow["path"]); // making a correct name for the link
@ -1125,8 +1128,8 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
switch ($type)
{
case "Agenda":
$TABLEAGENDA = $_course['dbNameGlu']."calendar_event";
$result = Database::query("SELECT * FROM `$TABLEAGENDA` WHERE id=$id");
$TABLEAGENDA = Database::get_course_table(TABLE_AGENDA,$_course['dbName']);;
$result = Database::query("SELECT * FROM $TABLEAGENDA WHERE id=$id");
$myrow=Database::fetch_array($result);
$sql="select * from $tbl_learnpath_item where id=$id_in_path";
@ -1161,8 +1164,8 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
break;
case "Link" :
$TABLETOOLLINK = $_course['dbNameGlu']."link";
$result= Database::query("SELECT * FROM `$TABLETOOLLINK` WHERE id=$id");
$TABLETOOLLINK = Database::get_course_table(TABLE_LINK,$_course['dbName']);
$result= Database::query("SELECT * FROM $TABLETOOLLINK WHERE id=$id");
$myrow=Database::fetch_array($result);
$sql="select * from $tbl_learnpath_item where id=$id_in_path";
@ -1180,8 +1183,8 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
break;
case "Exercise":
$TBL_EXERCICES = $_course['dbNameGlu'].'quiz';
$result= Database::query("SELECT * FROM `$TBL_EXERCICES` WHERE id=$id");
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST,$_course['dbName']);
$result= Database::query("SELECT * FROM $TBL_EXERCICES WHERE id=$id");
$myrow=Database::fetch_array($result);
if ($builder=='builder') { $origin='builder'; }
@ -1202,9 +1205,9 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
break;
case "HotPotatoes":
$TBL_DOCUMENT = $_course['dbNameGlu'].'document';
$TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT,$_course['dbName']);
$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
$result = Database::query("SELECT * FROM `".$TBL_DOCUMENT."` WHERE id=$id");
$result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE id=$id");
$myrow= Database::fetch_array($result);
$path=$myrow["path"];
$name=GetQuizName($path,$documentPath);
@ -1224,8 +1227,9 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
break;
case "Forum":
$TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
$result= Database::query("SELECT * FROM `$TBL_FORUMS` WHERE forum_id=$id");
//deprecated
$TBL_FORUMS = Database::get_course_table(TABLE_FORUM,$_course['dbName']);
$result= Database::query("SELECT * FROM $TBL_FORUMS WHERE forum_id=$id");
$myrow=Database::fetch_array($result);
if ($builder=='builder') { $origin='builder'; }
@ -1248,10 +1252,11 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
break;
case "Thread": //forum post
//deprecated
$tbl_topics = $_course['dbNameGlu'].'bb_topics';
$tbl_posts = $_course['dbNameGlu'].'bb_posts';
$TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
$sql="SELECT * FROM `$tbl_topics` where topic_id=$id";
$sql="SELECT * FROM $tbl_topics where topic_id=$id";
$result= Database::query($sql);
$myrow=Database::fetch_array($result);
@ -1273,10 +1278,10 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
$tbl_posts = $_course['dbNameGlu'].'bb_posts';
$tbl_posts_text = $_course['dbNameGlu'].'bb_posts_text';
$TBL_FORUMS = $_course['dbNameGlu']."bb_forums";
$result= Database::query("SELECT * FROM `$tbl_posts` where post_id=$id");
$result= Database::query("SELECT * FROM $tbl_posts where post_id=$id");
$myrow=Database::fetch_array($result);
// grabbing the title of the post
$sql_titel="SELECT * FROM `$tbl_posts_text` WHERE post_id=".$myrow["post_id"];
$sql_titel="SELECT * FROM $tbl_posts_text WHERE post_id=".$myrow["post_id"];
$result_titel=Database::query($sql_titel);
$myrow_titel=Database::fetch_array($result_titel);
@ -1303,8 +1308,8 @@ function get_addedresource_link_in_learnpath($type, $id, $id_in_path)
break;
case "Document":
$dbTable = $_course['dbNameGlu']."document";
$result=Database::query("SELECT * FROM `$dbTable` WHERE id=$id",__FILE__,__LINE);
$dbTable = Database::get_course_table(TABLE_DOCUMENT,$_course['dbName']);
$result=Database::query("SELECT * FROM $dbTable WHERE id=$id",__FILE__,__LINE);
$myrow=Database::fetch_array($result);
$pathname=explode("/",$myrow["path"]); // making a correct name for the link
@ -1424,7 +1429,7 @@ function delete_one_added_resource($source_type, $source_id, $resource_type, $re
global $_course;
$TABLERESOURCE = $_course['dbNameGlu']."resource";
$sql="DELETE FROM `$TABLERESOURCE` WHERE source_type='$source_type' and source_id='$source_id' and resource_type='$resource_type' and resource_id='$resource_id'";
$sql="DELETE FROM $TABLERESOURCE WHERE source_type='$source_type' and source_id='$source_id' and resource_type='$resource_type' and resource_id='$resource_id'";
Database::query($sql);
}
*/
@ -1434,9 +1439,9 @@ function delete_one_added_resource($source_type, $source_id, $resource_type, $re
function delete_added_resource($type, $id)
{
global $_course;
$TABLERESOURCE = $_course['dbNameGlu']."resource";
$TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES,$_course['dbName']);
$sql="DELETE FROM `$TABLERESOURCE` WHERE source_type='$type' and source_id='$id'";
$sql="DELETE FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'";
Database::query($sql);
}
@ -1447,9 +1452,9 @@ function delete_added_resource($type, $id)
function delete_all_resources_type($type)
{
global $_course;
$TABLERESOURCE = $_course['dbNameGlu']."resource";
$TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES,$_course['dbName']);
$sql="DELETE FROM `$TABLERESOURCE` WHERE source_type='$type'";
$sql="DELETE FROM $TABLERESOURCE WHERE source_type='$type'";
Database::query($sql);
}
@ -1460,8 +1465,8 @@ function delete_all_resources_type($type)
function check_added_resources($type, $id)
{
global $_course, $origin;
$TABLERESOURCE = $_course['dbNameGlu']."resource";
$sql="SELECT * FROM `$TABLERESOURCE` WHERE source_type='$type' and source_id='$id'";
$TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES,$_course['dbName']);
$sql="SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'";
$result=Database::query($sql);
$number_added=Database::num_rows($result);
if ($number_added<>0)
@ -1478,9 +1483,9 @@ function check_added_resources($type, $id)
function edit_added_resources($type, $id)
{
global $_course;
$TABLERESOURCE = $_course['dbNameGlu']."resource";
$TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES,$_course['dbName']);
$sql="SELECT * FROM `$TABLERESOURCE` WHERE source_type='$type' and source_id=$id";
$sql="SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id=$id";
$result=Database::query($sql);
while ($row=Database::fetch_array($result))
{
@ -1499,9 +1504,9 @@ function edit_added_resources($type, $id)
function update_added_resources($type, $id)
{
global $_course;
$TABLERESOURCE = $_course['dbNameGlu']."resource";
$TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES,$_course['dbName']);
// delete all the added resources for this item in the database;
$sql="DELETE FROM `$TABLERESOURCE` WHERE source_type='$type' AND source_id='$id'";
$sql="DELETE FROM $TABLERESOURCE WHERE source_type='$type' AND source_id='$id'";
//echo $sql;
Database::query($sql);
@ -1521,9 +1526,9 @@ function display_added_resources($type, $id, $style='')
$arr_icons=array('Agenda'=>'../img/agenda.gif', 'Ad Valvas'=>'../img/valves.gif', 'Link'=>'../img/links.gif', 'Exercise'=>'../img/quiz.gif' );
global $_course, $origin;
$TABLERESOURCE = $_course['dbNameGlu']."resource";
$TABLERESOURCE = Database::get_course_table(TABLE_LINKED_RESOURCES,$_course['dbName']);
$sql="SELECT * FROM `$TABLERESOURCE` WHERE source_type='$type' and source_id='$id'";
$sql="SELECT * FROM $TABLERESOURCE WHERE source_type='$type' and source_id='$id'";
$result=Database::query($sql);
while ($row=Database::fetch_array($result))
{

@ -621,10 +621,10 @@ if ($content == "Agenda")
$sql="SELECT agenda.*, toolitemproperties.*
FROM ".$TABLEAGENDA." agenda, ".$TABLE_ITEM_PROPERTY." toolitemproperties
WHERE `agenda`.`id` = `toolitemproperties`.`ref`
AND `toolitemproperties`.`tool`='".TOOL_CALENDAR_EVENT."'
AND `toolitemproperties`.`to_group_id`='0'
AND `toolitemproperties`.`visibility`='1'";
WHERE agenda.id = toolitemproperties.ref
AND toolitemproperties.tool='".TOOL_CALENDAR_EVENT."'
AND toolitemproperties.to_group_id='0'
AND toolitemproperties.visibility='1'";
$result = Database::query($sql);
@ -871,7 +871,7 @@ if (($content == "Exercise") or ($content == "HotPotatoes"))
$uploadPath = "/HotPotatoes_files";
$TBL_DOCUMENT = Database::get_course_table(TABLE_DOCUMENT);
$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
$sql = "SELECT * FROM ".$TBL_DOCUMENT." WHERE (path LIKE '%htm%' OR path LIKE '%html%') AND path LIKE '".$uploadPath."/%/%' ORDER BY `id` ASC";
$sql = "SELECT * FROM ".$TBL_DOCUMENT." WHERE (path LIKE '%htm%' OR path LIKE '%html%') AND path LIKE '".$uploadPath."/%/%' ORDER BY id ASC";
$result = Database::query($sql);
while ($myrow = Database::fetch_array($result))
{
@ -915,7 +915,7 @@ if ($content == "Externallink")
<?php
$tbl_categories = Database::get_course_table(TABLE_LINK_CATEGORY);
$sql = "SELECT * FROM `$tbl_categories` ORDER BY display_order ASC";
$sql = "SELECT * FROM $tbl_categories ORDER BY display_order ASC";
echo $sql;
$result = Database::query($sql);
while ($row = Database::fetch_array($result))

@ -8,8 +8,8 @@ Development information
Display::display_normal_message(print_r($arrLP,1));
DB modifications:
ALTER TABLE `lp_item` ADD `terms` TEXT NULL ;
ALTER TABLE `lp_item` ADD `search_did` INT(10) NULL
ALTER TABLE lp_item ADD terms TEXT NULL ;
ALTER TABLE lp_item ADD search_did INT(10) NULL
-- on every course, so it's pending(TODO):
-- script to generate it for all courses depending of the type of dokeos intalation(one db or many)
-- create it when a course is created

@ -211,7 +211,7 @@ if($is_allowedToTrack && $_configuration['tracking_enabled'])
// last 31 days
$sql = "SELECT count(*)
FROM $TABLETRACK_ACCESS
WHERE `access_cours_code` = '$_cid'
WHERE access_cours_code = '$_cid'
AND (access_date > DATE_ADD(CURDATE(), INTERVAL -31 DAY))
AND access_tool IS NULL";
$count = getOneResult($sql);
@ -221,7 +221,7 @@ if($is_allowedToTrack && $_configuration['tracking_enabled'])
// last 7 days
$sql = "SELECT count(*)
FROM $TABLETRACK_ACCESS
WHERE `access_cours_code` = '$_cid'
WHERE access_cours_code = '$_cid'
AND (access_date > DATE_ADD(CURDATE(), INTERVAL -7 DAY))
AND access_tool IS NULL";
$count = getOneResult($sql);
@ -231,7 +231,7 @@ if($is_allowedToTrack && $_configuration['tracking_enabled'])
// today
$sql = "SELECT count(*)
FROM $TABLETRACK_ACCESS
WHERE `access_cours_code` = '$_cid'
WHERE access_cours_code = '$_cid'
AND ( access_date > CURDATE() )
AND access_tool IS NULL";
$count = getOneResult($sql);
@ -252,11 +252,11 @@ if($is_allowedToTrack && $_configuration['tracking_enabled'])
$title_line = get_lang('ToolTitleToolnameColumn').";".get_lang('ToolTitleUsersColumn').";".get_lang('ToolTitleCountColumn')."\n";
$sql = "SELECT `access_tool`, COUNT(DISTINCT `access_user_id`),count( `access_tool` )
$sql = "SELECT access_tool, COUNT(DISTINCT access_user_id),count( access_tool )
FROM $TABLETRACK_ACCESS
WHERE `access_tool` IS NOT NULL
AND `access_cours_code` = '$_cid'
GROUP BY `access_tool`";
WHERE access_tool IS NOT NULL
AND access_cours_code = '$_cid'
GROUP BY access_tool";
$results = getManyResults3Col($sql);
@ -283,11 +283,11 @@ if($is_allowedToTrack && $_configuration['tracking_enabled'])
$tempView[3] = '0';
$sql = "SELECT `cl`.`title`, `cl`.`url`,count(DISTINCT `sl`.`links_user_id`), count(`cl`.`title`)
$sql = "SELECT cl.title, cl.url,count(DISTINCT sl.links_user_id), count(cl.title)
FROM $TABLETRACK_LINKS AS sl, $TABLECOURSE_LINKS AS cl
WHERE `sl`.`links_link_id` = `cl`.`id`
AND `sl`.`links_cours_id` = '$_cid'
GROUP BY `cl`.`title`, `cl`.`url`";
WHERE sl.links_link_id = cl.id
AND sl.links_cours_id = '$_cid'
GROUP BY cl.title, cl.url";
$results = getManyResultsXCol($sql,4);
@ -318,10 +318,10 @@ if($is_allowedToTrack && $_configuration['tracking_enabled'])
$tempView[4] = '0';
$sql = "SELECT `down_doc_path`, COUNT(DISTINCT `down_user_id`), COUNT(`down_doc_path`)
$sql = "SELECT down_doc_path, COUNT(DISTINCT down_user_id), COUNT(down_doc_path)
FROM $TABLETRACK_DOWNLOADS
WHERE `down_cours_id` = '$_cid'
GROUP BY `down_doc_path`";
WHERE down_cours_id = '$_cid'
GROUP BY down_doc_path";
$results = getManyResults3Col($sql);

@ -38,7 +38,7 @@ td {border-bottom: thin dashed gray;}
/*]]>*/
</style>";
//@todo use Database library
$TABLETRACK_ACCESS = $_configuration['statistics_database']."`.`track_e_access";
$TABLETRACK_ACCESS = $_configuration['statistics_database'].".track_e_access";
Display::display_header($nameTools,"Tracking");
include(api_get_path(LIBRARY_PATH)."statsUtils.lib.inc.php");
@ -148,61 +148,61 @@ $is_allowedToTrack = $is_courseAdmin;
{
// all days
case "year" :
$sql = "SELECT UNIX_TIMESTAMP( `access_date` )
FROM `$TABLETRACK_ACCESS`
WHERE YEAR( `access_date` ) = YEAR( FROM_UNIXTIME( '$reqdate' ) )
AND `access_cours_code` = '$_cid'
AND `access_tool` IS NULL ";
$sql = "SELECT UNIX_TIMESTAMP( access_date )
FROM $TABLETRACK_ACCESS
WHERE YEAR( access_date ) = YEAR( FROM_UNIXTIME( '$reqdate' ) )
AND access_cours_code = '$_cid'
AND access_tool IS NULL ";
if($displayType == "month")
{
$sql .= "ORDER BY UNIX_TIMESTAMP( `access_date`)";
$sql .= "ORDER BY UNIX_TIMESTAMP( access_date)";
$month_array = monthTab($sql);
makeHitsTable($month_array,get_lang('PeriodMonth'));
}
elseif($displayType == "day")
{
$sql .= "ORDER BY DAYOFYEAR( `access_date`)";
$sql .= "ORDER BY DAYOFYEAR( access_date)";
$days_array = daysTab($sql);
makeHitsTable($days_array,get_lang('PeriodDay'));
}
else // by hours by default
{
$sql .= "ORDER BY HOUR( `access_date`)";
$sql .= "ORDER BY HOUR( access_date)";
$hours_array = hoursTab($sql);
makeHitsTable($hours_array,get_lang('PeriodHour'));
}
break;
// all days
case "month" :
$sql = "SELECT UNIX_TIMESTAMP( `access_date` )
FROM `$TABLETRACK_ACCESS`
WHERE MONTH(`access_date`) = MONTH (FROM_UNIXTIME( '$reqdate' ) )
AND YEAR( `access_date` ) = YEAR( FROM_UNIXTIME( '$reqdate' ) )
AND `access_cours_code` = '$_cid'
AND `access_tool` IS NULL ";
$sql = "SELECT UNIX_TIMESTAMP( access_date )
FROM $TABLETRACK_ACCESS
WHERE MONTH(access_date) = MONTH (FROM_UNIXTIME( '$reqdate' ) )
AND YEAR( access_date ) = YEAR( FROM_UNIXTIME( '$reqdate' ) )
AND access_cours_code = '$_cid'
AND access_tool IS NULL ";
if($displayType == "day")
{
$sql .= "ORDER BY DAYOFYEAR( `access_date`)";
$sql .= "ORDER BY DAYOFYEAR( access_date)";
$days_array = daysTab($sql);
makeHitsTable($days_array,get_lang('PeriodDay'));
}
else // by hours by default
{
$sql .= "ORDER BY HOUR( `access_date`)";
$sql .= "ORDER BY HOUR( access_date)";
$hours_array = hoursTab($sql);
makeHitsTable($hours_array,get_lang('PeriodHour'));
}
break;
// all hours
case "day" :
$sql = "SELECT UNIX_TIMESTAMP( `access_date` )
FROM `$TABLETRACK_ACCESS`
WHERE DAYOFMONTH(`access_date`) = DAYOFMONTH(FROM_UNIXTIME( '$reqdate' ) )
AND MONTH(`access_date`) = MONTH (FROM_UNIXTIME( '$reqdate' ) )
AND YEAR( `access_date` ) = YEAR( FROM_UNIXTIME( '$reqdate' ) )
AND `access_cours_code` = '$_cid'
AND `access_tool` IS NULL
ORDER BY HOUR( `access_date` )";
$sql = "SELECT UNIX_TIMESTAMP( access_date )
FROM $TABLETRACK_ACCESS
WHERE DAYOFMONTH(access_date) = DAYOFMONTH(FROM_UNIXTIME( '$reqdate' ) )
AND MONTH(access_date) = MONTH (FROM_UNIXTIME( '$reqdate' ) )
AND YEAR( access_date ) = YEAR( FROM_UNIXTIME( '$reqdate' ) )
AND access_cours_code = '$_cid'
AND access_tool IS NULL
ORDER BY HOUR( access_date )";
$hours_array = hoursTab($sql,$reqdate);
makeHitsTable($hours_array,get_lang('PeriodHour'));
break;

@ -80,19 +80,19 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
{
if( $is_allowedToTrackEverybodyInCourse )
{
$sql = "SELECT `u`.`firstname`,`u`.`lastname`, `u`.`email`
$sql = "SELECT u.firstname,u.lastname, u.email
FROM $TABLECOURSUSER cu , $TABLEUSER u
WHERE `cu`.`user_id` = `u`.`user_id` AND cu.relation_type<>".COURSE_RELATION_TYPE_RRHH."
AND `cu`.`course_code` = '$_cid'
AND `u`.`user_id` = '$uInfo'";
WHERE cu.user_id = u.user_id AND cu.relation_type<>".COURSE_RELATION_TYPE_RRHH."
AND cu.course_code = '$_cid'
AND u.user_id = '$uInfo'";
}
else
{
$sql = "SELECT `u`.`firstname`,`u`.`lastname`, `u`.`email`
$sql = "SELECT u.firstname,u.lastname, u.email
FROM $TABLECOURSE_GROUPSUSER gu , $TABLEUSER u
WHERE `gu`.`user_id` = `u`.`user_id`
AND `gu`.`group_id` = '$_gid'
AND `u`.`user_id` = '$uInfo'";
WHERE gu.user_id = u.user_id
AND gu.group_id = '$_gid'
AND u.user_id = '$uInfo'";
}
$query = Database::query($sql);
$res = @Database::fetch_array($query);
@ -153,25 +153,25 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
switch($period)
{
case "month" :
$sql = "SELECT `access_date`
$sql = "SELECT access_date
FROM $TABLETRACK_ACCESS
WHERE `access_user_id` = '$uInfo'
AND `access_cours_code` = '".$_cid."'
AND MONTH(`access_date`) = MONTH( FROM_UNIXTIME('$reqdate') )
AND YEAR(`access_date`) = YEAR(FROM_UNIXTIME('$reqdate'))
GROUP BY DAYOFMONTH(`access_date`)
ORDER BY `access_date` ASC";
WHERE access_user_id = '$uInfo'
AND access_cours_code = '".$_cid."'
AND MONTH(access_date) = MONTH( FROM_UNIXTIME('$reqdate') )
AND YEAR(access_date) = YEAR(FROM_UNIXTIME('$reqdate'))
GROUP BY DAYOFMONTH(access_date)
ORDER BY access_date ASC";
$displayedDate = $MonthsLong[date("n", $reqdate)-1].date(" Y", $reqdate);
break;
case "week" :
$sql = "SELECT `access_date`
$sql = "SELECT access_date
FROM $TABLETRACK_ACCESS
WHERE `access_user_id` = '$uInfo'
AND `access_cours_code` = '".$_cid."'
AND WEEK(`access_date`) = WEEK( FROM_UNIXTIME('$reqdate') )
AND YEAR(`access_date`) = YEAR(FROM_UNIXTIME('$reqdate'))
GROUP BY DAYOFMONTH(`access_date`)
ORDER BY `access_date` ASC";
WHERE access_user_id = '$uInfo'
AND access_cours_code = '".$_cid."'
AND WEEK(access_date) = WEEK( FROM_UNIXTIME('$reqdate') )
AND YEAR(access_date) = YEAR(FROM_UNIXTIME('$reqdate'))
GROUP BY DAYOFMONTH(access_date)
ORDER BY access_date ASC";
$weeklowreqdate = ($reqdate-(86400*date("w" , $reqdate)));
$weekhighreqdate = ($reqdate+(86400*(6-date("w" , $reqdate)) ));
$displayedDate = get_lang('From')." ".date("d " , $weeklowreqdate).$MonthsLong[date("n", $weeklowreqdate)-1].date(" Y" , $weeklowreqdate)
@ -198,15 +198,15 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
$limit = $results[$j+1];
// select all access to tool between displayed date and next displayed date or now() if
// displayed date is the last login date
$sql = "SELECT `access_tool`, count(`access_tool`)
$sql = "SELECT access_tool, count(access_tool)
FROM $TABLETRACK_ACCESS
WHERE `access_user_id` = '$uInfo'
AND `access_tool` IS NOT NULL
AND `access_date` > '".$results[$j]."'
AND `access_date` < '".$limit."'
AND `access_cours_code` = '".$_cid."'
GROUP BY `access_tool`
ORDER BY `access_tool` ASC";
WHERE access_user_id = '$uInfo'
AND access_tool IS NOT NULL
AND access_date > '".$results[$j]."'
AND access_date < '".$limit."'
AND access_cours_code = '".$_cid."'
GROUP BY access_tool
ORDER BY access_tool ASC";
$results2 = getManyResults2Col($sql);
if (is_array($results2))

@ -46,11 +46,11 @@ td {border-bottom: thin dashed gray;}
$view = preg_replace('/[^01]/','',$_REQUEST['view']);
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TABLETRACK_ACCESS = $_configuration['statistics_database']."`.`track_e_access";
$TABLETRACK_LINKS = $_configuration['statistics_database']."`.`track_e_links";
$TABLETRACK_DOWNLOADS = $_configuration['statistics_database']."`.`track_e_downloads";
$TABLETRACK_LOGIN = $_configuration['statistics_database']."`.`track_e_login";
$TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices";
$TABLETRACK_ACCESS = $_configuration['statistics_database'].".track_e_access";
$TABLETRACK_LINKS = $_configuration['statistics_database'].".track_e_links";
$TABLETRACK_DOWNLOADS = $_configuration['statistics_database'].".track_e_downloads";
$TABLETRACK_LOGIN = $_configuration['statistics_database'].".track_e_login";
$TABLETRACK_EXERCICES = $_configuration['statistics_database'].".track_e_exercices";
$limitOfDisplayedLogins = 25; // number of logins to display
@ -99,10 +99,10 @@ if ( $_configuration['tracking_enabled'] )
[<a href='".api_get_self()."?view=".$tempView."'>".get_lang('Close')."</a>]
</td>
</tr>";
$sql = "SELECT `login_date`
FROM `".$TABLETRACK_LOGIN."`
WHERE `login_user_id` = '".$_user['user_id']."'
ORDER BY `login_date` DESC
$sql = "SELECT login_date
FROM ".$TABLETRACK_LOGIN."
WHERE login_user_id = '".$_user['user_id']."'
ORDER BY login_date DESC
LIMIT ".$limitOfDisplayedLogins."";
echo "<tr><td style='padding-left : 40px;' valign='top'>".get_lang('LoginsExplaination')."<br/>";
$results = getManyResults1Col($sql);
@ -129,9 +129,9 @@ if ( $_configuration['tracking_enabled'] )
$sql = "SELECT `access_tool`, count(access_tool), `access_cours_code`
FROM `".$TABLETRACK_ACCESS."`
WHERE `access_user_id` = '".$_user['user_id']."'".
$sql = "SELECT access_tool, count(access_tool), access_cours_code
FROM $TABLETRACK_ACCESS
WHERE access_user_id = '".$_user['user_id']."'".
//AND access_tool IS NOT NULL
"AND access_date > '".$value."'
AND access_date < '".$previousDate."'
@ -217,11 +217,11 @@ if ( $_configuration['tracking_enabled'] )
</tr>
";
echo " Ceci est amen etre dplac vers la page de garde des exercices ";
$sql = "SELECT `ce`.`title`, `te`.`exe_result` , `te`.`exe_weighting`, `te`.`exe_date`
FROM `$TABLECOURSE_EXERCICES` AS ce , `$TABLETRACK_EXERCICES` AS te
WHERE `te`.`exe_user_id` = '".$_user['user_id']."'
AND `te`.`exe_exo_id` = `ce`.`id`
ORDER BY `te`.`exe_cours_id` ASC, `ce`.`title` ASC, `te`.`exe_date`ASC";
$sql = "SELECT ce.title, te.exe_result , te.exe_weighting, te.exe_date
FROM $TABLECOURSE_EXERCICES AS ce , $TABLETRACK_EXERCICES AS te
WHERE te.exe_user_id = '".$_user['user_id']."'
AND te.exe_exo_id = ce.id
ORDER BY te.exe_cours_id ASC, ce.title ASC, te.exe_date ASC";
echo "<tr><td style='padding-left : 40px;padding-right : 40px;'>";
$results = getManyResultsXCol($sql,4);

@ -74,13 +74,13 @@ $reqdate=$_REQUEST['reqdate'];
<?php
$TABLETRACK_ACCESS = $_configuration['statistics_database']."`.`track_e_access";
$TABLETRACK_ACCESS = $_configuration['statistics_database'].".track_e_access";
if(isset($_cid)) //stats for the current course
{
// to see stats of one course user must be courseAdmin of this course
$is_allowedToTrack = $is_courseAdmin;
$courseCodeEqualcidIfNeeded = "AND `access_cours_code` = '$_cid'";
$courseCodeEqualcidIfNeeded = "AND access_cours_code = '$_cid'";
}
else // stats for all courses
{
@ -93,11 +93,11 @@ $reqdate=$_REQUEST['reqdate'];
// list of all tools
if (!isset($tool))
{
$sql = "SELECT `access_tool`, count( access_tool )
FROM `$TABLETRACK_ACCESS`
WHERE `access_tool` IS NOT NULL
".$courseCodeEqualcidIfNeeded."
GROUP BY `access_tool`";
$sql = "SELECT access_tool, count( access_tool )
FROM $TABLETRACK_ACCESS
WHERE access_tool IS NOT NULL
$courseCodeEqualcidIfNeeded
GROUP BY access_tool";
echo "<tr><td>";
echo "<tr>
<td>
@ -229,39 +229,39 @@ $reqdate=$_REQUEST['reqdate'];
{
// all days
case "month" :
$sql = "SELECT UNIX_TIMESTAMP(`access_date`)
FROM `$TABLETRACK_ACCESS`
WHERE `access_tool` = '$tool'
".$courseCodeEqualcidIfNeeded."
AND MONTH(`access_date`) = MONTH(FROM_UNIXTIME('$reqdate'))
AND YEAR(`access_date`) = YEAR(FROM_UNIXTIME('$reqdate'))
ORDER BY `access_date` ASC";
$sql = "SELECT UNIX_TIMESTAMP(access_date)
FROM $TABLETRACK_ACCESS
WHERE access_tool = '$tool'
$courseCodeEqualcidIfNeeded
AND MONTH(access_date) = MONTH(FROM_UNIXTIME('$reqdate'))
AND YEAR(access_date) = YEAR(FROM_UNIXTIME('$reqdate'))
ORDER BY access_date ASC";
$days_array = daysTab($sql);
makeHitsTable($days_array,$langDay);
break;
// all days
case "week" :
$sql = "SELECT UNIX_TIMESTAMP(`access_date`)
FROM `$TABLETRACK_ACCESS`
WHERE `access_tool` = '$tool'
".$courseCodeEqualcidIfNeeded."
AND WEEK(`access_date`) = WEEK(FROM_UNIXTIME('$reqdate'))
AND YEAR(`access_date`) = YEAR(FROM_UNIXTIME('$reqdate'))
ORDER BY `access_date` ASC";
$sql = "SELECT UNIX_TIMESTAMP(access_date)
FROM $TABLETRACK_ACCESS
WHERE access_tool = '$tool'
$courseCodeEqualcidIfNeeded
AND WEEK(access_date) = WEEK(FROM_UNIXTIME('$reqdate'))
AND YEAR(access_date) = YEAR(FROM_UNIXTIME('$reqdate'))
ORDER BY access_date ASC";
$days_array = daysTab($sql);
makeHitsTable($days_array,$langDay);
break;
// all hours
case "day" :
$sql = "SELECT UNIX_TIMESTAMP(`access_date`)
FROM `$TABLETRACK_ACCESS`
WHERE `access_tool` = '$tool'
".$courseCodeEqualcidIfNeeded."
AND DAYOFYEAR(`access_date`) = DAYOFYEAR(FROM_UNIXTIME('$reqdate'))
AND YEAR(`access_date`) = YEAR(FROM_UNIXTIME('$reqdate'))
ORDER BY `access_date` ASC";
$sql = "SELECT UNIX_TIMESTAMP(access_date)
FROM $TABLETRACK_ACCESS
WHERE access_tool = '$tool'
$courseCodeEqualcidIfNeeded
AND DAYOFYEAR(access_date) = DAYOFYEAR(FROM_UNIXTIME('$reqdate'))
AND YEAR(access_date) = YEAR(FROM_UNIXTIME('$reqdate'))
ORDER BY access_date ASC";
$hours_array = hoursTab($sql,$reqdate);
makeHitsTable($hours_array,$langHour);
@ -280,11 +280,6 @@ $reqdate=$_REQUEST['reqdate'];
echo get_lang('NotAllowed');
}
}
?>
</table>
<?php
echo '</table>';
// footer
Display::display_footer();
?>
Display::display_footer();

@ -75,12 +75,12 @@ $TABLEUSER = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$TABLETRACK_ACCESS = $_configuration['statistics_database']."`.`track_e_access";
$TABLETRACK_LINKS = $_configuration['statistics_database']."`.`track_e_links";
$TABLETRACK_LOGIN = $_configuration['statistics_database']."`.`track_e_login";
$TABLETRACK_DOWNLOADS = $_configuration['statistics_database']."`.`track_e_downloads";
$TABLETRACK_UPLOADS = $_configuration['statistics_database']."`.`track_e_uploads";
$TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices";
$TABLETRACK_ACCESS = $_configuration['statistics_database'].".track_e_access";
$TABLETRACK_LINKS = $_configuration['statistics_database'].".track_e_links";
$TABLETRACK_LOGIN = $_configuration['statistics_database'].".track_e_login";
$TABLETRACK_DOWNLOADS = $_configuration['statistics_database'].".track_e_downloads";
$TABLETRACK_UPLOADS = $_configuration['statistics_database'].".track_e_uploads";
$TABLETRACK_EXERCICES = $_configuration['statistics_database'].".track_e_exercices";
$TABLECOURSE_LINKS = Database::get_course_table(TABLE_LINK);
$TABLECOURSE_WORK = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
@ -242,7 +242,7 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
// check if user is in the group of this tutor
$sql = "SELECT u.firstname,u.lastname, u.email
FROM $TABLECOURSE_GROUPSUSER gu , $TABLEUSER u
WHERE gu.user_id = u.user_id`
WHERE gu.user_id = u.user_id
AND gu.group_id = '".Database::escape_string($_gid)."'
AND u.user_id = '".Database::escape_string($uInfo)."'";
$query = Database::query($sql);

@ -64,13 +64,13 @@ $TABLEUSER = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$TABLETRACK_ACCESS = $_configuration['statistics_database']."`.`track_e_access";
$TABLETRACK_LINKS = $_configuration['statistics_database']."`.`track_e_links";
$TABLETRACK_LOGIN = $_configuration['statistics_database']."`.`track_e_login";
$TABLETRACK_DOWNLOADS = $_configuration['statistics_database']."`.`track_e_downloads";
$TABLETRACK_UPLOADS = $_configuration['statistics_database']."`.`track_e_uploads";
$TABLETRACK_EXERCICES = $_configuration['statistics_database']."`.`track_e_exercices";
$TABLETRACK_HOTPOTATOES = $_configuration['statistics_database']."`.`track_e_hotpotatoes";
$TABLETRACK_ACCESS = $_configuration['statistics_database'].".track_e_access";
$TABLETRACK_LINKS = $_configuration['statistics_database'].".track_e_links";
$TABLETRACK_LOGIN = $_configuration['statistics_database'].".track_e_login";
$TABLETRACK_DOWNLOADS = $_configuration['statistics_database'].".track_e_downloads";
$TABLETRACK_UPLOADS = $_configuration['statistics_database'].".track_e_uploads";
$TABLETRACK_EXERCICES = $_configuration['statistics_database'].".track_e_exercices";
$TABLETRACK_HOTPOTATOES = $_configuration['statistics_database'].".track_e_hotpotatoes";
$TABLECOURSE_LINKS = Database::get_course_table(TABLE_LINK);
$TABLECOURSE_WORK = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
@ -136,12 +136,12 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
if(api_get_setting('use_session_mode')) {
$sql = "SELECT count(user_id)
FROM $TABLECOURSUSER
WHERE `course_code` = '$_cid' AND relation_type<>".COURSE_RELATION_TYPE_RRHH."";
WHERE course_code = '$_cid' AND relation_type<>".COURSE_RELATION_TYPE_RRHH."";
}
else {
$sql = "SELECT count(id_user)
FROM $tbl_session_course_user
WHERE `course_code` = '$_cid'";
WHERE course_code = '$_cid'";
}
}
else
@ -149,7 +149,7 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
// if user can only track one group : list users of this group
$sql = "SELECT count(user)
FROM $TABLECOURSE_GROUPSUSER
WHERE `group_id` = '$_gid'";
WHERE group_id = '$_gid'";
}
$userGroupNb = getOneResult($sql);
$step = 25; // number of student per page
@ -186,19 +186,19 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
if( $is_allowedToTrackEverybodyInCourse )
{
// list of users in this course
$sql = "SELECT `u`.`user_id`, `u`.`firstname`,`u`.`lastname`
$sql = "SELECT u.user_id, u.firstname,u.lastname
FROM $TABLECOURSUSER cu , $TABLEUSER u
WHERE `cu`.`user_id` = `u`.`user_id` AND cu.relation_type<>".COURSE_RELATION_TYPE_RRHH."
AND `cu`.`course_code` = '$_cid'
WHERE cu.user_id = u.user_id AND cu.relation_type<>".COURSE_RELATION_TYPE_RRHH."
AND cu.course_code = '$_cid'
LIMIT $offset,$step";
}
else
{
// list of users of this group
$sql = "SELECT `u`.`user_id`, `u`.`firstname`,`u`.`lastname`
$sql = "SELECT u.user_id, u.firstname,u.lastname
FROM $TABLECOURSE_GROUPSUSER gu , $TABLEUSER u
WHERE `gu`.`user_id` = `u`.`user_id`
AND `gu`.`group_id` = '$_gid'
WHERE gu.user_id = u.user_id
AND gu.group_id = '$_gid'
LIMIT $offset,$step";
}
$list_users = getManyResults3Col($sql);
@ -224,11 +224,11 @@ if( ( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse ) && $_configura
else
{
// check if user is in the group of this tutor
$sql = "SELECT `u`.`firstname`,`u`.`lastname`, `u`.`email`
$sql = "SELECT u.firstname,u.lastname, u.email
FROM $TABLECOURSE_GROUPSUSER gu , $TABLEUSER u
WHERE `gu`.`user_id` = `u`.`user_id`
AND `gu`.`group_id` = '$_gid'
AND `u`.`user_id` = '$uInfo'";
WHERE gu.user_id = u.user_id
AND gu.group_id = '$_gid'
AND u.user_id = '$uInfo'";
$query = Database::query($sql);
$tracked_user_info = @Database::fetch_assoc($query);
if(is_array($tracked_user_info)) $tracking_is_accepted = true;

@ -56,7 +56,7 @@ class TestStats extends UnitTestCase {
function testdecodeOpenInfos() { // 3 excepciones
//ob_start();
global $_course, $TABLETRACK_OPEN, $_configuration;
$TABLETRACK_OPEN = $_configuration['statistics_database']."`.`track_e_open";
$TABLETRACK_OPEN = $_configuration['statistics_database'].".track_e_open";
$ignore = ignore_user_abort();
$res=decodeOpenInfos();
//ob_end_clean();
@ -101,7 +101,7 @@ class TestStats extends UnitTestCase {
function testfillCountriesTable() {
global $TABLESTATS_COUNTRIES,$_configuration;
$TABLESTATS_COUNTRIES = $_configuration['statistics_database']."`.`track_c_countries";
$TABLESTATS_COUNTRIES = $_configuration['statistics_database'].".track_c_countries";
$countries_array=array();
$res=fillCountriesTable($countries_array);
$this->assertTrue(is_null($res));
@ -140,7 +140,7 @@ class TestStats extends UnitTestCase {
function testloadCountries() {
global $TABLESTATS_COUNTRIES,$_configuration;
$TABLESTATS_COUNTRIES = $_configuration['statistics_database']."`.`track_c_countries";
$TABLESTATS_COUNTRIES = $_configuration['statistics_database'].".track_c_countries";
$res=loadCountries();
if (!is_null($res)){
$this->assertTrue(is_array($res));

Loading…
Cancel
Save