Internal: Update from 1.11.x

pull/3466/head
Julio Montoya 5 years ago
parent 14963671d8
commit 54c2b4743a
  1. 2
      public/main/inc/lib/AnnouncementEmail.php
  2. 7
      public/main/inc/lib/agenda.lib.php
  3. 3
      public/main/session/index.php
  4. 6
      public/main/session/resume_session.php
  5. 6
      public/main/session/session_add.php
  6. 17
      public/main/session/session_category_edit.php
  7. 4
      public/main/session/session_category_list.php
  8. 1
      public/main/session/session_course_edit.php
  9. 1
      public/main/session/session_course_list.php
  10. 1
      public/main/session/session_course_user.php
  11. 24
      public/main/session/session_course_user_list.php
  12. 3
      public/main/session/session_edit.php
  13. 1
      public/main/session/session_export.php
  14. 1
      public/main/session/session_import.php
  15. 1
      public/main/session/session_import_drh.php
  16. 98
      public/main/session/session_list.php
  17. 1
      public/main/session/session_user_import.php
  18. 1
      public/main/social/download.php
  19. 1
      public/main/social/friends.php
  20. 1
      public/main/social/group_add.php
  21. 1
      public/main/social/group_edit.php
  22. 1
      public/main/social/group_invitation.php
  23. 1
      public/main/social/group_members.php
  24. 1
      public/main/social/group_topics.php
  25. 1
      public/main/social/group_waiting_list.php
  26. 1
      public/main/social/groups.php
  27. 2
      public/main/social/home.php
  28. 1
      public/main/social/map.php
  29. 1
      public/main/social/message_for_group_form.inc.php
  30. 4
      public/main/social/my_skills_report.php
  31. 3
      public/main/social/personal_data.php
  32. 78
      public/main/social/profile.php
  33. 1
      public/main/social/profile_friends_and_groups.inc.php
  34. 1
      public/main/social/promoted_messages.php
  35. 1
      public/main/social/search.php
  36. 1
      public/main/social/skills_ranking.php
  37. 1
      public/main/social/skills_wheel.php
  38. 1
      public/main/social/terms.php
  39. 18
      public/main/social/vcard_export.php
  40. 1
      public/main/social/view_promoted_message.php
  41. 27
      public/main/survey/fillsurvey.php
  42. 1
      public/main/survey/generate_link.php
  43. 1
      public/main/survey/meeting.php
  44. 1
      public/main/survey/pending.php
  45. 21
      public/main/survey/preview.php
  46. 9
      public/main/survey/reporting.php
  47. 158
      public/main/survey/survey.lib.php
  48. 93
      public/main/survey/survey.php
  49. 97
      public/main/survey/surveyUtil.class.php
  50. 1
      public/main/survey/survey_invitation.php
  51. 29
      public/main/survey/survey_invite.php
  52. 7
      public/main/survey/survey_list.php
  53. 93
      public/main/survey/survey_question.php
  54. 85
      public/main/tracking/courseLog.php
  55. 1
      public/main/tracking/course_log_resources.php
  56. 1
      public/main/tracking/course_log_tools.php
  57. 4
      public/main/tracking/course_session_report.php
  58. 1
      public/main/tracking/exams.php
  59. 1
      public/main/tracking/question_course_report.php
  60. 1
      public/main/tracking/total_time.php
  61. 1
      public/main/user/add_users_to_session.php
  62. 1
      public/main/user/career_diagram.php
  63. 1
      public/main/user/class.php
  64. 2
      public/main/user/classes.php
  65. 1
      public/main/user/resume_session.php
  66. 1
      public/main/user/session_list.php
  67. 118
      public/main/user/user.php
  68. 59
      public/main/user/user_export.php
  69. 1
      public/main/webservices/access_url.php
  70. 2
      public/main/webservices/additional_webservices.php
  71. 4
      public/main/webservices/api/tests/SaveUserTest.php
  72. 2
      public/main/webservices/api/tests/UpdateUserPauseTrainingTest.php
  73. 6
      public/main/webservices/api/v2.php
  74. 1
      public/main/webservices/cm_soap.php
  75. 1
      public/main/webservices/cm_soap_announcements.php
  76. 1
      public/main/webservices/cm_soap_course.php
  77. 1
      public/main/webservices/cm_soap_courses.php
  78. 1
      public/main/webservices/cm_soap_forum.php
  79. 1
      public/main/webservices/cm_soap_inbox.php
  80. 1
      public/main/webservices/cm_soap_user.php
  81. 1
      public/main/webservices/cm_webservice.php
  82. 1
      public/main/webservices/cm_webservice_announcements.php
  83. 1
      public/main/webservices/cm_webservice_course.php
  84. 1
      public/main/webservices/cm_webservice_courses.php
  85. 1
      public/main/webservices/cm_webservice_forum.php
  86. 1
      public/main/webservices/cm_webservice_inbox.php
  87. 1
      public/main/webservices/cm_webservice_user.php
  88. 2
      public/main/webservices/courses_list.rest.php
  89. 1
      public/main/webservices/courses_list.soap.php
  90. 1
      public/main/webservices/gradebook.php
  91. 1
      public/main/webservices/http-auth.php
  92. 1
      public/main/webservices/lp.php
  93. 1
      public/main/webservices/registration.soap.php
  94. 1
      public/main/webservices/soap.php
  95. 5
      public/main/webservices/soap.test.php
  96. 2
      public/main/webservices/soap_course.php
  97. 2
      public/main/webservices/soap_report.php
  98. 2
      public/main/webservices/soap_session.php
  99. 2
      public/main/webservices/soap_user.php
  100. 1
      public/main/webservices/testip.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -230,7 +230,7 @@ class AnnouncementEmail
