Quellcode durchsuchen

Minor - updating from mine

Julio Montoya vor 11 Jahren
Ursprung
Commit
39e2a257b8

+ 37 - 5
main/inc/lib/display.lib.php

@@ -1883,8 +1883,17 @@ class Display
 
      * @return string
      */
-    public static function progressPaginationBar($nextValue, $list, $current, $fixedValue = null, $conditions = array(), $link = null, $isMedia = false, $addHeaders = true)
-    {
+    public static function progressPaginationBar(
+        $nextValue,
+        $list,
+        $current,
+        $fixedValue = null,
+        $conditions = array(),
+        $link = null,
+        $isMedia = false,
+        $addHeaders = true,
+        $linkAttributes = array()
+    ) {
         if ($addHeaders) {
             $pagination_size = 'pagination-mini';
             $html = '<div class="exercise_pagination pagination '.$pagination_size.'"><ul>';
@@ -1908,7 +1917,19 @@ class Display
                     $isCurrent = $current == ($localCounter + $nextValue + 1) ? true : false;
                 }
             }
-            $html .= self::parsePaginationItem($itemId, $isCurrent, $conditions, $link, $nextValue, $isMedia, $localCounter, $fixedValue);
+
+            $html .= self::parsePaginationItem(
+                $itemId,
+                $isCurrent,
+                $conditions,
+                $link,
+                $nextValue,
+                $isMedia,
+                $localCounter,
+                $fixedValue,
+                $linkAttributes
+            );
+
             $localCounter++;
         }
 
@@ -1930,7 +1951,16 @@ class Display
      * @param int $fixedValue
      * @return string
      */
-    static function parsePaginationItem($itemId, $isCurrent, $conditions, $link, $nextValue = 0, $isMedia = false, $localCounter = null, $fixedValue = null)
+    static function parsePaginationItem(
+        $itemId,
+        $isCurrent,
+        $conditions,
+        $link,
+        $nextValue = 0,
+        $isMedia = false,
+        $localCounter = null,
+        $fixedValue = null,
+        $linkAttributes = array())
     {
         $defaultClass = "before";
         $class = $defaultClass;
@@ -1983,7 +2013,9 @@ class Display
             $link_to_show = $link.$fixedValue.'#questionanchor'.$itemId;
         }
 
-        return  '<li class = "'.$class.'"><a href="'.$link_to_show.'">'.$label.' </a></li>';
+        $link = Display::url($label.' ', $link_to_show, $linkAttributes);
+
+        return  '<li class = "'.$class.'">'.$link.'</li>';
     }
 
 

+ 4 - 2
main/inc/lib/events.lib.inc.php

@@ -1205,14 +1205,16 @@ function get_all_exercise_results_by_user($user_id, $courseId, $session_id = 0)
  * @return  array   with the results
  *
  */
-function get_exercise_results_by_attempt($exe_id)
+function get_exercise_results_by_attempt($exe_id, $status = null)
 {
     $table_track_exercises = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
     $table_track_attempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
     $table_track_attempt_recording = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
     $exe_id = intval($exe_id);
 
-    $sql = "SELECT * FROM $table_track_exercises WHERE status = '' AND exe_id = $exe_id";
+    $status = Database::escape_string($status);
+
+    $sql = "SELECT * FROM $table_track_exercises WHERE status = '".$status."' AND exe_id = $exe_id";
 
     $res = Database::query($sql);
     $list = array();

+ 0 - 1
main/inc/routes.php

@@ -655,7 +655,6 @@ if ($alreadyInstalled) {
     $app->mount('/admin/administrator/roles', new ChamiloLMS\Provider\ReflectionControllerProvider('role.controller'));
     $app->mount('/admin/administrator/question_scores', new ChamiloLMS\Provider\ReflectionControllerProvider('question_score.controller'));
     $app->mount('/admin/administrator/question_score_names', new ChamiloLMS\Provider\ReflectionControllerProvider('question_score_name.controller'));
-
     $app->mount('/courses/{course}/curriculum/category', new ChamiloLMS\Provider\ReflectionControllerProvider('curriculum_category.controller'));
     $app->mount('/courses/{course}/curriculum/item', new ChamiloLMS\Provider\ReflectionControllerProvider('curriculum_item.controller'));
     $app->mount('/courses/{course}/curriculum/user', new ChamiloLMS\Provider\ReflectionControllerProvider('curriculum_user.controller'));

+ 3 - 0
src/ChamiloLMS/Controller/Admin/Administrator/BranchController.php

@@ -151,8 +151,11 @@ class BranchController extends CommonController
     {
         $template = $this->get('template');
         $template->assign('links', $this->generateLinks());
+
+        /** @var \Entity\Repository\BranchSyncRepository $repo */
         $repo = $this->getRepository();
         $item = $this->getEntity($id);
+
         $children = $repo->children($item);
         $template->assign('item', $item);
         $template->assign('subitems', $children);

+ 8 - 5
src/ChamiloLMS/Controller/Admin/Director/BranchDirectorController.php

@@ -60,12 +60,8 @@ class BranchDirectorController extends CommonController
 
                     $juryList  .= $jury->getName() . ' '.$addUserLink.$viewUsers.'<br />';
                 }
-
-
                 return $row['branchName'].' <br />'.$juryList;
             }
-            //'representationField' => 'slug',
-            //'html' => true
         );
 
         // @todo add director filters
@@ -82,6 +78,14 @@ class BranchDirectorController extends CommonController
             ->getQuery();
 
         $htmlTree = $repo->buildTree($query->getArrayResult(), $options);
+
+        if (empty($htmlTree)) {
+            $this->get('session')->getFlashBag()->add(
+                'warning',
+                $this->get('translator')->trans("You don't have any branches.")
+            );
+        }
+
         $this->get('template')->assign('tree', $htmlTree);
         $this->get('template')->assign('links', $this->generateLinks());
         $response = $this->get('template')->render_template($this->getTemplatePath().'list.tpl');
@@ -99,7 +103,6 @@ class BranchDirectorController extends CommonController
         $request = $this->getRequest();
 
         $template->assign('links', $this->generateLinks());
-        $repo = $this->getRepository();
 
         $item = $this->getEntity($id);
         $template->assign('item', $item);

+ 0 - 4
src/ChamiloLMS/Controller/IndexController.php

@@ -261,10 +261,6 @@ class IndexController extends CommonController
         );
         $form->addElement('style_submit_button', 'submitAuth', get_lang('LoginEnter'), array('class' => 'btn'));
         $html = $form->return_form();
-        /*if (api_get_setting('openid_authentication') == 'true') {
-            include_once 'main/auth/openid/login.php';
-            $html .= '<div>'.openid_form().'</div>';
-        }*/
 
         /** Verify if settings is active to set keyboard. Included extra class in form input elements */