mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 09:05:16 +01:00
Support moving from different folders
This commit is contained in:
parent
103c0c73ad
commit
a885057213
@ -4609,29 +4609,39 @@ class mail_ui
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$uidA = self::splitRowID($_messageList['msg'][0]);
|
$messageList = array();
|
||||||
$folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder
|
while(count($_messageList['msg']) > 0)
|
||||||
$sourceProfileID = $uidA['profileID'];
|
|
||||||
foreach($_messageList['msg'] as $rowID)
|
|
||||||
{
|
{
|
||||||
//error_log(__METHOD__.__LINE__.$rowID);
|
$uidA = self::splitRowID($_messageList['msg'][0]);
|
||||||
$hA = self::splitRowID($rowID);
|
$folder = $uidA['folder']; // all messages in one set are supposed to be within the same folder
|
||||||
$messageList[] = $hA['msgUID'];
|
$sourceProfileID = $uidA['profileID'];
|
||||||
if ($_copyOrMove=='move')
|
$moveList = array();
|
||||||
|
foreach($_messageList['msg'] as $rowID)
|
||||||
{
|
{
|
||||||
$helpvar = explode(self::$delimiter,$rowID);
|
$hA = self::splitRowID($rowID);
|
||||||
array_shift($helpvar);
|
|
||||||
$messageListForRefresh[]= implode(self::$delimiter,$helpvar);
|
// If folder changes, stop and move what we've got
|
||||||
|
if($hA['folder'] != $folder) break;
|
||||||
|
|
||||||
|
array_shift($_messageList['msg']);
|
||||||
|
$messageList[] = $hA['msgUID'];
|
||||||
|
$moveList[] = $hA['msgUID'];
|
||||||
|
if ($_copyOrMove=='move')
|
||||||
|
{
|
||||||
|
$helpvar = explode(self::$delimiter,$rowID);
|
||||||
|
array_shift($helpvar);
|
||||||
|
$messageListForRefresh[]= implode(self::$delimiter,$helpvar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//error_log(__METHOD__.__LINE__."->".print_r($moveList,true).' folder:'.$folder.' Method:'.$_forceDeleteMethod.' '.$targetProfileID.'/'.$sourceProfileID);
|
||||||
|
$this->mail_bo->moveMessages($targetFolder,$moveList,($_copyOrMove=='copy'?false:true),$folder,false,$sourceProfileID,($targetProfileID!=$sourceProfileID?$targetProfileID:null));
|
||||||
|
}
|
||||||
|
catch (egw_exception $e)
|
||||||
|
{
|
||||||
|
$error = str_replace('"',"'",$e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//error_log(__METHOD__.__LINE__."->".print_r($messageList,true).' folder:'.$folder.' Method:'.$_forceDeleteMethod.' '.$targetProfileID.'/'.$sourceProfileID);
|
|
||||||
$this->mail_bo->moveMessages($targetFolder,$messageList,($_copyOrMove=='copy'?false:true),$folder,false,$sourceProfileID,($targetProfileID!=$sourceProfileID?$targetProfileID:null));
|
|
||||||
}
|
|
||||||
catch (egw_exception $e)
|
|
||||||
{
|
|
||||||
$error = str_replace('"',"'",$e->getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user