$id = $this->announcement->getIid(); $id = $this->announcement->getIid();
$course_id = $this->course['real_id']; $course_id = $this->course['real_id'];
$sql = "SELECT * FROM $table $sql = "SELECT * FROM $table
WHERE c_id = $course_id AND announcement_id = $id "; WHERE announcement_id = $id ";
$rs = Database::query($sql); $rs = Database::query($sql);
while ($row = Database::fetch_array($rs)) { while ($row = Database::fetch_array($rs)) {
$result[] = $row; $result[] = $row;

@ -276,9 +276,7 @@ class Agenda
$id = $event->getId(); $id = $event->getId();
break; break;
case 'course': case 'course':
$senderId = $this->getSenderId();
$sessionId = $this->getSessionId(); $sessionId = $this->getSessionId();
$userEntity = api_get_user_entity(api_get_user_id());
$sessionEntity = api_get_session_entity($sessionId); $sessionEntity = api_get_session_entity($sessionId);
$courseEntity = api_get_course_entity($this->course['real_id']); $courseEntity = api_get_course_entity($this->course['real_id']);
$groupEntity = api_get_group_entity(api_get_group_id()); $groupEntity = api_get_group_entity(api_get_group_id());
@ -300,10 +298,7 @@ class Agenda
$event->setParentEventId($parentEventId); $event->setParentEventId($parentEventId);
} }
$event $event->setParent($courseEntity);
// ->addCourseLink($courseEntity, $groupEntity, $sessionEntity)
->setParent($courseEntity)
;
if (!empty($usersToSend)) { if (!empty($usersToSend)) {
$sendTo = $this->parseSendToArray($usersToSend); $sendTo = $this->parseSendToArray($usersToSend);

@ -42,7 +42,7 @@ Session::erase('duration_time');
$userId = api_get_user_id(); $userId = api_get_user_id();
$session_info = SessionManager::fetch($session_id); $session_info = SessionManager::fetch($session_id);
$session_list = SessionManager::get_sessions_by_general_coach(api_get_user_id()); $session_list = SessionManager::get_sessions_by_coach(api_get_user_id());
$courseList = SessionManager::get_course_list_by_session_id($session_id); $courseList = SessionManager::get_course_list_by_session_id($session_id);
$userIsGeneralCoach = SessionManager::user_is_general_coach($userId, $session_id); $userIsGeneralCoach = SessionManager::user_is_general_coach($userId, $session_id);
@ -663,7 +663,6 @@ $tabs = [
$tabToHide = api_get_setting('session.hide_tab_list'); $tabToHide = api_get_setting('session.hide_tab_list');
if (!empty($tabToHide)) { if (!empty($tabToHide)) {
$tabToHide = explode(',', $tabToHide);
foreach ($tabToHide as $columnId) { foreach ($tabToHide as $columnId) {
unset($headers[$columnId]); unset($headers[$columnId]);
unset($tabs[$columnId]); unset($tabs[$columnId]);

@ -24,7 +24,6 @@ if (empty($sessionId)) {
} }
SessionManager::protectSession($sessionId); SessionManager::protectSession($sessionId);
$codePath = api_get_path(WEB_CODE_PATH); $codePath = api_get_path(WEB_CODE_PATH);
$tool_name = get_lang('Session overview'); $tool_name = get_lang('Session overview');
@ -173,10 +172,7 @@ if (0 === $session->getNbrCourses()) {
foreach ($courses as $sessionRelCourse) { foreach ($courses as $sessionRelCourse) {
$course = $sessionRelCourse->getCourse(); $course = $sessionRelCourse->getCourse();
// Select the number of users // Select the number of users
$numberOfUsers = SessionManager::getCountUsersInCourseSession( $numberOfUsers = SessionManager::getCountUsersInCourseSession($course, $session);
$course,
$session
);
// Get coachs of the courses in session // Get coachs of the courses in session
$namesOfCoaches = []; $namesOfCoaches = [];

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;
@ -383,6 +384,7 @@ if ($form->validate()) {
$showDescription = isset($params['show_description']) ? 1 : 0; $showDescription = isset($params['show_description']) ? 1 : 0;
$sendSubscriptionNotification = isset($params['send_subscription_notification']); $sendSubscriptionNotification = isset($params['send_subscription_notification']);
$isThisImageCropped = isset($params['picture_crop_result']); $isThisImageCropped = isset($params['picture_crop_result']);
$status = isset($params['status']) ? $params['status'] : 0;
$extraFields = []; $extraFields = [];
foreach ($params as $key => $value) { foreach ($params as $key => $value) {
@ -435,7 +437,9 @@ if ($form->validate()) {
$showDescription, $showDescription,
$extraFields, $extraFields,
null, null,
$sendSubscriptionNotification $sendSubscriptionNotification,
api_get_current_access_url_id(),
$status
); );
if ($return == strval(intval($return))) { if ($return == strval(intval($return))) {

@ -1,15 +1,14 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/**
* Edition script for sessions categories.
*/
$cidReset = true; $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
// setting the section (for the tabs) // setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true); api_protect_admin_script(true);
$id = intval($_GET['id']); $id = (int) $_GET['id'];
$formSent = 0; $formSent = 0;
$errorMsg = ''; $errorMsg = '';
@ -31,9 +30,16 @@ if (!$infos = Database::fetch_array($result)) {
header('Location: session_list.php'); header('Location: session_list.php');
exit(); exit();
} }
$year_start = $month_start = $day_start = null;
$year_end = $month_end = $day_end = null;
if ($infos['date_start']) {
list($year_start, $month_start, $day_start) = explode('-', $infos['date_start']); list($year_start, $month_start, $day_start) = explode('-', $infos['date_start']);
}
if ($infos['date_end']) {
list($year_end, $month_end, $day_end) = explode('-', $infos['date_end']); list($year_end, $month_end, $day_end) = explode('-', $infos['date_end']);
}
if (!api_is_platform_admin() && $infos['session_admin_id'] != $_user['user_id'] && !api_is_session_admin()) { if (!api_is_platform_admin() && $infos['session_admin_id'] != $_user['user_id'] && !api_is_session_admin()) {
api_not_allowed(true); api_not_allowed(true);
@ -94,7 +100,8 @@ if (!empty($return)) {
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-3 col-sm-6"> <div class="col-sm-offset-3 col-sm-6">
<?php echo get_lang('The time limit of a category is referential, will not affect the boundaries of a training session'); ?> <?php echo get_lang('The time limit of a category is referential, will not affect the boundaries of a training session'); ?>
<a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('Edit time limit'); ?></a> <a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}">
<?php echo get_lang('Edit time limit'); ?></a>
</div> </div>
</div> </div>
<div style="display: <?php echo $formSent ? 'display' : 'none'; ?>;" id="options"> <div style="display: <?php echo $formSent ? 'display' : 'none'; ?>;" id="options">

@ -2,9 +2,7 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/**
* List sessions categories.
*/
$cidReset = true; $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Course;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;
@ -23,7 +24,7 @@ $course_code = Database::escape_string(trim($_GET['course_code']));
$courseInfo = api_get_course_info($course_code); $courseInfo = api_get_course_info($course_code);
$courseId = $courseInfo['real_id']; $courseId = $courseInfo['real_id'];
$page = isset($_GET['page']) ? intval($_GET['page']) : null; $page = isset($_GET['page']) ? (int) $_GET['page'] : null;
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
$default_sort = api_sort_by_first_name() ? 'firstname' : 'lastname'; $default_sort = api_sort_by_first_name() ? 'firstname' : 'lastname';
$sort = isset($_GET['sort']) && in_array($_GET['sort'], ['lastname', 'firstname', 'username']) $sort = isset($_GET['sort']) && in_array($_GET['sort'], ['lastname', 'firstname', 'username'])
@ -41,7 +42,7 @@ if (is_array($idChecked)) {
$my_temp = []; $my_temp = [];
foreach ($idChecked as $id) { foreach ($idChecked as $id) {
// forcing the intval // forcing the intval
$my_temp[] = intval($id); $my_temp[] = (int) $id;
} }
$idChecked = $my_temp; $idChecked = $my_temp;
} }
@ -82,19 +83,28 @@ switch ($action) {
$limit = 20; $limit = 20;
$from = $page * $limit; $from = $page * $limit;
$is_western_name_order = api_is_western_name_order(); $is_western_name_order = api_is_western_name_order();
$urlTable = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$urlId = api_get_current_access_url_id();
$sql = " $sql = "
SELECT DISTINCT u.user_id," SELECT DISTINCT u.user_id,"
.($is_western_name_order ? 'u.firstname, u.lastname' : 'u.lastname, u.firstname') .($is_western_name_order ? 'u.firstname, u.lastname' : 'u.lastname, u.firstname')
.", u.username, scru.user_id as is_subscribed .", u.username, scru.user_id as is_subscribed
FROM $tbl_session_rel_user s FROM $tbl_session_rel_user s
INNER JOIN $tbl_user u ON (u.user_id=s.user_id) INNER JOIN $tbl_user u
ON (u.id = s.user_id)
INNER JOIN $urlTable url
ON (url.user_id = u.id)
LEFT JOIN $tbl_session_rel_course_rel_user scru LEFT JOIN $tbl_session_rel_course_rel_user scru
ON (s.session_id = scru.session_id AND s.user_id = scru.user_id AND scru.c_id = $courseId) ON (s.session_id = scru.session_id AND s.user_id = scru.user_id AND scru.c_id = $courseId)
WHERE s.session_id = $id_session WHERE
s.session_id = $id_session AND
url.access_url_id = $urlId
ORDER BY $sort $direction ORDER BY $sort $direction
LIMIT $from,".($limit + 1); LIMIT $from,".($limit + 1);
if ('desc' == $direction) { if ($direction === 'desc') {
$direction = 'asc'; $direction = 'asc';
} else { } else {
$direction = 'desc'; $direction = 'desc';
@ -102,9 +112,7 @@ if ('desc' == $direction) {
$result = Database::query($sql); $result = Database::query($sql);
$users = Database::store_result($result); $users = Database::store_result($result);
$nbr_results = count($users);
$nbr_results = sizeof($users);
$tool_name = get_lang('Session').': '.$session_name.' - '.get_lang('Course').': '.$course_title; $tool_name = get_lang('Session').': '.$session_name.' - '.get_lang('Course').': '.$course_title;
$interbreadcrumb[] = ['url' => 'session_list.php', 'name' => get_lang('Session list')]; $interbreadcrumb[] = ['url' => 'session_list.php', 'name' => get_lang('Session list')];

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
@ -79,6 +80,8 @@ if (api_is_multiple_url_enabled()) {
$result = Database::query($sql); $result = Database::query($sql);
$coaches = Database::store_result($result); $coaches = Database::store_result($result);
$thisYear = date('Y');
$coachesOption = [ $coachesOption = [
'' => '----- '.get_lang('none').' -----', '' => '----- '.get_lang('none').' -----',
]; ];

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;

@ -6,7 +6,6 @@ $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
$error_message = '';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true); api_protect_admin_script(true);
api_protect_limit_for_session_admin(); api_protect_limit_for_session_admin();

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;

@ -1,11 +1,11 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* List sessions in an efficient and usable way. * List sessions in an efficient and usable way.
*/ */
$cidReset = true; $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
@ -16,7 +16,40 @@ $htmlHeadXtra[] = api_get_jqgrid_js();
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
$idChecked = isset($_REQUEST['idChecked']) ? $_REQUEST['idChecked'] : null; $idChecked = isset($_REQUEST['idChecked']) ? $_REQUEST['idChecked'] : null;
$list_type = isset($_REQUEST['list_type']) ? $_REQUEST['list_type'] : 'custom'; $listType = isset($_REQUEST['list_type']) ? Security::remove_XSS($_REQUEST['list_type']) : SessionManager::getDefaultSessionTab();
switch ($action) {
case 'delete':
$sessionInfo = api_get_session_info($idChecked);
if ($sessionInfo) {
$response = SessionManager::delete($idChecked);
if ($response) {
Display::addFlash(
Display::return_message(get_lang('Deleted').': '.Security::remove_XSS($sessionInfo['name']))
);
}
}
$url = 'session_list.php';
if ('custom' !== $listType) {
$url = 'session_list.php?list_type='.$listType;
}
header('Location: '.$url);
exit();
break;
case 'copy':
$result = SessionManager::copy($idChecked);
if ($result) {
Display::addFlash(Display::return_message(get_lang('ItemCopied')));
} else {
Display::addFlash(Display::return_message(get_lang('ThereWasAnError'), 'error'));
}
$url = 'session_list.php';
if ('custom' !== $listType) {
$url = 'session_list.php?list_type='.$listType;
}
header('Location: '.$url);
break;
}
$tool_name = get_lang('SessionList'); $tool_name = get_lang('SessionList');
Display::display_header($tool_name); Display::display_header($tool_name);
@ -92,22 +125,19 @@ if (isset($_REQUEST['id_category'])) {
} }
} }
$url .= '&list_type='.$list_type; $url .= '&list_type='.$listType;
$result = SessionManager::getGridColumns($listType);
$result = SessionManager::getGridColumns($list_type);
$columns = $result['columns']; $columns = $result['columns'];
$column_model = $result['column_model']; $column_model = $result['column_model'];
// Autowidth
$extra_params['autowidth'] = 'true'; $extra_params['autowidth'] = 'true';
// height auto
$extra_params['height'] = 'auto'; $extra_params['height'] = 'auto';
// Custom params switch ($listType) {
case 'custom':
$extra_params['sortname'] = 'display_end_date'; $extra_params['sortname'] = 'display_end_date';
$extra_params['sortorder'] = 'desc'; $extra_params['sortorder'] = 'desc';
break;
}
if (!isset($_GET['keyword'])) { if (!isset($_GET['keyword'])) {
$extra_params['postData'] = [ $extra_params['postData'] = [
@ -157,7 +187,7 @@ $orderUrl = api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=order';
grid.showCol('name').trigger('reloadGrid'); grid.showCol('name').trigger('reloadGrid');
for (key in added_cols) { for (key in added_cols) {
grid.showCol(key); grid.showCol(key);
}; }
} }
var second_filters = []; var second_filters = [];
@ -216,9 +246,8 @@ $orderUrl = api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=order';
?> ?>
setSearchSelect("status"); setSearchSelect("status");
var grid = $("#sessions"), var grid = $("#sessions"),
prmSearch = { var prmSearch = {
multipleSearch : true, multipleSearch : true,
overlay : false, overlay : false,
width: 'auto', width: 'auto',
@ -295,7 +324,15 @@ $orderUrl = api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=order';
searchDialogAll.addClass("table"); searchDialogAll.addClass("table");
var searchDialog = $("#searchmodfbox_"+grid[0].id); var searchDialog = $("#searchmodfbox_"+grid[0].id);
searchDialog.addClass("ui-jqgrid ui-widget ui-widget-content ui-corner-all"); searchDialog.addClass("ui-jqgrid ui-widget ui-widget-content ui-corner-all");
searchDialog.css({position:"absolute", "z-index":"100", "float":"left", "top":"55%", "left" : "25%", "padding" : "5px", "border": "1px solid #CCC"}) searchDialog.css({
position: "absolute",
"z-index": "100",
"float": "left",
"top": "55%",
"left": "25%",
"padding": "5px",
"border": "1px solid #CCC"
})
var gbox = $("#gbox_"+grid[0].id); var gbox = $("#gbox_"+grid[0].id);
gbox.before(searchDialog); gbox.before(searchDialog);
gbox.css({clear:"left"}); gbox.css({clear:"left"});
@ -326,14 +363,6 @@ if (api_is_platform_admin()) {
Display::return_icon('folder.png', get_lang('Sessions categories list'), '', ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('folder.png', get_lang('Sessions categories list'), '', ICON_SIZE_MEDIUM).'</a>';
} }
/*if ($list_type == 'complete') {
echo '<a href="'.api_get_self().'?list_type=simple">'.
Display::return_icon('view_remove.png', get_lang('Simple'), '', ICON_SIZE_MEDIUM).'</a>';
} else {
echo '<a href="'.api_get_self().'?list_type=complete">'.
Display::return_icon('view_text.png', get_lang('Complete'), '', ICON_SIZE_MEDIUM).'</a>';
}*/
echo $actions; echo $actions;
if (api_is_platform_admin()) { if (api_is_platform_admin()) {
echo '<div class="pull-right">'; echo '<div class="pull-right">';
@ -341,14 +370,13 @@ if (api_is_platform_admin()) {
$form = new FormValidator( $form = new FormValidator(
'search_simple', 'search_simple',
'get', 'get',
'', api_get_self().'?list_type='.$listType,
'', '',
[], [],
FormValidator::LAYOUT_INLINE FormValidator::LAYOUT_INLINE
); );
$form->addElement('text', 'keyword', null, [ $form->addElement('text', 'keyword', null, ['aria-label' => get_lang('Search')]);
'aria-label' => get_lang('Search'), $form->addHidden('list_type', $listType);
]);
$form->addButtonSearch(get_lang('Search')); $form->addButtonSearch(get_lang('Search'));
$form->display(); $form->display();
echo '</div>'; echo '</div>';
@ -359,22 +387,8 @@ if (api_is_platform_admin()) {
} }
echo '</div>'; echo '</div>';
$tabs = [ echo SessionManager::getSessionListTabs($listType);
[
'content' => get_lang('SessionListCustom'),
'url' => api_get_path(WEB_CODE_PATH).'session/session_list.php',
],
[
'content' => get_lang('SessionList'),
'url' => api_get_path(WEB_CODE_PATH).'session/session_list_simple.php',
],
[
'content' => get_lang('Complete'),
'url' => api_get_path(WEB_CODE_PATH).'session/session_list_simple.php?list_type=complete',
],
];
echo Display::tabsOnlyLink($tabs, 1);
echo '<div id="session-table" class="table-responsive">'; echo '<div id="session-table" class="table-responsive">';
echo Display::grid_html('sessions'); echo Display::grid_html('sessions');
echo '</div>'; echo '</div>';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use ChamiloSession as Session; use ChamiloSession as Session;
@ -54,7 +55,6 @@ $social_group_block = SocialManager::getGroupBlock($user_id);
$friend_html = SocialManager::listMyFriendsBlock($user_id); $friend_html = SocialManager::listMyFriendsBlock($user_id);
// Block Social Sessions // Block Social Sessions
$wallSocialAddPost = SocialManager::getWallForm(api_get_self()); $wallSocialAddPost = SocialManager::getWallForm(api_get_self());
$socialAutoExtendLink = SocialManager::getAutoExtendLink($user_id, $countPost); $socialAutoExtendLink = SocialManager::getAutoExtendLink($user_id, $countPost);

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,12 +1,14 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Framework\Container;
/** /**
* Show the skills report. * Show the skills report.
* *
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
*/ */
use Chamilo\CoreBundle\Framework\Container;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Repository\LegalRepository; use Chamilo\CoreBundle\Repository\LegalRepository;
@ -8,7 +9,6 @@ $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
api_set_more_memory_and_time_limits(); api_set_more_memory_and_time_limits();
api_block_anonymous_users(); api_block_anonymous_users();
if (api_get_configuration_value('disable_gdpr')) { if (api_get_configuration_value('disable_gdpr')) {
@ -151,7 +151,6 @@ switch ($action) {
$explanation = $form->getSubmitValue('explanation'); $explanation = $form->getSubmitValue('explanation');
UserManager::createDataPrivacyExtraFields(); UserManager::createDataPrivacyExtraFields();
UserManager::update_extra_field_value( UserManager::update_extra_field_value(
$userId, $userId,
'request_for_legal_agreement_consent_removal', 'request_for_legal_agreement_consent_removal',

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use ChamiloSession as Session; use ChamiloSession as Session;
@ -20,7 +21,29 @@ if ('true' != api_get_setting('allow_social_tool')) {
exit; exit;
} }
$bossId = isset($_REQUEST['sup']) ? (int) $_REQUEST['sup'] : 0;
$user_id = api_get_user_id(); $user_id = api_get_user_id();
$redirectToBossId = 0;
if (!empty($bossId)) {
$bossList = UserManager::getStudentBossList($user_id);
if (!empty($bossList)) {
foreach ($bossList as $boss) {
$bossId = $boss['boss_id'];
$bossInfo = api_get_user_info($bossId);
if (!empty($bossInfo)) {
$redirectToBossId = $bossId;
break;
}
}
}
}
if (!empty($redirectToBossId)) {
header('Location: '.api_get_self().'?u='.$redirectToBossId);
exit;
}
$friendId = isset($_GET['u']) ? (int) $_GET['u'] : api_get_user_id(); $friendId = isset($_GET['u']) ? (int) $_GET['u'] : api_get_user_id();
$show_full_profile = true; $show_full_profile = true;
//social tab //social tab
@ -101,26 +124,7 @@ if (isset($_GET['u']) && is_numeric($_GET['u']) && $_GET['u'] != api_get_user_id
]; ];
} }
Session::write('social_user_id', (int) $user_id); Session::write('social_user_id', $user_id);
// Setting some course info
/*$course_list_code = [];
$personal_course_list = UserManager::get_personal_session_course_list($friendId, 50);
$i = 1;
$list = [];
if (is_array($personal_course_list)) {
foreach ($personal_course_list as $my_course) {
if ($i <= 10) {
$list[] = SocialManager::get_logged_user_course_html($my_course, $i);
$course_list_code[] = ['code' => $my_course['code']];
} else {
break;
}
$i++;
}
//to avoid repeted courses
$course_list_code = array_unique_dimensional($course_list_code);
}*/
// Social Block Menu // Social Block Menu
$menu = SocialManager::show_social_menu( $menu = SocialManager::show_social_menu(
@ -132,7 +136,6 @@ $menu = SocialManager::show_social_menu(
//Setting some session info //Setting some session info
$user_info = api_get_user_info($friendId); $user_info = api_get_user_info($friendId);
//$sessionList = SessionManager::getSessionsFollowedByUser($friendId, $user_info['status']);
$sessionList = []; $sessionList = [];
// My friends // My friends
@ -150,20 +153,6 @@ $listInvitations = '';
if ($show_full_profile) { if ($show_full_profile) {
$social_group_info_block = SocialManager::getGroupBlock($friendId); $social_group_info_block = SocialManager::getGroupBlock($friendId);
/*
$my_courses = null;
// COURSES LIST
if (is_array($list)) {
$i = 1;
foreach ($list as $key => $value) {
if (empty($value[2])) { //if out of any session
$my_courses .= $value[1];
$i++;
}
}
$social_course_block .= $my_courses;
}*/
// Block Social Sessions // Block Social Sessions
if (count($sessionList) > 0) { if (count($sessionList) > 0) {
$social_session_block = $sessionList; $social_session_block = $sessionList;
@ -181,17 +170,6 @@ if ($show_full_profile) {
// Images uploaded by course // Images uploaded by course
$file_list = ''; $file_list = '';
/*
if (is_array($course_list_code) && count($course_list_code) > 0) {
foreach ($course_list_code as $course) {
$file_list .= UserManager::get_user_upload_files_by_course(
$user_id,
$course['code'],
'images'
);
}
}*/
$count_pending_invitations = 0; $count_pending_invitations = 0;
if (!isset($_GET['u']) || if (!isset($_GET['u']) ||
(isset($_GET['u']) && $_GET['u'] == api_get_user_id()) (isset($_GET['u']) && $_GET['u'] == api_get_user_id())
@ -255,14 +233,6 @@ if ($show_full_profile) {
} }
$images_uploaded = null; $images_uploaded = null;
// Images uploaded by course
/*if (!empty($file_list)) {
$images_uploaded .= '<div><h3>'.get_lang('Uploaded images').'</h3></div>';
$images_uploaded .= '<div class="social-content-information">';
$images_uploaded .= $file_list;
$images_uploaded .= '</div>';
$socialRightInformation .= SocialManager::social_wrapper_div($images_uploaded, 4);
}*/
} }
if (!empty($user_info['competences']) || !empty($user_info['diplomas']) if (!empty($user_info['competences']) || !empty($user_info['diplomas'])

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use JeroenDesloovere\VCard\VCard; use JeroenDesloovere\VCard\VCard;
@ -11,7 +12,6 @@ use JeroenDesloovere\VCard\VCard;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
api_block_anonymous_users(); api_block_anonymous_users();
api_protect_admin_script();
if (isset($_REQUEST['userId'])) { if (isset($_REQUEST['userId'])) {
$userId = intval($_REQUEST['userId']); $userId = intval($_REQUEST['userId']);
@ -22,10 +22,24 @@ if (isset($_REQUEST['userId'])) {
// Return User Info to vCard Export // Return User Info to vCard Export
$userInfo = api_get_user_info($userId, true, false, true); $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(
$currentUserId,
$userId,
true
);
if ($hasRelation == 0) {
/* if has not relation, check if are admin */
api_protect_admin_script();
}
if (empty($userInfo)) { if (empty($userInfo)) {
api_not_allowed(true); api_not_allowed(true);
} }
if (api_get_user_id() != $userId && !SocialManager::get_relation_between_contacts(api_get_user_id(), $userId)) {
api_not_allowed(true);
}
// Pre-Loaded User Info // Pre-Loaded User Info
$language = get_lang('Language').': '.$userInfo['language']; $language = get_lang('Language').': '.$userInfo['language'];

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;

@ -378,7 +378,6 @@ if (count($_POST) > 0) {
$result = Database::query($sql); $result = Database::query($sql);
$row = Database::fetch_array($result, 'ASSOC'); $row = Database::fetch_array($result, 'ASSOC');
$option_value = $row['value']; $option_value = $row['value'];
//$option_value = 0;
$survey_question_answer = $value; $survey_question_answer = $value;
// We save the answer after making sure that a possible previous attempt is deleted // We save the answer after making sure that a possible previous attempt is deleted
@ -406,7 +405,6 @@ if (count($_POST) > 0) {
} }
$user_id = api_get_user_id(); $user_id = api_get_user_id();
if (0 == $user_id) { if (0 == $user_id) {
$user_id = $survey_invitation['user']; $user_id = $survey_invitation['user'];
} }
@ -674,7 +672,8 @@ if (1 == $survey_data['shuffle']) {
$shuffle = ' BY RAND() '; $shuffle = ' BY RAND() ';
} }
if ((isset($_GET['show']) && '' != $_GET['show']) || $pageBreakText = [];
if ((isset($_GET['show']) && $_GET['show'] != '') ||
isset($_POST['personality']) isset($_POST['personality'])
) { ) {
// Getting all the questions for this page and add them to a // Getting all the questions for this page and add them to a
@ -709,6 +708,7 @@ if ((isset($_GET['show']) && '' != $_GET['show']) ||
} else { } else {
if ('pagebreak' == $row['type']) { if ('pagebreak' == $row['type']) {
$counter++; $counter++;
$pageBreakText[$counter] = $row['survey_question'];
} else { } else {
$paged_questions[$counter][] = $row['question_id']; $paged_questions[$counter][] = $row['question_id'];
} }
@ -1001,6 +1001,7 @@ if ((isset($_GET['show']) && '' != $_GET['show']) ||
$counter++; $counter++;
} elseif ('pagebreak' == $row['type']) { } elseif ('pagebreak' == $row['type']) {
$counter++; $counter++;
$pageBreakText[$counter] = $row['survey_question'];
} else { } else {
// ids from question of the current survey // ids from question of the current survey
$paged_questions_sec[$counter][] = $row['question_id']; $paged_questions_sec[$counter][] = $row['question_id'];
@ -1105,6 +1106,7 @@ if ((isset($_GET['show']) && '' != $_GET['show']) ||
} else { } else {
if ('pagebreak' == $row['type']) { if ('pagebreak' == $row['type']) {
$counter++; $counter++;
$pageBreakText[$counter] = $row['survey_question'];
} else { } else {
// ids from question of the current survey // ids from question of the current survey
$paged_questions[$counter][] = $row['question_id']; $paged_questions[$counter][] = $row['question_id'];
@ -1237,6 +1239,11 @@ $form = new FormValidator(
); );
$form->addHidden('language', $p_l); $form->addHidden('language', $p_l);
$showNumber = true;
if (SurveyManager::hasDependency($survey_data)) {
$showNumber = false;
}
if (isset($questions) && is_array($questions)) { if (isset($questions) && is_array($questions)) {
$originalShow = isset($_GET['show']) ? (int) $_GET['show'] : 0; $originalShow = isset($_GET['show']) ? (int) $_GET['show'] : 0;
$questionCounter = 1; $questionCounter = 1;
@ -1252,6 +1259,18 @@ if (isset($questions) && is_array($questions)) {
$form->addHtml('<div class="start-survey">'); $form->addHtml('<div class="start-survey">');
$js = ''; $js = '';
if (isset($pageBreakText[$originalShow]) && !empty(strip_tags($pageBreakText[$originalShow]))) {
// Only show page-break texts if there is something there, apart from
// HTML tags
$form->addHtml(
'<div>'.
Security::remove_XSS($pageBreakText[$originalShow]).
'</div>'
);
$form->addHtml('<br />');
}
foreach ($questions as $key => &$question) { foreach ($questions as $key => &$question) {
$ch_type = 'ch_'.$question['type']; $ch_type = 'ch_'.$question['type'];
$questionNumber = $questionCounter; $questionNumber = $questionCounter;
@ -1273,7 +1292,9 @@ if (isset($questions) && is_array($questions)) {
// @todo move this in a function. // @todo move this in a function.
$form->addHtml('<div class="survey_question '.$ch_type.' '.$parentClass.'">'); $form->addHtml('<div class="survey_question '.$ch_type.' '.$parentClass.'">');
if ($showNumber) {
$form->addHtml('<div style="float:left; font-weight: bold; margin-right: 5px;"> '.$questionNumber.'. </div>'); $form->addHtml('<div style="float:left; font-weight: bold; margin-right: 5px;"> '.$questionNumber.'. </div>');
}
$form->addHtml('<div>'.Security::remove_XSS($question['survey_question']).'</div> '); $form->addHtml('<div>'.Security::remove_XSS($question['survey_question']).'</div> ');
$userAnswerData = SurveyUtil::get_answers_of_question_by_user($question['survey_id'], $question['question_id']); $userAnswerData = SurveyUtil::get_answers_of_question_by_user($question['survey_id'], $question['question_id']);

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Course; use Chamilo\CoreBundle\Entity\Course;

@ -76,6 +76,7 @@ if (isset($_POST['finish_survey'])) {
} }
$questions = []; $questions = [];
$pageBreakText = [];
if (isset($_GET['show'])) { if (isset($_GET['show'])) {
// Getting all the questions for this page and add them to a // Getting all the questions for this page and add them to a
// multidimensional array where the first index is the page. // multidimensional array where the first index is the page.
@ -101,6 +102,7 @@ if (isset($_GET['show'])) {
} else { } else {
if ('pagebreak' == $row['type']) { if ('pagebreak' == $row['type']) {
$counter++; $counter++;
$pageBreakText[$counter] = $row['survey_question'];
} else { } else {
$paged_questions[$counter][] = $row['question_id']; $paged_questions[$counter][] = $row['question_id'];
} }
@ -191,7 +193,24 @@ if (is_array($questions) && count($questions) > 0) {
$counter = $before + 1; $counter = $before + 1;
} }
$showNumber = true;
if (SurveyManager::hasDependency($survey_data)) {
$showNumber = false;
}
$js = ''; $js = '';
if (isset($pageBreakText[$originalShow]) && !empty(strip_tags($pageBreakText[$originalShow]))) {
// Only show page-break texts if there is something there, apart from
// HTML tags
$form->addHtml(
'<div>'.
Security::remove_XSS($pageBreakText[$originalShow]).
'</div>'
);
$form->addHtml('<br />');
}
foreach ($questions as $key => &$question) { foreach ($questions as $key => &$question) {
$ch_type = 'ch_'.$question['type']; $ch_type = 'ch_'.$question['type'];
$display = survey_question::createQuestion($question['type']); $display = survey_question::createQuestion($question['type']);
@ -211,7 +230,9 @@ if (is_array($questions) && count($questions) > 0) {
$js .= survey_question::getQuestionJs($question); $js .= survey_question::getQuestionJs($question);
$form->addHtml('<div class="survey_question '.$ch_type.' '.$parentClass.'">'); $form->addHtml('<div class="survey_question '.$ch_type.' '.$parentClass.'">');
if ($showNumber) {
$form->addHtml('<div style="float:left; font-weight: bold; margin-right: 5px;"> '.$counter.'. </div>'); $form->addHtml('<div style="float:left; font-weight: bold; margin-right: 5px;"> '.$counter.'. </div>');
}
$form->addHtml('<div>'.Security::remove_XSS($question['survey_question']).'</div> '); $form->addHtml('<div>'.Security::remove_XSS($question['survey_question']).'</div> ');
$display->render($form, $question); $display->render($form, $question);
$form->addHtml('</div>'); $form->addHtml('</div>');

@ -58,16 +58,21 @@ if (!api_is_allowed_to_edit(false, true) || $isDrhOfCourse) {
$exportReport = isset($_REQUEST['export_report']) ? $_REQUEST['export_report'] : ''; $exportReport = isset($_REQUEST['export_report']) ? $_REQUEST['export_report'] : '';
$format = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : ''; $format = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : '';
if (!empty($exportReport) && !empty($format)) { if (!empty($exportReport) && !empty($format)) {
$compact = false;
switch ($format) { switch ($format) {
case 'xls': case 'xls':
$filename = 'survey_results_'.$survey_id.'.xlsx'; $filename = 'survey_results_'.$survey_id.'.xlsx';
SurveyUtil::export_complete_report_xls($survey_data, $filename, $userId); SurveyUtil::export_complete_report_xls($survey_data, $filename, $userId);
exit; exit;
break; break;
case 'csv-compact':
$compact = true;
// no break
case 'csv': case 'csv':
default: default:
$data = SurveyUtil::export_complete_report($survey_data, $userId); $data = SurveyUtil::export_complete_report($survey_data, $userId, $compact);
$filename = 'survey_results_'.$survey_id.'.csv'; $filename = 'survey_results_'.$survey_id.($compact ? '_compact' : '').'.csv';
header('Content-type: application/octet-stream'); header('Content-type: application/octet-stream');
header('Content-Type: application/force-download'); header('Content-Type: application/force-download');

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CourseBundle\Entity\CSurvey; use Chamilo\CourseBundle\Entity\CSurvey;
@ -682,6 +683,8 @@ class SurveyManager
} }
/** /**
* Copy given survey to a new (optional) given survey ID.
*
* @param int $survey_id * @param int $survey_id
* @param int $new_survey_id * @param int $new_survey_id
* @param int $targetCourseId * @param int $targetCourseId
@ -742,7 +745,7 @@ class SurveyManager
} }
$sql = "SELECT * FROM $table_survey_question_group $sql = "SELECT * FROM $table_survey_question_group
WHERE c_id = $course_id AND survey_id='".$survey_id."'"; WHERE c_id = $course_id AND survey_id = $survey_id";
$res = Database::query($sql); $res = Database::query($sql);
while ($row = Database::fetch_array($res, 'ASSOC')) { while ($row = Database::fetch_array($res, 'ASSOC')) {
$params = [ $params = [
@ -762,7 +765,7 @@ class SurveyManager
// Get questions // Get questions
$sql = "SELECT * FROM $table_survey_question $sql = "SELECT * FROM $table_survey_question
WHERE c_id = $course_id AND survey_id='".$survey_id."'"; WHERE c_id = $course_id AND survey_id = $survey_id";
$res = Database::query($sql); $res = Database::query($sql);
while ($row = Database::fetch_array($res, 'ASSOC')) { while ($row = Database::fetch_array($res, 'ASSOC')) {
$params = [ $params = [
@ -1495,6 +1498,8 @@ class SurveyManager
* @param int $question_id the id of the question * @param int $question_id the id of the question
* @param bool $shared * @param bool $shared
* *
* @return mixed False on error, true if the question could be deleted
*
* @todo also delete the answers to this question * @todo also delete the answers to this question
* *
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
@ -1517,12 +1522,16 @@ class SurveyManager
$sql = "DELETE FROM $table $sql = "DELETE FROM $table
WHERE WHERE
c_id = $course_id AND c_id = $course_id AND
survey_id='".$survey_id."' AND survey_id = $survey_id AND
question_id='".$question_id."'"; question_id = $question_id";
Database::query($sql); $result = Database::query($sql);
if (false == $result) {
return false;
}
// Deleting the options of the question of the survey
self::delete_survey_question_option($survey_id, $question_id, $shared); self::delete_survey_question_option($survey_id, $question_id, $shared);
// Deleting the options of the question of the survey
return true;
} }
/** /**
@ -1571,8 +1580,9 @@ class SurveyManager
{ {
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
$type = $form_content['type']; $type = $form_content['type'];
// A percentage question type has options 1 -> 100 // A percentage question type has options 1 -> 100
if ('percentage' === $form_content['type']) { if ($type === 'percentage') {
for ($i = 1; $i < 101; $i++) { for ($i = 1; $i < 101; $i++) {
$form_content['answers'][] = $i; $form_content['answers'][] = $i;
} }
@ -2114,7 +2124,7 @@ class SurveyManager
} }
/** /**
* This function copy survey specifying course id and session id where will be copied. * Copy survey specifying course ID and session ID where will be copied.
* *
* @param int $surveyId * @param int $surveyId
* @param int $targetCourseId target course id * @param int $targetCourseId target course id
@ -2159,7 +2169,7 @@ class SurveyManager
Database::query($sql); Database::query($sql);
$sql = "SELECT * FROM $surveyQuestionGroupTable $sql = "SELECT * FROM $surveyQuestionGroupTable
WHERE survey_id = $surveyId AND c_id = $originalCourseId "; WHERE c_id = $originalCourseId AND survey_id = $surveyId";
$res = Database::query($sql); $res = Database::query($sql);
while ($row = Database::fetch_array($res, 'ASSOC')) { while ($row = Database::fetch_array($res, 'ASSOC')) {
$params = [ $params = [
@ -2178,7 +2188,7 @@ class SurveyManager
// Get questions // Get questions
$sql = "SELECT * FROM $surveyQuestionTable $sql = "SELECT * FROM $surveyQuestionTable
WHERE survey_id = $surveyId AND c_id = $originalCourseId"; WHERE c_id = $originalCourseId AND survey_id = $surveyId";
$res = Database::query($sql); $res = Database::query($sql);
while ($row = Database::fetch_array($res, 'ASSOC')) { while ($row = Database::fetch_array($res, 'ASSOC')) {
$params = [ $params = [
@ -2240,6 +2250,88 @@ class SurveyManager
return false; return false;
} }
/**
* Copy/duplicate one question (into the same survey).
* Note: Relies on the question iid to find all necessary info.
*
* @param int $questionId
*
* @return int The new question's iid, or 0 on error
*/
public static function copyQuestion($questionId)
{
if (empty($questionId)) {
return 0;
}
$questionId = (int) $questionId;
$questionTable = Database::get_course_table(TABLE_SURVEY_QUESTION);
$optionsTable = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
// Get questions
$sql = "SELECT * FROM $questionTable WHERE iid = $questionId";
$res = Database::query($sql);
if (false == $res) {
// Could not find this question
return 0;
}
$row = Database::fetch_array($res, 'ASSOC');
$params = [
'c_id' => $row['c_id'],
'survey_id' => $row['survey_id'],
'survey_question' => trim($row['survey_question'])."'",
'survey_question_comment' => $row['survey_question_comment'],
'type' => $row['type'],
'display' => $row['display'],
'shared_question_id' => $row['shared_question_id'],
'max_value' => $row['max_value'],
'survey_group_pri' => $row['survey_group_pri'],
'survey_group_sec1' => $row['survey_group_sec1'],
'survey_group_sec2' => $row['survey_group_sec2'],
];
if (api_get_configuration_value('allow_required_survey_questions')) {
if (isset($row['is_required'])) {
$params['is_required'] = $row['is_required'];
}
}
// Get question position
$sqlSort = "SELECT max(sort) as sort FROM $questionTable
WHERE survey_id = ".$row['survey_id'];
$resSort = Database::query($sqlSort);
$rowSort = Database::fetch_assoc($resSort);
$params['sort'] = $rowSort['sort'] + 1;
// Insert the new question
$insertId = Database::insert($questionTable, $params);
if (false == $insertId) {
return 0;
}
// Normalize question_id with iid
$sql = "UPDATE $questionTable
SET question_id = iid
WHERE iid = $insertId";
Database::query($sql);
// Get questions options
$sql = "SELECT * FROM $optionsTable WHERE question_id = $questionId";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
$params = [
'c_id' => $row['c_id'],
'question_id' => $insertId,
'survey_id' => $row['survey_id'],
'option_text' => $row['option_text'],
'sort' => $row['sort'],
'value' => $row['value'],
];
$optionId = Database::insert($optionsTable, $params);
if ($optionId) {
$sql = "UPDATE $optionsTable SET question_option_id = $optionId WHERE iid = $optionId";
Database::query($sql);
}
}
return $insertId;
}
/** /**
* @param array $surveyData * @param array $surveyData
* *
@ -2420,6 +2512,42 @@ class SurveyManager
return true; return true;
} }
public static function hasDependency($survey)
{
if (false === api_get_configuration_value('survey_question_dependency')) {
return false;
}
if (empty($survey)) {
return false;
}
if (!isset($survey['survey_id'])) {
return false;
}
$courseId = (int) $survey['c_id'];
$surveyId = (int) $survey['survey_id'];
$table = Database::get_course_table(TABLE_SURVEY_QUESTION);
$sql = "SELECT COUNT(iid) count FROM $table
WHERE
c_id = $courseId AND
survey_id = $surveyId AND
parent_option_id <> 0
LIMIT 1
";
$result = Database::query($sql);
$row = Database::fetch_array($result);
if ($row) {
return $row['count'] > 0;
}
return false;
}
/** /**
* @param array $survey * @param array $survey
* *
@ -2431,8 +2559,8 @@ class SurveyManager
return 0; return 0;
} }
$courseId = $survey['c_id']; $courseId = (int) $survey['c_id'];
$surveyId = $survey['survey_id']; $surveyId = (int) $survey['survey_id'];
$table = Database::get_course_table(TABLE_SURVEY_QUESTION); $table = Database::get_course_table(TABLE_SURVEY_QUESTION);
@ -2530,7 +2658,8 @@ class SurveyManager
$groupId = 0 $groupId = 0
) { ) {
$invitationRepo = Database::getManager()->getRepository('ChamiloCourseBundle:CSurveyInvitation'); $invitationRepo = Database::getManager()->getRepository('ChamiloCourseBundle:CSurveyInvitation');
$invitations = $invitationRepo->findBy(
return $invitationRepo->findBy(
[ [
'user' => $userId, 'user' => $userId,
'cId' => $courseId, 'cId' => $courseId,
@ -2540,8 +2669,6 @@ class SurveyManager
], ],
['invitationDate' => 'DESC'] ['invitationDate' => 'DESC']
); );
return $invitations;
} }
/** /**
@ -2699,6 +2826,7 @@ class SurveyManager
); );
SurveyUtil::saveInvitations( SurveyUtil::saveInvitations(
$surveyId,
['users' => $tutor['user_id']], ['users' => $tutor['user_id']],
$subject, $subject,
$content, $content,

@ -33,9 +33,12 @@ if (!api_is_allowed_to_edit(false, true) ||
} }
// Database table definitions // Database table definitions
$table_survey = Database::get_course_table(TABLE_SURVEY);
$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION); $table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
$table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION); $table_survey_question_option = Database::get_course_table(TABLE_SURVEY_QUESTION_OPTION);
$table_survey_question_group = Database::get_course_table(TABLE_SURVEY_QUESTION_GROUP); $table_survey_question_group = Database::get_course_table(TABLE_SURVEY_QUESTION_GROUP);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$survey_id = (int) $_GET['survey_id']; $survey_id = (int) $_GET['survey_id'];
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
@ -94,32 +97,63 @@ if ($is_survey_type_1 && ('addgroup' == $action || 'deletegroup' == $action)) {
exit; exit;
} }
$htmlHeadXtra[] = '<script>'.api_get_language_translate_html().'</script>';
$my_question_id_survey = isset($_GET['question_id']) ? (int) $_GET['question_id'] : null;
$my_survey_id_survey = (int) $_GET['survey_id'];
$message_information = isset($_GET['message']) ? Security::remove_XSS($_GET['message']) : null;
// Displaying the header // Displaying the header
Display::display_header($tool_name, 'Survey'); if (!empty($action)) {
switch ($action) {
// Action handling case 'copyquestion':
$my_action_survey = Security::remove_XSS($action); $copied = SurveyManager::copyQuestion($_GET['question_id']);
$my_question_id_survey = isset($_GET['question_id']) ? Security::remove_XSS($_GET['question_id']) : null; if (false !== $copied) {
$my_survey_id_survey = Security::remove_XSS($_GET['survey_id']); $sendmsg = 'QuestionAdded';
} else {
if (isset($action)) { $sendmsg = 'ErrorOccurred';
if (('moveup' == $action || 'movedown' == $action) && isset($_GET['question_id'])) {
SurveyManager::move_survey_question(
$my_action_survey,
$my_question_id_survey,
$my_survey_id_survey
);
echo Display::return_message(get_lang('The question has been moved'), 'confirmation');
} }
if ('delete' == $action && is_numeric($_GET['question_id'])) { break;
SurveyManager::delete_survey_question( case 'delete':
$result = SurveyManager::delete_survey_question(
$my_survey_id_survey, $my_survey_id_survey,
$my_question_id_survey, $my_question_id_survey,
$survey_data['is_shared'] $survey_data['is_shared']
); );
if (false == $result) {
$sendmsg = 'ErrorOccured';
} else {
$sendmsg = 'Deleted';
}
break;
case 'moveup':
case 'movedown':
SurveyManager::move_survey_question(
$action,
$my_question_id_survey,
$my_survey_id_survey
);
$sendmsg = 'SurveyQuestionMoved';
break;
}
header('Location: '.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&sendmsg='.$sendmsg);
exit;
} }
$htmlHeadXtra[] = '<script>'.api_get_language_translate_html().'</script>';
// Displaying the header
Display::display_header($tool_name, 'Survey');
// Show error/success messages, if any
if (!$is_survey_type_1 && !empty($_GET['sendmsg'])) {
$messageType = 'confirmation';
if (in_array($_GET['sendmsg'], ['ErrorOccurred'])) {
$messageType = 'error';
}
echo Display::return_message(
get_lang($_GET['sendmsg']),
'confirmation',
false
);
} }
if (!empty($survey_data['survey_version'])) { if (!empty($survey_data['survey_version'])) {
@ -222,7 +256,7 @@ if (0 == $survey_data['survey_type']) {
} }
// Displaying the table header with all the questions // Displaying the table header with all the questions
echo '<table class="table table-bordered">'; echo '<table class="table table-bordered data_table">';
echo '<thead>'; echo '<thead>';
echo '<tr>'; echo '<tr>';
echo ' <th width="5%">'.get_lang('N°').'</th>'; echo ' <th width="5%">'.get_lang('N°').'</th>';
@ -252,7 +286,7 @@ $sql = "SELECT survey_question.*, count(survey_question_option.question_option_i
LEFT JOIN $table_survey_question_option survey_question_option LEFT JOIN $table_survey_question_option survey_question_option
ON ON
survey_question.question_id = survey_question_option.question_id AND survey_question.question_id = survey_question_option.question_id AND
survey_question_option.c_id = survey_question.c_id survey_question_option.c_id = $course_id
WHERE WHERE
survey_question.survey_id = $survey_id AND survey_question.survey_id = $survey_id AND
survey_question.c_id = $course_id survey_question.c_id = $course_id
@ -261,8 +295,20 @@ $sql = "SELECT survey_question.*, count(survey_question_option.question_option_i
$result = Database::query($sql); $result = Database::query($sql);
$question_counter_max = Database::num_rows($result); $question_counter_max = Database::num_rows($result);
$questionsGroupClass = '';
while ($row = Database::fetch_array($result, 'ASSOC')) { while ($row = Database::fetch_array($result, 'ASSOC')) {
echo '<tr>'; $breakClass = '';
// Visually impact questions between page breaks by changing the bg color
if ($row['type'] == 'pagebreak') {
$breakClass = ' highlight';
if (empty($questionsGroupClass)) {
$questionsGroupClass = 'row_even';
} else {
$questionsGroupClass = '';
}
}
echo '<tr class="'.$questionsGroupClass.$breakClass.'">';
echo ' <td>'.$question_counter.'</td>'; echo ' <td>'.$question_counter.'</td>';
echo ' <td>'; echo ' <td>';
@ -298,7 +344,10 @@ while ($row = Database::fetch_array($result, 'ASSOC')) {
Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
} }
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&action=delete&survey_id='.$survey_id.'&question_id='.$row['question_id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("Delete surveyQuestion").'?', ENT_QUOTES, $charset)).'\')) return false;">'. echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&action=copyquestion&type='.$row['type'].'&survey_id='.$survey_id.'&question_id='.$row['question_id'].'">'.
Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.api_get_cidreq().'&action=delete&survey_id='.$survey_id.'&question_id='.$row['question_id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurveyQuestion").'?', ENT_QUOTES, $charset)).'\')) return false;">'.
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
if (3 != $survey_data['survey_type']) { if (3 != $survey_data['survey_type']) {
if ($question_counter > 1) { if ($question_counter > 1) {

@ -456,9 +456,7 @@ class SurveyUtil
} }
break; break;
case 'multipleresponse': case 'multipleresponse':
$finalAnswer = isset($answers[$question['question_id']]) $finalAnswer = isset($answers[$question['question_id']]) ? $answers[$question['question_id']] : '';
? $answers[$question['question_id']]
: '';
break; break;
default: default:
$finalAnswer = ''; $finalAnswer = '';
@ -629,7 +627,7 @@ class SurveyUtil
$sql = "SELECT * FROM $table_survey_question $sql = "SELECT * FROM $table_survey_question
WHERE WHERE
c_id = $course_id AND c_id = $course_id AND
survey_id='".$surveyId."' AND survey_id = $surveyId AND
survey_question NOT LIKE '%{{%' AND survey_question NOT LIKE '%{{%' AND
type <>'pagebreak' type <>'pagebreak'
ORDER BY sort ASC ORDER BY sort ASC
@ -1280,7 +1278,8 @@ class SurveyUtil
$content .= '<th> $content .= '<th>
<a href="'.$url.'&action=userreport&user='.$user.'">' <a href="'.$url.'&action=userreport&user='.$user.'">'
.$user_displayed.'</a> .$user_displayed.'
</a>
</th>'; // the user column </th>'; // the user column
} else { } else {
$content .= '<th>'.$user.'</th>'; // the user column $content .= '<th>'.$user.'</th>'; // the user column
@ -1354,8 +1353,14 @@ class SurveyUtil
* Quite similar to display_complete_report(), returns an HTML string * Quite similar to display_complete_report(), returns an HTML string
* that can be used in a csv file. * that can be used in a csv file.
* *
* @param array $survey_data The basic survey data as initially obtained by SurveyManager::get_survey()
* @param int $user_id The ID of the user asking for the report
* @param bool $compact Whether to present the long (v marks with multiple columns per question) or compact (one column per question) answers format
*
* @todo consider merging this function with display_complete_report * @todo consider merging this function with display_complete_report
* *
* @throws Exception
*
* @return string The contents of a csv file * @return string The contents of a csv file
* *
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
@ -1429,7 +1434,7 @@ class SurveyUtil
is_array($_POST['questions_filter']) && is_array($_POST['questions_filter']) &&
in_array($row['question_id'], $_POST['questions_filter'])) in_array($row['question_id'], $_POST['questions_filter']))
) { ) {
if ($row['number_of_options'] == 0 or $compact) { if ($row['number_of_options'] == 0 || $compact) {
$return .= str_replace( $return .= str_replace(
"\r\n", "\r\n",
' ', ' ',
@ -1526,7 +1531,7 @@ class SurveyUtil
survey_id = $surveyId survey_id = $surveyId
"; ";
if ($user_id != 0) { if ($user_id != 0) {
$user_id = intval($user_id); $user_id = (int) $user_id;
$sql .= " AND user = $user_id "; $sql .= " AND user = $user_id ";
} }
$sql .= ' ORDER BY user ASC '; $sql .= ' ORDER BY user ASC ';
@ -1550,8 +1555,8 @@ class SurveyUtil
$answers_of_user = []; $answers_of_user = [];
} }
if ('open' == $possible_answers_type[$row['question_id']] || if ('open' === $possible_answers_type[$row['question_id']] ||
'comment' == $possible_answers_type[$row['question_id']] 'comment' === $possible_answers_type[$row['question_id']]
) { ) {
$temp_id = 'open'.$open_question_iterator; $temp_id = 'open'.$open_question_iterator;
$answers_of_user[$row['question_id']][$temp_id] = $row; $answers_of_user[$row['question_id']][$temp_id] = $row;
@ -1578,10 +1583,12 @@ class SurveyUtil
/** /**
* Add a line to the csv file. * Add a line to the csv file.
* *
* @param array Possible answers * @param array $survey_data Basic survey data (we're mostly interested in the 'anonymous' index)
* @param array User's answers * @param array $possible_options Possible answers
* @param mixed User ID or user details as string - Used as a string in the result string * @param array $answers_of_user User's answers
* @param bool Whether to display user fields or not * @param mixed $user User ID or user details as string - Used as a string in the result string
* @param bool $display_extra_user_fields Whether to display user fields or not
* @param bool $compact Whether to show answers as different column values (true) or one column per option (false, default)
* *
* @return string One line of the csv file * @return string One line of the csv file
* *
@ -2350,10 +2357,11 @@ class SurveyUtil
* and additional users in the database * and additional users in the database
* and sends the invitations by email. * and sends the invitations by email.
* *
* @param $users_array Users $array array can be both a list of course uids AND a list of additional emailaddresses * @param int $surveyId
* @param $invitation_title Title $string of the invitation, used as the title of the mail * @param array $users_array Users array can be both a list of course uids AND a list of additional email addresses
* @param $invitation_text Text $string of the invitation, used as the text of the mail. * @param string $invitation_title title of the mail
* The text has to contain a **link** string or this will automatically be added to the end * @param string $invitation_text text of the mail has to contain a **link** string or
* this will automatically be added to the end
* @param int $reminder * @param int $reminder
* @param bool $sendmail * @param bool $sendmail
* @param int $remindUnAnswered * @param int $remindUnAnswered
@ -2366,6 +2374,7 @@ class SurveyUtil
* @version January 2007 * @version January 2007
*/ */
public static function saveInvitations( public static function saveInvitations(
$surveyId,
$users_array, $users_array,
$invitation_title, $invitation_title,
$invitation_text, $invitation_text,
@ -2375,12 +2384,13 @@ class SurveyUtil
$isAdditionalEmail = false, $isAdditionalEmail = false,
$hideLink = false $hideLink = false
) { ) {
$surveyId = (int) $surveyId;
if (!is_array($users_array)) { if (!is_array($users_array)) {
return 0; return 0;
} }
// Getting the survey information // Getting the survey information
$survey_data = SurveyManager::get_survey($_GET['survey_id']); $survey_data = SurveyManager::get_survey($surveyId);
$survey_invitations = self::get_invitations($survey_data['survey_code']); $survey_invitations = self::get_invitations($survey_data['survey_code']);
$already_invited = self::get_invited_users($survey_data['code']); $already_invited = self::get_invited_users($survey_data['code']);
@ -2389,7 +2399,7 @@ class SurveyUtil
if (1 == $remindUnAnswered) { if (1 == $remindUnAnswered) {
// Remind only unanswered users // Remind only unanswered users
$reminder = 1; $reminder = 1;
$exclude_users = SurveyManager::get_people_who_filled_survey($_GET['survey_id']); $exclude_users = SurveyManager::get_people_who_filled_survey($surveyId);
} }
$counter = 0; // Nr of invitations "sent" (if sendmail option) $counter = 0; // Nr of invitations "sent" (if sendmail option)
@ -2891,8 +2901,6 @@ class SurveyUtil
$table->set_header(2, get_lang('SurveyCourse code')); $table->set_header(2, get_lang('SurveyCourse code'));
$table->set_header(3, get_lang('Questions')); $table->set_header(3, get_lang('Questions'));
$table->set_header(4, get_lang('Author')); $table->set_header(4, get_lang('Author'));
//$table->set_header(5, get_lang('Language'));
//$table->set_header(6, get_lang('Shared'));
$table->set_header(5, get_lang('Available from')); $table->set_header(5, get_lang('Available from'));
$table->set_header(6, get_lang('Until')); $table->set_header(6, get_lang('Until'));
$table->set_header(7, get_lang('Invite')); $table->set_header(7, get_lang('Invite'));
@ -2909,7 +2917,13 @@ class SurveyUtil
} }
$table->set_column_filter(8, 'anonymous_filter'); $table->set_column_filter(8, 'anonymous_filter');
$table->set_form_actions(['delete' => get_lang('Delete survey')]); $actions = [
'export_all' => get_lang('ExportResults'),
'send_to_tutors' => get_lang('SendToGroupTutors'),
'multiplicate' => get_lang('MultiplicateQuestions'),
'delete' => get_lang('DeleteSurvey'),
];
$table->set_form_actions($actions);
$table->display(); $table->display();
} }
@ -2990,14 +3004,10 @@ class SurveyUtil
* @param int $survey_id the id of the survey * @param int $survey_id the id of the survey
* @param bool $drh * @param bool $drh
* *
* @throws \Doctrine\ORM\ORMException * @return string html code that are the actions that can be performed on any survey
* @throws \Doctrine\ORM\OptimisticLockException
* @throws \Doctrine\ORM\TransactionRequiredException
* *
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* *
* @return string html code that are the actions that can be performed on any survey
*
* @version January 2007 * @version January 2007
*/ */
public static function modify_filter($survey_id, $drh = false) public static function modify_filter($survey_id, $drh = false)
@ -3033,13 +3043,13 @@ class SurveyUtil
$type = $survey->getSurveyType(); $type = $survey->getSurveyType();
// Coach can see that only if the survey is in his session // Coach can see that only if the survey is in his session
if (api_is_allowed_to_edit() || if (api_is_allowed_to_edit() || api_is_element_in_the_session(TOOL_SURVEY, $survey_id)) {
api_is_element_in_the_session(TOOL_SURVEY, $survey_id) $configUrl = $codePath.'survey/create_new_survey.php?'.
) {
$editUrl = $codePath.'survey/create_new_survey.php?'.
http_build_query($params + ['action' => 'edit', 'survey_id' => $survey_id]); http_build_query($params + ['action' => 'edit', 'survey_id' => $survey_id]);
$editUrl = $codePath.'survey/survey.php?'.
http_build_query($params + ['survey_id' => $survey_id]);
if (3 == $survey->getSurveyType()) { if (3 == $survey->getSurveyType()) {
$editUrl = $codePath.'survey/edit_meeting.php?'. $configUrl = $codePath.'survey/edit_meeting.php?'.
http_build_query($params + ['action' => 'edit', 'survey_id' => $survey_id]); http_build_query($params + ['action' => 'edit', 'survey_id' => $survey_id]);
} }
@ -3047,6 +3057,10 @@ class SurveyUtil
Display::return_icon('edit.png', get_lang('Edit')), Display::return_icon('edit.png', get_lang('Edit')),
$editUrl $editUrl
); );
$actions[] = Display::url(
Display::return_icon('settings.png', get_lang('Configure')),
$configUrl
);
if (SurveyManager::survey_generation_hash_available()) { if (SurveyManager::survey_generation_hash_available()) {
$actions[] = Display::url( $actions[] = Display::url(
@ -3604,17 +3618,18 @@ class SurveyUtil
} }
echo '<tr>'; echo '<tr>';
if (0 == $row['answered']) { if ($row['answered'] == 0) {
echo '<td>'; echo '<td>';
echo Display::return_icon( $url = self::generateFillSurveyLink($row['invitation_code'], $_course, $row['session_id']);
'statistics.png', $icon = Display::return_icon(
get_lang('Create survey'), 'survey.png',
[], get_lang('ClickHereToAnswerTheSurvey'),
['style' => 'margin-top: -4px'],
ICON_SIZE_TINY ICON_SIZE_TINY
); );
$url = self::generateFillSurveyLink($row['invitation_code'], $_course, $row['session_id']);
echo '<a href="'.$url.'"> echo '<a href="'.$url.'">
'.$row['title'] '.$icon
.$row['title']
.'</a></td>'; .'</a></td>';
} else { } else {
$isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh( $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
@ -3622,8 +3637,8 @@ class SurveyUtil
$_course $_course
); );
$icon = Display::return_icon( $icon = Display::return_icon(
'statistics_na.png', 'survey_na.png',
get_lang('Survey'), get_lang('SurveysDone'),
[], [],
ICON_SIZE_TINY ICON_SIZE_TINY
); );

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -61,8 +61,6 @@ if (api_is_course_admin()) {
]; ];
} }
$tool_name = get_lang('Publication of the survey'); $tool_name = get_lang('Publication of the survey');
// Displaying the header
Display::display_header($tool_name, 'Survey'); Display::display_header($tool_name, 'Survey');
echo '<script> echo '<script>
@ -102,24 +100,10 @@ $form = new FormValidator(
'post', 'post',
api_get_self().'?survey_id='.$survey_id.'&'.api_get_cidreq() api_get_self().'?survey_id='.$survey_id.'&'.api_get_cidreq()
); );
$form->addElement('header', '', $tool_name); $form->addHeader($tool_name);
$sessionId = api_get_session_id();
// Course users
$complete_user_list = CourseManager::get_user_list_from_course_code(
api_get_course_id(),
api_get_session_id(),
'',
api_sort_by_first_name() ? 'ORDER BY firstname' : 'ORDER BY lastname'
);
$possible_users = [];
foreach ($complete_user_list as &$user) {
$possible_users[$user['user_id']] = api_get_person_name(
$user['firstname'],
$user['lastname']
);
}
CourseManager::addUserGroupMultiSelect($form, []); CourseManager::addUserGroupMultiSelect($form, [], true);
// Additional users // Additional users
$form->addElement( $form->addElement(
@ -196,8 +180,11 @@ if ($form->validate()) {
} }
} }
$survey = Database::getManager()->getRepository('ChamiloCourseBundle:CSurvey')->find($survey_data['survey_id']);
// Save the invitation mail // Save the invitation mail
SurveyUtil::save_invite_mail( SurveyUtil::saveInviteMail(
$survey,
$values['mail_text'], $values['mail_text'],
$values['mail_title'], $values['mail_title'],
!empty($survey_data['invite_mail']) !empty($survey_data['invite_mail'])
@ -205,6 +192,7 @@ if ($form->validate()) {
// Saving the invitations for the course users // Saving the invitations for the course users
$count_course_users = SurveyUtil::saveInvitations( $count_course_users = SurveyUtil::saveInvitations(
$survey_data['survey_id'],
$users, $users,
$values['mail_title'], $values['mail_title'],
$values['mail_text'], $values['mail_text'],
@ -224,6 +212,7 @@ if ($form->validate()) {
} }
$counter_additional_users = SurveyUtil::saveInvitations( $counter_additional_users = SurveyUtil::saveInvitations(
$survey_data['survey_id'],
$additional_users, $additional_users,
$values['mail_title'], $values['mail_title'],
$values['mail_text'], $values['mail_text'],

@ -5,9 +5,10 @@
use ChamiloSession as Session; use ChamiloSession as Session;
/** /**
* @author unknown, the initial survey that did not make it in 1.8 because of bad code * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of the code * the code
* @author Julio Montoya Armas <gugli100@gmail.com>, Chamilo: Personality Test modification and rewriting large parts of the code * @author Julio Montoya Armas <gugli100@gmail.com>, Chamilo: Personality Test modification and rewriting large parts
* of the code
* *
* @todo use quickforms for the forms * @todo use quickforms for the forms
*/ */

@ -180,7 +180,8 @@ class survey_question
$allowParent = true; $allowParent = true;
break; break;
case 'multiplechoiceother': case 'multiplechoiceother':
$toolName = get_lang('SurveyMultipleAnswerWithOther'); $toolName = get_lang('SurveyQuestionMultipleChoiceWithOther');
$questionComment = get_lang('SurveyQuestionMultipleChoiceWithOtherComment');
$allowParent = true; $allowParent = true;
break; break;
case 'pagebreak': case 'pagebreak':
@ -276,18 +277,17 @@ class survey_question
} }
$this->html .= ' <tr><td colspan=""> $this->html .= ' <tr><td colspan="">
<fieldset style="border:1px solid black"><legend>'.get_lang('Condition').'</legend> <fieldset style="border:1px solid black">
<legend>'.get_lang('Condition').'</legend>
<b>'.get_lang('Primary').'</b><br /> <b>'.get_lang('Primary').'</b><br />
'.'<input type="radio" name="choose" value="1" '.((1 == $formData['choose']) ? 'checked' : ''). <input type="radio" name="choose" value="1" '.(($formData['choose'] == 1) ? 'checked' : '').'>
'><select name="assigned">'.$grouplist.'</select><br />'; <select name="assigned">'.$grouplist.'</select><br />';
$this->html .= ' $this->html .= '
<b>'.get_lang('Secondary').'</b><br /> <b>'.get_lang('Secondary').'</b><br />
'.'<input type="radio" name="choose" value="2" '.((2 == $formData['choose']) ? 'checked' : ''). <input type="radio" name="choose" value="2" '.(($formData['choose'] == 2) ? 'checked' : '').'>
'><select name="assigned1">'.$grouplist1.'</select> '. <select name="assigned1">'.$grouplist1.'</select>
'<select name="assigned2">'.$grouplist2.'</select>' <select name="assigned2">'.$grouplist2.'</select>
.'</fieldset><br />'; </fieldset><br />';
} }
$this->setForm($form); $this->setForm($form);
@ -302,19 +302,22 @@ class survey_question
{ {
if (isset($_GET['question_id']) && !empty($_GET['question_id'])) { if (isset($_GET['question_id']) && !empty($_GET['question_id'])) {
/** /**
* Check if survey has answers first before update it, this is because if you update it, the question * Prevent the edition of already-answered questions to avoid
* options will delete and re-insert in database loosing the iid and question_id to verify the correct answers. * inconsistent answers. Use the configuration option
* survey_allow_answered_question_edit to change this behaviour.
*/ */
$surveyId = isset($_GET['survey_id']) ? (int) $_GET['survey_id'] : 0; $surveyId = isset($_GET['survey_id']) ? (int) $_GET['survey_id'] : 0;
$answersChecker = SurveyUtil::checkIfSurveyHasAnswers($surveyId); $answersChecker = SurveyUtil::checkIfSurveyHasAnswers($surveyId);
if (!$answersChecker) { $allowQuestionEdit = api_get_configuration_value('survey_allow_answered_question_edit') == true;
$this->buttonList[] = $this->getForm()->addButtonUpdate(get_lang('Edit question'), 'save', true); if ($allowQuestionEdit or !$answersChecker) {
$this->buttonList[] = $this->getForm()->addButtonUpdate(get_lang('ModifyQuestionSurvey'), 'save', true);
} else { } else {
$this->getForm()->addHtml(' $this->getForm()->addHtml('
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label"></label> <label class="col-sm-2 control-label"></label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="alert alert-info">'.get_lang('You can\'t edit this question because answers by students have already been registered').'</div> <div class="alert alert-info">'.
get_lang('YouCantNotEditThisQuestionBecauseAlreadyExistAnswers').'</div>
</div> </div>
<div class="col-sm-2"></div> <div class="col-sm-2"></div>
</div> </div>
@ -486,7 +489,7 @@ class survey_question
* *
* @return mixed * @return mixed
*/ */
public function save($surveyData, $formData) public function save($surveyData, $formData, $dataFromDatabase = [])
{ {
// Saving a question // Saving a question
if (isset($_POST['buttons']) && isset($_POST['buttons']['save'])) { if (isset($_POST['buttons']) && isset($_POST['buttons']['save'])) {
@ -597,34 +600,76 @@ class survey_question
*/ */
public static function getQuestionJs($question) public static function getQuestionJs($question)
{ {
if (empty($question)) {
return '';
}
$list = self::getDependency($question); $list = self::getDependency($question);
if (empty($list)) { if (empty($list)) {
return ''; return '';
} }
$js = ''; $type = $question['type'];
$questionId = $question['question_id']; $questionId = $question['question_id'];
$newList = []; $newList = [];
foreach ($list as $child) { foreach ($list as $child) {
$childQuestionId = $child['question_id']; $childQuestionId = $child['question_id'];
$optionId = $child['parent_option_id']; $optionId = $child['parent_option_id'];
$newList[$optionId] = $childQuestionId; $newList[$optionId][] = $childQuestionId;
}
if ('multipleresponse' === $type) {
$multiple = '';
foreach ($newList as $optionId => $child) {
$multiple .= '
$(\'input[name="question'.$questionId.'['.$optionId.']"]\').on("change", function() {
var isChecked= $(this).is(\':checked\');
var checkedValue = $(this).val();
if (isChecked) {
$.each(list, function(index, value) {
$(".with_parent_" + value).find("input").prop("checked", false);
});
var questionId = $(this).val();
var questionToShow = list[questionId];
$(".with_parent_" + questionToShow).show();
} else {
var checkedValue = list[checkedValue];
} }
});
';
}
$js = '
<script>
$(function() {
var list = '.json_encode($newList).';
'.$multiple.'
});
</script>';
$js .= ' return $js;
}
$js = '
<script> <script>
$(function() { $(function() {
var list = '.json_encode($newList).'; var list = '.json_encode($newList).';
$("input[name=question'.$questionId.']").on("click", function() { $("input[name=question'.$questionId.']").on("click", function() {
$.each(list, function(index, value) { $.each(list, function(index, value) {
$(".with_parent_" + value).hide(); $.each(value, function(index, itemValue) {
$(".with_parent_" + value).find("input").prop("checked", false); $(".with_parent_" + itemValue).hide();
$(".with_parent_only_hide_" + value).hide(); $(".with_parent_" + itemValue).find("input").prop("checked", false);
$(".with_parent_only_hide_" + itemValue).hide();
});
}); });
var questionId = $(this).val(); var questionId = $(this).val();
var questionToShow = list[questionId]; var questionToShowList = list[questionId];
$(".with_parent_" + questionToShow).show(); $.each(questionToShowList, function(index, value) {
$(".with_parent_" + value).show();
});
}); });
}); });
</script>'; </script>';

@ -644,47 +644,38 @@ if ($nbStudents > 0) {
$table->set_header( $table->set_header(
4, 4,
get_lang('Time').'&nbsp;'. get_lang('TrainingTime').'&nbsp;'.
Display::return_icon('info3.gif', get_lang('Time spent in the course'), ['align' => 'absmiddle', 'hspace' => '3px']), Display::return_icon('info3.gif', get_lang('CourseTimeInfo'), [], ICON_SIZE_TINY),
false, false
['style' => 'width:110px;']
);
$headers['training_time'] = get_lang('Time');
$table->set_header(5, get_lang('Progress').'&nbsp;'.
Display::return_icon(
'info3.gif',
get_lang('Average progress in courses'),
['align' => 'absmiddle', 'hspace' => '3px']
),
false,
['style' => 'width:110px;']
); );
$headers['course_progress'] = get_lang('Progress'); $headers['training_time'] = get_lang('TrainingTime');
$table->set_header(
5,
get_lang('CourseProgress').'&nbsp;'.
Display::return_icon('info3.gif', get_lang('ScormAndLPProgressTotalAverage'), [], ICON_SIZE_TINY),
false
);
$headers['course_progress'] = get_lang('CourseProgress');
$table->set_header(6, get_lang('Exercise progress').'&nbsp;'. $table->set_header(
Display::return_icon( 6,
'info3.gif', get_lang('ExerciseProgress').'&nbsp;'.
get_lang('Exercise progressInfo'), Display::return_icon('info3.gif', get_lang('ExerciseProgressInfo'), [], ICON_SIZE_TINY),
['align' => 'absmiddle', 'hspace' => '3px'] false
),
false,
['style' => 'width:110px;']
); );
$headers['exercise_progress'] = get_lang('Exercise progress'); $headers['exercise_progress'] = get_lang('ExerciseProgress');
$table->set_header(7, get_lang('Exercise average').'&nbsp;'. $table->set_header(
Display::return_icon('info3.gif', get_lang('Exercise averageInfo'), ['align' => 'absmiddle', 'hspace' => '3px']), 7,
false, get_lang('ExerciseAverage').'&nbsp;'.
['style' => 'width:110px;'] Display::return_icon('info3.gif', get_lang('ExerciseAverageInfo'), [], ICON_SIZE_TINY),
); false
$headers['exercise_average'] = get_lang('Exercise average'); );
$table->set_header(8, get_lang('Score').'&nbsp;'. $headers['exercise_average'] = get_lang('ExerciseAverage');
Display::return_icon( $table->set_header(
'info3.gif', 8,
get_lang('Average of tests in Learning Paths'), get_lang('Score').'&nbsp;'.
['align' => 'absmiddle', 'hspace' => '3px'] Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), [], ICON_SIZE_TINY),
), false
false,
['style' => 'width:110px;']
); );
$headers['score'] = get_lang('Score'); $headers['score'] = get_lang('Score');
$table->set_header(9, get_lang('Assignments'), false); $table->set_header(9, get_lang('Assignments'), false);
@ -705,20 +696,22 @@ if ($nbStudents > 0) {
$headers['first_login'] = get_lang('FirstLoginInCourse'); $headers['first_login'] = get_lang('FirstLoginInCourse');
$table->set_header(14, get_lang('LatestLoginInCourse'), false); $table->set_header(14, get_lang('LatestLoginInCourse'), false);
$headers['latest_login'] = get_lang('LatestLoginInCourse'); $headers['latest_login'] = get_lang('LatestLoginInCourse');
if (isset($_GET['additional_profile_field'])) {
$counter = 15; $counter = 15;
if (api_get_setting('show_email_addresses') === 'true') {
$table->set_header($counter, get_lang('Email'), false);
$headers['email'] = get_lang('Email');
$counter++;
}
if (isset($_GET['additional_profile_field'])) {
foreach ($_GET['additional_profile_field'] as $fieldId) { foreach ($_GET['additional_profile_field'] as $fieldId) {
$table->set_header($counter, $extra_info[$fieldId]['display_text'], false); $table->set_header($counter, $extra_info[$fieldId]['display_text'], false);
$headers[$extra_info[$fieldId]['variable']] = $extra_info[$fieldId]['display_text']; $headers[$extra_info[$fieldId]['variable']] = $extra_info[$fieldId]['display_text'];
$counter++; $counter++;
$parameters['additional_profile_field'] = $fieldId; $parameters['additional_profile_field'] = $fieldId;
} }
$table->set_header($counter, get_lang('Details'), false);
$headers['details'] = get_lang('Details');
} else {
$table->set_header(15, get_lang('Details'), false);
$headers['details'] = get_lang('Details');
} }
$table->set_header($counter, get_lang('Details'), false);
$headers['Details'] = get_lang('Details');
if (!empty($fields)) { if (!empty($fields)) {
foreach ($fields as $key => $value) { foreach ($fields as $key => $value) {
@ -917,7 +910,11 @@ if (!empty($groupList)) {
$totalLpProgress += $lpProgress; $totalLpProgress += $lpProgress;
} }
if (empty($nbStudents)) {
$lpProgress = '0 %';
} else {
$lpProgress = round($totalLpProgress / $nbStudents, 2).' %'; $lpProgress = round($totalLpProgress / $nbStudents, 2).' %';
}
$totalBestScoreAverageNotInLP = 0; $totalBestScoreAverageNotInLP = 0;
$bestScoreAverageNotInLP = 0; $bestScoreAverageNotInLP = 0;
if (!empty($exerciseList)) { if (!empty($exerciseList)) {

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use ChamiloSession as Session; use ChamiloSession as Session;

@ -1,9 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/**
* Report.
*/
$cidReset = true; $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use ChamiloSession as Session; use ChamiloSession as Session;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$cidReset = true; $cidReset = true;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/* /*

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,5 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* @author Julio Montoya <gugli100@gmail.com> * @author Julio Montoya <gugli100@gmail.com>
*/ */

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
@ -421,12 +422,37 @@ if (api_is_allowed_to_edit(null, true)) {
if (isset($_GET['user_id']) && is_numeric($_GET['user_id']) && if (isset($_GET['user_id']) && is_numeric($_GET['user_id']) &&
($_GET['user_id'] != $_user['user_id'] || api_is_platform_admin()) ($_GET['user_id'] != $_user['user_id'] || api_is_platform_admin())
) { ) {
CourseManager::unsubscribe_user($_GET['user_id'], $courseCode, 0); $user_id = (int) $_GET['user_id'];
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$sql = "SELECT user.id as user_id
FROM $tbl_user user
INNER JOIN $tbl_session_rel_user reluser
ON user.id = reluser.user_id AND reluser.relation_type <> ".SESSION_RELATION_TYPE_RRHH."
INNER JOIN $tbl_session_rel_course rel_course
ON rel_course.session_id = reluser.session_id
WHERE
user.id = $user_id AND
rel_course.c_id = $courseId ";
$result = Database::query($sql);
$row = Database::fetch_array($result, 'ASSOC');
if ($row['user_id'] == $user_id || $row['user_id'] == "") {
CourseManager::unsubscribe_user($_GET['user_id'], $courseCode);
Display::addFlash(
Display::return_message(get_lang('UserUnsubscribed'))
);
} else {
Display::addFlash( Display::addFlash(
Display::return_message(get_lang('User is now unsubscribed')) Display::return_message(
get_lang('ThisStudentIsSubscribeThroughASession')
)
); );
} }
} }
}
} else { } else {
// If student can unsubscribe // If student can unsubscribe
if (isset($_REQUEST['unregister']) && 'yes' == $_REQUEST['unregister']) { if (isset($_REQUEST['unregister']) && 'yes' == $_REQUEST['unregister']) {
@ -636,7 +662,6 @@ if (!isset($origin) || 'learnpath' != $origin) {
Display::display_footer(); Display::display_footer();
} }
/* Helper functions for the users lists in course */
/** /**
* Get the users to display on the current page. * Get the users to display on the current page.
*/ */
@ -646,7 +671,7 @@ function get_number_of_users()
$sessionId = api_get_session_id(); $sessionId = api_get_session_id();
$courseCode = api_get_course_id(); $courseCode = api_get_course_id();
$active = isset($_GET['active']) ? $_GET['active'] : null; $active = isset($_GET['active']) ? $_GET['active'] : null;
$type = isset($_REQUEST['type']) ? intval($_REQUEST['type']) : STUDENT; $type = isset($_REQUEST['type']) ? (int) $_REQUEST['type'] : STUDENT;
if (empty($sessionId)) { if (empty($sessionId)) {
$status = $type; $status = $type;
@ -659,7 +684,7 @@ function get_number_of_users()
} }
if (!empty($sessionId)) { if (!empty($sessionId)) {
$a_course_users = CourseManager::get_user_list_from_course_code( $users = CourseManager::get_user_list_from_course_code(
$courseCode, $courseCode,
$sessionId, $sessionId,
null, null,
@ -674,7 +699,7 @@ function get_number_of_users()
$active $active
); );
} else { } else {
$a_course_users = CourseManager::get_user_list_from_course_code( $users = CourseManager::get_user_list_from_course_code(
$courseCode, $courseCode,
0, 0,
null, null,
@ -690,14 +715,14 @@ function get_number_of_users()
); );
} }
foreach ($a_course_users as $o_course_user) { foreach ($users as $user) {
if (( if ((
isset($_GET['keyword']) && isset($_GET['keyword']) &&
searchUserKeyword( searchUserKeyword(
$o_course_user['firstname'], $user['firstname'],
$o_course_user['lastname'], $user['lastname'],
$o_course_user['username'], $user['username'],
$o_course_user['official_code'], $user['official_code'],
$_GET['keyword'] $_GET['keyword']
) )
) || !isset($_GET['keyword']) || empty($_GET['keyword']) ) || !isset($_GET['keyword']) || empty($_GET['keyword'])
@ -726,9 +751,9 @@ function searchUserKeyword($firstname, $lastname, $username, $official_code, $ke
false !== api_strripos($official_code, $keyword) false !== api_strripos($official_code, $keyword)
) { ) {
return true; return true;
} else {
return false;
} }
return false;
} }
/** /**
@ -745,7 +770,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
{ {
global $is_western_name_order; global $is_western_name_order;
global $extraFields; global $extraFields;
$type = isset($_REQUEST['type']) ? intval($_REQUEST['type']) : STUDENT; $type = isset($_REQUEST['type']) ? (int) $_REQUEST['type'] : STUDENT;
$course_info = api_get_course_info(); $course_info = api_get_course_info();
$sessionId = api_get_session_id(); $sessionId = api_get_session_id();
$course_code = $course_info['code']; $course_code = $course_info['code'];
@ -805,7 +830,7 @@ function get_user_data($from, $number_of_items, $column, $direction)
} }
} }
$a_course_users = CourseManager::get_user_list_from_course_code( $users = CourseManager :: get_user_list_from_course_code(
$course_code, $course_code,
$sessionId, $sessionId,
$limit, $limit,
@ -820,14 +845,14 @@ function get_user_data($from, $number_of_items, $column, $direction)
$active $active
); );
foreach ($a_course_users as $user_id => $o_course_user) { foreach ($users as $user_id => $userData) {
if (( if ((
isset($_GET['keyword']) && isset($_GET['keyword']) &&
searchUserKeyword( searchUserKeyword(
$o_course_user['firstname'], $userData['firstname'],
$o_course_user['lastname'], $userData['lastname'],
$o_course_user['username'], $userData['username'],
$o_course_user['official_code'], $userData['official_code'],
$_GET['keyword'] $_GET['keyword']
) )
) || !isset($_GET['keyword']) || empty($_GET['keyword']) ) || !isset($_GET['keyword']) || empty($_GET['keyword'])
@ -844,35 +869,35 @@ function get_user_data($from, $number_of_items, $column, $direction)
$photo = Display::img($userInfo['avatar_small'], $userInfo['complete_name'], [], false); $photo = Display::img($userInfo['avatar_small'], $userInfo['complete_name'], [], false);
$temp[] = $user_id; $temp[] = $user_id;
$temp[] = $photo; $temp[] = $photo;
$temp[] = $o_course_user['official_code']; $temp[] = $userData['official_code'];
if ($is_western_name_order) { if ($is_western_name_order) {
$temp[] = $o_course_user['firstname']; $temp[] = $userData['firstname'];
$temp[] = $o_course_user['lastname']; $temp[] = $userData['lastname'];
} else { } else {
$temp[] = $o_course_user['lastname']; $temp[] = $userData['lastname'];
$temp[] = $o_course_user['firstname']; $temp[] = $userData['firstname'];
} }
$temp[] = $o_course_user['username']; $temp[] = $userData['username'];
// Groups. // Groups.
$temp[] = implode(', ', $groupsNameListParsed); $temp[] = implode(', ', $groupsNameListParsed);
// Status // Status
$default_status = get_lang('Learner'); $default_status = get_lang('Student');
if ((isset($o_course_user['status_rel']) && 1 == $o_course_user['status_rel']) || if ((isset($userData['status_rel']) && $userData['status_rel'] == 1) ||
(isset($o_course_user['status_session']) && 2 == $o_course_user['status_session']) (isset($userData['status_session']) && $userData['status_session'] == 2)
) { ) {
$default_status = get_lang('Teacher'); $default_status = get_lang('CourseManager');
} elseif (isset($o_course_user['is_tutor']) && 1 == $o_course_user['is_tutor']) { } elseif (isset($userData['is_tutor']) && $userData['is_tutor'] == 1) {
$default_status = get_lang('Coach'); $default_status = get_lang('Tutor');
} }
$temp[] = $default_status; $temp[] = $default_status;
// active // active
$temp[] = $o_course_user['active']; $temp[] = $userData['active'];
$extraFieldOption = new ExtraFieldOption('user'); $extraFieldOption = new ExtraFieldOption('user');
$extraFieldValue = new ExtraFieldValue('user'); $extraFieldValue = new ExtraFieldValue('user');
@ -882,24 +907,27 @@ function get_user_data($from, $number_of_items, $column, $direction)
$user_id, $user_id,
$extraField['id'] $extraField['id']
); );
if (isset($data['value'])) {
$optionList = $extraFieldOption->get_field_option_by_field_and_option( $optionList = $extraFieldOption->get_field_option_by_field_and_option(
$extraField['id'], $extraField['id'],
$data['value'] $data['value']
); );
if (!empty($optionList)) { if (!empty($optionList)) {
$options = implode(', ', array_column($optionList, 'display_text')); $options = implode(', ', array_column($optionList, 'display_text'));
$temp[] = $options; $temp[] = Security::remove_XSS($options);
} else { } else {
$temp[] = $data['value']; $temp[] = Security::remove_XSS($data['value']);
}
} else {
$temp[] = '';
} }
} }
} }
// User id for actions // User id for actions
$temp[] = $user_id; $temp[] = $user_id;
$temp['is_tutor'] = isset($o_course_user['is_tutor']) ? $o_course_user['is_tutor'] : ''; $temp['is_tutor'] = isset($userData['is_tutor']) ? $userData['is_tutor'] : '';
$temp['user_status_in_course'] = isset($o_course_user['status_rel']) ? $o_course_user['status_rel'] : ''; $temp['user_status_in_course'] = isset($userData['status_rel']) ? $userData['status_rel'] : '';
} else { } else {
$userInfo = api_get_user_info($user_id); $userInfo = api_get_user_info($user_id);
$userPicture = $userInfo['avatar']; $userPicture = $userInfo['avatar'];
@ -908,21 +936,21 @@ function get_user_data($from, $number_of_items, $column, $direction)
$temp[] = ''; $temp[] = '';
$temp[] = $photo; $temp[] = $photo;
$temp[] = $o_course_user['official_code']; $temp[] = $userData['official_code'];
if ($is_western_name_order) { if ($is_western_name_order) {
$temp[] = $o_course_user['firstname']; $temp[] = $userData['firstname'];
$temp[] = $o_course_user['lastname']; $temp[] = $userData['lastname'];
} else { } else {
$temp[] = $o_course_user['lastname']; $temp[] = $userData['lastname'];
$temp[] = $o_course_user['firstname']; $temp[] = $userData['firstname'];
} }
$temp[] = $o_course_user['username']; $temp[] = $userData['username'];
// Group. // Group.
$temp[] = implode(', ', $groupsNameListParsed); $temp[] = implode(', ', $groupsNameListParsed);
if (1 == $course_info['unsubscribe']) { if ($course_info['unsubscribe'] == 1) {
//User id for actions //User id for actions
$temp[] = $user_id; $temp[] = $user_id;
} }

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
@ -7,7 +8,6 @@ $this_section = SECTION_COURSES;
api_protect_admin_script(true, true); api_protect_admin_script(true, true);
$export = []; $export = [];
$export['file_type'] = isset($_REQUEST['file_type']) ? $_REQUEST['file_type'] : null; $export['file_type'] = isset($_REQUEST['file_type']) ? $_REQUEST['file_type'] : null;
$export['course_code'] = isset($_REQUEST['course_code']) ? $_REQUEST['course_code'] : null; $export['course_code'] = isset($_REQUEST['course_code']) ? $_REQUEST['course_code'] : null;
$export['course_session'] = isset($_REQUEST['course_session']) ? $_REQUEST['course_session'] : null; $export['course_session'] = isset($_REQUEST['course_session']) ? $_REQUEST['course_session'] : null;
@ -16,12 +16,12 @@ $export['session'] = isset($_REQUEST['session']) ? $_REQUEST['session'] : null;
// Database table definitions // Database table definitions
$course_table = Database::get_main_table(TABLE_MAIN_COURSE); $course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$user_table = Database::get_main_table(TABLE_MAIN_USER); $userTable = Database::get_main_table(TABLE_MAIN_USER);
$course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER); $course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$session_course_user_table = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); $session_course_user_table = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$session_user_table = Database::get_main_table(TABLE_MAIN_SESSION_USER); $session_user_table = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$file_type = $export['file_type']; $fileType = $export['file_type'];
$course_code = Database::escape_string($export['course_code']); $course_code = Database::escape_string($export['course_code']);
$courseInfo = api_get_course_info($course_code); $courseInfo = api_get_course_info($course_code);
$courseId = isset($courseInfo['real_id']) ? $courseInfo['real_id'] : 0; $courseId = isset($courseInfo['real_id']) ? $courseInfo['real_id'] : 0;
@ -45,8 +45,20 @@ if (is_array($courseSessionValue) && isset($courseSessionValue[1])) {
$sessionInfo = api_get_session_info($sessionId); $sessionInfo = api_get_session_info($sessionId);
} }
$extraUrlJoin = '';
$extraUrlCondition = '';
if (api_is_multiple_url_enabled()) {
$tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1) {
$extraUrlJoin .= " INNER JOIN $tbl_user_rel_access_url as user_rel_url
ON (u.id = user_rel_url.user_id) ";
$extraUrlCondition = " AND access_url_id = $access_url_id";
}
}
$sql = "SELECT $sql = "SELECT
u.user_id AS UserId, u.id AS UserId,
u.lastname AS LastName, u.lastname AS LastName,
u.firstname AS FirstName, u.firstname AS FirstName,
u.email AS Email, u.email AS Email,
@ -58,48 +70,57 @@ $sql = "SELECT
u.phone AS Phone, u.phone AS Phone,
u.registration_date AS RegistrationDate"; u.registration_date AS RegistrationDate";
if (strlen($course_code) > 0) { if (strlen($course_code) > 0) {
$sql .= " FROM $user_table u, $course_user_table cu $sql .= " FROM $userTable u
INNER JOIN $course_user_table cu
ON (u.id = cu.user_id)
$extraUrlJoin
WHERE WHERE
u.user_id = cu.user_id AND
cu.c_id = $courseId AND cu.c_id = $courseId AND
cu.relation_type<>".COURSE_RELATION_TYPE_RRHH." cu.relation_type<>".COURSE_RELATION_TYPE_RRHH."
$extraUrlCondition
ORDER BY lastname,firstname"; ORDER BY lastname,firstname";
$filename = 'export_users_'.$course_code.'_'.api_get_local_time(); $filename = 'export_users_'.$course_code.'_'.api_get_local_time();
} elseif (strlen($courseSessionCode) > 0) { } elseif (strlen($courseSessionCode) > 0) {
$sql .= " FROM $user_table u, $session_course_user_table scu $sql .= " FROM $userTable u
INNER JOIN $session_course_user_table scu
ON (u.id = scu.user_id)
$extraUrlJoin
WHERE WHERE
u.user_id = scu.user_id AND
scu.c_id = $courseSessionId AND scu.c_id = $courseSessionId AND
scu.session_id = $sessionId scu.session_id = $sessionId
$extraUrlCondition
ORDER BY lastname,firstname"; ORDER BY lastname,firstname";
$filename = 'export_users_'.$courseSessionCode.'_'.$sessionInfo['name'].'_'.api_get_local_time(); $filename = 'export_users_'.$courseSessionCode.'_'.$sessionInfo['name'].'_'.api_get_local_time();
} elseif ($sessionId > 0) { } elseif ($sessionId > 0) {
$sql .= " FROM $user_table u, $session_user_table su $sql .= " FROM $userTable u
INNER JOIN $session_user_table su
ON (u.id = su.user_id)
$extraUrlJoin
WHERE WHERE
u.user_id = su.user_id AND
su.session_id = $sessionId su.session_id = $sessionId
$extraUrlCondition
ORDER BY lastname,firstname"; ORDER BY lastname,firstname";
$filename = 'export_users_'.$sessionInfo['name'].'_'.api_get_local_time(); $filename = 'export_users_'.$sessionInfo['name'].'_'.api_get_local_time();
} else { } else {
if (api_is_multiple_url_enabled()) { if (api_is_multiple_url_enabled()) {
$tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
$access_url_id = api_get_current_access_url_id(); $access_url_id = api_get_current_access_url_id();
if (-1 != $access_url_id) { if ($access_url_id != -1) {
$sql .= " FROM $user_table u $sql .= " FROM $userTable u
INNER JOIN $tbl_user_rel_access_url as user_rel_url INNER JOIN $tbl_user_rel_access_url as user_rel_url
ON (u.user_id= user_rel_url.user_id) ON (u.id = user_rel_url.user_id)
WHERE access_url_id = $access_url_id WHERE access_url_id = $access_url_id
ORDER BY lastname,firstname"; ORDER BY lastname,firstname";
} }
} else { } else {
$sql .= " FROM $user_table u ORDER BY lastname,firstname"; $sql .= " FROM $userTable u ORDER BY lastname,firstname";
} }
$filename = 'export_users_'.api_get_local_time(); $filename = 'export_users_'.api_get_local_time();
} }
$data = []; $data = [];
$extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC', false); $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC', false);
if ('1' == $export['addcsvheader'] && 'csv' == $export['file_type']) { if ($export['addcsvheader'] == '1' && $export['file_type'] === 'csv') {
if ('none' != $_configuration['password_encryption']) { if ($_configuration['password_encryption'] !== 'none') {
$data[] = [ $data[] = [
'UserId', 'UserId',
'LastName', 'LastName',
@ -135,12 +156,12 @@ if ('1' == $export['addcsvheader'] && 'csv' == $export['file_type']) {
$res = Database::query($sql); $res = Database::query($sql);
while ($user = Database::fetch_array($res, 'ASSOC')) { while ($user = Database::fetch_array($res, 'ASSOC')) {
$student_data = UserManager:: get_extra_user_data( $studentData = UserManager:: get_extra_user_data(
$user['UserId'], $user['UserId'],
true, true,
false false
); );
foreach ($student_data as $key => $value) { foreach ($studentData as $key => $value) {
$key = substr($key, 6); $key = substr($key, 6);
if (is_array($value)) { if (is_array($value)) {
$user[$key] = $value['extra_'.$key]; $user[$key] = $value['extra_'.$key];
@ -151,7 +172,7 @@ while ($user = Database::fetch_array($res, 'ASSOC')) {
$data[] = $user; $data[] = $user;
} }
switch ($file_type) { switch ($fileType) {
case 'xml': case 'xml':
Export::arrayToXml($data, $filename, 'Contact', 'Contacts'); Export::arrayToXml($data, $filename, 'Contact', 'Contacts');
exit; exit;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;

@ -1,5 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* @author Francis Gonzales * @author Francis Gonzales
*/ */

@ -28,7 +28,6 @@ class SaveUserTest extends V2TestCase
$loginName = 'testUser'.time(); $loginName = 'testUser'.time();
$email = 'testUser@local'; $email = 'testUser@local';
$status = 5; $status = 5;
$userId = $this->integer( $userId = $this->integer(
[ [
'loginname' => $loginName, 'loginname' => $loginName,
@ -56,8 +55,7 @@ class SaveUserTest extends V2TestCase
} }
/** /**
* Creates a test user with an extra field * Creates a test user with an extra field asserts that the extra field values were saved.
* asserts that the extra field values were saved
* *
* @throws Exception if it cannot delete the created test user * @throws Exception if it cannot delete the created test user
*/ */

@ -27,7 +27,7 @@ class UpdateUserPauseTrainingTest extends V2TestCase
'pause_formation' => 0, 'pause_formation' => 0,
'start_pause_date' => '2020-06-30 10:00', 'start_pause_date' => '2020-06-30 10:00',
'end_pause_date' => '2020-06-30 11:00', 'end_pause_date' => '2020-06-30 11:00',
'allow_notifications' => 0, 'disable_emails' => 1,
]; ];
$userId = $this->integer($params); $userId = $this->integer($params);

@ -343,15 +343,17 @@ try {
break; break;
case Rest::UPDATE_USER_PAUSE_TRAINING: case Rest::UPDATE_USER_PAUSE_TRAINING:
$allow = api_get_plugin_setting('pausetraining', 'tool_enable') === 'true'; $allow = api_get_plugin_setting('pausetraining', 'tool_enable') === 'true';
$allowPauseFormation = api_get_plugin_setting('pausetraining', 'allow_users_to_edit_pause_formation') === 'true';
if (false === $allow || false === $allowPauseFormation) { if (false === $allow) {
throw new Exception(get_lang('Plugin configured')); throw new Exception(get_lang('Plugin configured'));
} }
if (empty($_POST['user_id'])) { if (empty($_POST['user_id'])) {
throw new Exception('user_id is required'); throw new Exception('user_id is required');
} }
if (null === $restApi) {
throw new Exception('Check that the username and api_key are field in the request');
}
$plugin = PauseTraining::create(); $plugin = PauseTraining::create();
$data = $plugin->updateUserPauseTraining($_POST['user_id'], $_POST); $data = $plugin->updateUserPauseTraining($_POST['user_id'], $_POST);
$restResponse->setData([$data]); $restResponse->setData([$data]);

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/cm_webservice_announcements.php'; require_once __DIR__.'/cm_webservice_announcements.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/cm_webservice_course.php'; require_once __DIR__.'/cm_webservice_course.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/cm_webservice_courses.php'; require_once __DIR__.'/cm_webservice_courses.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/cm_webservice_forum.php'; require_once __DIR__.'/cm_webservice_forum.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/cm_webservice_inbox.php'; require_once __DIR__.'/cm_webservice_inbox.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/cm_webservice_user.php'; require_once __DIR__.'/cm_webservice_user.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\User; use Chamilo\CoreBundle\Entity\User;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,5 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This script provides the caller service with a list * This script provides the caller service with a list
* of courses that have a certain level of visibility * of courses that have a certain level of visibility

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Skill as SkillManager; use Skill as SkillManager;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$realm = 'The batcave'; $realm = 'The batcave';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\ExtraField as EntityExtraField; use Chamilo\CoreBundle\Entity\ExtraField as EntityExtraField;

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';

@ -1,4 +1,7 @@
<?php /* For licensing terms, see /license.txt */ <?php
/* For licensing terms, see /license.txt */
/** /**
* Test script for soap.php. * Test script for soap.php.
* *

@ -1,5 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Configures the WSCourse SOAP service. * Configures the WSCourse SOAP service.
*/ */

@ -1,5 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Configures the WSReport SOAP service. * Configures the WSReport SOAP service.
*/ */

@ -1,5 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Configures the WSSession SOAP service. * Configures the WSSession SOAP service.
*/ */

@ -1,5 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Configures the WSUser SOAP service. * Configures the WSUser SOAP service.
*/ */

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
$ip = trim($_SERVER['REMOTE_ADDR']); $ip = trim($_SERVER['REMOTE_ADDR']);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save