Minor - flint fixes

pull/2539/head
jmontoyaa 8 years ago
parent ac7665e531
commit 57a8dafa4d
  1. 31
      main/auth/courses_controller.php
  2. 3
      main/inc/lib/CoursesAndSessionsCatalog.class.php
  3. 3
      main/inc/lib/course_category.lib.php
  4. 1
      plugin/buycourses/src/buy_course_plugin.class.php

@ -6,7 +6,6 @@ use Chamilo\CoreBundle\Entity\SequenceResource;
use Chamilo\CoreBundle\Entity\SessionRelCourse; use Chamilo\CoreBundle\Entity\SessionRelCourse;
use Chamilo\CoreBundle\Entity\Tag; use Chamilo\CoreBundle\Entity\Tag;
/** /**
* Class CoursesController. * Class CoursesController.
* *
@ -827,6 +826,21 @@ class CoursesController
$tpl->display($contentTemplate); $tpl->display($contentTemplate);
} }
/**
* @return array
*/
public static function getLimitArray()
{
$pageCurrent = isset($_REQUEST['pageCurrent']) ? intval($_GET['pageCurrent']) : 1;
$pageLength = isset($_REQUEST['pageLength']) ? intval($_GET['pageLength']) : CoursesAndSessionsCatalog::PAGE_LENGTH;
return [
'start' => ($pageCurrent - 1) * $pageLength,
'current' => $pageCurrent,
'length' => $pageLength,
];
}
/** /**
* Get the formatted data for sessions block to be displayed on Session Catalog page. * Get the formatted data for sessions block to be displayed on Session Catalog page.
* *
@ -960,19 +974,4 @@ class CoursesController
return $sessionsBlocks; return $sessionsBlocks;
} }
/**
* @return array
*/
public static function getLimitArray()
{
$pageCurrent = isset($_REQUEST['pageCurrent']) ? intval($_GET['pageCurrent']) : 1;
$pageLength = isset($_REQUEST['pageLength']) ? intval($_GET['pageLength']) : CoursesAndSessionsCatalog::PAGE_LENGTH;
return [
'start' => ($pageCurrent - 1) * $pageLength,
'current' => $pageCurrent,
'length' => $pageLength,
];
}
} }

@ -1,8 +1,8 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Doctrine\Common\Collections\Criteria;
use Chamilo\CoreBundle\Entity\ExtraField; use Chamilo\CoreBundle\Entity\ExtraField;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\Query\Expr\Join;
/** /**
@ -205,7 +205,6 @@ class CoursesAndSessionsCatalog
return $categories; return $categories;
} }
/** /**
* Return LIMIT to filter SQL query. * Return LIMIT to filter SQL query.
* *

@ -573,7 +573,6 @@ class CourseCategory
return $categories; return $categories;
} }
/** /**
* @param string $category_code * @param string $category_code
* @param string $searchTerm * @param string $searchTerm
@ -628,8 +627,6 @@ class CourseCategory
return Database::num_rows(Database::query($sql)); return Database::num_rows(Database::query($sql));
} }
/** /**
* create recursively all categories as option of the select passed in parameter. * create recursively all categories as option of the select passed in parameter.
* *

@ -2382,7 +2382,6 @@ class BuyCoursesPlugin extends Plugin
private function filterSessionList($name = null, $min = 0, $max = 0) private function filterSessionList($name = null, $min = 0, $max = 0)
{ {
if (empty($name) && empty($min) && empty($max)) { if (empty($name) && empty($min) && empty($max)) {
return CoursesAndSessionsCatalog::browseSessions(); return CoursesAndSessionsCatalog::browseSessions();
} }

Loading…
Cancel
Save