skala
Juan Carlos Raña 16 years ago
commit 4fbe08ccd8
  1. 48
      main/admin/add_users_to_group.php
  2. 2
      main/admin/add_users_to_session.php
  3. 2
      main/admin/course_add.php
  4. 4
      main/admin/group_list.php
  5. 6
      main/admin/user_fields_add.php
  6. 12
      main/css/blue_lagoon/default.css
  7. 4
      main/exercice/exercice.php
  8. 4
      main/exercice/exercise.class.php
  9. 8
      main/gradebook/gradebook.php
  10. 10
      main/gradebook/index.php
  11. BIN
      main/img/unknown_50_50.jpg
  12. BIN
      main/img/unknown_group.png
  13. BIN
      main/img/userfield_user_tag.png
  14. 111
      main/inc/lib/group_portal_manager.lib.php
  15. 13
      main/inc/lib/usermanager.lib.php
  16. 5
      main/newscorm/learnpath.class.php
  17. 10
      main/social/groups.php
  18. 6
      main/social/select_options.php
  19. 36
      main/tracking/courseLog.php

@ -39,7 +39,7 @@ $tbl_group_rel_user = Database::get_main_table(TABLE_MAIN_USER_REL_GROUP);
$tool_name = get_lang('SubscribeUsersToGroup'); $tool_name = get_lang('SubscribeUsersToGroup');
$group_id = intval($_GET['id']); $group_id = intval($_GET['id']);
$add_type = 'single'; $add_type = 'multiple';
if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){ if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
$add_type = Security::remove_XSS($_REQUEST['add_type']); $add_type = Security::remove_XSS($_REQUEST['add_type']);
} }
@ -210,12 +210,16 @@ if($_POST['form_sent']) {
$UserList = $_POST['sessionUsersList']; $UserList = $_POST['sessionUsersList'];
$ClassList = $_POST['sessionClassesList']; $ClassList = $_POST['sessionClassesList'];
$group_id = intval($_POST['id']);
if(!is_array($UserList)) { if(!is_array($UserList)) {
$UserList=array(); $UserList=array();
} }
if ($form_sent == 1) { if ($form_sent == 1) {
//added a parameter to send emails when registering a user $result = GroupPortalManager::add_users_to_groups($UserList, array($group_id));
//SessionManager::suscribe_users_to_session($id_session,$UserList,true,true); //SessionManager::suscribe_users_to_session($id_session,$UserList,true,true);
//adding the session to the access_url_rel_session table //adding the session to the access_url_rel_session table
@ -333,13 +337,11 @@ if ($ajax_search) {
ON $tbl_session_rel_user.id_user = u.user_id AND id_session = '$id_session' ON $tbl_session_rel_user.id_user = u.user_id AND id_session = '$id_session'
$where_filter $where_filter
$order_clause"; $order_clause";
} else { } else {
$sql="SELECT u.user_id, lastname, firstname, username, group_id $sql="SELECT u.user_id, lastname, firstname, username, group_id
FROM $tbl_user u FROM $tbl_user u
LEFT JOIN $tbl_group_rel_user gu LEFT JOIN $tbl_group_rel_user gu
ON (gu.user_id = u.user_id) WHERE gu.group_id = $group_id ON (gu.user_id = u.user_id) AND gu.group_id = $group_id
$order_clause"; $order_clause";
} }
@ -364,13 +366,13 @@ if ($ajax_search) {
if($user['group_id'] != $group_id) if($user['group_id'] != $group_id)
$nosessionUsersList[$user['user_id']] = $user ; $nosessionUsersList[$user['user_id']] = $user ;
} }
var_dump($nosessionUsersList);
$user_anonymous=api_get_anonymous_id(); $user_anonymous=api_get_anonymous_id();
/* foreach($nosessionUsersList as $key_user_list =>$value_user_list) { foreach($nosessionUsersList as $key_user_list =>$value_user_list) {
if ($nosessionUsersList[$key_user_list]['user_id']==$user_anonymous) { if ($nosessionUsersList[$key_user_list]['user_id']==$user_anonymous) {
unset($nosessionUsersList[$key_user_list]); unset($nosessionUsersList[$key_user_list]);
} }
}*/ }
//filling the correct users in list //filling the correct users in list
$sql="SELECT u.user_id, lastname, firstname, username, group_id $sql="SELECT u.user_id, lastname, firstname, username, group_id
@ -392,6 +394,7 @@ if ($ajax_search) {
$order_clause"; $order_clause";
} }
} }
$result=Database::query($sql,__FILE__,__LINE__); $result=Database::query($sql,__FILE__,__LINE__);
$Users=Database::store_result($result); $Users=Database::store_result($result);
@ -411,25 +414,21 @@ if ($ajax_search) {
} }
if ($add_type == 'multiple') { if ($add_type == 'multiple') {
//$link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=unique">'.Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>'; $link_add_type_unique = '<a href="'.api_get_self().'?id='.$group_id.'&add='.Security::remove_XSS($_GET['add']).'&add_type=unique">'.Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>';
//$link_add_type_multiple = Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple'); $link_add_type_multiple = Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple');
} else { } else {
//$link_add_type_unique = Display::return_icon('single.gif').get_lang('SessionAddTypeUnique'); $link_add_type_unique = Display::return_icon('single.gif').get_lang('SessionAddTypeUnique');
//$link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>'; $link_add_type_multiple = '<a href="'.api_get_self().'?id='.$group_id.'&add='.Security::remove_XSS($_GET['add']).'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>';
/*
* <div class="actions">
<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
</div>
*/
} }
?> ?>
<div class="actions">
<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
</div>
<?php echo '<div class="row"><div class="form_header">'.$tool_name.' ('.$session_info['name'].')</div></div><br/>'; ?> <?php echo '<div class="row"><div class="form_header">'.$tool_name.' ('.$session_info['name'].')</div></div><br/>'; ?>
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo Security::remove_XSS($_GET['page']); ?>&id_session=<?php echo $id_session; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $group_id; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
<?php <?php
if ($add_type=='multiple') { if ($add_type=='multiple') {
@ -461,6 +460,7 @@ if ($add_type=='multiple') {
?> ?>
<input type="hidden" name="form_sent" value="1" /> <input type="hidden" name="form_sent" value="1" />
<input type="hidden" name="id" value="<?=$group_id?>" />
<input type="hidden" name="add_type" /> <input type="hidden" name="add_type" />
<?php <?php
@ -537,7 +537,7 @@ if(!empty($errorMsg)) {
<?php <?php
} }
?> ?>
<br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br />
</td> </td>
<td align="center"> <td align="center">
<select id="destination_users" name="sessionUsersList[]" multiple="multiple" size="15" style="width:360px;"> <select id="destination_users" name="sessionUsersList[]" multiple="multiple" size="15" style="width:360px;">
@ -559,13 +559,7 @@ unset($sessionUsersList);
<td colspan="3" align="center"> <td colspan="3" align="center">
<br /> <br />
<?php <?php
if(isset($_GET['add'])) {
echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('FinishSessionCreation').'</button>';
} else {
//@todo see that the call to "valide()" doesn't duplicate the onsubmit of the form (necessary to avoid delete on "enter" key pressed)
echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('SubscribeUsersToGroup').'</button>'; echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('SubscribeUsersToGroup').'</button>';
}
?> ?>
</td> </td>
</tr> </tr>

@ -373,7 +373,7 @@ if ($ajax_search) {
$order_clause"; $order_clause";
} }
} }
echo $sql;
$result=Database::query($sql,__FILE__,__LINE__); $result=Database::query($sql,__FILE__,__LINE__);
$Users=Database::store_result($result); $Users=Database::store_result($result);
//var_dump($_REQUEST['id_session']); //var_dump($_REQUEST['id_session']);

