Show link categories content when exporting to PDF see BT#15679

pull/2990/head
Julio 6 years ago
parent 0fb1d58ba8
commit e54f219f46
  1. 12
      main/inc/lib/link.lib.php
  2. 2
      main/link/link.php

@ -1562,6 +1562,7 @@ class Link extends Model
* @param string $show * @param string $show
* @param null $token * @param null $token
* @param bool $showActionLinks * @param bool $showActionLinks
* @param bool $forceOpenCategories
* *
* @return string * @return string
*/ */
@ -1571,12 +1572,11 @@ class Link extends Model
$categoryId, $categoryId,
$show = 'none', $show = 'none',
$token = null, $token = null,
$showActionLinks = true $showActionLinks = true,
$forceOpenCategories = false
) { ) {
$categoryId = (int) $categoryId; $categoryId = (int) $categoryId;
$content = ''; $content = '';
$categories = self::getLinkCategories($course_id, $session_id); $categories = self::getLinkCategories($course_id, $session_id);
$countCategories = count($categories); $countCategories = count($categories);
$linksPerCategory = self::showLinksPerCategory(0, $course_id, $session_id, $showActionLinks); $linksPerCategory = self::showLinksPerCategory(0, $course_id, $session_id, $showActionLinks);
@ -1636,8 +1636,10 @@ class Link extends Model
} }
// Validation when belongs to a session // Validation when belongs to a session
$showChildren = $categoryId == $myrow['id'] || $show == 'all'; $showChildren = $categoryId == $myrow['id'] || $show === 'all';
$myrow['description'] = $myrow['description']; if ($forceOpenCategories) {
$showChildren = true;
}
$strVisibility = ''; $strVisibility = '';
$visibilityClass = null; $visibilityClass = null;

@ -212,7 +212,7 @@ switch ($action) {
exit; exit;
break; break;
case 'export': case 'export':
$content = Link::listLinksAndCategories($course_id, $session_id, $categoryId, $show, null, false); $content = Link::listLinksAndCategories($course_id, $session_id, $categoryId, $show, null, false, true);
$courseInfo = api_get_course_info_by_id($course_id); $courseInfo = api_get_course_info_by_id($course_id);
if (!empty($session_id)) { if (!empty($session_id)) {
$sessionInfo = api_get_session_info($session_id); $sessionInfo = api_get_session_info($session_id);

Loading…
Cancel
Save