From a4e1324a043f592c041837a7ee7bd6ff210a9261 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 6 Feb 2014 17:18:12 +0000 Subject: [PATCH] Add subscription popup to mail, and fix the context menu. The popup up backend is not completed, though --- mail/inc/class.mail_ui.inc.php | 42 +++++++++++++++++++++------- mail/js/app.js | 12 ++++++++ mail/templates/default/subscribe.xet | 27 ++++++++++++++++++ 3 files changed, 71 insertions(+), 10 deletions(-) create mode 100755 mail/templates/default/subscribe.xet diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 10b790cc61..2e9f0d53a1 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -36,6 +36,7 @@ class mail_ui 'importMessage' => True, 'importMessageFromVFS2DraftAndDisplay'=>True, 'TestConnection' => True, + 'subscription' => True, ); /** @@ -176,6 +177,33 @@ class mail_ui $GLOBALS['egw']->preferences->save_repository(true); $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] = self::$icServerID; } + /** + * Subscription popup window + * + * @param array $content + * @param type $msg + */ + function subscription(array $content=null ,$msg='') + { + $stmpl = new etemplate_new('mail.subscribe'); + $profile = $_GET['acc_id']; + + if (!is_array($content)) + { + if ($profile) + { + $sel_options['foldertree'] = $this->getFolderTree(false, $profile,true); + } + } + else + { + + } + $content = array(); + $readonlys = array(); + + $stmpl->exec('mail.mail_ui.subscription', $content,$sel_options,$readonlys,array(),2); + } /** * Main mail page @@ -309,12 +337,6 @@ class mail_ui // Set tree actions $tree_actions = array( - 'all_folders' => array( - 'caption' => 'Show all folders', - 'checkbox' => true, - 'onExecute' => 'javaScript:app.mail.all_folders', - 'group' => $group++, - ), 'drop_move_mail' => array( 'type' => 'drop', 'acceptedTypes' => 'mail', @@ -358,9 +380,9 @@ class mail_ui 'onExecute' => 'javaScript:app.mail.mail_DeleteFolder' ), 'subscribe' => array( - 'caption' => 'Subscribe folder', + 'caption' => 'Subscribe folder ...', //'icon' => 'configure', - 'onExecute' => 'javaScript:app.mail.subscribe_folder', + 'onExecute' => 'javaScript:app.mail.edit_subscribe', ), 'unsubscribe' => array( 'caption' => 'Unsubscribe folder', @@ -379,13 +401,13 @@ class mail_ui 'group' => $group++, ), 'edit_account' => array( - 'caption' => 'Edit account', + 'caption' => 'Edit account ...', 'icon' => 'configure', 'onExecute' => 'javaScript:app.mail.edit_account', //'enableId' => '^\\d+$', // only show action on account itself ), 'edit_acl' => array( - 'caption' => 'Edit folder ACL', + 'caption' => 'Edit folder ACL ...', 'icon' => 'blocks', 'onExecute' => 'javaScript:app.mail.edit_acl', ), diff --git a/mail/js/app.js b/mail/js/app.js index b5ae79b357..a5361a692c 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -2585,6 +2585,18 @@ app.classes.mail = AppJS.extend( },this)) .sendRequest(); }, + + /** + * Popup the subscription dialog + * + * @param {action} _action + * @param {sender} _senders + */ + edit_subscribe: function (_action,_senders) + { + var acc_id = parseInt(_senders[0].id); + this.egw.open_link('mail.mail_ui.subscription&acc_id='+acc_id, '_blank', '720x500'); + }, /** * Subscribe selected unsubscribed folder diff --git a/mail/templates/default/subscribe.xet b/mail/templates/default/subscribe.xet new file mode 100755 index 0000000000..5dac781ab6 --- /dev/null +++ b/mail/templates/default/subscribe.xet @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file