@ -74,8 +74,8 @@ $form->applyFilter('title','trim');
$form->add_textfield( 'visual_code', get_lang('CourseCode'),false,array('size'=>'20','maxlength'=>20)); $form->add_textfield( 'visual_code', get_lang('CourseCode'),false,array('size'=>'20','maxlength'=>20));
$form->applyFilter('visual_code','api_strtoupper'); $form->applyFilter('visual_code','api_strtoupper');
$form->applyFilter('visual_code','html_filter'); $form->applyFilter('visual_code','html_filter');
$form->addRule('visual_code',get_lang('Max'),'maxlength',$maxlength);
$form->addRule('wanted_code',get_lang('Max'),'maxlength',$maxlength);
$form->addElement('select', 'tutor_id', get_lang('CourseTitular'), $teachers); $form->addElement('select', 'tutor_id', get_lang('CourseTitular'), $teachers);
$form->applyFilter('tutor_id','html_filter'); $form->applyFilter('tutor_id','html_filter');

@ -106,7 +106,7 @@ function get_group_data($from, $number_of_items, $column, $direction)
$users = array (); $users = array ();
$t = time(); $t = time();
while ($group = Database::fetch_row($res)) { while ($group = Database::fetch_row($res)) {
// forget about the expiration date field $group['1'] = '<a href="/main/social/groups.php?id='.$group['0'].'">'.$group['1'].'</a>';
$groups[] = $group; $groups[] = $group;
} }
return $groups; return $groups;
@ -180,8 +180,6 @@ function modify_filter($group_id,$url_params,$row)
$result .= '<a href="'.api_get_path(WEB_CODE_PATH).'admin/add_users_to_group.php?id='.$group_id.'">'.Display::return_icon('add_user_big.gif',get_lang('AddUsersToGroup')).'</a>'; $result .= '<a href="'.api_get_path(WEB_CODE_PATH).'admin/add_users_to_group.php?id='.$group_id.'">'.Display::return_icon('add_user_big.gif',get_lang('AddUsersToGroup')).'</a>';
$result .= '<a href="group_edit.php?id='.$group_id.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>&nbsp;&nbsp;'; $result .= '<a href="group_edit.php?id='.$group_id.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>&nbsp;&nbsp;';
$result .= '<a href="group_list.php?action=delete_group&amp;group_id='.$group_id.'&amp;'.$url_params.'&amp;sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>'; $result .= '<a href="group_list.php?action=delete_group&amp;group_id='.$group_id.'&amp;'.$url_params.'&amp;sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
} }
return $result; return $result;
} }

