Make folder acl be able to be selected from differnet accounts

This commit is contained in:
Hadi Nategh 2013-12-20 16:17:12 +00:00
parent 13cf8a1f0d
commit dc02eb28d7
2 changed files with 39 additions and 8 deletions

View File

@ -56,7 +56,8 @@ class mail_acl
*/ */
function __construct() function __construct()
{ {
$this->mail_bo = mail_bo::getInstance(false, $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID']); $acc_id = $_GET['acc_id']?$_GET['acc_id']:$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
$this->mail_bo = mail_bo::getInstance(false, $acc_id);
} }
@ -160,7 +161,7 @@ class mail_acl
} }
else else
{ {
error_log(__METHOD__.__LINE__. "()" . "The remove_acl suppose to return an array back, something is there"); error_log(__METHOD__.__LINE__. "()" . "The remove_acl suppose to return an array back, something is wrong there");
} }
egw_framework::refresh_opener($msg, 'mail', 'update'); egw_framework::refresh_opener($msg, 'mail', 'update');
} }
@ -180,7 +181,6 @@ class mail_acl
* the mailbox including all its subfolders will be considered. * the mailbox including all its subfolders will be considered.
* @param string $msg Message * @param string $msg Message
* *
* @todo rights 'c' and 'd' should be fixed
*/ */
function update_acl ($content, &$msg) function update_acl ($content, &$msg)
{ {
@ -213,7 +213,7 @@ class mail_acl
if($keys !== count($content['grid'])) if($keys !== count($content['grid']))
{ {
array_push($validator, $keys); array_push($validator, $keys);
$msg = lang("Could not save the ACL! Because some names are empty!"); $msg = lang("Error:Could not save the ACL! Because some names are empty!");
} }
} }
} }

View File

@ -2262,7 +2262,37 @@ app.classes.mail = AppJS.extend(
*/ */
all_folders: function(_action) all_folders: function(_action)
{ {
egw.json('mail.mail_ui.ajax_foldertree',[null,!_action.checked]) var mailbox = _senders[0].id.split('::');
acc_id = mailbox[0];
egw.json('mail.mail_ui.ajax_foldertree',[acc_id,!_action.checked])
.sendRequest();
},
/**
* Subscribe selected unsubscribed folder
*
* @param {sender} _senders
* @param {action} _action
*/
subscribe_folder: function(_action,_senders)
{
var mailbox = _senders[0].id.split('::');
var folder = mailbox[1], acc_id = mailbox[0];
egw.json('mail.mail_ui.ajax_foldersubscription',[acc_id,folder,true])
.sendRequest();
},
/**
* Unsubscribe selected subscribed folder
*
* @param {sender} _senders
* @param {action} _action
*/
unsubscribe_folder: function(_action,_senders)
{
var mailbox = _senders[0].id.split('::');
var folder = mailbox[1], acc_id = mailbox[0];
egw.json('mail.mail_ui.ajax_foldersubscription',[acc_id,folder,false])
.sendRequest(); .sendRequest();
}, },
@ -2274,8 +2304,9 @@ app.classes.mail = AppJS.extend(
*/ */
edit_acl: function(_action, _senders) edit_acl: function(_action, _senders)
{ {
var folder_id = _senders[0].id.split('::'); var mailbox = _senders[0].id.split('::');
this.egw.open_link('mail.mail_acl.edit&mailbox='+ jQuery.base64Encode(folder_id[1]), '_blank', '640x480'); var folder = mailbox[1], acc_id = mailbox[0];
this.egw.open_link('mail.mail_acl.edit&mailbox='+ jQuery.base64Encode(folder)+'&acc_id='+acc_id, '_blank', '640x480');
}, },
/** /**