mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-04-10 17:18:19 +02:00
Fix collab editor does not get open when triggered from infolog
This commit is contained in:
parent
e6bc7940b3
commit
ee1ca5c402
@ -1613,8 +1613,17 @@ class filemanager_ui
|
|||||||
function editor($content=null)
|
function editor($content=null)
|
||||||
{
|
{
|
||||||
$tmpl = new Etemplate('filemanager.editor');
|
$tmpl = new Etemplate('filemanager.editor');
|
||||||
$file_path = $_GET['path'];
|
$path = $_GET['path'];
|
||||||
$paths = explode('/webdav.php', $file_path);
|
if (!preg_match("/\/webdav.php\//", $path))
|
||||||
|
{
|
||||||
|
$download_url = Vfs::download_url($path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$download_url = $path;
|
||||||
|
$paths = explode('/webdav.php', $path);
|
||||||
|
$path = $paths[1];
|
||||||
|
}
|
||||||
// Include css files used by wodocollabeditor
|
// Include css files used by wodocollabeditor
|
||||||
Api\Framework::includeCSS('/api/js/webodf/collab/app/resources/app.css');
|
Api\Framework::includeCSS('/api/js/webodf/collab/app/resources/app.css');
|
||||||
Api\Framework::includeCSS('/api/js/webodf/collab/wodocollabpane.css');
|
Api\Framework::includeCSS('/api/js/webodf/collab/wodocollabpane.css');
|
||||||
@ -1623,10 +1632,10 @@ class filemanager_ui
|
|||||||
|
|
||||||
if (!$content)
|
if (!$content)
|
||||||
{
|
{
|
||||||
if ($file_path)
|
if ($download_url)
|
||||||
{
|
{
|
||||||
$content['es_id'] = md5 ($file_path);
|
$content['es_id'] = md5 ($download_url);
|
||||||
$content['file_path'] = $paths[1];
|
$content['file_path'] = $path;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1635,7 +1644,7 @@ class filemanager_ui
|
|||||||
}
|
}
|
||||||
|
|
||||||
$actions = self::getActions_edit();
|
$actions = self::getActions_edit();
|
||||||
if (!Api\Vfs::check_access($paths[1], Api\Vfs::WRITABLE))
|
if (!Api\Vfs::check_access($path, Api\Vfs::WRITABLE))
|
||||||
{
|
{
|
||||||
unset ($actions['save']);
|
unset ($actions['save']);
|
||||||
unset ($actions['discard']);
|
unset ($actions['discard']);
|
||||||
|
@ -296,25 +296,26 @@ app.classes.filemanager = app.classes.filemanager.extend({
|
|||||||
mode: 'saveas',
|
mode: 'saveas',
|
||||||
button_caption:"",
|
button_caption:"",
|
||||||
button_label:_egwAction.id == 'saveas'?"save as":"save",
|
button_label:_egwAction.id == 'saveas'?"save as":"save",
|
||||||
value: "doc.odt",
|
value: "doc.odt"
|
||||||
onchange: function (){
|
|
||||||
file_path = vfs_select.get_value();
|
|
||||||
if (vfs_select.get_value())
|
|
||||||
{
|
|
||||||
// Add odt extension if not exist
|
|
||||||
if (!file_path.match(/\.odt$/,'ig')) file_path += '.odt';
|
|
||||||
widgetFilePath.set_value(file_path);
|
|
||||||
self.editor.getDocumentAsByteArray(saveByteArrayLocally);
|
|
||||||
self.editor_leaveSession(function(){
|
|
||||||
var path = window.location.href.split('&path=');
|
|
||||||
window.location.href = path[0]+'&path='+self.editor_getFilePath();
|
|
||||||
});
|
|
||||||
egw.refresh('','filemanager');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
// create file selector
|
// create file selector
|
||||||
var vfs_select = et2_createWidget('vfs-select', vfs_attrs, this.et2);
|
var vfs_select = et2_createWidget('vfs-select', vfs_attrs, this.et2);
|
||||||
|
|
||||||
|
jQuery(vfs_select.getDOMNode()).on('change', function (){
|
||||||
|
file_path = vfs_select.get_value();
|
||||||
|
if (vfs_select.get_value())
|
||||||
|
{
|
||||||
|
// Add odt extension if not exist
|
||||||
|
if (!file_path.match(/\.odt$/,'ig')) file_path += '.odt';
|
||||||
|
widgetFilePath.set_value(file_path);
|
||||||
|
self.editor.getDocumentAsByteArray(saveByteArrayLocally);
|
||||||
|
self.editor_leaveSession(function(){
|
||||||
|
var path = window.location.href.split('&path=');
|
||||||
|
window.location.href = path[0]+'&path='+self.editor_getFilePath();
|
||||||
|
});
|
||||||
|
egw.refresh('','filemanager');
|
||||||
|
}
|
||||||
|
});
|
||||||
// start the file selector dialog
|
// start the file selector dialog
|
||||||
vfs_select.click();
|
vfs_select.click();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user