fixed broken emailadmin editProfile add/edit/delete mailAlternate/mailForward

This commit is contained in:
Klaus Leithoff 2012-04-13 11:57:12 +00:00
parent 239624ad56
commit 5070027e00
2 changed files with 70 additions and 10 deletions

View File

@ -42,7 +42,7 @@ class uiuserdata
function display_app_header()
{
$GLOBALS['egw']->js->validate_file('jscode','editUserdata','emailadmin');
$GLOBALS['egw']->js->validate_file('.','app','emailadmin');
$GLOBALS['egw_info']['flags']['include_xajax'] = True;
$GLOBALS['egw']->common->egw_header();

View File

@ -21,3 +21,63 @@ function disableGroupSelector()
document.getElementById('exec[ea_group]').disabled = false;
}
}
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;
}
}