@ -81,7 +81,7 @@ function change_image_user_field (image_value) {
document.getElementById(\'options\').style.display = \'none\'; document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\'; document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;"); $("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_divider.png', get_lang('UserTag'))."'".'); $("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_user_tag.png', get_lang('UserTag'))."'".');
} }
} }
@ -162,7 +162,7 @@ $form->addElement('text','fieldlabel',get_lang('FieldLabel'));
$form->applyFilter('fieldlabel','html_filter'); $form->applyFilter('fieldlabel','html_filter');
$form->addRule('fieldlabel', get_lang('OnlyLettersAndNumbersAllowed'), 'username'); $form->addRule('fieldlabel', get_lang('OnlyLettersAndNumbersAllowed'), 'username');
$form->addRule('fieldlabel', '', 'maxlength',20); $form->addRule('fieldlabel', '', 'maxlength',20);
$form->addRule('fieldlabel', get_lang('FieldTaken'), 'fieldlabel_available'); //$form->addRule('fieldlabel', get_lang('FieldTaken'), 'fieldlabel_available');
// Field options possible // Field options possible
$form->addElement('text','fieldoptions',get_lang('FieldPossibleValues').Display::return_icon('info3.gif', get_lang('FieldPossibleValuesComment'), array('align' => 'absmiddle', 'hspace' => '3px'))); $form->addElement('text','fieldoptions',get_lang('FieldPossibleValues').Display::return_icon('info3.gif', get_lang('FieldPossibleValuesComment'), array('align' => 'absmiddle', 'hspace' => '3px')));
@ -286,7 +286,7 @@ if(!empty($defaults['fieldtype'])) {
} else if ($image_value==9) { } else if ($image_value==9) {
echo '<br />'.Display::return_icon('userfield_divider.png', get_lang('AddUserFields')); echo '<br />'.Display::return_icon('userfield_divider.png', get_lang('AddUserFields'));
} else if ($image_value==10) { } else if ($image_value==10) {
echo '<br />'.Display::return_icon('userfield_divider.png', get_lang('UserTag')); echo '<br />'.Display::return_icon('userfield_user_tag.png', get_lang('UserTag'));
} }
} else { } else {
echo '<br />'.Display::return_icon('userfield_text.png', get_lang('AddUserFields')); echo '<br />'.Display::return_icon('userfield_text.png', get_lang('AddUserFields'));

@ -2625,6 +2625,8 @@ input.arrowl {
/* UI improvements */ /* UI improvements */
* { * {
outline :none; outline :none;
} }
@ -2650,3 +2652,13 @@ input, select, textarea {
input[type="text"]:focus, input[type="password"]:focus, textarea:focus { input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
background-image:url(images/shadow.gif); background-image:url(images/shadow.gif);
} }
.independent_course_item a {
font-size:120%;
}
.session_course_item a {
font-size:120%;
}

@ -532,10 +532,12 @@ if ($is_allowedToEdit) {
$sql = 'SELECT gl.id FROM ' . $tbl_grade_link . ' gl WHERE gl.type="1" AND gl.ref_id="' . $exerciseId . '";'; $sql = 'SELECT gl.id FROM ' . $tbl_grade_link . ' gl WHERE gl.type="1" AND gl.ref_id="' . $exerciseId . '";';
$result = Database::query($sql, __FILE__, __LINE__); $result = Database::query($sql, __FILE__, __LINE__);
$row = Database :: fetch_array($result, 'ASSOC'); $row = Database :: fetch_array($result, 'ASSOC');
//see
if (!empty($row['id'])) {
$link = LinkFactory :: load($row['id']); $link = LinkFactory :: load($row['id']);
if ($link[0] != null) { if ($link[0] != null) {
$link[0]->delete(); $link[0]->delete();
}
} }
Display :: display_confirmation_message(get_lang('ExerciseDeleted')); Display :: display_confirmation_message(get_lang('ExerciseDeleted'));
break; break;

@ -576,7 +576,7 @@ class Exercise
$cond1=Database::escape_string(Security::remove_XSS($exercise)); $cond1=Database::escape_string(Security::remove_XSS($exercise));
$cond2=Database::escape_string(Security::remove_XSS(api_html_entity_decode($description),COURSEMANAGERLOWSECURITY)); $cond2=Database::escape_string(Security::remove_XSS(api_html_entity_decode($description),COURSEMANAGERLOWSECURITY));
}*/ }*/
$sql="INSERT INTO $TBL_EXERCICES (start_time, end_time, title, description, sound, type, random,active, results_disabled, max_attempt, feedback_type, session_id) $sql="INSERT INTO $TBL_EXERCICES (start_time, end_time, title, description, sound, type, random,active, results_disabled, max_attempt, feedback_type, expired_time, session_id)
VALUES( VALUES(
'$start_time','$end_time', '$start_time','$end_time',
'".Database::escape_string($exercise)."', '".Database::escape_string($exercise)."',
@ -588,6 +588,7 @@ class Exercise
'".Database::escape_string($results_disabled)."', '".Database::escape_string($results_disabled)."',
'".Database::escape_string($attempts)."', '".Database::escape_string($attempts)."',
'".Database::escape_string($feedbacktype)."', '".Database::escape_string($feedbacktype)."',
'".Database::escape_string($expired_time)."',
'".Database::escape_string($session_id)."' '".Database::escape_string($session_id)."'
)"; )";
Database::query($sql,__FILE__,__LINE__); Database::query($sql,__FILE__,__LINE__);
@ -983,7 +984,6 @@ class Exercise
$form -> addElement('text', 'enabletimercontroltotalminutes',get_lang('ExerciseTotalDurationInMinutes'),array('style' => 'width : 35px')); $form -> addElement('text', 'enabletimercontroltotalminutes',get_lang('ExerciseTotalDurationInMinutes'),array('style' => 'width : 35px'));
$form -> addElement('html','</div>'); $form -> addElement('html','</div>');
//$form -> addElement('text', 'exerciseAttempts', get_lang('ExerciseAttempts').' : ',array('size'=>'2')); //$form -> addElement('text', 'exerciseAttempts', get_lang('ExerciseAttempts').' : ',array('size'=>'2'));

@ -269,6 +269,8 @@ if (isset ($_GET['visiblelink'])) {
} }
if (isset ($_GET['deletelink'])) { if (isset ($_GET['deletelink'])) {
block_students(); block_students();
//fixing #5229
if (!empty($_GET['deletelink'])) {
$link= LinkFactory :: load(Security::remove_XSS($_GET['deletelink'])); $link= LinkFactory :: load(Security::remove_XSS($_GET['deletelink']));
if ($link[0] != null) { if ($link[0] != null) {
$sql='UPDATE '.$tbl_forum_thread.' SET thread_qualify_max=0,thread_weight=0,thread_title_qualify="" WHERE thread_id=(SELECT ref_id FROM '.$tbl_grade_links.' where id='.Security::remove_XSS($_GET['deletelink']).');'; $sql='UPDATE '.$tbl_forum_thread.' SET thread_qualify_max=0,thread_weight=0,thread_title_qualify="" WHERE thread_id=(SELECT ref_id FROM '.$tbl_grade_links.' where id='.Security::remove_XSS($_GET['deletelink']).');';
@ -279,6 +281,7 @@ if (isset ($_GET['deletelink'])) {
$confirmation_message = get_lang('LinkDeleted'); $confirmation_message = get_lang('LinkDeleted');
$filter_confirm_msg = false; $filter_confirm_msg = false;
} }
}
$course_to_crsind = isset ($course_to_crsind) ? $course_to_crsind : ''; $course_to_crsind = isset ($course_to_crsind) ? $course_to_crsind : '';
if ($course_to_crsind && !isset($_GET['confirm'])) { if ($course_to_crsind && !isset($_GET['confirm'])) {
block_students(); block_students();
@ -328,13 +331,16 @@ if (isset ($_POST['action'])) {
$number_of_deleted_evaluations++; $number_of_deleted_evaluations++;
} }
if (api_substr($indexstr, 0, 4) == 'LINK') { if (api_substr($indexstr, 0, 4) == 'LINK') {
$link= LinkFactory :: load(api_substr($indexstr, 4)); $id = api_substr($indexstr, 4);
if (!empty($id)) {
$link= LinkFactory :: load();
if ($link[0] != null) { if ($link[0] != null) {
$link[0]->delete(); $link[0]->delete();
} }
$number_of_deleted_links++; $number_of_deleted_links++;
} }
} }
}
$confirmation_message = get_lang('DeletedCategories') . ' : <b>' . $number_of_deleted_categories . '</b><br />' . get_lang('DeletedEvaluations') . ' : <b>' . $number_of_deleted_evaluations . '</b><br />' . get_lang('DeletedLinks') . ' : <b>' . $number_of_deleted_links . '</b><br /><br />' . get_lang('TotalItems') . ' : <b>' . $number_of_selected_items . '</b>'; $confirmation_message = get_lang('DeletedCategories') . ' : <b>' . $number_of_deleted_categories . '</b><br />' . get_lang('DeletedEvaluations') . ' : <b>' . $number_of_deleted_evaluations . '</b><br />' . get_lang('DeletedLinks') . ' : <b>' . $number_of_deleted_links . '</b><br /><br />' . get_lang('TotalItems') . ' : <b>' . $number_of_selected_items . '</b>';
$filter_confirm_msg = false; $filter_confirm_msg = false;
break; break;

@ -327,6 +327,8 @@ if (isset ($_GET['visiblelink'])) {
if (isset ($_GET['deletelink'])) { if (isset ($_GET['deletelink'])) {
block_students(); block_students();
$get_delete_link=Security::remove_XSS($_GET['deletelink']); $get_delete_link=Security::remove_XSS($_GET['deletelink']);
//fixing #5229
if (!empty($get_delete_link)) {
$link= LinkFactory :: load($get_delete_link); $link= LinkFactory :: load($get_delete_link);
if ($link[0] != null) { if ($link[0] != null) {
$sql='UPDATE '.$tbl_forum_thread.' SET thread_qualify_max=0,thread_weight=0,thread_title_qualify="" WHERE thread_id=(SELECT ref_id FROM '.$tbl_grade_links.' where id='.$get_delete_link.');'; $sql='UPDATE '.$tbl_forum_thread.' SET thread_qualify_max=0,thread_weight=0,thread_title_qualify="" WHERE thread_id=(SELECT ref_id FROM '.$tbl_grade_links.' where id='.$get_delete_link.');';
@ -337,6 +339,7 @@ if (isset ($_GET['deletelink'])) {
$confirmation_message = get_lang('LinkDeleted'); $confirmation_message = get_lang('LinkDeleted');
$filter_confirm_msg = false; $filter_confirm_msg = false;
} }
}
if (!empty($course_to_crsind) && !isset($_GET['confirm'])) { if (!empty($course_to_crsind) && !isset($_GET['confirm'])) {
block_students(); block_students();
@ -387,14 +390,17 @@ if (isset ($_POST['action'])) {
$number_of_deleted_evaluations++; $number_of_deleted_evaluations++;
} }
if (substr($indexstr, 0, 4) == 'LINK') { if (substr($indexstr, 0, 4) == 'LINK') {
$link= LinkFactory :: load(substr($indexstr, 4)); //fixing #5229
$id = substr($indexstr, 4);
if (!empty($id)) {
$link= LinkFactory :: load($id);
if ($link[0] != null) { if ($link[0] != null) {
$link[0]->delete(); $link[0]->delete();
} }
$number_of_deleted_links++; $number_of_deleted_links++;
} }
} }
}
$confirmation_message = get_lang('DeletedCategories') . ' : <b>' . $number_of_deleted_categories . '</b><br />' . get_lang('DeletedEvaluations') . ' : <b>' . $number_of_deleted_evaluations . '</b><br />' . get_lang('DeletedLinks') . ' : <b>' . $number_of_deleted_links . '</b><br /><br />' . get_lang('TotalItems') . ' : <b>' . $number_of_selected_items . '</b>'; $confirmation_message = get_lang('DeletedCategories') . ' : <b>' . $number_of_deleted_categories . '</b><br />' . get_lang('DeletedEvaluations') . ' : <b>' . $number_of_deleted_evaluations . '</b><br />' . get_lang('DeletedLinks') . ' : <b>' . $number_of_deleted_links . '</b><br /><br />' . get_lang('TotalItems') . ' : <b>' . $number_of_selected_items . '</b>';
$filter_confirm_msg = false; $filter_confirm_msg = false;
break; break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

@ -4,7 +4,7 @@
============================================================================== ==============================================================================
* This library provides functions for the access_url management. * This library provides functions for the access_url management.
* Include/require it in your code to use its functionality. * Include/require it in your code to use its functionality.
* * @author Julio Montoya <gugli100@gmail.com>
* @package dokeos.library * @package dokeos.library
============================================================================== ==============================================================================
*/ */
@ -147,6 +147,9 @@ class GroupPortalManager
/** /**
* Gets data of all groups * Gets data of all groups
* @author Julio Montoya * @author Julio Montoya
* @param int visibility
* @param int from which record the results will begin (use for pagination)
* @param int number of items
* @return array * @return array
* */ * */
function get_all_group_data($visibility = GROUP_PERMISSION_OPEN, $from=0, $number_of_items=10) function get_all_group_data($visibility = GROUP_PERMISSION_OPEN, $from=0, $number_of_items=10)
@ -163,6 +166,11 @@ class GroupPortalManager
return $data; return $data;
} }
/**
* Gets the group data
*
*
*/
function get_group_data($group_id) function get_group_data($group_id)
{ {
$table = Database :: get_main_table(TABLE_MAIN_GROUP); $table = Database :: get_main_table(TABLE_MAIN_GROUP);
@ -177,6 +185,12 @@ class GroupPortalManager
return $item; return $item;
} }
/**
* Gets the tags from a given group
* @param int group id
* @param bool show group links or not
*
*/
function get_group_tags($group_id, $show_tag_links = true) function get_group_tags($group_id, $show_tag_links = true)
{ {
$tag = Database :: get_main_table(TABLE_MAIN_TAG); $tag = Database :: get_main_table(TABLE_MAIN_TAG);
@ -283,7 +297,7 @@ class GroupPortalManager
$array = array(); $array = array();
while ($row = Database::fetch_array($result, 'ASSOC')) { while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($with_image == true) { if ($with_image == true) {
$picture = UserManager::get_picture_user($row['user_id'], $row['picture_uri'],80); $picture = UserManager::get_picture_user($row['user_id'], $row['picture_uri'],80,'medium_');
$img = '<img src="'.$picture['file'].'" />'; $img = '<img src="'.$picture['file'].'" />';
$row['picture_uri'] = $img; $row['picture_uri'] = $img;
} }
@ -374,8 +388,9 @@ class GroupPortalManager
* @author Julio Montoya * @author Julio Montoya
* @param int user id * @param int user id
* @param int group_id * @param int group_id
* @return boolean true if success * @return int 0 if there are not relationship otherwise return GROUP_USER_PERMISSION_ADMIN or GROUP_USER_PERMISSION_READER constants
* */ * */
function get_user_group_role($user_id, $group_id) function get_user_group_role($user_id, $group_id)
{ {
$table_group_rel_user= Database :: get_main_table(TABLE_MAIN_USER_REL_GROUP); $table_group_rel_user= Database :: get_main_table(TABLE_MAIN_USER_REL_GROUP);
@ -425,35 +440,6 @@ class GroupPortalManager
} }
/**
* Add a group of users into a group of URLs
* @author Julio Montoya
* @param array of user_ids
* @param array of url_ids
* */
function add_users_to_urls($user_list, $url_list)
{
$table_url_rel_user= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$result_array=array();
if (is_array($user_list) && is_array($url_list)){
foreach ($url_list as $url_id) {
foreach ($user_list as $user_id) {
$count = UrlManager::relation_url_user_exist($user_id,$url_id);
if ($count==0) {
$sql = "INSERT INTO $table_url_rel_user
SET user_id = ".Database::escape_string($user_id).", access_url_id = ".Database::escape_string($url_id);
$result = Database::query($sql, __FILE__, __LINE__);
if($result)
$result_array[$url_id][$user_id]=1;
else
$result_array[$url_id][$user_id]=0;
}
}
}
}
return $result_array;
}
/** /**
@ -540,34 +526,40 @@ class GroupPortalManager
return $result; return $result;
} }
function add_course_to_url($course_code, $url_id=1)
{
$table_url_rel_course= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
if (empty($url_id)) $url_id=1;
$count = UrlManager::relation_url_course_exist($course_code,$url_id);
if (empty($count)) {
$sql = "INSERT INTO $table_url_rel_course
SET course_code = '".Database::escape_string($course_code)."', access_url_id = ".Database::escape_string($url_id);
$result = Database::query($sql, __FILE__, __LINE__);
}
return $result;
}
/**
* Add a group of users into a group of URLs
* @author Julio Montoya
* @param array of user_ids
* @param array of url_ids
* */
function add_users_to_groups($user_list, $group_list, $relation_type = GROUP_USER_PERMISSION_READER) {
$table_url_rel_group = Database :: get_main_table(TABLE_MAIN_USER_REL_GROUP);
$result_array = array();
$relation_type = intval($relation_type);
if (is_array($user_list) && is_array($group_list)) {
foreach ($group_list as $group_id) {
foreach ($user_list as $user_id) {
$role = self::get_user_group_role($user_id,$group_id);
if ($role == 0) {
$sql = "INSERT INTO $table_url_rel_group
SET user_id = ".intval($user_id).", group_id = ".intval($group_id).", relation_type = ".intval($relation_type)."";
function add_session_to_url($session_id, $url_id=1)
{
$table_url_rel_session= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
if (empty($url_id)) $url_id=1;
$count = UrlManager::relation_url_session_exist($session_id,$url_id);
if (empty($count)) {
$sql = "INSERT INTO $table_url_rel_session
SET session_id = ".Database::escape_string($session_id).", access_url_id = ".Database::escape_string($url_id);
$result = Database::query($sql, __FILE__, __LINE__); $result = Database::query($sql, __FILE__, __LINE__);
if ($result)
$result_array[$group_id][$user_id]=1;
else
$result_array[$group_id][$user_id]=0;
}
}
} }
return $result; }
return $result_array;
} }
/** /**
* Deletes an url and user relationship * Deletes an url and user relationship
* @author Julio Montoya * @author Julio Montoya
@ -815,9 +807,9 @@ class GroupPortalManager
/** /**
* Creates new user pfotos in various sizes of a user, or deletes user pfotos. * Creates new group pictures in various sizes of a user, or deletes user pfotos.
* Note: This method relies on configuration setting from dokeos/main/inc/conf/profile.conf.php * Note: This method relies on configuration setting from dokeos/main/inc/conf/profile.conf.php
* @param int $user_id The user internal identitfication number. * @param int The group id
* @param string $file The common file name for the newly created pfotos. It will be checked and modified for compatibility with the file system. * @param string $file The common file name for the newly created pfotos. It will be checked and modified for compatibility with the file system.
* If full name is provided, path component is ignored. * If full name is provided, path component is ignored.
* If an empty name is provided, then old user photos are deleted only, @see UserManager::delete_user_picture() as the prefered way for deletion. * If an empty name is provided, then old user photos are deleted only, @see UserManager::delete_user_picture() as the prefered way for deletion.
@ -919,7 +911,7 @@ class GroupPortalManager
} }
/** /**
* Get user picture URL or path from user ID (returns an array). * Gets the group picture URL or path from group ID (returns an array).
* The return format is a complete path, enabling recovery of the directory * The return format is a complete path, enabling recovery of the directory
* with dirname() or the file with basename(). This also works for the * with dirname() or the file with basename(). This also works for the
* functions dealing with the user's productions, as they are located in * functions dealing with the user's productions, as they are located in
@ -1006,10 +998,11 @@ class GroupPortalManager
} }
return $temp; return $temp;
} }
/** /**
* Gets the current user image * Gets the current group image
* @param string user id * @param string group id
* @param string picture user name * @param string picture group name
* @param string height * @param string height
* @param string picture size it can be small_, medium_ or big_ * @param string picture size it can be small_, medium_ or big_
* @param string style css * @param string style css

@ -2209,7 +2209,17 @@ class UserManager
if (file_exists($file) && !is_dir($file)) { if (file_exists($file) && !is_dir($file)) {
$picture['file'] = $image_array['dir'].$picture_file; $picture['file'] = $image_array['dir'].$picture_file;
} else { } else {
$picture['file'] = api_get_path(WEB_CODE_PATH).'img/unknown.jpg'; switch ($size_picture) {
case 'big_' :
$picture['file'] = api_get_path(WEB_CODE_PATH).'img/unknown.jpg'; break;
case 'medium_' :
$picture['file'] = api_get_path(WEB_CODE_PATH).'img/unknown_50_50.jpg'; break;
case 'small_' :
$picture['file'] = api_get_path(WEB_CODE_PATH).'img/unknown.jpg'; break;
default:
$picture['file'] = api_get_path(WEB_CODE_PATH).'img/unknown.jpg'; break;
}
} }
} }
return $picture; return $picture;
@ -2568,7 +2578,6 @@ class UserManager
$sql = "SELECT u.user_id,u.username,firstname, lastname, email, tag, picture_uri FROM $table_user_tag ut INNER JOIN $table_user_tag_values uv ON (uv.tag_id=ut.id) $sql = "SELECT u.user_id,u.username,firstname, lastname, email, tag, picture_uri FROM $table_user_tag ut INNER JOIN $table_user_tag_values uv ON (uv.tag_id=ut.id)
INNER JOIN $user_table u ON(uv.user_id =u.user_id) INNER JOIN $user_table u ON(uv.user_id =u.user_id)
WHERE $where_field tag LIKE '$tag%' ORDER BY tag"; WHERE $where_field tag LIKE '$tag%' ORDER BY tag";
$sql .= " LIMIT $from,$number_of_items"; $sql .= " LIMIT $from,$number_of_items";
$result = Database::query($sql, __FILE__, __LINE__); $result = Database::query($sql, __FILE__, __LINE__);

@ -883,10 +883,15 @@ class learnpath {
$sql = 'SELECT gl.id FROM ' . $tbl_grade_link . ' gl WHERE gl.type="4" AND gl.ref_id="' . $id . '";'; $sql = 'SELECT gl.id FROM ' . $tbl_grade_link . ' gl WHERE gl.type="4" AND gl.ref_id="' . $id . '";';
$result = Database::query($sql, __FILE__, __LINE__); $result = Database::query($sql, __FILE__, __LINE__);
$row = Database :: fetch_array($result, 'ASSOC'); $row = Database :: fetch_array($result, 'ASSOC');
//fixing gradebook link deleted see #5229
if (!empty($row['id'])) {
$link = LinkFactory :: load($row['id']); $link = LinkFactory :: load($row['id']);
if ($link[0] != null) { if ($link[0] != null) {
$link[0]->delete(); $link[0]->delete();
} }
}
//TODO: also delete items and item-views //TODO: also delete items and item-views
if (api_get_setting('search_enabled') == 'true') { if (api_get_setting('search_enabled') == 'true') {
require_once (api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'); require_once (api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');

@ -26,8 +26,12 @@ if ($group_id != 0 ) {
$tags = GroupPortalManager::get_group_tags($group_id,true); $tags = GroupPortalManager::get_group_tags($group_id,true);
$users = GroupPortalManager::get_users_by_group($group_id,true); $users = GroupPortalManager::get_users_by_group($group_id,true);
//@todo this must be move to default.css for dev use only
echo '<style>
#group_members { width:250px; height:300px; overflow-x:none; overflow-y: auto;}
.group_member_item { width:80px; float:left;}
//var_dump($users); </style>';
//Group's title //Group's title
@ -60,10 +64,10 @@ if ($group_id != 0 ) {
echo '</div>'; echo '</div>';
} }
echo '<div id="group_members">';
echo get_lang('Members').' : '; echo get_lang('Members').' : ';
echo '<div id="group_members">';
foreach($users as $user) { foreach($users as $user) {
echo $user['picture_uri'].$user['firstname'].$user['lastname'].'<br />'; echo '<div class="group_member_item">'.$user['picture_uri'].$user['firstname'].$user['lastname'].'</div>';
} }
echo '</div>'; echo '</div>';

@ -11,13 +11,19 @@ $current_date=date('Y-m-d H:i:s',time());
$html_form='<select id="id_search_name" name="id_search_name" size="8"" style="width:350px;">'; $html_form='<select id="id_search_name" name="id_search_name" size="8"" style="width:350px;">';
$user_id = api_get_user_id(); $user_id = api_get_user_id();
$is_western_name_order = api_is_western_name_order(); $is_western_name_order = api_is_western_name_order();
if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true') { if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true') {
$sql = 'SELECT DISTINCT u.user_id as id, '.($is_western_name_order ? 'concat(u.firstname," ",u.lastname," ","( ",u.email," )")' : 'concat(u.lastname," ",u.firstname," ","( ",u.email," )")').' as name $sql = 'SELECT DISTINCT u.user_id as id, '.($is_western_name_order ? 'concat(u.firstname," ",u.lastname," ","( ",u.email," )")' : 'concat(u.lastname," ",u.firstname," ","( ",u.email," )")').' as name
FROM '.$tbl_my_user_friend.' uf ' . FROM '.$tbl_my_user_friend.' uf ' .
'INNER JOIN '.$tbl_my_user.' AS u ON uf.friend_user_id = u.user_id ' . 'INNER JOIN '.$tbl_my_user.' AS u ON uf.friend_user_id = u.user_id ' .
'WHERE relation_type<>6 AND friend_user_id<>'.(int)$user_id.' AND '.($is_western_name_order ? 'concat(u.firstname, " ", u.lastname)' : 'concat(u.lastname, " ", u.firstname)').' like CONCAT("%","'.$search.'","%") '; 'WHERE relation_type<>6 AND friend_user_id<>'.(int)$user_id.' AND '.($is_western_name_order ? 'concat(u.firstname, " ", u.lastname)' : 'concat(u.lastname, " ", u.firstname)').' like CONCAT("%","'.$search.'","%") ';
} elseif (api_get_setting('allow_social_tool')=='false' && api_get_setting('allow_message_tool')=='true') { } elseif (api_get_setting('allow_social_tool')=='false' && api_get_setting('allow_message_tool')=='true') {
$valid=api_get_setting('time_limit_whosonline'); $valid=api_get_setting('time_limit_whosonline');
$sql='SELECT DISTINCT u.user_id as id, '.($is_western_name_order ? 'concat(u.firstname," ",u.lastname," ","( ",u.email," )")' : 'concat(u.lastname," ",u.firstname," ","( ",u.email," )")').' as name $sql='SELECT DISTINCT u.user_id as id, '.($is_western_name_order ? 'concat(u.firstname," ",u.lastname," ","( ",u.email," )")' : 'concat(u.lastname," ",u.firstname," ","( ",u.email," )")').' as name
FROM '.$tbl_my_user.' u INNER JOIN '.$track_online_table.' t ON u.user_id=t.login_user_id FROM '.$tbl_my_user.' u INNER JOIN '.$track_online_table.' t ON u.user_id=t.login_user_id
WHERE DATE_ADD(login_date,INTERVAL "'.$valid.'" MINUTE) >= "'.$current_date.'" AND '.($is_western_name_order ? 'concat(u.firstname, " ", u.lastname)' : 'concat(u.lastname, " ", u.firstname)').' like CONCAT("%","'.$search.'","%") '; WHERE DATE_ADD(login_date,INTERVAL "'.$valid.'" MINUTE) >= "'.$current_date.'" AND '.($is_western_name_order ? 'concat(u.firstname, " ", u.lastname)' : 'concat(u.lastname, " ", u.firstname)').' like CONCAT("%","'.$search.'","%") ';

@ -663,9 +663,11 @@ if ($_GET['studentlist'] == 'false') {
$table -> set_header(7, get_lang('Messages'),false); $table -> set_header(7, get_lang('Messages'),false);
$table -> set_header(8, get_lang('FirstLogin'), false, 'align="center"'); $table -> set_header(8, get_lang('FirstLogin'), false, 'align="center"');
$table -> set_header(9, get_lang('LatestLogin'), false, 'align="center"'); $table -> set_header(9, get_lang('LatestLogin'), false, 'align="center"');
$table -> set_header(10, get_lang('Details'),false);
if (isset($_GET['additional_profile_field']) AND is_numeric($_GET['additional_profile_field'])) { if (isset($_GET['additional_profile_field']) AND is_numeric($_GET['additional_profile_field'])) {
$table -> set_header(11, get_lang('AdditionalProfileField'),false); $table -> set_header(10, get_lang('AdditionalProfileField'),false);
$table -> set_header(11, get_lang('Details'),false);
} else {
$table -> set_header(10, get_lang('Details'),false);
} }
if ($export_csv) { if ($export_csv) {
$csv_content[] = array (); $csv_content[] = array ();
@ -703,13 +705,15 @@ if ($_GET['studentlist'] == 'false') {
$row[] = Tracking :: get_first_connection_date_on_the_course($student_id, $course_code); $row[] = Tracking :: get_first_connection_date_on_the_course($student_id, $course_code);
$row[] = Tracking :: get_last_connection_date_on_the_course($student_id, $course_code); $row[] = Tracking :: get_last_connection_date_on_the_course($student_id, $course_code);
$row[] = '<center><a href="../mySpace/myStudents.php?student='.$student_id.'&details=true&course='.$course_code.'&origin=tracking_course"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></center>';
// we need to display an additional profile field // we need to display an additional profile field
if (isset($_GET['additional_profile_field']) AND is_numeric($_GET['additional_profile_field'])) { if (isset($_GET['additional_profile_field']) AND is_numeric($_GET['additional_profile_field'])) {
if (is_array($additional_user_profile_info[$student_id])) if (is_array($additional_user_profile_info[$student_id])) {
$row[]=implode(', ', $additional_user_profile_info[$student_id]); $row[]=implode(', ', $additional_user_profile_info[$student_id]);
} else {
$row[]='&nbsp;';
} }
}
$row[] = '<center><a href="../mySpace/myStudents.php?student='.$student_id.'&details=true&course='.$course_code.'&origin=tracking_course"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a></center>';
if ($export_csv) { if ($export_csv) {
$row[8] = strip_tags($row[8]); $row[8] = strip_tags($row[8]);
$row[9] = strip_tags($row[9]); $row[9] = strip_tags($row[9]);
@ -904,10 +908,10 @@ function get_addtional_profile_information_of_field_by_user($field_id, $users){
// Database table definition // Database table definition
$table_user = Database::get_main_table(TABLE_MAIN_USER); $table_user = Database::get_main_table(TABLE_MAIN_USER);
$table_user_field_values = Database::get_main_table(TABLE_MAIN_USER_FIELD_VALUES); $table_user_field_values = Database::get_main_table(TABLE_MAIN_USER_FIELD_VALUES);
$result = UserManager::get_extra_field_information($field_id); $result_extra_field = UserManager::get_extra_field_information($field_id);
if (!empty($users)) { if (!empty($users)) {
if ($result['field_type'] == USER_FIELD_TYPE_TAG ) { if ($result_extra_field['field_type'] == USER_FIELD_TYPE_TAG ) {
foreach($users as $user_id) { foreach($users as $user_id) {
$user_result = UserManager::get_user_tags($user_id, $field_id); $user_result = UserManager::get_user_tags($user_id, $field_id);
$tag_list = array(); $tag_list = array();
@ -929,6 +933,24 @@ function get_addtional_profile_information_of_field_by_user($field_id, $users){
$result = api_sql_query($sql,__FILE__,__LINE__); $result = api_sql_query($sql,__FILE__,__LINE__);
while($row = Database::fetch_array($result)) { while($row = Database::fetch_array($result)) {
if (!empty($row['field_value'])) {
if ($result_extra_field['field_type'] == USER_FIELD_TYPE_DOUBLE_SELECT) {
$id_double_select = explode(';',$row['field_value']);
$value1 = $result_extra_field['options'][$id_double_select[0]]['option_value'];
$value2 = $result_extra_field['options'][$id_double_select[1]]['option_value'];
$row['field_value'] = ($value1.';'.$value2);
} else if ($result_extra_field['field_type'] == USER_FIELD_TYPE_DATE) {
$datetime = explode(';',$row['field_value']);
$time = mktime(0,0,0,$datetime[1],$datetime[0],$datetime[2]);
$row['field_value'] = date('Y-m-d',$time);
} else if ($result_extra_field['field_type'] == USER_FIELD_TYPE_DATETIME) {
$datetime = explode(';',$row['field_value']);
$time = mktime($datetime[3],$datetime[4],0,$datetime[1],$datetime[0],$datetime[2]);
$row['field_value'] = date('Y-m-d H:i:s',$time);
}
}
$return[$row['user_id']][] = $row['field_value']; $return[$row['user_id']][] = $row['field_value'];
} }
} }

Loading…
Cancel
Save