Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

pull/3376/head
Yannick Warnier 5 years ago
commit e0e6a5f592
  1. 8
      main/course_home/course_home.php
  2. 16
      main/course_info/delete_course.php
  3. 6
      main/coursecopy/recycle_course.php
  4. 2
      main/exercise/exercise_result.php
  5. 2
      main/inc/lib/document.lib.php
  6. 22
      main/inc/lib/events.lib.php
  7. 2
      main/inc/lib/formvalidator/Element/SelectAjax.php
  8. 4
      main/inc/lib/message.lib.php
  9. 13
      main/inc/lib/social.lib.php
  10. 12
      main/mySpace/myStudents.php
  11. 4
      main/social/vcard_export.php
  12. 10
      main/work/work.lib.php

@ -171,13 +171,13 @@ $htmlHeadXtra[] = '<script type="text/javascript">
if (info.message == "is_active") {
message = "'.get_lang('ToolIsNowVisible', '').'";
$("#" + tool_id)
.attr("alt", "' . get_lang('Activate', '') . '")
.attr("title", "' . get_lang('Activate', '') . '");
.attr("alt", "'.get_lang('Activate', '').'")
.attr("title", "'.get_lang('Activate', '').'");
} else {
message = "'.get_lang('ToolIsNowHidden', '').'";
$("#" + tool_id)
.attr("alt", "' . get_lang('Deactivate', '') . '")
.attr("title", "' . get_lang('Deactivate', '') . '");
.attr("alt", "'.get_lang('Deactivate', '').'")
.attr("title", "'.get_lang('Deactivate', '').'");
}
$(".normal-message").hide();
$("#id_confirmation_message").html(message);

