Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Direct link to document in the editor issue.
(1 viewing) (1) Guest
Document management system (DMS) component for Joomla!

NOTE: This category has been locked. If you have purchased paid version, please, use our Support Ticket system instead. If you are using free edition, please see the Community Support section.
  • Page:
  • 1

TOPIC: Direct link to document in the editor issue.

Direct link to document in the editor issue. 12 years, 4 months ago #31462

When I put a direct link using the JoomDOC editor extension it will add in URL the following url format:

index.php?option=com_joomdoc&task=document.download&path=Members%5COrganization+Hierarchy+-+2000.pdf

However, when I click this link am directed to the root of my JoomDOC to a document / folder listing page instead of downloading the file.

Has anyone ever experienced this, or have any suggestions?

Further information:
JoomDocs v3.4.0 Pro
Joomla! v2.5.4
The topic has been locked.

Re: Direct link to document in the editor issue. 12 years, 4 months ago #31515

Try to modify the file modal.php (administrator/components/com_joomdoc/views/documents/tmpl/modal.php) with this content :
 
<?php
 
/**
* @version $Id$
* @package Joomla.Administrator
* @subpackage JoomDOC
* @author ARTIO s.r.o., info@artio.net, http:://www.artio.net
* @copyright Copyright (C) 2011 Artio s.r.o.. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

 
defined('_JEXEC') or die;
 
$mainframe = JFactory::getApplication();
/* @var $mainframe JApplication */
 
/* @var $this JoomDOCViewDocuments */
 
$listOrder = $this->escape($this->state->get(JOOMDOC_FILTER_ORDERING));
$listDirn = $this->escape($this->state->get(JOOMDOC_FILTER_DIRECTION));
 
$useLinkType = JRequest::getInt('useLinkType');
$linkType = JOOMDOC_LINK_TYPE_DETAIL;
 
$addSymLink = JRequest::getString('addSymLink');
$symLinkSource = JRequest::getString('symLinkSource');
 
if ($addSymLink == 'target')
echo '<p>' . JText::sprintf('JOOMDOC_SYMLINKS_ADD_TARGET', '<img src="' . JURI::root() . 'components/com_joomdoc/assets/images/icon-16-symlink.png" alt="" />') . '</p>';
elseif ($addSymLink == 'source')
echo '<p>' . JText::sprintf('JOOMDOC_SYMLINKS_ADD_SOURCE', '<img src="' . JURI::root() . 'components/com_joomdoc/assets/images/icon-16-symlink.png" alt="" />') . '</p>';
 
$separator = JText::_('JOOMDOC_PATHWAY_SEPARATOR');
foreach (JoomDOCFileSystem::getPathBreadCrumbs($this->access->relativePath) as $i => $breadCrumb) {
echo '<span>' . $separator . '<a href="' . JRoute::_(JoomDOCRoute::modalDocuments($breadCrumb->path, $useLinkType, $addSymLink, $symLinkSource)) . '" class="hasTip" title="' . $this->getTooltip($breadCrumb->path, 'JOOMDOC_DOCUMENTS_OPEN_FOLDER') . '">' . $breadCrumb->name . '</a></span>';
}
 
echo '<form action="' . JRoute::_(JoomDOCRoute::modalDocuments($this->access->relativePath, $useLinkType, $addSymLink, $symLinkSource)) . '" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">';
echo '<fieldset id="filter-bar">';
echo '<div>';
echo '<label for="filter" class="hasTip filter-search-lbl" title="' . $this->getTooltip('JOOMDOC_DOCUMENTS_FILTER') . '">' . JText::_('JOOMDOC_DOCUMENTS_FILTER') . ':</label>';
echo '<input type="text" name="filter" id="filter" value="' . $this->escape($this->filter) . '" />';
echo '<button type="submit" class="btn">' . JText::_('JSEARCH_FILTER_SUBMIT') . '</button>';
echo '<button type="button" onclick="var f=this.form;f.filter.value=\'\';f.submit();">' . JText::_('JSEARCH_FILTER_CLEAR') . '</button>';
 
