mail_wizard extending emailadmin_wizard, to allow regular users to use it

This commit is contained in:
Ralf Becker 2013-11-03 10:24:09 +00:00
parent 7e856af544
commit e125b27e52
4 changed files with 62 additions and 2 deletions

View File

@ -808,6 +808,12 @@ class mail_hooks
$menu_title = lang('Preferences'); // ToDo: remove Preferences sub-menu from sidebox
$file = array();
// create account wizard
$file += array(
'create new account' => "javascript:egw_openWindowCentered2('" .
egw::link('/index.php', array('menuaction' => 'mail.mail_wizard.add'), '').
"','_blank',640,480,'yes')",
);
if($preferences->userDefinedAccounts || $preferences->userDefinedIdentities) {
$linkData = array (
'menuaction' => 'mail.mail_uipreferences.index',

View File

@ -307,7 +307,13 @@ class mail_ui
'delete' => array(
'caption' => 'Delete Folder',
'onExecute' => 'javaScript:app.mail.mail_DeleteFolder'
)
),
'edit_account' => array(
'caption' => 'Edit account',
'icon' => 'configure',
'onExecute' => 'javaScript:app.mail.edit_account',
//'enableId' => '^\\d+$', // only show action on account itself
),
));
//error_log(__METHOD__.__LINE__.array2string($content));
if (empty($content[self::$nm_index]['filter2']) || empty($content[self::$nm_index]['search'])) $content[self::$nm_index]['filter2']='quick';

View File

@ -0,0 +1,37 @@
<?php
/**
* EGroupware Mail: Wizard to create mail accounts
*
* @link http://www.stylite.de
* @package emailadmin
* @author Ralf Becker <rb@stylite.de>
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @version $Id$
*/
/**
* Wizard to create mail accounts
*
* Extends emailadmin_wizard to allow non-admins to use it.
*/
class mail_wizard extends emailadmin_wizard
{
/**
* Prefix for callback names
*/
const APP_CLASS = 'mail.mail_wizard.';
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
// need emailadmin's app.css file
egw_framework::includeCSS('emailadmin','app');
// and translations
translation::add_app('emailadmin');
}
}

View File

@ -1168,7 +1168,7 @@ app.mail = AppJS.extend(
},
/**
*
*
*/
displayAttachment: function(tag_info, widget)
{
@ -1946,4 +1946,15 @@ app.mail = AppJS.extend(
request.sendRequest();
},
/**
* Edit a mail account
*
* @param _action
* @param _senders - the representation of the tree leaf to be manipulated
*/
edit_account: function(_action, _senders)
{
var acc_id = parseInt(_senders[0].id);
this.egw.open_link('mail.mail_wizard.edit&acc_id='+acc_id, '_blank', '640x480');
}
});