remove obsolet javascript; control that global tab, ->can be used by group<- cannot be set/used together with ->can be used by user<-; as most users thought of it as a concept of narrowing access by user AND group, and not as a concept of allowing a profile to either a user OR a given group

This commit is contained in:
Klaus Leithoff 2012-04-10 15:38:58 +00:00
parent d8e4780d5e
commit 1c0956dec7
7 changed files with 30 additions and 163 deletions

View File

@ -253,10 +253,10 @@ class emailadmin_ui extends emailadmin_bo
/**
* Get a list of supported SMTP Auth Config options
*
*
* @return array value => label pairs
*/
static public function getSMTPAuthConfig()
static public function getSMTPAuthConfig()
{
return array(
'no' => 'No',
@ -422,6 +422,7 @@ class emailadmin_ui extends emailadmin_bo
);
*/
//_debug_array($this->data);
$GLOBALS['egw']->js->set_onload('javascript:disableGroupSelector();');
return $etpl->exec(parent::APP.'.emailadmin_ui.edit',$content,$sel_options,$readonlys,$preserv,2);
}

23
emailadmin/js/app.js Normal file
View File

@ -0,0 +1,23 @@
/**
* EGroupware emailadmin static javascript code
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package emailadmin
* @link http://www.egroupware.org
* @author Klaus Leithoff <kl@stylite.de>
* @version $Id$
*/
function disableGroupSelector()
{
//alert('Group'+document.getElementById('exec[ea_group]').value+' User'+document.getElementById('eT_accountsel_exec_ea_user').value);
if (document.getElementById('eT_accountsel_exec_ea_user').value != '')
{
if (document.getElementById('exec[ea_group]').value != '') document.getElementById('exec[ea_group]').value = '';
document.getElementById('exec[ea_group]').disabled = true;
}
else
{
document.getElementById('exec[ea_group]').disabled = false;
}
}

View File

@ -1,42 +0,0 @@
var tab = new Tabs(5,'activetab','inactivetab','tab','tabcontent','','','tabpage');
var smtp = new Tabs(5,'activetab','inactivetab','smtp','smtpcontent','smtpselector','','');
var imap = new Tabs(6,'activetab','inactivetab','imap','imapcontent','imapselector','','');
function initAll() {
tab.init();
smtp.init();
imap.init();
var imapType = document.getElementsByName("imapsettings[imapType]")[0];
var v=imapType.value; imap.display(imapType.value); imapType.value=v;
onchange_imapsettings(v, 'imapLoginType');
}
function ea_setIMAPDefaults(_imapType) {
var currentInput = document.getElementsByName("imapsettings[" + _imapType + "][imapPort]")[0];
onchange_imapsettings(_imapType, 'imapLoginType');
if(_imapType > 1) {
// imap
if(currentInput.value == '110') {
currentInput.value = '143';
}
} else {
// pop3
if(currentInput.value == '143') {
currentInput.value = '110';
}
}
}
function onchange_imapsettings(_imapType,_varname) {
var currentAuthType = document.getElementsByName("imapsettings[" + _imapType + "][" + _varname + "]")[0];
var imapuser = document.getElementsByName("imapsettings[" + _imapType + "][imapAuthUsername]")[0];
var imappw = document.getElementsByName("imapsettings[" + _imapType + "][imapAuthPassword]")[0];
if (currentAuthType.value == "admin") {
imapuser.disabled = false;
imappw.disabled = false;
} else {
imapuser.disabled=true;
imappw.disabled=true;
}
}

View File

@ -1,59 +0,0 @@
function addRow(_selectBoxName, _prompt) {
result = prompt(_prompt, '');
if((result == '') || (result == null)) {
return false;
}
var newOption = new Option(result, result);
selectBox = document.getElementById(_selectBoxName);
var length = selectBox.length;
selectBox.options[length] = newOption;
selectBox.selectedIndex = length;
}
function editRow(_selectBoxName, _prompt) {
selectBox = document.getElementById(_selectBoxName);
selectedItem = selectBox.selectedIndex;
if(selectedItem != null && selectedItem != -1) {
value = selectBox.options[selectedItem].text;
result = prompt(_prompt, value);
if((result == '') || (result == null)) {
return false;
}
var newOption = new Option(result, result);
selectBox.options[selectedItem] = newOption;
selectBox.selectedIndex = selectedItem;
}
}
function removeRow(_selectBoxName) {
selectBox = document.getElementById(_selectBoxName);
selectedItem = selectBox.selectedIndex;
if(selectedItem != null) {
selectBox.options[selectedItem] = null;
}
selectedItem--;
if(selectedItem >= 0) {
selectBox.selectedIndex = selectedItem;
} else if (selectBox.length > 0) {
selectBox.selectedIndex = 0;
}
}
function selectAllOptions(_selectBoxName) {
selectBox = document.getElementById(_selectBoxName);
for(var i=0;i<selectBox.length;i++) {
selectBox[i].selected=true;
}
}

