fix condition for folder move

This commit is contained in:
Klaus Leithoff 2014-01-10 13:07:01 +00:00
parent 2ebf237504
commit b0f50abd78
2 changed files with 12 additions and 4 deletions

View File

@ -3538,7 +3538,14 @@ $success=true;
$_newName = $namePart;
$oldParentFolder = implode($del,$pA);
$parentFolder = $_newLocation;
if (strtoupper($folderName)!= 'INBOX' && (strlen($parentFolder)>strlen($folderName) && strpos($parentFolder,$folderName)===false))
//error_log(__METHOD__.__LINE__.'->'."$folderName");
//error_log(__METHOD__.__LINE__.'->'."$parentFolder");
//error_log(__METHOD__.__LINE__.'->'."$oldParentFolder");
if (strtoupper($folderName)!= 'INBOX' &&
(($oldParentFolder === $parentFolder) || //$oldParentFolder == $parentFolder means move on same level
(($oldParentFolder != $parentFolder &&
strlen($parentFolder)>0 && strlen($folderName)>0 &&
strpos($parentFolder,$folderName)===false)))) // indicates that we move the older up the tree within its own branch
{
//error_log(__METHOD__.__LINE__."$folderName, $parentFolder, $_newName");
$oldFolderInfo = $this->mail_bo->getFolderStatus($folderName,false);
@ -3629,7 +3636,7 @@ $success=true;
}
else
{
$response->call('egw_refresh',lang('failed to move %1 ! Reason: %2',$oldFolderName,$msg),'mail');
$response->call('egw_refresh',lang('failed to move %1 ! Reason: %2',$folderName,$msg),'mail');
}
}
}

View File

@ -624,7 +624,8 @@ app.classes.mail = AppJS.extend(
//console.log("mail_preview",dataElem);
this.mail_selectedMails.push(_id);
this.mail_disablePreviewArea(false);
this.et2.getWidgetById('toolbar').set_actions(JSON.parse(dataElem.data.toolbaractions));
var toolbaractions = JSON.parse(dataElem.data.toolbaractions);
this.et2.getWidgetById('toolbar').set_actions(toolbaractions);
var IframeHandle = this.et2.getWidgetById('messageIFRAME');
//console.log(IframeHandle);
IframeHandle.set_src(egw.link('/index.php',{menuaction:'mail.mail_ui.loadEmailBody',_messageID:_id}));
@ -903,7 +904,7 @@ app.classes.mail = AppJS.extend(
//}
//this.mail_setMsg('<span style="font-weight: bold;">' +_msg+ '</span>');
egw_message(_msg,_type);
this.mail_setMsg('');//without that applyFilters is not refreshing the index page
app.mail.mail_setMsg('');//without that applyFilters is not refreshing the index page
if (_app=='mail')
{
//we may want to trigger some actions, like modifying the grid, disable preview and stuff