forked from extern/egroupware
Improvements for linking mail:
- Let filemanager encode name so we can keep more characters - Remove doubled mime removal, which sometimes damaged title - Fix file information action
This commit is contained in:
parent
49097a7b63
commit
4c1424db9b
@ -179,10 +179,6 @@ class etemplate_widget_link extends etemplate_widget
|
||||
$link['target'] = '_blank';
|
||||
$link['label'] = 'Delete';
|
||||
$link['help'] = lang('Delete this file');
|
||||
if ($GLOBALS['egw_info']['user']['preferences']['common']['link_list_format'] != 'text')
|
||||
{
|
||||
$link['title'] = preg_replace('/: ([^ ]+) /',': ',$link['title']); // remove mime-type, it's alread in the icon
|
||||
}
|
||||
$link['title'] = egw_vfs::decodePath($link['title']);
|
||||
$link['icon'] = egw_link::vfs_path($link['app2'],$link['id2'],$link['id'],true);
|
||||
$link['download_url'] = egw_vfs::download_url($link['icon']);
|
||||
|
@ -1517,7 +1517,8 @@ var et2_link_list = et2_link_string.extend(
|
||||
var link_data = self.context.data;
|
||||
if(link_data.app == 'file')
|
||||
{
|
||||
var url = self.egw().mime_open(link_data);
|
||||
// File info is always the same
|
||||
var url = '/apps/'+link_data.app2+'/'+link_data.id2+'/'+decodeURIComponent(link_data.id);
|
||||
if(typeof url == 'string' && url.indexOf('webdav.php'))
|
||||
{
|
||||
// URL is url to file in webdav, so get rid of that part
|
||||
|
@ -169,6 +169,11 @@ class filemanager_select
|
||||
$files = $content['path'];
|
||||
break;
|
||||
|
||||
case 'saveas':
|
||||
// Don't trust the name the user gives, encode it
|
||||
$content['name'] = egw_vfs::encodePathComponent($content['name']);
|
||||
// Fall through
|
||||
|
||||
default:
|
||||
$files = egw_vfs::concat($content['path'],$content['name']);
|
||||
break;
|
||||
|
@ -2552,7 +2552,7 @@ app.classes.mail = AppJS.extend(
|
||||
url += 'menuaction=filemanager.filemanager_select.select'; // todo compose for Draft folder
|
||||
url += '&mode=saveas';
|
||||
var subject = dataElem? dataElem.data.subject: _elems[0].subject;
|
||||
var filename = subject.replace(/[\f\n\t\v/\\:*#?<>\|]/g,"_")|| 'unknown';
|
||||
var filename = subject.replace(/[\f\n\t\v]/g,"_")|| 'unknown';
|
||||
url += '&name='+encodeURIComponent(filename+'.eml');
|
||||
url += '&mime=message'+encodeURIComponent('/')+'rfc822';
|
||||
url += '&method=mail.mail_ui.vfsSaveMessage';
|
||||
|
Loading…
Reference in New Issue
Block a user