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

pull/2487/head
Yannick Warnier 7 years ago
commit 886058978d
  1. 8
      main/inc/lib/course.lib.php
  2. 24
      main/inc/lib/fileManage.lib.php
  3. 41
      main/inc/lib/fileUpload.lib.php
  4. 6
      main/inc/lib/lp_item.lib.php
  5. 2
      main/lp/learnpath.class.php
  6. 5
      main/mySpace/myStudents.php
  7. 29
      main/survey/reporting.php
  8. 5
      main/survey/surveyUtil.class.php
  9. 5
      main/tracking/courseLog.php

@ -2025,10 +2025,10 @@ class CourseManager
if ($orderList === true) {
$html .= '<ul class="user-teacher">';
foreach ($list as $teacher) {
$html .= Display::tag(
'li',
Display::return_icon('teacher.png', $teacher, null, ICON_SIZE_TINY).' '.$teacher
);
$html .= '<li>';
$html .= Display::return_icon('teacher.png', '', null, ICON_SIZE_TINY);
$html .= ' '.$teacher;
$html .= '</li>';
}
$html .= '</ul>';
} else {

@ -314,27 +314,3 @@ function getextension($filename)
$bouts = explode('.', $filename);
return array(array_pop($bouts), implode('.', $bouts));
}
/**
* Calculation size of a directory
*
* @returns integer size
* @param string $root path of dir to measure
* @param boolean $recursive if true , include subdirectory in total
*/
function dirsize($root, $recursive = true)
{
$dir = @opendir($root);
$size = 0;
while ($file = @readdir($dir)) {
if (!in_array($file, array('.', '..'))) {
if (is_dir($root.'/'.$file)) {
$size += $recursive ? dirsize($root.'/'.$file) : 0;
} else {
$size += @filesize($root.'/'.$file);
}
}
}
@closedir($dir);
return $size;
}

@ -1373,22 +1373,6 @@ function item_property_update_on_folder($_course, $path, $user_id)
}
}
/**
* Returns the directory depth of the file.
*
* @author Olivier Cauberghe <olivier.cauberghe@ugent.be>
* @param path+filename eg: /main/document/document.php
* @return The directory depth
*/
function get_levels($filename)
{
$levels = explode('/', $filename);
if (empty($levels[count($levels) - 1])) {
unset($levels[count($levels) - 1]);
}
return count($levels);
}
/**
* Adds file to document table in database
* deprecated: use file_set_default_settings instead
@ -1759,31 +1743,6 @@ function replace_img_path_in_html_file($original_img_path, $new_img_path, $html_
}
}
/**
* Creates a file containing an html redirection to a given url
*
* @author Hugues Peeters <hugues.peeters@claroline.net>
* @param string $file_path
* @param string $url
* @return void
*/
function create_link_file($file_path, $url)
{
$file_content = '<html>'
.'<head>'
.'<meta http-equiv="refresh" content="1;url='.$url.'">'
.'</head>'
.'<body>'
.'</body>'
.'</html>';
if (file_exists($file_path)) {
if (!($fp = fopen($file_path, 'w'))) {
return false;
}
return fwrite($fp, $file_content);
}
}
/**
* Checks the extension of a file, if it's .htm or .html
* we use search_img_from_html to get all image paths in the file

@ -80,11 +80,11 @@ class LpItem
/**
* Update in database
*/
public function update_in_bdd()
public function update()
{
$item_view_table = Database::get_course_table(TABLE_LP_ITEM);
$table = Database::get_course_table(TABLE_LP_ITEM);
if ($this->c_id > 0 && $this->id > 0) {
$sql = "UPDATE $item_view_table SET
$sql = "UPDATE $table SET
lp_id = '".intval($this->lp_id)."' ,
item_type = '".Database::escape_string($this->item_type)."' ,
ref = '".Database::escape_string($this->ref)."' ,

@ -9538,7 +9538,7 @@ class learnpath
$tmp_obj_exercice = new Exercise($course_id);
$tmp_obj_exercice->read($tmp_obj_lp_item->path);
$tmp_obj_lp_item->max_score = $tmp_obj_exercice->get_max_score();
$tmp_obj_lp_item->update_in_bdd();
$tmp_obj_lp_item->update();
$item['max_score'] = $tmp_obj_lp_item->max_score;
$return .= '<td>';

@ -557,7 +557,7 @@ $userGroups = $userGroupManager->getNameListByUser(
<tbody>
<tr>
<td><?php echo get_lang('Name'); ?></td>
<td><?php echo $user_info['complete_name']; ?></td>
<td><?php echo $user_info['complete_name_with_message_link']; ?></td>
</tr>
<tr>
<td><?php echo get_lang('Email'); ?></td>
@ -599,7 +599,8 @@ $userGroups = $userGroupManager->getNameListByUser(
'origin' => $origin,
'cidReq' => $course_code,
'id_session' => $sessionId
])
]),
['class' => 'btn btn-default']
);
?>
</td>