if ($useLinkType) {
$linkType = JRequest::getString('linkType', JOOMDOC_LINK_TYPE_DETAIL);
$options[] = JHtml::_('select.option', JOOMDOC_LINK_TYPE_DETAIL, JText::_('JOOMDOC_LINK_TYPE_DETAIL'));
$options[] = JHtml::_('select.option', JOOMDOC_LINK_TYPE_DOWNLOAD, JText::_('JOOMDOC_LINK_TYPE_DOWNLOAD'));
echo JHtml::_('select.genericlist', $options, 'linkType', 'onchange="this.form.submit()"', 'value', 'text', $linkType);
}
echo '</div>';
echo '</fieldset>';
echo '<table class="adminlist">';
echo '<thead>';
echo '<tr>';
echo '<th>' . JHtml::_('grid.sort', 'JOOMDOC_DOCUMENTS_ITEM', JOOMDOC_ORDER_PATH, $listDirn, $listOrder) . '</th>';
echo '<th>' . JText::_('JOOMDOC_DOCUMENT') . '</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
 
$prefix = '/administrator/';
$prefixLength = JString::strlen($prefix);
 
$this->root->initIteration();
$i = 0;
while ($this->root->hasNext()) {
$item = $this->root->getNext();
$access = new JoomDOCAccessHelper($item);
echo '<tr class="row' . ($i % 2) . '">';
echo '<td>';
 
$id = $this->escape($access->relativePath);
$title = $this->escape($access->docid ? $item->document->title : $access->relativePath);
 
// URL généré
$url = JRoute::_($linkType == JOOMDOC_LINK_TYPE_DOWNLOAD && $access->isFile ? JoomDOCRoute::download($access->relativePath, $access->alias) : JoomDOCRoute::viewDocuments($access->relativePath, $access->alias));
 
if (JString::strpos($url, $prefix) === 0) { // Si la position du préfixe dans l'url est = à 0
$url = JString::substr($url, $prefixLength); // alors on enlève le préfixe
} else {
$url = substr_replace($url, "/", JString::strpos($url, $prefix), $prefixLength); // Ajout Mikael le 25/05/12
}
 
echo '<a href="javascript:window.parent.jSelectJoomdocDocument(\'' . $id . '\', \'' . addslashes($title) . '\', \'' . addslashes($url) . '\')" class="hasTip addDocument" title="' . $this->getTooltip('JOOMDOC_SET_DOCUMENT') . '"></a>';
 
if ($access->isFolder) {
echo '<a class="hasTip folder" href="' . JRoute::_(JoomDOCRoute::modalDocuments($access->relativePath, $useLinkType, $addSymLink, $symLinkSource)) . '" title="' . $this->getTooltip($access->relativePath, 'JOOMDOC_DOCUMENTS_OPEN_FOLDER') . '">' . $this->escape($access->name) . '</a>';
} else {
echo '<span class="file">' . $this->escape($access->name) . '</span>';
}
echo '</td>';
echo '<td>' . ($access->docid ? $this->escape($item->document->title) : '-') . '</td>';
echo '</tr>';
$i++;
}
echo '</tbody>';
echo '</table>';
echo '<input type="hidden" name="task" value="" />';
echo '<input type="hidden" name="boxchecked" value="" />';
echo '<input type="hidden" name="filter_order" value="' . $listOrder . '" />';
echo '<input type="hidden" name="filter_order_Dir" value="' . $listDirn . '" />';
echo JHtml::_('form.token');
echo '</form>';
 
?>


If it doesn't work, i have an other solution that you can try.
This solution will work when you upload the file. It will remove space and special characters in the filename.

I hope it will help you

Best regards,

Mikael

Sorry for my english, i'm french ;-)
The topic has been locked.

Re: Direct link to document in the editor issue. 12 years, 4 months ago #31570

  • jitr
  • OFFLINE
  • ARTIO Support
  • Posts: 1432
Hello, thanks for your notice. We will fix it in next version.
ARTIO Support Team
The topic has been locked.
  • Page:
  • 1
User Login Empty