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 // fetch the data for the selected messages
if (self::$debug) $starttime = microtime(true); if (self::$debug) $starttime = microtime(true);
//$headersNew = $this->icServer->getSummary($queryString, $rByUid); //$headersNew = $this->icServer->getSummary($queryString, $rByUid);
$headersNew = $this->_getSummary($queryString, $rByUid); $headersNew = $this->_getSummary($queryString, $rByUid,false,$_folderName);
if (PEAR::isError($headersNew) && empty($queryString)) if (PEAR::isError($headersNew) && empty($queryString))
{ {
$headersNew = array(); $headersNew = array();

View File

@ -2706,29 +2706,25 @@ blockquote[type=cite] {
return "opener.app.mail.import_closeVfsSelector('$path');"; 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 * importMessage
*/ */
function importMessage($content=null) function importMessage($content=null)
{ {
//error_log(__METHOD__.__LINE__.$this->mail_bo->getDraftFolder()); //error_log(__METHOD__.__LINE__.$this->mail_bo->getDraftFolder());
error_log(__METHOD__.__LINE__.array2string($_GET)); if (isset($_REQUEST['file']) && isset($_REQUEST['folder']))
error_log(__METHOD__.__LINE__.array2string($content)); {
$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)) if (!empty($content))
{ {
//error_log(__METHOD__.__LINE__.array2string($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 // names used here are assigned in app.mail.import_displayVfsSelector and class.mail_hooks.inc.php
this.mail_fileSelectorWindow = window.open('','mail_import_vfsSelector'); this.mail_fileSelectorWindow = window.open('','mail_import_vfsSelector');
importMessageDialog = window.open('','importMessageDialog'); importMessageDialog = window.open('','importMessageDialog');
this.mail_fileSelectorWindow.close();
var vfsfile = importMessageDialog.app.mail.et2.getWidgetById('vfsfile'); var vfsfile = importMessageDialog.app.mail.et2.getWidgetById('vfsfile');
//console.log(vfsfile); //console.log(vfsfile);
vfsfile.input[0].value=_ref; vfsfile.input[0].value=_ref;
var folder = importMessageDialog.app.mail.et2.getWidgetById('FOLDER'); var folder = importMessageDialog.app.mail.et2.getWidgetById('FOLDER');
//console.log(vfsfile.input[0].value,folder.value[0]); //console.log(vfsfile.input[0].value,folder.value[0]);
importMessageDialog.close(); importMessageDialog = egw().open_link(egw.link('/index.php', {
egw().open_link(egw.link('/index.php', {
menuaction: 'mail.mail_ui.importMessage', menuaction: 'mail.mail_ui.importMessage',
content: {fi: vfsfile.input[0].value, fo: folder.value[0]},//represents the target where to import to file: vfsfile.input[0].value,
}), 'mail_display', '640x580'); folder: folder.value[0]
}), 'importMessageDialog', '640x580');
this.mail_fileSelectorWindow.close();
importMessageDialog.focus();
//vfsfile._parent._parent._parent.parentNode.et2_obj.submit(); //vfsfile._parent._parent._parent.parentNode.et2_obj.submit();
}, },