From 7ceb584bd7a8e4b70597d1434fd991eefa3e9d92 Mon Sep 17 00:00:00 2001 From: lcubas Date: Wed, 18 Nov 2020 11:30:05 -0500 Subject: [PATCH 1/2] Documents: Fix audio icon size --- app/Resources/public/css/base.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index 280f4aac14..a17ec7d521 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -8952,8 +8952,9 @@ ul.dropdown-menu.inner > li > a { .preview .mejs__container { background: #aaa; border-radius: 50%; - width: 22px; - height: 22px; + width: 22px !important; + height: 22px !important; + min-width: 22px !important; } .preview .mejs__controls { @@ -8962,7 +8963,7 @@ ul.dropdown-menu.inner > li > a { } .preview .mejs__button > button { - margin: 16px 6px; + margin: 20px 2px; } /* end document mp3 preview */ From d6b7c4b801cd2bf6e71fe29c2d3ea8e15b4151d9 Mon Sep 17 00:00:00 2001 From: lcubas Date: Wed, 18 Nov 2020 15:07:59 -0500 Subject: [PATCH 2/2] Tickets: Fix filter by session id in getLpList function --- main/inc/ajax/lp.ajax.php | 3 ++- main/lp/learnpath.class.php | 7 ++++++- main/ticket/new_ticket.php | 10 ++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/main/inc/ajax/lp.ajax.php b/main/inc/ajax/lp.ajax.php index ff39c1ed54..12a048d50c 100755 --- a/main/inc/ajax/lp.ajax.php +++ b/main/inc/ajax/lp.ajax.php @@ -22,8 +22,9 @@ if ($debug) { switch ($action) { case 'get_lp_list_by_course': $course_id = (isset($_GET['course_id']) && !empty($_GET['course_id'])) ? (int) $_GET['course_id'] : 0; + $session_id = (isset($_GET['session_id']) && !empty($_GET['session_id'])) ? (int) $_GET['session_id'] : 0; $onlyActiveLp = !(api_is_platform_admin(true) || api_is_course_admin()); - $results = learnpath::getLpList($course_id, $onlyActiveLp); + $results = learnpath::getLpList($course_id, $session_id, $onlyActiveLp); $data= []; if (!empty($results)) { diff --git a/main/lp/learnpath.class.php b/main/lp/learnpath.class.php index 65730a7747..c6423a0cd9 100755 --- a/main/lp/learnpath.class.php +++ b/main/lp/learnpath.class.php @@ -12207,11 +12207,12 @@ EOD; } } - public static function getLpList($courseId, $onlyActiveLp = true) + public static function getLpList($courseId, $sessionId, $onlyActiveLp = true) { $TABLE_LP = Database::get_course_table(TABLE_LP_MAIN); $TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY); $courseId = (int) $courseId; + $sessionId = (int) $sessionId; $sql = "SELECT lp.id, lp.name FROM $TABLE_LP lp @@ -12219,6 +12220,10 @@ EOD; ON lp.id = ip.ref WHERE lp.c_id = $courseId "; + if (!empty($sessionId)) { + $sql .= "AND ip.session_id = $sessionId "; + } + if ($onlyActiveLp) { $sql .= "AND ip.tool = 'learnpath' "; $sql .= "AND ip.visibility = 1 "; diff --git a/main/ticket/new_ticket.php b/main/ticket/new_ticket.php index 6a6d759a9a..0d6b2383f7 100644 --- a/main/ticket/new_ticket.php +++ b/main/ticket/new_ticket.php @@ -13,6 +13,7 @@ if (!api_is_platform_admin() && api_get_setting('ticket_allow_student_add') !== api_block_anonymous_users(); $courseId = api_get_course_int_id(); +$sessionId = api_get_session_id(); $exerciseId = (isset($_GET['exerciseId']) && !empty($_GET['exerciseId'])) ? (int) $_GET['exerciseId'] : 0; $lpId = (isset($_GET['lpId']) && !empty($_GET['lpId'])) ? (int) $_GET['lpId'] : 0; @@ -73,13 +74,14 @@ function updateExerciseList(courseId, sessionId) { }, "json"); } -function updateLpList(courseId) { +function updateLpList(courseId, sessionId) { var $selectLp = $("select#lp_id"); $selectLp.empty(); $.get("'.api_get_path(WEB_AJAX_PATH).'lp.ajax.php", { a: "get_lp_list_by_course", - course_id: courseId + course_id: courseId, + session_id: sessionId }, function (lpList) { $("