control target options regarding the move of messages via dragndrop (prefaskformove)

This commit is contained in:
Klaus Leithoff 2014-03-10 13:01:02 +00:00
parent 416c5d3b75
commit 1a07aefd4a
3 changed files with 20 additions and 1 deletions

View File

@ -425,6 +425,7 @@ class mail_hooks
'name' => 'prefaskformove', 'name' => 'prefaskformove',
'values' => $no_yes_copy, 'values' => $no_yes_copy,
'xmlrpc' => True, 'xmlrpc' => True,
'default'=> 2,
'admin' => False, 'admin' => False,
'forced' => '1', 'forced' => '1',
), ),

View File

@ -533,6 +533,25 @@ class mail_ui
'onExecute' => 'javaScript:app.mail.edit_acl', 'onExecute' => 'javaScript:app.mail.edit_acl',
), ),
); );
// the preference prefaskformove controls actually if there is a popup on target or not
// if there are multiple options there is a popup on target, 0 for prefaskformove means
// that only move is available; 1 stands for move and cancel; 2 (should be the default if
// not set); so we are assuming this, when not set
if (isset($this->mail_bo->mailPreferences['prefaskformove']))
{
switch ($this->mail_bo->mailPreferences['prefaskformove'])
{
case 0:
unset($tree_actions['drop_copy_mail']);
unset($tree_actions['drop_cancel']);
break;
case 1:
unset($tree_actions['drop_copy_mail']);
break;
default:
// everything is fine
}
}
//error_log(__METHOD__.__LINE__.' showAllFoldersInFolderPane:'.$this->mail_bo->mailPreferences['showAllFoldersInFolderPane'].'/'.$GLOBALS['egw_info']['user']['preferences']['mail']['showAllFoldersInFolderPane']); //error_log(__METHOD__.__LINE__.' showAllFoldersInFolderPane:'.$this->mail_bo->mailPreferences['showAllFoldersInFolderPane'].'/'.$GLOBALS['egw_info']['user']['preferences']['mail']['showAllFoldersInFolderPane']);
if ($this->mail_bo->mailPreferences['showAllFoldersInFolderPane']) if ($this->mail_bo->mailPreferences['showAllFoldersInFolderPane'])
{ {

View File

@ -2088,7 +2088,6 @@ app.classes.mail = AppJS.extend(
*/ */
mail_move: function(_action,_senders,_target) { mail_move: function(_action,_senders,_target) {
//console.log(_action,_senders,_target); //console.log(_action,_senders,_target);
//egw.preference('prefaskformove','mail');
var target = _action.id == 'drop_move_mail' ? _target.iface.id : _action.id.substr(5); var target = _action.id == 'drop_move_mail' ? _target.iface.id : _action.id.substr(5);
var messages = this.mail_getFormData(_senders); var messages = this.mail_getFormData(_senders);
//alert('mail_move('+messages.msg.join(',')+' --> '+target+')'); //alert('mail_move('+messages.msg.join(',')+' --> '+target+')');