get importFromVFS working, when selecting vfs file via vfs dialog

This commit is contained in:
Klaus Leithoff 2013-09-24 13:38:02 +00:00
parent 0601d40bd3
commit e7a5418af2
3 changed files with 20 additions and 23 deletions

View File

@ -1129,7 +1129,7 @@ class mail_bo
// fetch the data for the selected messages
if (self::$debug) $starttime = microtime(true);
//$headersNew = $this->icServer->getSummary($queryString, $rByUid);
$headersNew = $this->_getSummary($queryString, $rByUid);
$headersNew = $this->_getSummary($queryString, $rByUid,false,$_folderName);
if (PEAR::isError($headersNew) && empty($queryString))
{
$headersNew = array();

View File

@ -2706,29 +2706,25 @@ blockquote[type=cite] {
return "opener.app.mail.import_closeVfsSelector('$path');";
}
function importMessageFromVFS($target, $path=null)
{
//error_log(__METHOD__.__LINE__.array2string(array('target'=>$target,'file'=>$path)));
$content['divImportArea']['FOLDER'][0]=$target;
$content['divImportArea']['uploadForImport'] = array(
'name' => egw_vfs::basename($path),
'type' => egw_vfs::mime_content_type($path),
'file' => egw_vfs::PREFIX.$path,
'size' => filesize(egw_vfs::PREFIX.$path),
);
//$this->importMessage($content);
return "window.close();";
}
/**
* importMessage
*/
function importMessage($content=null)
{
//error_log(__METHOD__.__LINE__.$this->mail_bo->getDraftFolder());
error_log(__METHOD__.__LINE__.array2string($_GET));
error_log(__METHOD__.__LINE__.array2string($content));
if (isset($_REQUEST['file']) && isset($_REQUEST['folder']))
{
$path = $_REQUEST['file'];
$target = $_REQUEST['folder'];
$content['divImportArea']['FOLDER'][0]=$target;
$content['divImportArea']['uploadForImport'] = array(
'name' => egw_vfs::basename($path),
'type' => egw_vfs::mime_content_type($path),
'file' => egw_vfs::PREFIX.$path,
'size' => filesize(egw_vfs::PREFIX.$path),
);
}
if (!empty($content))
{
//error_log(__METHOD__.__LINE__.array2string($content));

View File

@ -1189,17 +1189,18 @@ app.mail = AppJS.extend(
// names used here are assigned in app.mail.import_displayVfsSelector and class.mail_hooks.inc.php
this.mail_fileSelectorWindow = window.open('','mail_import_vfsSelector');
importMessageDialog = window.open('','importMessageDialog');
this.mail_fileSelectorWindow.close();
var vfsfile = importMessageDialog.app.mail.et2.getWidgetById('vfsfile');
//console.log(vfsfile);
vfsfile.input[0].value=_ref;
var folder = importMessageDialog.app.mail.et2.getWidgetById('FOLDER');
//console.log(vfsfile.input[0].value,folder.value[0]);
importMessageDialog.close();
egw().open_link(egw.link('/index.php', {
importMessageDialog = egw().open_link(egw.link('/index.php', {
menuaction: 'mail.mail_ui.importMessage',
content: {fi: vfsfile.input[0].value, fo: folder.value[0]},//represents the target where to import to
}), 'mail_display', '640x580');
file: vfsfile.input[0].value,
folder: folder.value[0]
}), 'importMessageDialog', '640x580');
this.mail_fileSelectorWindow.close();
importMessageDialog.focus();
//vfsfile._parent._parent._parent.parentNode.et2_obj.submit();
},