Project

General

Profile

Bug #1038

Learning Path add step : filename instead of title + fiw

Added by Hubert Borderiou over 9 years ago. Updated over 9 years ago.

Status:
Feature implemented
Priority:
Normal
Category:
-
Target version:
Start date:
20/04/2010
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
1

Description

Hi,
on version 1.8.7a
when you want to add a step on a learning path, if the step is a Document
you see on list filename of documents and not title.
see attached.

To correct it, edit file /main/newscorm|learnpath.class.php
and modify functions get_documents and write_resources_tree

get_document line 7833 :

 if ($is_file) {
  eval ('$resources_sorted' . $path_to_eval . '[' . $resource['id'] . '] = "' .$resource['title']."/". $last_path. '";');
  } else {
  eval ('$resources_sorted' . $path_to_eval . '["' . $last_path . '"]["id"]=' . $resource['id'] . ';');
  }

function write_resources_tree

  function write_resources_tree($resources_sorted, $num = 0) {

    include_once (api_get_path(LIBRARY_PATH) . 'fileDisplay.lib.php');

    if (count($resources_sorted) > 0) {
      foreach ($resources_sorted as $key => $resource) {

        if (is_int($resource['id'])) { // it's a folder
          $return .= '<div><div style="margin-left:' . ($num * 15) . 'px;margin-right:5px;"><img style="cursor: pointer;" src="../img/nolines_plus.gif" align="absmiddle" id="img_' . $resource["id"] . '" onclick="testResources(\'' . $resource["id"] . '\',\'img_' . $resource["id"] . '\')"><img alt="" src="../img/lp_folder.gif" title="" align="absmiddle" />&nbsp;<span onclick="testResources(\'' . $resource["id"] . '\',\'img_' . $resource["id"] . '\')" style="cursor: pointer;" >' . $key . '</span></div><div style="display: none;" id="' . $resource['id'] . '">';
          $return .= $this->write_resources_tree($resource['files'], $num +1);
          $return .= "</div></div>\r\n";
        } else {
          // it's a file
          $icon = choose_image($resource);
          $position = strrpos($icon, '.');
          $icon = substr($icon, 0, $position) . '_small.gif';
          $tabFilenameAndTitle = explode('/', $resource);
          $Afiletitle = $tabFilenameAndTitle[0];
          $Afilename = $tabFilenameAndTitle[1];
          $return .= '<div><div style="margin-left:' . (($num +1) * 15) . 'px;margin-right:5px;"><a href="' . api_get_self() . '?cidReq=' . $_GET['cidReq'] . '&amp;action=add_item&amp;type=' . TOOL_DOCUMENT . '&amp;file=' . $key . '&amp;lp_id=' . $this->lp_id . '"><img alt="" src="../img/' . $icon . '" title="" />&nbsp;' . $Afiletitle . "</a></div></div>\r\n";
        }
      }
    }
    return $return;
  }

hope this help

regards


Files

2010-04-19_1654.png (65.7 KB) 2010-04-19_1654.png Filename instead of Title Hubert Borderiou, 20/04/2010 11:12

History

#1

Updated by Yannick Warnier over 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Carlos Vargas
  • SCRUM pts - complexity changed from ? to 1
#2

Updated by Yannick Warnier over 9 years ago

  • Target version changed from 1.8.7 beta to 1.8.7 RC1
#3

Updated by Yannick Warnier over 9 years ago

  • Assignee changed from Carlos Vargas to Julio Montoya
#4

Updated by Julio Montoya over 9 years ago

  • Status changed from Assigned to Needs testing
  • Assignee changed from Julio Montoya to Curt Ricardo Rodriguez Salazar
#5

Updated by Julio Montoya over 9 years ago

  • % Done changed from 0 to 90
#6

Updated by Curt Ricardo Rodriguez Salazar over 9 years ago

this problem has been solved and fixed.

FIXED AND CLOSED

#7

Updated by Curt Ricardo Rodriguez Salazar over 9 years ago

  • Status changed from Needs testing to Feature implemented
  • % Done changed from 90 to 100

Also available in: Atom PDF