@ -32,30 +32,30 @@ if (isset($_GET['delete']) && $_GET['delete'] === 'yes' && $_GET['course_code']
// DELETE CONFIRMATION MESSAGE
Session::erase('_cid');
Session::erase('_real_cid');
$message = '<h2>' . get_lang('Course') . ' : ' . $current_course_name . ' (' . $current_course_code . ') </h2>';
$message = '<h2>'.get_lang('Course').' : '.$current_course_name.' ('.$current_course_code.') </h2>';
$message .= get_lang('HasDel');
$message .= '<br /><br /><a href="../../index.php">' . get_lang('BackHome') . '</a>';
$message .= '<br /><br /><a href="../../index.php">'.get_lang('BackHome').'</a>';
} else {
/* message if code course is incorrect */
$message = '<h2>' . get_lang('Course') . ' : ' . $current_course_name . ' (' . $current_course_code . ') </h2>';
$message = '<h2>'.get_lang('Course').' : '.$current_course_name.' ('.$current_course_code.') </h2>';
$message .= '<p>'.get_lang('CourseRegistrationCodeIncorrect').'</p>';
$message .= '<p><a class="btn btn-primary" href="'
.api_get_path(WEB_CODE_PATH)
.'course_info/delete_course.php?'
.api_get_cidreq()
.'">'.get_lang('BackToPreviousPage').'</a>';
$message .= '<br /><br /><a href="../../index.php">' . get_lang('BackHome') . '</a>';
$message .= '<br /><br /><a href="../../index.php">'.get_lang('BackHome').'</a>';
$type_info_message = 'error';
}
} else {
$message = '<h3>' . get_lang('Course') . ' : ' . $current_course_name . ' (' . $current_course_code . ') </h3>';
$message .= '<p>' . get_lang('ByDel') . '</p>';
$message = '<h3>'.get_lang('Course').' : '.$current_course_name.' ('.$current_course_code.') </h3>';
$message .= '<p>'.get_lang('ByDel').'</p>';
$message .= '<p><span class="form_required">*</span>'
.get_lang('CourseCodeConfirmation')
.'&nbsp;<input type="text" name="course_code" id="course_code"></p>';
$message .= '<p>';
$message .= '<button class="btn btn-danger delete-course">' . get_lang('ValidateChanges') . '</button>';
$message .= '<button class="btn btn-danger delete-course">'.get_lang('ValidateChanges').'</button>';
$message .= '&nbsp;';
$message .= '<a class="btn btn-primary"href="'
.api_get_path(WEB_CODE_PATH)
@ -69,7 +69,7 @@ if (isset($_GET['delete']) && $_GET['delete'] === 'yes' && $_GET['course_code']
'name' => get_lang('Maintenance'),
];
}
$htmlHeadXtra[] ='<script>
$htmlHeadXtra[] = '<script>
$(function(){
/* Asking by course code to confirm recycling*/
$(".delete-course").on("click",function(){

@ -16,7 +16,6 @@ require_once __DIR__.'/../inc/global.inc.php';
$current_course_tool = TOOL_COURSE_MAINTENANCE;
api_protect_course_script(true);
$_course = api_get_course_info();
$current_course_code = $_course['official_code'];
@ -60,7 +59,7 @@ if (Security::check_token('post') && (
}
$recycle_type = '';
$fullDelete = 0;
$courseCodeConfirmation ='';
$courseCodeConfirmation = '';
if (isset($_POST['course_code_confirmation'])) {
$courseCodeConfirmation = $_POST['course_code_confirmation'];
}
@ -78,13 +77,12 @@ if (Security::check_token('post') && (
$cr->recycle($recycle_type);
echo Display::return_message(get_lang('RecycleFinished'), 'confirm');
} else {
$messageFailCourseCode = '<p>' . get_lang('CourseRegistrationCodeIncorrect') . '</p>';
$messageFailCourseCode = '<p>'.get_lang('CourseRegistrationCodeIncorrect').'</p>';
$messageFailCourseCode .= '<p><a class="btn btn-primary" href="'.api_get_self().'?'.api_get_cidreq().'">'.
get_lang('BackToPreviousPage').
'</a></p>';
echo Display::return_message($messageFailCourseCode, 'error', false);
}
} elseif ($recycle_type == 'select_items') {
$cr->recycle($recycle_type);
echo Display::return_message(get_lang('RecycleFinished'), 'confirm');

@ -106,7 +106,7 @@ if (api_is_course_admin() && !in_array($origin, ['learnpath', 'embeddable'])) {
.Display::url(
Display::return_icon('edit.png', get_lang('ModifyExercise'), [], 32),
'exercise_admin.php?'.api_get_cidreq().'&modifyExercise=yes&exerciseId='.$objExercise->id
)
),
]
);
}

@ -591,7 +591,7 @@ class DocumentManager
}
$where = '';
if ($search != true) {
$where .= "docs.path NOT LIKE '" . Database::escape_string($path . $addedSlash . '%/%') . "' AND";
$where .= "docs.path NOT LIKE '".Database::escape_string($path.$addedSlash.'%/%')."' AND";
}
$sql = "SELECT
docs.id,

@ -1,7 +1,7 @@
<?php
/* See license terms in /license.txt */
//use Chamilo\UserBundle\Entity\User;
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use ChamiloSession as Session;
@ -2237,12 +2237,12 @@ class Event
* updating the current one to be just the considered_working_time and
* end at the same second as the user connected to the course.
*
* @param int $courseId The course in which to add the time
* @param int $userId The user for whom to add the time
* @param int $sessionId The session in which to add the time (if any)
* @param string $virtualTime The amount of time to be added,
* in a hh:mm:ss format. If int, we consider it is expressed in hours.
* @param int $resultWorkId Student publication id result
* @param int $courseId The course in which to add the time
* @param int $userId The user for whom to add the time
* @param int $sessionId The session in which to add the time (if any)
* @param string $virtualTime The amount of time to be added,
* in a hh:mm:ss format. If int, we consider it is expressed in hours.
* @param int $workId Student publication id result
*
* @return true on successful insertion, false otherwise
*/
@ -2251,7 +2251,7 @@ class Event
$userId,
$sessionId,
$virtualTime,
$resultWorkId
$workId
) {
if (empty($virtualTime)) {
return false;
@ -2293,14 +2293,14 @@ class Event
Database::insert($platformTrackingTable, $params);
if (Tracking::minimumTimeAvailable($sessionId, $courseId)) {
$resultWorkId = (int) $resultWorkId;
$workId = (int) $workId;
$logInfo = [
'c_id' => $courseId,
'session_id' => $sessionId,
'tool' => TOOL_STUDENTPUBLICATION,
'date_reg' => $loginDate,
'action' => 'add_work_start_'.$resultWorkId,
'action' => 'add_work_start_'.$workId,
'action_details' => $virtualTime,
'user_id' => $userId,
];
@ -2311,7 +2311,7 @@ class Event
'session_id' => $sessionId,
'tool' => TOOL_STUDENTPUBLICATION,
'date_reg' => $logoutDate,
'action' => 'add_work_end_'.$resultWorkId,
'action' => 'add_work_end_'.$workId,
'action_details' => $virtualTime,
'user_id' => $userId,
];

@ -76,7 +76,7 @@ class SelectAjax extends HTML_QuickForm_select
$max = !empty($max) ? "maximumSelectionLength: $max, " : '';
// wait XX milliseconds before triggering the request
$delay = (int)$this->getAttribute('delay');
$delay = (int) $this->getAttribute('delay');
$delay = (0 !== $delay) ? "delay: $delay, " : '';
$html = <<<JS

@ -1537,10 +1537,10 @@ class MessageManager
$message_content .= '<a href="inbox.php?action=deleteone&id='.$messageId.'&'.$social_link.'" >'.
Display::return_icon('delete.png', get_lang('DeleteMessage')).'</a>&nbsp;';
if ($idPrevMessage != 0) {
$message_content .= '<a title="' . get_lang('PrevMessage') . '" href="view_message.php?type=' . $type . '&id=' . $idPrevMessage . '" ">' . Display::return_icon('icons/22/back.png', get_lang('ScormPrevious')) . '</a> &nbsp';
$message_content .= '<a title="'.get_lang('PrevMessage').'" href="view_message.php?type='.$type.'&id='.$idPrevMessage.'" ">'.Display::return_icon('icons/22/back.png', get_lang('ScormPrevious')).'</a> &nbsp';
}
if ($idNextMessage != 0) {
$message_content .= '<a title="' . get_lang('NextMessage') . '" href="view_message.php?type=' . $type . '&id=' . $idNextMessage . '">' . Display::return_icon('icons/22/move.png', get_lang('ScormNext')) . '</a> &nbsp';
$message_content .= '<a title="'.get_lang('NextMessage').'" href="view_message.php?type='.$type.'&id='.$idNextMessage.'">'.Display::return_icon('icons/22/move.png', get_lang('ScormNext')).'</a> &nbsp';
}
break;
}

@ -54,9 +54,9 @@ class SocialManager extends UserManager
/**
* Get the kind of relation between contacts.
*
* @param int $user_id user id
* @param int $user_friend user friend id
* @param boolean $includeRH include the RH relationship
* @param int $user_id user id
* @param int $user_friend user friend id
* @param bool $includeRH include the RH relationship
*
* @return int
*
@ -112,15 +112,14 @@ class SocialManager extends UserManager
foreach ($targetUserCoursesList as $course) {
$teachersList = CourseManager::get_teacher_list_from_course_code($course['code']);
foreach ($teachersList as $teacher) {
if ($currentUserId == $teacher['user_id']) {
return USER_RELATION_TYPE_GOODFRIEND;
}
if ($currentUserId == $teacher['user_id']) {
return USER_RELATION_TYPE_GOODFRIEND;
}
}
}
} else {
return USER_UNKNOWN;
}
}
}

@ -1874,6 +1874,7 @@ if (empty($details)) {
foreach ($userWorks as $work) {
$work = $work['work'];
$showOnce = true;
foreach ($work->user_results as $key => $results) {
$resultId = $results['id'];
@ -1906,15 +1907,16 @@ if (empty($details)) {
$time = $field->getValue();
echo '<td class="text-center">';
echo $time;
if ($workingTimeEdit) {
echo Display::url(
if ($workingTimeEdit && $showOnce) {
$showOnce = false;
echo '&nbsp;'.Display::url(
get_lang('AddTime'),
$currentUrl.'&action=add_work_time&time='.$time.'&work_id='.$resultId
$currentUrl.'&action=add_work_time&time='.$time.'&work_id='.$work->id
);
echo Display::url(
echo '&nbsp;'.Display::url(
get_lang('RemoveTime'),
$currentUrl.'&action=remove_work_time&time='.$time.'&work_id='.$resultId
$currentUrl.'&action=remove_work_time&time='.$time.'&work_id='.$work->id
);
}
echo '</td>';

@ -25,7 +25,7 @@ $userInfo = api_get_user_info($userId, true, false, true);
/* Get the relationship between current user and vCard user */
$currentUserId = api_get_user_id();
$hasRelation = SocialManager::get_relation_between_contacts(
$hasRelation = SocialManager::get_relation_between_contacts(
$currentUserId,
$userId,
true
@ -38,7 +38,7 @@ if ($hasRelation == 0) {
if (empty($userInfo)) {
api_not_allowed(true);
}
if (api_get_user_id() != $userId && !SocialManager::get_relation_between_contacts(api_get_user_id(),$userId)) {
if (api_get_user_id() != $userId && !SocialManager::get_relation_between_contacts(api_get_user_id(), $userId)) {
api_not_allowed(true);
}
// Pre-Loaded User Info

@ -4300,7 +4300,13 @@ function processWorkForm(
if (1 == count($userWorks)) {
// The student only uploaded one doc so far, so add the
// considered work time to his course connection time
Event::eventAddVirtualCourseTime($courseId, $userId, $sessionId, $workingTime, $workId);
Event::eventAddVirtualCourseTime(
$courseId,
$userId,
$sessionId,
$workingTime,
$workInfo['iid']
);
}
}
}
@ -4806,7 +4812,7 @@ function deleteWorkItem($item_id, $courseInfo)
$row['user_id'],
$sessionId,
$workingTime,
$item_id
$row['parent_id']
);
}
}

Loading…
Cancel
Save