View File

@ -1,56 +0,0 @@
function getOrder(tableID) {
order = '';
table = document.getElementById(tableID);
inputElements = table.getElementsByTagName('tr');
for(i=0; i<inputElements.length; i++)
{
//alert(inputElements[i].value);
if(i>0)
order = order + ',';
order = order + inputElements[i].id;
}
return order;
}
function moveUp(node) {
// get the row node
thisRow = node.parentNode.parentNode;
if(thisRow.previousSibling)
{
currentNode = thisRow.previousSibling;
while(currentNode.nodeType != 1)
{
if(!currentNode.previousSibling)
return;
currentNode = currentNode.previousSibling;
}
thisRow.parentNode.insertBefore(thisRow,currentNode);
//getOrder('tabel1');
}
}
function moveDown(node) {
// get the row node
thisRow = node.parentNode.parentNode;
if(thisRow.nextSibling)
{
currentNode = thisRow.nextSibling;
while(currentNode.nodeType != 1)
{
if(!currentNode.nextSibling)
return;
currentNode = currentNode.nextSibling;
}
thisRow.parentNode.insertBefore(currentNode,thisRow);
//getOrder('tabel1');
}
}
function saveOrder()
{
xajax_doXMLHTTP("emailadmin.ajaxemailadmin.setOrder", getOrder('nextMatchBody'));
}

View File

