Minor - format code.

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent f6e043f5fc
commit 3d50dbda2a
  1. 2
      main/coursecopy/recycle_course.php
  2. 33
      main/inc/lib/link.lib.php
  3. 2
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRecycler.php
  4. 1
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseRestorer.php

@ -63,9 +63,7 @@ if (Security::check_token('post') && (
}
$cr = new CourseRecycler($course);
$cr->recycle($recycle_type);
Display::display_confirmation_message(get_lang('RecycleFinished'));
} elseif (Security::check_token('post') && (
isset($_POST['recycle_option']) &&
$_POST['recycle_option'] == 'select_items'

@ -805,11 +805,11 @@ class Link extends Model
$sql = "SELECT *, linkcat.id
FROM $tblLinkCategory linkcat
INNER JOIN $tblItemProperty itemproperties
ON (linkcat.id = itemproperties.ref AND linkcat.c_id = itemproperties.c_id)
INNER JOIN $tblItemProperty ip
ON (linkcat.id = ip.ref AND linkcat.c_id = ip.c_id)
WHERE
itemproperties.tool = '" . TOOL_LINK_CATEGORY . "' AND
(itemproperties.visibility = '0' OR itemproperties.visibility = '1')
ip.tool = '" . TOOL_LINK_CATEGORY . "' AND
(ip.visibility = '0' OR ip.visibility = '1')
$sessionCondition AND
linkcat.c_id = " . $courseId . "
ORDER BY linkcat.display_order DESC";
@ -831,11 +831,11 @@ class Link extends Model
$sql = "SELECT DISTINCT linkcat.*, visibility
FROM $tblLinkCategory linkcat
INNER JOIN $tblItemProperty itemproperties
ON (linkcat.id = itemproperties.ref AND linkcat.c_id = itemproperties.c_id)
INNER JOIN $tblItemProperty ip
ON (linkcat.id = ip.ref AND linkcat.c_id = ip.c_id)
WHERE
itemproperties.tool = '" . TOOL_LINK_CATEGORY . "' AND
(itemproperties.visibility = '0' OR itemproperties.visibility = '1')
ip.tool = '" . TOOL_LINK_CATEGORY . "' AND
(ip.visibility = '0' OR ip.visibility = '1')
$sessionCondition AND
linkcat.c_id = " . $courseId . "
ORDER BY linkcat.display_order DESC
@ -863,17 +863,19 @@ class Link extends Model
// Condition for the session.
$condition_session = api_get_session_condition($session_id, true, true, 'link.session_id');
$content = '';
$sql = "SELECT *, link.id FROM $tbl_link link
INNER JOIN $TABLE_ITEM_PROPERTY itemproperties
ON (link.id=itemproperties.ref AND link.c_id = itemproperties.c_id)
$sql = "SELECT *, link.id
FROM $tbl_link link
INNER JOIN $TABLE_ITEM_PROPERTY ip
ON (link.id=ip.ref AND link.c_id = ip.c_id)
WHERE
itemproperties.tool='" . TOOL_LINK . "' AND
ip.tool='" . TOOL_LINK . "' AND
link.category_id='" . $catid . "' AND
(itemproperties.visibility='0' OR itemproperties.visibility='1')
(ip.visibility='0' OR ip.visibility='1')
$condition_session AND
link.c_id = " . $course_id . " AND
itemproperties.c_id = " . $course_id . "
ip.c_id = " . $course_id . "
ORDER BY link.display_order ASC";
$result = Database:: query($sql);
$numberoflinks = Database:: num_rows($result);
if ($numberoflinks > 0) {
@ -1498,8 +1500,6 @@ class Link extends Model
public static function listLinksAndCategories($course_id, $session_id, $categoryId, $show = 'none', $token = null)
{
$tbl_link = Database::get_course_table(TABLE_LINK);
$_user = api_get_user_info();
$categoryId = intval($categoryId);
/* Action Links */
@ -1544,7 +1544,6 @@ class Link extends Model
// Validation when belongs to a session
$showChildren = $categoryId == $myrow['id'] || $show == 'all';
$session_img = api_get_session_image($myrow['session_id'], $_user['status']);
$myrow['description'] = $myrow['description'];
$strVisibility = '';

@ -330,7 +330,7 @@ class CourseRecycler
{
$link_cat_table = Database :: get_course_table(TABLE_LINK_CATEGORY);
$link_table = Database :: get_course_table(TABLE_LINK);
$sql = "SELECT lc.id FROM ".$link_cat_table." lc
$sql = "SELECT lc.id FROM $link_cat_table lc
LEFT JOIN ".$link_table." l
ON
lc.id=l.category_id AND

@ -1315,7 +1315,6 @@ class CourseRestorer
$params['category_title'] = self::DBUTF8($link_cat->title);
$params['description'] = self::DBUTF8($link_cat->description);
$params['display_order'] = $display_order;
$new_id = Database::insert($link_cat_table, $params);
if ($new_id) {

Loading…
Cancel
Save