Merge 1.10.x

ofaj
jmontoyaa 9 years ago
commit 84c4c7acbc
  1. 2
      README.md
  2. 49
      main/inc/ajax/course_home.ajax.php
  3. 12
      main/inc/ajax/lp.ajax.php
  4. 2
      main/inc/lib/array.lib.php
  5. 4
      main/inc/lib/course_home.lib.php
  6. 16
      main/inc/lib/pear/PEAR.php
  7. 2
      main/lang/english/trad4all.inc.php
  8. 4
      main/lp/scorm_api.php
  9. 3
      main/mySpace/myStudents.php
  10. 2
      main/template/default/learnpath/view.tpl
  11. 16
      plugin/bbb/lib/bbb.lib.php

@ -165,7 +165,7 @@ php bin/doctrine.php migrations:execute 20150527120703 --up --configuration=app/
You can also print the differences between your database and what it should be by issuing the following command from the Chamilo base folder:
```
php bin/doctrine.php orm:schema:update --dump-sql
php bin/doctrine.php orm:schema-tool:update --dump-sql
```
## Contributing

@ -77,8 +77,6 @@ switch ($action) {
echo get_lang('PrivateAccess');
break;
}
//echo Display::tag('h2', $course_info['name']);
//echo '<br />';
$sql = "SELECT * FROM $tbl_course_description
WHERE c_id = ".$course_info['real_id']." AND session_id = 0
@ -117,7 +115,6 @@ switch ($action) {
$session_id = intval($_REQUEST['session_id']);
$course_id = intval($_REQUEST['course_id']);
//Filter users that does not belong to the session
if (!api_is_platform_admin()) {
$new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
@ -137,10 +134,10 @@ switch ($action) {
$temp = array();
foreach ($course_list as $item) {
$list = new LearnpathList(api_get_user_id(), $item['code'], $session_id);
$flat_list = $list->get_flat_list();
$flat_list = $list->get_flat_list();
$lps[$item['code']] = $flat_list;
$course_url = api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id;
$item['title'] = Display::url($item['title'], $course_url, array('target' => SESSION_LINK_TARGET));
$course_url = api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id;
$item['title'] = Display::url($item['title'], $course_url, array('target' => SESSION_LINK_TARGET));
foreach ($flat_list as $lp_id => $lp_item) {
$temp[$count]['id']= $lp_id;
@ -199,12 +196,11 @@ switch ($action) {
Display::url($icons.' '.$lp_item['lp_name'], $lp_url, array('target'=>SESSION_LINK_TARGET))
);
$temp[$count]['course'] = strip_tags($item['title']);
$temp[$count]['lp'] = $lp_item['lp_name'];
$temp[$count]['date'] = $lp_item['publicated_on'];
$temp[$count]['lp'] = $lp_item['lp_name'];
$temp[$count]['date'] = $lp_item['publicated_on'];
$count++;
}
}
$temp = msort($temp, $sidx, $sord);
$i =0;
@ -279,7 +275,11 @@ switch ($action) {
$list = new LearnpathList(api_get_user_id(),$item['code'], $session_id, 'publicated_on DESC');
$flat_list = $list->get_flat_list();
$lps[$item['code']] = $flat_list;
$item['title'] = Display::url($item['title'],api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id,array('target'=>SESSION_LINK_TARGET));
$item['title'] = Display::url(
$item['title'],
api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id,
array('target' => SESSION_LINK_TARGET)
);
foreach ($flat_list as $lp_id => $lp_item) {
$temp[$count]['id']= $lp_id;
@ -312,8 +312,7 @@ switch ($action) {
$date = '-';
}
//Checking LP publicated and expired_on dates
// Checking LP publicated and expired_on dates
if (!empty($lp_item['publicated_on']) && $lp_item['publicated_on'] != '0000-00-00 00:00:00') {
$week_data = date('Y', api_strtotime($lp_item['publicated_on'], 'UTC')).' - '.get_week_from_day($lp_item['publicated_on']);
if ($now < api_strtotime($lp_item['publicated_on'], 'UTC')) {
@ -329,12 +328,18 @@ switch ($action) {
}
}
$temp[$count]['cell'] = array($week_data, $date, $item['title'], Display::url($icons.' '.$lp_item['lp_name'], $lp_url, array('target'=>SESSION_LINK_TARGET)));
$temp[$count]['cell'] = array(
$week_data,
$date,
$item['title'],
Display::url($icons.' '.$lp_item['lp_name'], $lp_url, array('target' => SESSION_LINK_TARGET)),
);
$temp[$count]['course'] = strip_tags($item['title']);
$temp[$count]['lp'] = $lp_item['lp_name'];
$temp[$count]['lp'] = $lp_item['lp_name'];
$count++;
}
}
if (!empty($sidx)) {
$temp = msort($temp, $sidx, $sord);
}
@ -374,8 +379,8 @@ switch ($action) {
$sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id';
$sidx = str_replace(array('course asc,', ' '), '', $sidx);
$sord = $_REQUEST['sord']; //asc or desc
if (!in_array($sord, array('asc','desc'))) {
$sord = $_REQUEST['sord']; //asc or desc
if (!in_array($sord, array('asc', 'desc'))) {
$sord = 'desc';
}
$session_id = intval($_REQUEST['session_id']);
@ -424,11 +429,11 @@ switch ($action) {
if ($lp_item['modified_on'] == '0000-00-00 00:00:00' || empty($lp_item['modified_on'])) {
$lp_date = api_get_local_time($lp_item['created_on']);
$image = 'new.gif';
$label = get_lang('LearnpathAdded');
$label = get_lang('LearnpathAdded');
} else {
$lp_date = api_get_local_time($lp_item['modified_on']);
$image = 'moderator_star.png';
$label = get_lang('LearnpathUpdated');
$lp_date = api_get_local_time($lp_item['modified_on']);
$image = 'moderator_star.png';
$label = get_lang('LearnpathUpdated');
}
$icons = '';
if (strtotime($last_date) < strtotime($lp_date)) {
@ -457,8 +462,8 @@ switch ($action) {
Display::url($icons.' '.$lp_item['lp_name'], $lp_url, array('target'=>SESSION_LINK_TARGET))
);
$temp[$count]['course'] = strip_tags($item['title']);
$temp[$count]['lp'] = $lp_item['lp_name'];
$temp[$count]['date'] = $lp_item['publicated_on'];
$temp[$count]['lp'] = $lp_item['lp_name'];
$temp[$count]['date'] = $lp_item['publicated_on'];
$count++;
}

@ -64,9 +64,8 @@ switch ($action) {
case 'update_lp_item_order':
if (api_is_allowed_to_edit(null, true)) {
$new_order = $_POST['new_order'];
$sections = explode('^', $new_order);
$new_order = $_POST['new_order'];
$sections = explode('^', $new_order);
$new_array = array();
// We have to update parent_item_id, previous_item_id, next_item_id, display_order in the database
@ -187,12 +186,7 @@ switch ($action) {
break;
}
$learningPath = new learnpath(
api_get_course_id(),
$lpId,
api_get_user_id()
);
$learningPath = learnpath::getLpFromSession(api_get_course_id(), $lpId, api_get_user_id());
$lpItem = $learningPath->getItem($lpItemId);
if (empty($lpItem)) {

@ -57,7 +57,7 @@ function msort($array, $id = 'id', $order = 'desc')
$lowest_id = $index;
}
} else {
if ($item[$id] > $array[$lowest_id][$id]) {
if (isset($item[$id]) && $item[$id] > $array[$lowest_id][$id]) {
$lowest_id = $index;
}
}

@ -1093,6 +1093,7 @@ class CourseHome
{
$navigation_items = array();
$course_id = api_get_course_int_id();
$courseInfo = api_get_course_info();
if (!empty($course_id)) {
@ -1100,7 +1101,7 @@ class CourseHome
/* Link to the Course homepage */
$navigation_items['home']['image'] = 'home.gif';
$navigation_items['home']['link'] = api_get_path(WEB_CODE_PATH).Security::remove_XSS($_SESSION['_course']['path']).'/index.php';
$navigation_items['home']['link'] = $courseInfo['course_public_url'];
$navigation_items['home']['name'] = get_lang('CourseHomepageLink');
$sql = "SELECT * FROM $course_tools_table
@ -1198,6 +1199,7 @@ class CourseHome
$html .= '</dl></div></div>';
}
$html .= '</div><!-- end "#toolnav" -->';
return $html;
}

@ -19,10 +19,6 @@
* @since File available since Release 0.1
*/
// Added by Chamilo team, 16-MAR-2010
if (class_exists('pear')) { return; }
//
/**#@+
* ERROR constants
*/
@ -156,7 +152,7 @@ class PEAR
* @access public
* @return void
*/
public function __construc($error_class = null)
public function __construct($error_class = null)
{
$classname = strtolower(get_class($this));
if ($this->_debug) {
@ -867,9 +863,13 @@ class PEAR_Error
* @access public
*
*/
public function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
public function __constructor(
$message = 'unknown error',
$code = null,
$mode = null,
$options = null,
$userinfo = null
) {
if ($mode === null) {
$mode = PEAR_ERROR_RETURN;
}

@ -6980,7 +6980,7 @@ $EventType = "Event type";
$WamiFlashDialog = "It will display a dialog box which asks for your permission to access the microphone, answer yes and close the dialog box (if you do not want to appear again, before closing check remember)";
$WamiStartRecorder = "Start recording by pressing the microphone and stop it by pressing again. Each time you do this will generate a file.";
$WamiNeedFilename = "Before you activate recording it is necessary a file name.";
$InputNameHere = "Enter filename here";
$InputNameHere = "Enter name here";
$Reload = "Reload";
$SelectGradeModel = "Select a calification model";
$AllMustWeight100 = "The sum of all values must be 100";

@ -1663,7 +1663,7 @@ function switch_item(current_item, next_item){
});
olms.switch_finished = 0; //only changed back once LMSInitialize() happens
loadForumThead(olms.lms_lp_id, next_item);
loadForumThread(olms.lms_lp_id, next_item);
checkCurrentItemPosition(olms.lms_item_id);
return true;
@ -1699,7 +1699,7 @@ var checkCurrentItemPosition = function(lpItemId) {
/**
* Get a forum info when the learning path item has a associated forum
*/
var loadForumThead = function(lpId, lpItemId) {
var loadForumThread = function(lpId, lpItemId) {
var loadForum = $.getJSON('<?php echo api_get_path(WEB_AJAX_PATH) ?>lp.ajax.php', {
a: 'get_forum_thread',
lp: lpId,

@ -12,7 +12,8 @@ api_block_anonymous_users();
if (!api_is_allowed_to_create_course() &&
!api_is_session_admin() &&
!api_is_drh() &&
!api_is_student_boss()
!api_is_student_boss() &&
!api_is_platform_admin()
) {
// Check if the user is tutor of the course
$user_course_status = CourseManager::get_tutor_in_course_status(

@ -214,7 +214,7 @@
$('.lp-view-tabs').fadeIn();
});
loadForumThead({{ lp_id }}, {{ lp_current_item_id }});
loadForumThread({{ lp_id }}, {{ lp_current_item_id }});
checkCurrentItemPosition({{ lp_current_item_id }});
{% if glossary_extra_tools in glossary_tool_availables %}

@ -55,11 +55,21 @@ class bbb
$this->groupSupport = isset($columns['group_id']) ? true : false;
if ($this->groupSupport) {
// Plugin check
$this->groupSupport = (bool) $plugin->get('enable_conference_in_course_groups');
if ($this->groupSupport) {
$courseInfo = api_get_course_info();
if ($courseInfo) {
$this->groupSupport = api_get_course_setting('bbb_enable_conference_in_groups') === '1';
// Platform check
$bbbSetting = api_get_setting('bbb_enable_conference_in_course_groups');
$bbbSetting = isset($bbbSetting['bbb']) ? $bbbSetting['bbb'] === 'true' : false;
if ($bbbSetting) {
// Course check
$courseInfo = api_get_course_info();
if ($courseInfo) {
$this->groupSupport = api_get_course_setting('bbb_enable_conference_in_groups') === '1';
}
}
}
}

Loading…
Cancel
Save