mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-24 23:09:13 +01:00
basic implementation on Strg+A for copy/move mails; not working as of now, as this.mail_checkAllSelected(_action,true) seems not to produce the desiredv result on dragndrop
This commit is contained in:
parent
d071e645cd
commit
0ab34ccfe5
@ -4565,17 +4565,68 @@ $this->partID = $partID;
|
|||||||
|
|
||||||
if ($_messageList=='all' || !empty($_messageList['msg']))
|
if ($_messageList=='all' || !empty($_messageList['msg']))
|
||||||
{
|
{
|
||||||
if ($_messageList=='all')
|
$error=false;
|
||||||
|
if (isset($_messageList['all']) && $_messageList['all'])
|
||||||
{
|
{
|
||||||
// we have no folder information
|
// we have both messageIds AND allFlag folder information
|
||||||
$folder=null;
|
$uidA = self::splitRowID($_messageList['msg'][0]);
|
||||||
|
$folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder
|
||||||
|
$sourceProfileID = $uidA['profileID'];
|
||||||
|
if (isset($_messageList['activeFilters']) && $_messageList['activeFilters'])
|
||||||
|
{
|
||||||
|
$query = $_messageList['activeFilters'];
|
||||||
|
if (!empty($query['search']) || !empty($query['filter']))
|
||||||
|
{
|
||||||
|
//([filterName] => Schnellsuche[type] => quick[string] => ebay[status] => any
|
||||||
|
if (is_null(emailadmin_imapbase::$supportsORinQuery) || !isset(emailadmin_imapbase::$supportsORinQuery[$this->mail_bo->profileID]))
|
||||||
|
{
|
||||||
|
emailadmin_imapbase::$supportsORinQuery = egw_cache::getCache(egw_cache::INSTANCE,'email','supportsORinQuery'.trim($GLOBALS['egw_info']['user']['account_id']), null, array(), 60*60*10);
|
||||||
|
if (!isset(emailadmin_imapbase::$supportsORinQuery[$this->mail_bo->profileID])) emailadmin_imapbase::$supportsORinQuery[$this->mail_bo->profileID]=true;
|
||||||
|
}
|
||||||
|
$filter = array('filterName' => (emailadmin_imapbase::$supportsORinQuery[$this->mail_bo->profileID]?lang('quicksearch'):lang('subject')),'type' => ($query['filter2']?$query['filter2']:(emailadmin_imapbase::$supportsORinQuery[$this->mail_bo->profileID]?'quick':'subject')),'string' => $query['search'],'status' => 'any');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$filter = array();
|
||||||
|
}
|
||||||
|
$messageList = array();
|
||||||
|
$_sR = $this->mail_bo->getSortedList(
|
||||||
|
$folder,
|
||||||
|
$sort=0,
|
||||||
|
$reverse=1,
|
||||||
|
$filter,
|
||||||
|
$rByUid=true,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
$messageList = $_sR['match']->ids;
|
||||||
|
foreach($messageList as $uID)
|
||||||
|
{
|
||||||
|
//error_log(__METHOD__.__LINE__.$uID);
|
||||||
|
if ($_copyOrMove=='move')
|
||||||
|
{
|
||||||
|
$messageListForRefresh[] = self::generateRowID($sourceProfileID, $folderName, $uID, $_prependApp=false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$messageList='all';
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//error_log(__METHOD__.__LINE__."->".print_r($messageList,true).' folder:'.$folder.' Method:'.$_forceDeleteMethod);
|
||||||
|
$this->mail_bo->moveMessages($targetFolder,$messageList,($_copyOrMove=='copy'?false:true),$folder,false,($targetProfileID!=$sourceProfileID?$targetProfileID:null));
|
||||||
|
}
|
||||||
|
catch (egw_exception $e)
|
||||||
|
{
|
||||||
|
$error = str_replace('"',"'",$e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$uidA = self::splitRowID($_messageList['msg'][0]);
|
$uidA = self::splitRowID($_messageList['msg'][0]);
|
||||||
$folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder
|
$folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder
|
||||||
$sourceProfileID = $uidA['profileID'];
|
$sourceProfileID = $uidA['profileID'];
|
||||||
}
|
|
||||||
foreach($_messageList['msg'] as $rowID)
|
foreach($_messageList['msg'] as $rowID)
|
||||||
{
|
{
|
||||||
//error_log(__METHOD__.__LINE__.$rowID);
|
//error_log(__METHOD__.__LINE__.$rowID);
|
||||||
@ -4588,10 +4639,29 @@ $this->partID = $partID;
|
|||||||
$messageListForRefresh[]= implode(self::$delimiter,$helpvar);
|
$messageListForRefresh[]= implode(self::$delimiter,$helpvar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$response = egw_json_response::get();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
//error_log(__METHOD__.__LINE__."->".print_r($messageList,true).' folder:'.$folder.' Method:'.$_forceDeleteMethod);
|
||||||
$this->mail_bo->moveMessages($targetFolder,$messageList,($_copyOrMove=='copy'?false:true),$folder,false,($targetProfileID!=$sourceProfileID?$targetProfileID:null));
|
$this->mail_bo->moveMessages($targetFolder,$messageList,($_copyOrMove=='copy'?false:true),$folder,false,($targetProfileID!=$sourceProfileID?$targetProfileID:null));
|
||||||
|
}
|
||||||
|
catch (egw_exception $e)
|
||||||
|
{
|
||||||
|
$error = str_replace('"',"'",$e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$response = egw_json_response::get();
|
||||||
|
if ($error)
|
||||||
|
{
|
||||||
|
if ($changeFolderActions == false)
|
||||||
|
{
|
||||||
|
unset($lastFoldersUsedForMoveCont[$targetProfileID][$targetFolder]);
|
||||||
|
$changeFolderActions = true;
|
||||||
|
}
|
||||||
|
$response->call('egw.message',$error,"error");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if ($_copyOrMove=='copy')
|
if ($_copyOrMove=='copy')
|
||||||
{
|
{
|
||||||
$response->call('egw.message',lang('copied %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder));
|
$response->call('egw.message',lang('copied %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder));
|
||||||
@ -4601,16 +4671,6 @@ $this->partID = $partID;
|
|||||||
$response->call('egw.refresh',lang('moved %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder),'mail',$messageListForRefresh,'delete');
|
$response->call('egw.refresh',lang('moved %1 message(s) from %2 to %3',count($messageList),$folder,$targetFolder),'mail',$messageListForRefresh,'delete');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception $e)
|
|
||||||
{
|
|
||||||
//error_log(__METHOD__.__LINE__.function_backtrace());
|
|
||||||
$response->call('egw.message',$e->getMessage(),"error");
|
|
||||||
if ($changeFolderActions == false)
|
|
||||||
{
|
|
||||||
unset($lastFoldersUsedForMoveCont[$targetProfileID][$targetFolder]);
|
|
||||||
$changeFolderActions = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($changeFolderActions == true)
|
if ($changeFolderActions == true)
|
||||||
{
|
{
|
||||||
egw_cache::setCache(egw_cache::INSTANCE,'email','lastFolderUsedForMove'.trim($GLOBALS['egw_info']['user']['account_id']),$lastFoldersUsedForMoveCont, $expiration=60*60*1);
|
egw_cache::setCache(egw_cache::INSTANCE,'email','lastFolderUsedForMove'.trim($GLOBALS['egw_info']['user']['account_id']),$lastFoldersUsedForMoveCont, $expiration=60*60*1);
|
||||||
|
Loading…
Reference in New Issue
Block a user