@ -2,7 +2,7 @@
/**
* EGroupware - eTemplates for Application emailadmin
* http://www.egroupware.org
* generated by soetemplate::dump4setup() 2012-04-10 12:15
* generated by soetemplate::dump4setup() 2012-04-10 13:44
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package emailadmin
@ -14,7 +14,7 @@ $templ_version=1;
$templ_data[] = array('name' => 'emailadmin.edit','template' => '','lang' => '','group' => '0','version' => '1.7.003','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:2:{s:2:"h1";s:6:",!@msg";s:1:"A";s:4:"100%";}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:5:"align";s:6:"center";s:4:"name";s:3:"msg";s:4:"span";s:10:",redItalic";}}i:2;a:1:{s:1:"A";a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:3:{s:1:"C";s:3:"50%";s:1:"B";s:3:"40%";s:1:"D";s:2:"5%";}i:1;a:4:{s:1:"A";a:4:{s:4:"type";s:4:"text";s:5:"label";s:2:"ID";s:4:"name";s:13:"ea_profile_id";s:8:"readonly";s:1:"1";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:12:"Profile Name";}s:1:"C";a:3:{s:4:"type";s:4:"text";s:4:"name";s:14:"ea_description";s:5:"align";s:5:"right";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"align";s:5:"right";}}}s:4:"rows";i:1;s:4:"cols";i:4;s:4:"size";s:3:"98%";s:7:"options";a:1:{i:0;s:3:"98%";}}}i:3;a:1:{s:1:"A";a:3:{s:4:"type";s:3:"tab";s:5:"label";s:45:"Global|SMTP|IMAP|Signature|Stationery|History";s:4:"name";s:50:"tabs=global|SMTP|IMAP|signature|stationery|history";}}i:4;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";i:1;a:3:{s:4:"type";s:6:"button";s:4:"name";s:4:"save";s:5:"label";s:4:"Save";}i:2;a:3:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:5:"apply";}i:3;a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:6:"cancel";}}i:2;a:5:{s:4:"type";s:6:"button";s:4:"name";s:6:"delete";s:5:"label";s:6:"Delete";s:5:"align";s:5:"right";s:7:"onclick";s:60:"return confirm(\'Do you really want to delete this Profile\');";}}}}s:4:"rows";i:4;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '.redItalic { color: red; font-style: italics; }','modified' => '1255612671',);
$templ_data[] = array('name' => 'emailadmin.edit.global','template' => '','lang' => '','group' => '0','version' => '1.7.003','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"groupbox";s:5:"label";s:12:"Organisation";s:4:"size";s:1:"1";i:1;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:50:"enter your default mail domain (from: user@domain)";}s:1:"B";a:2:{s:4:"type";s:4:"text";s:4:"name";s:17:"ea_default_domain";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"name of organisation";}s:1:"B";a:2:{s:4:"type";s:4:"text";s:4:"name";s:20:"ea_organisation_name";}}}s:4:"rows";i:2;s:4:"cols";i:2;s:7:"options";a:0:{}}}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";s:5:"label";s:21:"profile access rights";i:1;a:5:{s:4:"type";s:4:"grid";s:7:"options";a:0:{}s:4:"data";a:4:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:26:"can be used by application";}s:1:"B";a:3:{s:4:"type";s:6:"select";s:4:"name";s:10:"ea_appname";s:4:"size";s:15:"any application";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"can be used by group";}s:1:"B";a:3:{s:4:"type";s:14:"select-account";s:4:"size";s:16:"any group,groups";s:4:"name";s:8:"ea_group";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:19:"can be used by user";}s:1:"B";a:3:{s:4:"type";s:14:"select-account";s:4:"size";s:17:"any user,accounts";s:4:"name";s:7:"ea_user";}}}s:4:"rows";i:3;s:4:"cols";i:2;}}}i:3;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";s:5:"label";s:14:"global options";i:1;a:5:{s:4:"type";s:4:"grid";s:7:"options";a:0:{}s:4:"data";a:5:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:17:"profile is active";}s:1:"B";a:2:{s:4:"type";s:8:"checkbox";s:4:"name";s:9:"ea_active";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:37:"users can define their own identities";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:26:"ea_user_defined_identities";s:4:"size";s:6:"yes,no";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:40:"users can define their own emailaccounts";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:24:"ea_user_defined_accounts";s:4:"size";s:6:"yes,no";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"order";}s:1:"B";a:2:{s:4:"type";s:3:"int";s:4:"name";s:8:"ea_order";}}}s:4:"rows";i:4;s:4:"cols";i:2;}}}}s:4:"rows";i:3;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1255426691',);
$templ_data[] = array('name' => 'emailadmin.edit.global','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"groupbox";s:5:"label";s:12:"Organisation";s:4:"size";s:1:"1";i:1;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:50:"enter your default mail domain (from: user@domain)";}s:1:"B";a:2:{s:4:"type";s:4:"text";s:4:"name";s:17:"ea_default_domain";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"name of organisation";}s:1:"B";a:2:{s:4:"type";s:4:"text";s:4:"name";s:20:"ea_organisation_name";}}}s:4:"rows";i:2;s:4:"cols";i:2;s:7:"options";a:0:{}}}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";s:5:"label";s:21:"profile access rights";i:1;a:5:{s:4:"type";s:4:"grid";s:7:"options";a:0:{}s:4:"data";a:4:{i:0;a:1:{s:2:"h2";s:9:",@ea_user";}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:26:"can be used by application";}s:1:"B";a:3:{s:4:"type";s:6:"select";s:4:"name";s:10:"ea_appname";s:4:"size";s:15:"any application";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"can be used by group";}s:1:"B";a:3:{s:4:"type";s:14:"select-account";s:4:"size";s:16:"any group,groups";s:4:"name";s:8:"ea_group";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:19:"can be used by user";}s:1:"B";a:3:{s:4:"type";s:14:"select-account";s:4:"size";s:17:"any user,accounts";s:4:"name";s:7:"ea_user";}}}s:4:"rows";i:3;s:4:"cols";i:2;}}}i:3;a:1:{s:1:"A";a:4:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";s:5:"label";s:14:"global options";i:1;a:5:{s:4:"type";s:4:"grid";s:7:"options";a:0:{}s:4:"data";a:5:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:17:"profile is active";}s:1:"B";a:2:{s:4:"type";s:8:"checkbox";s:4:"name";s:9:"ea_active";}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:37:"users can define their own identities";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:26:"ea_user_defined_identities";s:4:"size";s:6:"yes,no";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:40:"users can define their own emailaccounts";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:24:"ea_user_defined_accounts";s:4:"size";s:6:"yes,no";}}i:4;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"order";}s:1:"B";a:2:{s:4:"type";s:3:"int";s:4:"name";s:8:"ea_order";}}}s:4:"rows";i:4;s:4:"cols";i:2;}}}}s:4:"rows";i:3;s:4:"cols";i:1;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1334058065',);
$templ_data[] = array('name' => 'emailadmin.edit.history','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:2:{s:4:"type";s:10:"historylog";s:4:"name";s:7:"history";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"size";s:17:"100%,400,,,,,auto";s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"400";i:6;s:4:"auto";}}}','size' => '100%,400,,,,,auto','style' => '','modified' => '1283865538',);

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<template id="emailadmin.edit.global" template="" lang="" group="0" version="1.7.003">
<template id="emailadmin.edit.global" template="" lang="" group="0" version="1.9.001">
<grid width="100%">
<columns>
<column/>
@ -52,7 +52,7 @@
<row>
<description value="can be used by user"/>
<menulist>
<menupopup type="select-account" id="ea_user" options="any user,accounts"/>
<menupopup type="select-account" id="ea_user" onchange="disableGroupSelector();" options="any user,accounts"/>
</menulist>
</row>
</rows>