@ -13,7 +13,6 @@
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES;
$cidReq = api_get_cidreq();
$survey_id = intval($_GET['survey_id']);
$userId = isset($_GET['user_id']) ? $_GET['user_id'] : 0;
$survey_data = SurveyManager::get_survey($survey_id);
@ -22,8 +21,11 @@ $survey_data = SurveyManager::get_survey($survey_id);
/**
* @todo use Export::arrayToCsv($data, $filename = 'export')
*/
if (isset($_POST['export_report']) && $_POST['export_report']) {
switch ($_POST['export_format']) {
$exportReport = isset($_REQUEST['export_report']) ? $_REQUEST['export_report'] : '';
$format = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : '';
if (!empty($exportReport) && !empty($format)) {
switch ($format) {
case 'xls':
$filename = 'survey_results_'.$survey_id.'.xlsx';
$data = SurveyUtil::export_complete_report_xls(
@ -150,20 +152,13 @@ Display::display_header($tool_name, 'Survey');
// Action handling
SurveyUtil::handle_reporting_actions($survey_data, $people_filled);
// Actions bar
echo '<div class="actions">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('BackToSurvey'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
// Content
if (!isset($_GET['action']) ||
isset($_GET['action']) &&
$_GET['action'] == 'overview'
) {
$myweb_survey_id = $survey_id;
$html = null;
$url = api_get_path(WEB_CODE_PATH).'survey/reporting.php?';
$url = api_get_path(WEB_CODE_PATH).'survey/reporting.php?'.api_get_cidreq().'&';
$html .= '<div class="survey-reports">';
$html .= '<div class="list-group">';
@ -174,7 +169,7 @@ if (!isset($_GET['action']) ||
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('QuestionsOverallReport').'</h4><p>'.get_lang('QuestionsOverallReportDetail').'</p>',
$url.'action=questionreport&survey_id='.$survey_id.'&'.$cidReq.'&single_page=1',
$url.'action=questionreport&survey_id='.$survey_id.'&single_page=1',
array('class' => 'list-group-item')
);
@ -185,7 +180,7 @@ if (!isset($_GET['action']) ||
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('DetailedReportByQuestion').'</h4><p>'.get_lang('DetailedReportByQuestionDetail').'</p>',
$url.'action=questionreport&survey_id='.$survey_id.'&'.$cidReq,
$url.'action=questionreport&survey_id='.$survey_id,
array('class' => 'list-group-item')
);
@ -196,7 +191,7 @@ if (!isset($_GET['action']) ||
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('DetailedReportByUser').'</h4><p>'.get_lang('DetailedReportByUserDetail').'</p>',
$url.'action=userreport&survey_id='.$survey_id.'&'.$cidReq,
$url.'action=userreport&survey_id='.$survey_id,
array('class' => 'list-group-item')
);
@ -207,7 +202,7 @@ if (!isset($_GET['action']) ||
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('ComparativeReport').'</h4><p>'.get_lang('ComparativeReportDetail').'</p>',
$url.'action=comparativereport&survey_id='.$survey_id.'&'.$cidReq,
$url.'action=comparativereport&survey_id='.$survey_id,
array('class' => 'list-group-item')
);
@ -218,7 +213,7 @@ if (!isset($_GET['action']) ||
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('CompleteReport').'</h4><p>'.get_lang('CompleteReportDetail').'</p>',
$url.'action=completereport&survey_id='.$survey_id.'&'.$cidReq,
$url.'action=completereport&survey_id='.$survey_id,
array('class' => 'list-group-item')
);
@ -228,4 +223,4 @@ if (!isset($_GET['action']) ||
echo $html;
}
Display :: display_footer();
Display::display_footer();

@ -317,8 +317,7 @@ class SurveyUtil
// Actions bar
echo '<div class="actions">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq()
.'">'.
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ReportingOverview'), '', ICON_SIZE_MEDIUM)
.'</a>';
if (isset($_GET['user'])) {
@ -851,7 +850,7 @@ class SurveyUtil
// Actions bar
echo '<div class="actions">';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'">'
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq().'">'
.Display::return_icon(
'back.png',
get_lang('BackTo').' '.get_lang('ReportingOverview'),

@ -312,7 +312,7 @@ if ($session_id) {
$teacherList = CourseManager::getTeacherListFromCourseCodeToString(
$courseInfo['code'],
',',
false,
true,
true
);
@ -322,7 +322,7 @@ if (!empty($session_id)) {
$session_id,
$courseInfo['real_id'],
',',
false,
true,
true
);
}
@ -540,6 +540,7 @@ if (count($a_students) > 0) {
} else {
$html .= Display::return_message(get_lang('NoUsersInCourse'), 'warning', true);
}
echo Display::panel($html, $titleSession);
// Send the csv file if asked.
if ($export_csv) {

Loading…
Cancel
Save