| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files (x86)/Mail Enable/Bin/NETWebMail/Mondo/lang/sys/Forms/VCF/ |
Upload File : |
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="list.aspx.vb" Inherits="MailEnable.Clients.WebMail.Mondo.listContact" %>
<%@ Register TagPrefix="uc1" TagName="uscStyleHeader" Src="../../../Controls/uscStyleHeader.ascx" %>
<%@ Register TagPrefix="uc2" TagName="ScriptsInclude" Src="../../../Controls/ScriptsInclude.ascx" %>
<%@ Register TagPrefix="uc3" TagName="uscFileUpload" Src="../../../Controls/uscFileUpload.ascx"%>
<%@ Register TagPrefix="uc4" TagName="ContactDetails" Src="ContactDetails.ascx" %>
<%@ Register TagPrefix="uc5" TagName="uscLanguageTokenMondo" Src="../../../Controls/uscLanguageToken.ascx" %>
<%@ Register TagPrefix="uc6" TagName="uscScriptTranslationsArray" Src="../../../Controls/ScriptTranslationsArray.ascx" %>
<uc5:uscLanguageTokenMondo id="uscToken" runat="server"></uc5:uscLanguageTokenMondo>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <%=GetThemeStyle()%>>
<head>
<title><%=uscToken.GetText("[ME_TXT-Contacts]")%></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<uc1:uscStyleHeader id="UscStyleHeader1" runat="server"></uc1:uscStyleHeader>
<uc2:ScriptsInclude id="ScriptsInclude" runat="server"></uc2:ScriptsInclude>
<script type="text/javascript" src="LIBContactList.js"></script>
<script type="text/javascript">
<!--
getTopAppWindow().ShowPageLoad();
//var SkinRoot = '<%=Session("skin")%>';
var POPUP_MENU_ID_DELETE = 0;
var POPUP_MENU_ID_EMAIL = 1;
var POPUP_MENU_ID_DOWNLOAD = 2;
var POPUP_MENU_ID_SEND_VCARD = 3;
var oConfirmationDialog = null;
var oInputDialog = null;
var oAlertDialog = null;
var oImportDialog = null;
var oWaitDialog;
var BTTN_PADDING = 3;
var gTotalGroups = 0;
var arrTableColumns = {};
var gColumnNames = "";
var gSearchStr = "";
var gSortColumn = "";
var gSortOrder = "Asc";
var gCurrentPageNum = 1;
var gOptionsMode = '<%=gOptionsMode%>';
var gShiftMode = false;
var gCtrlMode = false;
var gGetContactDelayTimeout = null;
var gAllowContactGet = true;
var gContactID = "";
var gItemsPerPage = 10; // Number of rows to draw (including partial rows) in the list. This value is recaculated before the list rows are drawn.
var gUnitScrollLength = 26; // Height of each row in the list
var gPopupItemID; // Item ID of the selected item in the list (via context/popup menu)
var gMode = MODE_EDIT;
// SCROLLBAR_ID --> SCROLLBAR_DIV
// 'ME_ScrollControl' --> 'ME_ScrollControlDiv'
// 'PanelMessageList' --> LIST_CONTAINER
var SCROLLBAR_TD = 'ME_ScrollControlTD';
var SCROLLBAR_DIV = 'ME_ScrollControlDiv';
var SCROLLBAR_CANVAS = 'ME_ScrollControlCanvas';
var LIST_ID = 'MEContactsList';
var LIST_CONTAINER = 'msgList_shell_js';
var LIST_CONTAINER_INNER = 'msgList_container_js';
var DIV_SCROLL_TOOLTIP = 'divScrollTooltip';
var DIV_SCROLL_TOOLTIP_TEXT = 'divScrollTooltipText';
// Datatable List styles
var DATA_TABLE_HEAD_CLASS = 'dataTable2_table_head';
var DATA_TABLE_CLASS = 'dataTable_table';
var ROW_CLASS_SELECTED = 'dataTable_listRow_selected';
var ROW_CLASS_UNSELECTED = 'dataTable_listRow_unselected';
var TABLE_CLASS_SELECTED = 'dataTable_listTable_selected';
var COL_CLASS_TICKBOX = 'dataTable_tickbox';
var COL_CLASS_GROUP = 'dataTable_icon';
var COL_CLASS_GROUP_NAME = 'dataTable_groupName';
var COL_CLASS_ICON_GROUP = 'dataTable_icon_group'
var COL_CLASS_FULLNAME = 'dataTable_name';
var COL_CLASS_EMAIL = 'dataTable_email';
var COL_CLASS_TEXT = 'dataTable_text';
var COL_CLASS_LAST = 'dataTable_noWidth';
var ARROW_CLASS_BLANK = 'tableHead_bttn_arrow';
var ARROW_CLASS_UP_SELECTED = 'tableHead_bttn_arrow_up_selected';
var ARROW_CLASS_DOWN_SELECTED = 'tableHead_bttn_arrow_down_selected';
var TABLE_ALL_BODY_ID = "tblAll_body";
var TABLE_MEMBERS_BODY_ID = "tblMembers_body";
var TABLE_ALL_HEAD_ID = "tblAll_head";
var TABLE_MEMBERS_HEAD_ID = "tblMembers_head";
var MODE_SORT_KEY = 0;
var MODE_SORT_VALUE = 1;
var SORT_ORDER_ASC = 0;
var SORT_ORDER_DESC = 1;
var gContactSearchStrInputed = false;
var mPostoffice = '<%=Session.Item("AUTH_ACCOUNT")%>';
var mMailbox = '<%=Session.Item("AUTH_USERNAME")%>';
var ACCESS_MODE_READ = 0;
var ACCESS_MODE_FULL = 1;
var gAccessMode; // this will be set everytime a new list of messages comes back from the server
var gBrowserType = GetBrowserType();
var gSourceURI = "";
var gMembersAllListLoaded = false; // whether or not the All Contacts list (in Group details) has been loaded from server
var gKeepShowingWait = false;
var gIsSelectAll = false; // indicates we're currently doing a Select-All operation
var bIsTouchScreen = (GetBrowserScrollMode() == 2);
var gDetailsPaneMinWidth = bIsTouchScreen ? 450: 530;
var layoutMain = null;
var layoutSettings = {
useStateCookie: !bIsTouchScreen // use cookies to remember widths of pane if it's in a normal browser (i.e. not touchscreen user agent)
, defaults: {
name: "layoutContacts"
, size: "auto"
//, minSize: 300
, paneClass: "pane" // default = 'ui-layout-pane'
, resizerClass: "resizer" // default = 'ui-layout-resizer'
, togglerClass: "toggler" // default = 'ui-layout-toggler'
, buttonClass: "button" // default = 'ui-layout-button'
, slidable: false
, contentSelector: ".content" // inner div to auto-size so only it scrolls, not the entire pane!
, contentIgnoreSelector: "span" // 'paneSelector' for content to 'ignore' when measuring room for content
, togglerLength_open: 21 // WIDTH of toggler on north/south edges - HEIGHT on east/west edges
, togglerLength_closed: 15 // "100%" OR -1 = full height
, hideTogglerOnSlide: true // hide the toggler when pane is 'slid open'
, togglerTip_open: t_("[ME_TXT-CollapseThisPane]")
, togglerTip_closed: t_("[ME_TXT-OpenThisPane]")
, resizerTip: t_("[ME_TXT-Resize]")
// effect defaults - overridden on some panes
, fxName: "slide" // none, slide, drop, scale
, fxSpeed_open: 400
, fxSpeed_close: 400
//, fxSettings_open: { easing: "easeInQuint" }
//, fxSettings_close: { easing: "easeOutQuint" }
, resizerDragOpacity: 0.5
}
, center: {
// Contacts List pane
size: "auto"
, spacing_closed: 21 // wider space when closed
, initClosed: false // start with the pane open
//, onresize: function() { ResizeToolbarIcons('toolbar_primary_table_left_js');}
}
, east: {
// Contact Details pane
size: gDetailsPaneMinWidth
, minSize: gDetailsPaneMinWidth
, spacing_closed: 21 // wider space when closed
, initClosed: false // start with the pane open
, togglerLength_closed: 15
, togglerAlign_closed: "middle" // align toggle button (when pane is collapsed) to the middle of resizer bar
, togglerTip_open: t_("[ME_TXT-CollapseDetailsPane]")
, togglerTip_closed: t_("[ME_TXT-OpenDetailsPane]")
//, resizerTip_open: "Resize Tasks List"
, slideTrigger_open: "click" // collapsed pane is re-opened on click
//, slideTrigger_open: "mouseover" // collapsed pane is re-opened on click
, sliderTip: t_("[ME_TXT-ViewDetailsPane]") // slider tooltip
// add 'bounce' option to default 'slide' effect
//, fxSettings_open: { easing: "easeOutBounce" }
//, fxName: "drop" // slider effect (when clicked on slider bar)
}
};
function SetListHeight()
{
try {
var toolbar_primary_height; // height of the actions toolbar
var msgListPane_height; // height of the message list pane (including toolbar)
var bodyCol_shell_height; // height of the message list shell (not including the toolbar)
var toolbar_foot_height; // height of the footer toolbar
var paneiframe_padding;
var paneiframe_padding = 0;
toolbar_primary_height = document.getElementById("toolbar_primary_js").clientHeight;
toolbar_foot_height = document.getElementById("contacts_foot_shell_js").clientHeight;
if ($('.pane-iframe').css('padding-top')) {
paneiframe_padding = $('.pane-iframe').css('padding-top').replace('px', '');
}
msgListPane_height = $('html').height();
bodyCol_shell_height = msgListPane_height - toolbar_primary_height - toolbar_foot_height - paneiframe_padding;
// set list shell height
document.getElementById(LIST_CONTAINER).style.height = bodyCol_shell_height + "px";
document.getElementById(LIST_CONTAINER_INNER).style.height = bodyCol_shell_height + "px";
var HeaderHeight = 0;
if (CurrentViewType() != 1) {
HeaderHeight = HEADER_ROW_HEIGHT;
$('div.dataTable_scrollbar_top').show(); // show the actions toolbar (to act on list items)
} else {
$('div.dataTable_scrollbar_top').hide(); // hide the actions toolbar (to act on list items)
}
// set the scrollbar height (via the scroll canvas)
var scrollCanvas_height = (bodyCol_shell_height - HeaderHeight);
document.getElementById(SCROLLBAR_DIV).style.height = scrollCanvas_height + "px";
// set gMsgListHeight variable so the message list knows how many rows to draw
gMsgListHeight = bodyCol_shell_height - HeaderHeight;
DataItemList_SetScrollRange();
} catch (ex) { }
}
function SetDetailsPaneHeight()
{
// set the pane height (for background color)
//var paneHeight = layoutMain.state.container.innerHeight;
//var paneHeight = layoutMain.state.east.innerHeight;
var paneHeight = $('html').height();
var paneiframe_padding = 0;
if ($('.pane-iframe').css('padding-top')) {
paneiframe_padding = $('.pane-iframe').css('padding-top').replace('px', '');
}
document.getElementById("contactsDetails_shell_js").style.height = paneHeight - paneiframe_padding + "px";
}
function InitLayout() {
var html_height = $('html').height();
if (html_height > 0)
{
$('body div.level0_shell').height(html_height);
if (layoutMain == null)
{
// init the layout manager for the panes (list & details panes)
layoutMain = $('body div.level0_shell').layout(layoutSettings);
}
}
// set the height of the center panel (Contacts List)
SetListHeight();
// set the height of the east panel (Contact Details)
SetDetailsPaneHeight();
// set the toolbar button widths
var toolbar_new_w = $('#bttn_toolbar_new').outerWidth();
var toolbar_search_w = $("#toolbar_search_js").outerWidth();
var toolbar_view_w = $("#bttn_toolbar_view").outerWidth();
var toolbar_import_w = 0;
var bttn_toolbar_import = $('#bttn_toolbar_import').outerWidth();
if (bttn_toolbar_import)
{
toolbar_import_w = bttn_toolbar_import;
}
var toolbar_footer_bttns = 0;
document.getElementById("toolbar_new_td_js").style.width = toolbar_new_w + BTTN_PADDING + "px";
document.getElementById("toolbar_search_td_js").style.width = toolbar_search_w + BTTN_PADDING + "px";
document.getElementById("toolbar_view_td_js").style.width = toolbar_view_w + 3 + "px";
toolbar_footer_bttns = toolbar_import_w + 5;
<% If AllowExportContacts() Then %>
var toolbar_export_w = 0;
toolbar_export_w = $('#bttn_toolbar_export').outerWidth();
toolbar_footer_bttns += toolbar_export_w + 2;
<% End If %>
document.getElementById("toolbar_import_td_js").style.width = toolbar_footer_bttns + "px";
ConfigureView(CurrentViewType());
gItemsPerPage = CalculateItemsPerPage(gMsgListHeight, gUnitScrollLength);
}
function AddMailboxContactFolders() {
//adds all the folders except the contacts folder.
var dc = $('#ddlSharedContacts');
if (dc) {
var cl = {};
getTopAppWindow().fetchFoldersByClass(cl, 'IPF.Contact'); //gets from the server
getTopAppWindow().getFoldersByClass(cl,'IPF.Contact'); //this merges the ones in the tree (which includes connections to shares)
for (var key in cl) {
var sPath = (cl[key].RelativePathOnDisk || cl[key].RelativeFolderPath)
if (cl[key].RelativePathOnDisk != undefined)
{
dc.append($('<option>', { value: cl[key].RelativePathOnDisk||cl[key].RelativeFolderPath, text:cl[key].RelativeFolderPath}));
}
}
}
}
function BrowserResize() {
InitLayout();
DataItemList_RewriteTableRows(LIST_ID, gDataListTopOfPageOrdinal-1, arrTableColumns,"refresh");
}
function ListDirectorySources()
{
ServerRequest('GET-DIRECTORY-SOURCES', '', false);
}
function ListShares(URI)
{
var sOptions = "";
if (URI && URI.length > 0)
{
sOptions = "URI=" + URI;
}
if (getTopAppWindow().g_opt['SharingEnabled'])
{
ServerRequest('LIST-CONNECTIONS', sOptions, false);
}
}
function GetContactColumns()
{
ServerRequest("GET-CONTACTCOLS", "", false);
}
var TOOLBAR_HEIGHT = 28;
function ResizeToolbarIcons(ToolbarCellID)
{
var tdToobar = document.getElementById(ToolbarCellID);
if (tdToobar && (tdToobar.style.display == 'none'))
{
return 0;
}
var bResize = false;
if (GetBrowserScrollMode() == 2)
{
// resize the toolbar buttons for iPhone/iPad
bResize = true;
}
else
{
// show all .bttn_toolbar_primary_text, reset padding on .bttn_toolbar_primary_left
$('#' + ToolbarCellID + ' .bttn_toolbar_primary_text').css('display', '');
$('#' + ToolbarCellID + ' .bttn_toolbar_primary_divider').css('display', '');
$('#' + ToolbarCellID + ' .bttn_toolbar_primary_left').css('padding-left', '3px');
// when scrollHeight of the td is over 21px it means buttons have overflowed
var toolbar_scrollheight = $('#' + ToolbarCellID + ' .toolbar_primary_bttns_td_shell').attr('scrollHeight');
if (toolbar_scrollheight > TOOLBAR_HEIGHT) {
bResize = true;
}
}
if (bResize)
{
// hide all .bttn_toolbar_primary_text, reduce padding on .bttn_toolbar_primary_left
$('#' + ToolbarCellID + ' .bttn_toolbar_primary_text').css('display', 'none');
$('#' + ToolbarCellID + ' .bttn_toolbar_primary_divider').css('display', 'none');
$('#' + ToolbarCellID + ' .bttn_toolbar_primary_left').css('padding-left', '1px');
return 1;
}
return 0;
}
function IsDefaultContactFolder(sRelativeFolderPath)
{
return (!sRelativeFolderPath) || (sRelativeFolderPath == '') || (sRelativeFolderPath == 'Mine') || (sRelativeFolderPath == '/Contacts');
}
function PageLoad()
{
oConfirmationDialog = new MessageDialog("Confirm");
oInputDialog = new InputDialog("Input");
oAlertDialog = new MessageDialog("Alert");
oImportDialog = new Dialog("Import", t_("[ME_TXT-ImportContacts]"), $("#divImport"), { Width: 500});
var taw = getTopAppWindow();
GetContactColumns();
getTopAppWindow().gTabViewLoaded = false;
DataItemList_Create(document.getElementById('msgList_shell_js'),"ContactsList");
InitLayout();
// Now we disable the select options that have the disabled property for IE6 & IE7
OldIEDisabledOptionsFix();
$("#lstImportFormat").on('change', function(){
//var value = $("#lstFormat option:selected").val();
$("#dvFile").toggle();
$("#dvCardDAV").toggle();
});
initContactDetails();
ListDirectorySources();
if (getTopAppWindow().g_opt['SharingEnabled'])
{
ListShares();
}
else
{
$('#ddlSharedContacts').hide();
}
gSelectedIM = new SelectedItemsManager();
if (!taw.gGlobalAddressListEnabled)
{
$('#ddlSource').hide();
}
var iSourceType = <%= gContactsSource %>;
var sURI = '';
if (taw.getParameterByName)
{
sURI = taw.getParameterByName('URI', window.location.href);
}
gOptionsMode = '<%=gOptionsMode%>';
//DataItemList_Init(LIST_ID);
var birthdayPickerLocation = document.getElementById('birthdayPickerLocation');
var today = new Date();
arrDatePickers['birthdayPicker'] = new InlineListsDatePicker('birthdayPicker', birthdayPickerLocation,
'mdy', null, ME_DP_MONDAY, dayTokens, monthTokens, '(' + t_('[ME_TXT-None]') + ')', 'ME_StandardText',
today.getFullYear()-100, today.getFullYear());
arrDatePickers['birthdayPicker'].todayButtonText = t_('[ME_TXT-Today]');
arrDatePickers['birthdayPicker'].selectionButtonText = t_('[ME_TXT-Selection]');
arrDatePickers['birthdayPicker'].selectNoneButtonText = t_('[ME_TXT-None]');
arrDatePickers['birthdayPicker'].prepare();
arrDatePickers['birthdayPicker'].enableSelectNoneButton();
if (IsDefaultContactFolder(sURI))
{
SelectListItemByValue('ddlSharedContacts', 'Mine');
}
else
{
if (iSourceType != SOURCE_DIRECTORY) {
SelectListItemByValue('ddlSharedContacts', sURI);
gSourceURI = sURI;
}
}
SelectSource(iSourceType, sURI);
ConfigureMouseWheelEvent(1); // for mouse wheel scrolling of the list
ConfigureKeyEvents(1); // for key navigation
//disableSelection(document.body);
addEvent(window, 'resize', BrowserResize, true);
$('.level0_shell').css({ visibility: 'visible' });
getTopAppWindow().HidePageLoad();
}
function ShowAlert(Title, Message, IsWarning, FnAction)
{
if (oAlertDialog != null) {
oAlertDialog.Alert(Title, Message, IsWarning, true, FnAction);
}
else {
alert(Message);
}
}
function FillContactList(BaseNode,Target)
{
var BaseNodeAttributes = BaseNode.attributes;
var XMLNode;
var XMLNodeAttributes;
var iItemsArraySize = 0;
if (BaseNode.getElementsByTagName('ELEMENT'))
{
iItemsArraySize = BaseNode.getElementsByTagName('ELEMENT').length;
}
// Add contacts to our global array
var i;
var oTarget = document.getElementById(Target);
var ContactID,FullName,Email,DisplayValue;
for (i = 0; i < iItemsArraySize; i++)
{
XMLNode = BaseNode.childNodes[i];
XMLNodeAttributes = XMLNode.attributes;
ContactID = GetXMLValue(XMLNodeAttributes.getNamedItem('ID'));
FullName = GetXMLValue(XMLNode.getElementsByTagName("FULLNAME")[0]);
Email = GetXMLValue(XMLNode.getElementsByTagName("EMAIL")[0]);
if (FullName && FullName.length > 0)
DisplayValue = FullName + ' [' + Email + ']';
else
DisplayValue = '[' + Email + ']';
AddItemToList(oTarget,ContactID,DisplayValue);
}
}
function ProcessDirectorySources(BaseNode, ddlDirectories)
{
//ClearList(ddlDirectories.id);
var DiretoryNodes = BaseNode.getElementsByTagName("ITEM");
for (var i = 0; i < DiretoryNodes.length; i++)
{
var DirectoryNode = DiretoryNodes[i];
var DirectoryID = GetXMLValue(DirectoryNode.attributes.getNamedItem("ID"));
var sDirectoryName = GetXMLValue(DirectoryNode.getElementsByTagName("NAME")[0]);
AddItemToList(ddlDirectories,DirectoryID,sDirectoryName);
}
// SetRightPanelTitle(ddlDirectories.options[ddlDirectories.selectedIndex].text);
// if (frmContacts.ChangeSource)
// {
// frmContacts.ChangeSource(ddlDirectories.value);
// }
}
function ServerRequest(sCommand, sData, bUseCallback, sFrameName)
{
var sURI = "";
if ( gSourceURI && gSourceURI.length > 0 )
{
sURI = '&URI=' + encodeURIComponent(gSourceURI);
}
if (sURI && sURI.length > 0)
{
sData = sData + sURI;
}
return LIBAjax_ServerRequest(sCommand, sData, bUseCallback, sFrameName);
}
function ServerPost(sCommand, sData, bUseCallback, sFrameName)
{
LIBAjax_ServerPost(sCommand, sData, bUseCallback, sFrameName);
}
function ProcessXMLResult(responseXML, FrameName)
{
var BaseNode = responseXML.getElementsByTagName("BASEELEMENT")[0];
if (BaseNode == null)
{
alert(t_("[ME_TXT-Serverfailure]"));
return false;
}
var oSchema = BaseNode.attributes.getNamedItem('SCHEMA');
var oMethod = BaseNode.attributes.getNamedItem('METHOD');
var sSchema;
var sMethod;
if (oSchema)
{
sSchema = GetXMLValue(oSchema);
}
if (oMethod)
{
sMethod = GetXMLValue(oMethod);
}
if (sSchema == 'DIRECTORY-SOURCES') {
var ddlSource = document.getElementById('ddlSource');
ProcessDirectorySources(BaseNode, ddlSource);
}
if (sSchema == 'RESULT')
{
if (sMethod == 'LIST-CONNECTIONS')
{
ProcessSharesList(BaseNode);
}
if ( sMethod == 'GET-CONTACT' )
{
getTopAppWindow().Async_UnlockUI();
ProcessContact(BaseNode);
}
else if ( sMethod == 'ADD-CONTACT' )
{
ProcessSaveResult(BaseNode, MODE_ADD);
}
else if ( sMethod == 'EDIT-CONTACT' )
{
ProcessSaveResult(BaseNode, MODE_EDIT);
}
else if ( sMethod == 'DELETE-CONTACT' )
{
ProcessDeleteResult(BaseNode);
}
else if ( sMethod == 'ADD-CONTACTGROUP' )
{
ProcessSaveResult(BaseNode, MODE_ADD);
}
else if ( sMethod == 'GET-CONTACTGROUP' )
{
getTopAppWindow().Async_UnlockUI();
//ServerRequest('LIST-CONTACTS', 'Source=' + SOURCE_ADDRESSBOOK + '&Target=lstContacts&SortField=FullName&SortOrder=Asc&Pagination=none', false);
if (!gMembersAllListLoaded) {
// we only want to load the addressbook if it hasn't already been loaded
ListAddressBook(SOURCE_ADDRESSBOOK);
}
ShowGroupDetails();
ProcessContactGroup(BaseNode);
}
else if ( sMethod == 'EDIT-CONTACTGROUP' )
{
ProcessSaveResult(BaseNode, MODE_EDIT);
}
else if ( sMethod == 'DELETE-CONTACTGROUP' )
{
ProcessDeleteResult(BaseNode);
}
else if ( sMethod == 'LIST-CONTACTS' )
{
alert('System Error (ME-E5015): A permission problem or index corruption occured when accessing the message store. Please contact your administrator.');
}
else if ( sMethod == 'LIST-ADDRESSBOOK' )
{
ProcessAddressBook(BaseNode);
}
else if ( sMethod == 'LIST-CONTACTGROUPS' )
{
var BaseNodeAttributes = BaseNode.attributes;
gTotalGroups = parseInt(GetXMLValue(BaseNodeAttributes.getNamedItem('TOTAL')));
getTopAppWindow().SetStatusBarValues(getTopAppWindow().VIEW_CONTACTS, gTotalItems, gTotalGroups);
}
else if ( sMethod == 'CONTACT-GETSOURCE' )
{
ProcessGetSource(BaseNode);
}
}
if (sSchema == 'COLUMNS')
{
ProcessContactColumns(BaseNode);
}
if (sSchema == 'CONTACTS')
{
if (!gKeepShowingWait) {
getTopAppWindow().Async_UnlockUI();
}
ProcessMessageList(BaseNode, arrTableColumns);
ProcessSelectedIDs(BaseNode);
// tick the SelectAll checkbox if everything is selected
if (gTotalItems > 0 && gSelectedIM.GetSize() == gTotalItems)
SetSelectAllCheckbox(true);
else
SetSelectAllCheckbox(false);
if (!gListFirstLoad && !gIsSelectAll)
{
// need to redraw the list because the data may have been updated from the server
DataItemList_RewriteTableRows(LIST_ID, gDataListTopOfPageOrdinal-1, arrTableColumns,"result");
}
else
{
// select the selected item passed in the request after the first list load
var SelectItemID = '<%=ParseRequestArgument("ID") %>';
if (SelectItemID)
{
MsgListRowSelect(SelectItemID, false, false);
}
gListFirstLoad = false; // because now we've just redrawn (cleared) the list
}
var wholeRowsPP = CalculateWholeRowsPerPage(gMsgListHeight, gUnitScrollLength);
if (gTotalItems <= wholeRowsPP) {
ScrollBar_Hide(SCROLLBAR_DIV, SCROLLBAR_TD);
}
else
{
DataItemList_SetScrollRange();
}
SetActionButtonsStatus();
SetFieldFocus(LIST_ID); // so that key events fire on the selection
// add popup rows
if (gAccessMode == ACCESS_MODE_FULL)
{
PopUp_ClearItems('menuItemsdiv');
PopUp_AddItem('menuItemsdiv', POPUP_MENU_ID_DELETE, 'Delete', t_('[ME_TXT-Delete]'), 'dropDown_icon_delete');
PopUp_AddItem('menuItemsdiv', POPUP_MENU_ID_EMAIL, 'Email', t_('[ME_TXT-SendEmail]'), 'dropDown_icon_sendMail');
PopUp_AddItem('menuItemsdiv', POPUP_MENU_ID_DOWNLOAD, 'Download', t_('[ME_TXT-DownloadAsVCFFile]'), 'dropDown_icon_download');
<% If AllowSendAsVCard() Then %>
PopUp_AddItem('menuItemsdiv', POPUP_MENU_ID_SEND_VCARD, 'SendAsVCard', t_('[ME_TXT-SendAsVCard]'), 'dropDown_icon_vcard');
<% End If %>
}
else
{
PopUp_ClearItems('menuItemsdiv');
}
// resize the toolbar buttons to make it fit into the available screen real estate
//ResizeToolbarIcons('toolbar_primary_table_left_js');
if (GetBrowserScrollMode() == 2)
{
// hide the import button on iPhone/iPad
$('#toolbar_import_td_js').css('visibility', 'hidden');
}
}
window.status = gSelectedIM.GetSize() + " " + t_("[ME_TXT-Selected]");
return true;
}
function ProcessContactColumns(BaseNode)
{
var oCols = BaseNode.getElementsByTagName('COLUMNS')[0];
if (oCols)
{
gColumnNames = GetXMLValue(oCols);
}
var sFnAction = "ListContacts(CurrentSourceType(), null, CurrentViewType());";
dropDown_clearOptions("dropDown_viewOptions");
dropDown_clearOptions("dropDown_styleOptions");
if (gColumnNames.length > 0)
{
// Populate the 'View' dropdown menu with custom columns
var oArray = gColumnNames.split(",");
var sColName, sOptionName = "";
for (i = 0; i < oArray.length; i++) {
sColName = trimAll(oArray[i]);
sOptionName = GetViewOptionName(sColName);
if (sOptionName.length > 0)
{
dropDown_addTickOption("dropDown_viewOptions", sColName, sOptionName, sFnAction);
}
}
gSortColumn = trimAll(oArray[0]); // set 1st column as the sorted column
}
else
{
gSortColumn = "FullName";
// Populate the 'View' dropdown menu with default columns (FullName, Nickname, Email and Cellphone)
dropDown_addTickOption("dropDown_viewOptions", "FullName", t_("[ME_TXT-FullName]"), sFnAction);
dropDown_addTickOption("dropDown_viewOptions", "Nickname", t_("[ME_TXT-Nickname]"), sFnAction);
dropDown_addTickOption("dropDown_viewOptions", "Email", t_("[ME_TXT-EmailAddress]"), sFnAction);
dropDown_addTickOption("dropDown_viewOptions", "PhoneM", t_("[ME_TXT-Phone(M)]"), sFnAction);
}
dropDown_addTickOption("dropDown_styleOptions", "Summary", t_("[ME_TXT-Summary]"), "ChangeView();");
SetViewMenu(CurrentViewType());
}
function ChangeView() {
var IsSummary = dropDown_IsItemTicked("dropDown_styleOptions_Summary li");
var CurrentView = (IsSummary) ? 1 : 0;
getTopAppWindow().SetOption('ContactViewType', CurrentView, true, 0, 0);
SetViewMenu(CurrentView);
DataItemList_ClearListContents(LIST_ID, true);
InitLayout();
ListContacts(CurrentSourceType(), null, CurrentViewType());
return 0;
}
function SetViewMenu(iView) {
if (iView == -1) {
//#dropDown_styleOptions
$("#dropDown_styleOptions").hide();
$(".viewOptions_toggle_menu").hide();
}
else if (iView == 0) {
dropDown_SetTickOption($("#dropDown_styleOptions_Summary")[0], false);
$("#dropDown_viewOptions").show();
$(".viewOptions_toggle_menu").show();
} else {
dropDown_SetTickOption($("#dropDown_styleOptions_Summary")[0], true);
$("#dropDown_viewOptions").hide();
$(".viewOptions_toggle_menu").hide();
}
}
function GetViewOptionName(ColName)
{
if (ColName == "Email")
return t_("[ME_TXT-EmailAddress]");
if (ColName == "FullName")
return t_("[ME_TXT-FullName]");
if (ColName == "LastName")
return t_("[ME_TXT-LastName]");
if (ColName == "FirstName")
return t_("[ME_TXT-FirstName]");
if (ColName == "MiddleName")
return t_("[ME_TXT-MiddleName]");
if (ColName == "Title")
return t_("[ME_TXT-Title]");
if (ColName == "Nickname")
return t_("[ME_TXT-Nickname]");
if (ColName == "PhoneW")
return t_("[ME_TXT-Phone(W)]");
if (ColName == "PhoneH")
return t_("[ME_TXT-Phone(H)]");
if (ColName == "PhoneM")
return t_("[ME_TXT-Phone(M)]");
if (ColName == "Business")
return t_("[ME_TXT-Business]");
if (ColName == "Department")
return t_("[ME_TXT-Department]");
if (ColName == "PhonePager")
return t_("[ME_TXT-PhoneP]");
if (ColName == "PhoneFax")
return t_("[ME_TXT-PhoneF]");
if (ColName == "Birthday")
return t_("[ME_TXT-Birthday]");
if (ColName == "Assistant")
return t_("[ME_TXT-Assistant]");
if (ColName == "Homepage")
return t_("[ME_TXT-HomePage]");
if (ColName == "Messenger")
return t_("[ME_TXT-MSMessenger]");
if (ColName == "Country")
return t_("[ME_TXT-Country]");
if (ColName == "Locality")
return t_("[ME_TXT-Locality]");
if (ColName == "Postcode")
return t_("[ME_TXT-PostalCode]");
if (ColName == "StreeAddress")
return t_("[ME_TXT-StreetAddress]");
if (ColName == "Province")
return t_("[ME_TXT-State]");
return "";
}
function GetMyMailboxDLI()
{
return 'VCF://' + mPostoffice + '/' + mMailbox + '/$VCFROOT/[' + mMailbox + ']';
}
function CIM(s1,s2)
{
return ( s1.toUpperCase() == s2.toUpperCase() );
}
function SortArrByAscValue(KeyArr, AscArr)
{
// Returns a sorted array (KeyArr) in ascending order;
// sorted on the key value of the associative array (AscArr) passed in.
return KeyArr.sort(function(a, b) {
if (AscArr[a] > AscArr[b])
return 1;
if (AscArr[a] < AscArr[b])
return -1;
// now we compare the key since the key-value is the same
if (a > b)
return 1;
if (a < b)
return -1;
return 0;
});
}
function SortAscArr(Arr, SortOrder, Mode)
{
// Sorts an associative array based on the mode (key or value)
var sortedKeys = new Array();
var sortedAscArr = {};
// separate keys and sort them
for (var key in Arr){
sortedKeys.push(key);
}
if (Mode == MODE_SORT_KEY) {
sortedKeys.sort(); // sort lexicographically (alphabetically)
}
else if (Mode == MODE_SORT_VALUE) {
SortArrByAscValue(sortedKeys, Arr, SortOrder);
}
if (SortOrder == SORT_ORDER_DESC) {
sortedKeys.reverse();
}
// reconstruct the associative array based on keys
for (var key in sortedKeys) {
sortedAscArr[sortedKeys[key]] = Arr[sortedKeys[key]];
}
return sortedAscArr;
}
function SortMembersList(TableBodyID, ColNum, SortOrder)
{
// This function sorts the Group Members/All list
var mode = (ColNum == 2)? MODE_SORT_KEY: MODE_SORT_VALUE;
var arr = GetDataArray(TableBodyID, mode);
var arrIDMappings = GetMappingDataArray(TableBodyID); // { Fullname:ContactID }
arr = SortAscArr(arr, SortOrder, mode);
// now redraw the data list...
ClearGroupContactsList(TableBodyID);
SetGroupDetailsSelectAllChkbox();
var i=0;
var sContactID, sFullName, sEmail = "";
for (var key in arr)
{
sContactID = arrIDMappings[key];
sEmail = arr[key];
if (key && (key.indexOf("[n_") == 0) )
{
sFullName = "";
}
else
{
sFullName = key;
}
AddContactMemberRow(TableBodyID, sContactID, sFullName, sEmail, (i % 2 != 0));
i++;
}
// untick the Select All checkbox;
// we have to anyway because the list has been completely redrawn without selected states
var sTblHeadID = TableBodyID.replace("_body", "_head");
SetSelectAllGroupCheckbox(sTblHeadID, false);
}
function SetSortHeaderArrow(TableHeadID, ColNum, SortOrder)
{
var oTbl = document.getElementById(TableHeadID);
if (!oTbl) return false;
var divHeader = oTbl.getElementsByTagName("TD")[ColNum - 1].getElementsByTagName("DIV")[0];
if (!divHeader) return false;
if (SortOrder == SORT_ORDER_ASC)
divHeader.getElementsByTagName("div")[1].className = ARROW_CLASS_UP_SELECTED;
else if (SortOrder == SORT_ORDER_DESC)
divHeader.getElementsByTagName("div")[1].className = ARROW_CLASS_DOWN_SELECTED;
// reset the arrow style for the other columns
var iNumCols = $('#' + TableHeadID + ' td').length;
for (var i = 1; i < iNumCols; i++)
{
if (i != (ColNum - 1)) {
// blank the directional arrow
$('#' + TableHeadID + ' tr').children('td').eq(i).children('div').children(':eq(1)').attr('class', ARROW_CLASS_BLANK);
}
}
}
function ToggleColSort(TableHeadID, TableBodyID, HeaderDiv, ColNum) {
var sortOrder;
if (HeaderDiv.childNodes.length > 0) {
if (HeaderDiv.getElementsByTagName("div")[1].className == ARROW_CLASS_BLANK) {
sortOrder = SORT_ORDER_ASC;
}
else if (HeaderDiv.getElementsByTagName("div")[1].className == ARROW_CLASS_UP_SELECTED) {
sortOrder = SORT_ORDER_DESC;
}
else if (HeaderDiv.getElementsByTagName("div")[1].className == ARROW_CLASS_DOWN_SELECTED) {
sortOrder = SORT_ORDER_ASC;
}
}
SetSortHeaderArrow(TableHeadID, ColNum, sortOrder);
// sort the data (by colum specified)
SortMembersList(TableBodyID, ColNum, sortOrder);
}
function SetSelectAllGroupCheckbox(TableHeadID, Checked)
{
try {
document.getElementById(TableHeadID).getElementsByTagName("TD")[0].firstChild.checked = Checked;
} catch (ex) {}
}
function SelectAllChkboxCallback(TableID, Checked) {
SelectAllRows(TableID, Checked);
if ( TableID == TABLE_MEMBERS_BODY_ID )
{
if (Checked)
EnableGroupRemoveBttn();
else
DisableGroupRemoveBttn();
}
if ( TableID == TABLE_ALL_BODY_ID )
{
if (Checked)
EnableGroupAddBttn();
else
DisableGroupAddBttn();
}
}
function SelectAllRows(TableID, Selected) {
var sItemID, sEmail;
// Loop through each row of the specified list (table)
// and select it based on 'Selected' value.
$('#' + TableID + ' > tbody > tr').each(function()
{
// set the checkbox checked status
$(this).find('td:first table input').prop('checked', Selected);
// also set the style (highlight) for selected row...
RowSelect($(this).attr('id'), Selected);
});
}
var MODE_COUNT_ALL = 0;
var MODE_COUNT_SELECTED_ONLY = 1;
function GetNumRows(TableID, mode)
{
var count = 0;
// get the number of rows in the list
$('#' + TableID + ' > tbody > tr').each(function()
{
if ( mode && (mode == MODE_COUNT_SELECTED_ONLY) )
{
if ($(this).find('td:first table input').prop('checked') == true)
{
count++;
}
}
else
{
count++;
}
});
return count;
}
function RowSelect(RowID, Selected) {
try {
var oRow = document.getElementById(RowID);
var oTable = oRow.getElementsByTagName("TABLE")[0];
var sRowClass = "";
var sTableClass = "";
if (Selected) {
sRowClass = ROW_CLASS_SELECTED;
// also append the selected style (background color highlight)
// on the inner table so that the mouseover will also show the
// row as highlighted.
sTableClass = oTable.className + " " + TABLE_CLASS_SELECTED;
}
else {
sRowClass = ROW_CLASS_UNSELECTED;
// remove the selected style (background color highlight)
var sRegExStr = " " + TABLE_CLASS_SELECTED;
sTableClass = oTable.className.replace(sRegExStr, "");
}
oRow.className = sRowClass;
oTable.className = sTableClass;
}
catch (ex) { }
}
function RowClick(ChkBoxID, RowID, TableID) {
try {
var oChkbox = document.getElementById(ChkBoxID);
oChkbox.checked = !oChkbox.checked;
RowSelect(RowID, oChkbox.checked);
var numRows = GetNumRows(TableID);
var numRowsSelected = GetNumRows(TableID, MODE_COUNT_SELECTED_ONLY);
if (numRowsSelected == 0)
{
if (TableID == TABLE_MEMBERS_BODY_ID)
{
// disable Remove button
DisableGroupRemoveBttn();
}
if (TableID == TABLE_ALL_BODY_ID)
{
// disable Add button
DisableGroupAddBttn();
}
}
else if (numRowsSelected > 0)
{
if (TableID == TABLE_MEMBERS_BODY_ID)
{
EnableGroupRemoveBttn();
}
if (TableID == TABLE_ALL_BODY_ID)
{
EnableGroupAddBttn();
}
}
// tick/untick the Select All checkbox for the list
var tblHeadID = TableID.replace("_body", "_head");
var bSelectAllChecked = false;
if (numRowsSelected == numRows)
bSelectAllChecked = true;
$('#' + tblHeadID + ' > tbody > tr').find('td:first input').prop('checked', bSelectAllChecked);
return 1;
}
catch (ex) { return 0; }
}
function ProcessAddressBook(BaseNode)
{
var sContactID, sFullName, sEmail = "";
var XMLNode, XMLNodeAttributes = null;
var ObjectType;
var bIsGroup = false;
var iNumContacts = BaseNode.getElementsByTagName('ELEMENT').length;
ClearGroupContactsList(TABLE_ALL_BODY_ID);
SetGroupDetailsSelectAllChkbox();
for (var i = 0; i < iNumContacts; i++) {
XMLNode = BaseNode.childNodes[i];
XMLNodeAttributes = XMLNode.attributes;
ObjectType = GetXMLValue(XMLNode.getElementsByTagName('TYPE')[0]);
if (ObjectType == 20) {
bIsGroup = true;
}
else {
bIsGroup = false;
}
sContactID = GetXMLValue(XMLNodeAttributes.getNamedItem('ID'));
sFullName = HTMLEncode(GetXMLValue(XMLNode.getElementsByTagName("FULLNAME")[0]));
sEmail = HTMLEncode(GetXMLValue(XMLNode.getElementsByTagName("EMAIL")[0]));
if (!bIsGroup) {
// only add if it's not a group
AddContactMemberRow(TABLE_ALL_BODY_ID, sContactID, sFullName, sEmail, (i%2 != 0));
}
}
gMembersAllListLoaded = true;
// list should already be sorted alphabetically from server in ascending order
// set the column sort arrow
SetSortHeaderArrow(TABLE_ALL_HEAD_ID, 2, SORT_ORDER_ASC);
// apply alternating bordered row styles
ApplyBorderedStyles(TABLE_ALL_BODY_ID);
}
function GetRowID(TableID, ContactID)
{
if (!TableID || !ContactID)
return "";
return TableID + "_tr_" + ContactID;
}
function GetContactIDFromRowID(TableID, RowID)
{
return RowID.replace(TableID + "_tr_", "");
}
function AddContactMemberRow(TableID, ContactID, FullName, Email, Bordered)
{
var oTable = document.getElementById(TableID);
if (!oTable) return false;
var oTBody = oTable.getElementsByTagName('TBODY')[0];
// create new row for the contact
var oRow = document.createElement('TR');
var oRowTD = document.createElement('TD');
var oTbl = document.createElement('TABLE');
var oTblRow = document.createElement('TR');
var oTblBody = document.createElement('TBODY');
var oDivText;
var sRowID = GetRowID(TableID, ContactID);
oRow.id = sRowID;
oTbl.border = 0;
oTbl.cellSpacing = 0;
oTbl.cellPadding = 0;
if (Bordered) {
oTbl.className = ROW_TABLE_CLASS_BORDERED;
}
else {
oTbl.className = ROW_TABLE_CLASS_NORMAL;
}
// the select checkbox
var oTD = document.createElement('TD');
oTD.className = COL_CLASS_TICKBOX;
var oChk = document.createElement('INPUT');
var sChkID = 'chk_' + sRowID;
oChk.id = sChkID;
oChk.type = 'CHECKBOX';
oChk.onclick = function(ev) {
ev = ev || window.event;
var target = ev.target || ev.srcElement;
target.checked = !target.checked;
};
oRow.onclick = new Function("RowClick('" + sChkID.replace(/\'/g, "\\'") + "', '" + sRowID.replace(/\'/g, "\\'") + "', '" + TableID + "');");
oTD.appendChild(oChk);
oTblRow.appendChild(oTD);
// full name
oTD = document.createElement('TD');
oTD.className = COL_CLASS_FULLNAME;
oDivText = document.createElement('DIV');
oDivText.className = 'dataTable_text_div';
oDivText.innerHTML = FullName;
oTD.appendChild(oDivText);
oTD.title = FullName;
oTblRow.appendChild(oTD);
// email address
oTD = document.createElement('TD');
oTD.className = COL_CLASS_LAST;
oDivText = document.createElement('DIV');
oDivText.className = 'dataTable_text_div';
oDivText.innerHTML = Email;
oTD.appendChild(oDivText);
oTD.title = Email;
oTblRow.appendChild(oTD);
// now add the row to our table
oTblBody.appendChild(oTblRow);
oTbl.appendChild(oTblBody);
oRowTD.appendChild(oTbl);
oRow.appendChild(oRowTD);
// append the new table row to our existing table
oTBody.appendChild(oRow);
}
function GetContactMemberListCount(TableID)
{
var oTbl = document.getElementById(TableID);
if (!oTbl) return 0;
return oTbl.getElementsByTagName("TBODY")[0].childNodes.length;
}
function ClearGroupContactsList(TableID)
{
clearChildNodes(document.getElementById(TableID).getElementsByTagName("TBODY")[0]);
// untick the Select All checkbox for the list
var tblHeadID = TableID.replace("_body", "_head");
$('#' + tblHeadID + ' > tbody > tr').find('td:first input').prop('checked', false);
}
function ClearSharesList()
{
// remove all dropdown values that are not "Mine"
$('#ddlSharedContacts option[value="Mine_"] ~ option').remove();
}
function RemoveSharedListItem(URI)
{
RemoveListItemByValue('ddlSharedContacts', URI);
}
function DisableGroupAddRemoveBttns()
{
DisableGroupAddBttn();
DisableGroupRemoveBttn();
}
function EnableGroupAddBttn()
{
SetGroupBttnState("bttn_add_js", BTTN_FLOAT_LEFT, true, AddToGroupMembers);
}
function DisableGroupAddBttn()
{
SetGroupBttnState("bttn_add_js", BTTN_FLOAT_LEFT, false, null);
}
function EnableGroupRemoveBttn()
{
SetGroupBttnState("bttn_remove_js", BTTN_FLOAT_RIGHT, true, RemoveFromGroup);
}
function DisableGroupRemoveBttn()
{
SetGroupBttnState("bttn_remove_js", BTTN_FLOAT_RIGHT, false, null);
}
function SetGroupBttnState(BttnID, Float, Enabled, fnAction)
{
if (Enabled)
{
EnableIconButton(BttnID, fnAction);
}
else
{
DisableIconButton(BttnID, Float);
}
}
function ProcessSharesList(BaseNode)
{
var ddlSharedContacts = document.getElementById('ddlSharedContacts');
if (!ddlSharedContacts) return false;
ClearSharesList();
AddMailboxContactFolders();
if (BaseNode.childNodes.length > 0)
{
for (var i = 0; i < BaseNode.childNodes.length; i++)
{
var ShareNode = BaseNode.childNodes[i];
var sClass = GetXMLValue(ShareNode.getElementsByTagName("CLASS")[0]);
if (sClass == 'IPF.Contact') {
var sURI = GetXMLValue(ShareNode.getElementsByTagName("URI")[0]);
var sMailbox = GetXMLValue(ShareNode.getElementsByTagName("MAILBOX")[0]);
var sResourceName = GetXMLValue(ShareNode.getElementsByTagName("RESOURCE_NAME")[0]);
var sContactsURI = sURI;
var sDesc = GetXMLValue(ShareNode.getElementsByTagName("DESCRIPTION")[0]);
if (sResourceName == '/') {
sContactsURI += 'Contacts';
}
var sInsert = '<option value="' + sURI + '">' + sDesc + '</option>';
var newOption = $(sInsert);
newOption.insertAfter('#ddlSharedContacts option[value="sharelist"]');
}
}
}
}
function ProcessContactGroup(BaseNode)
{
// Processes the result or returning a contact group
// ie: it needs to list the members of the group and allow them to be swapped from one panel to another
var sResult = GetXMLValue(BaseNode.getElementsByTagName("RETURNVALUE")[0]);
if ( sResult != "1" )
{
return false;
}
var sID;
var sGroupName;
sID = GetXMLValue(BaseNode.attributes.getNamedItem('ID'));
if ( sID.length > 0)
{
gContactID = sID;
}
sGroupName = GetXMLValue(BaseNode.getElementsByTagName("NAME")[0]);
document.getElementById("group_name").value = sGroupName;
// now populate the members list
ClearGroupContactsList(TABLE_MEMBERS_BODY_ID);
SetGroupDetailsSelectAllChkbox();
var oMembersNode = BaseNode.getElementsByTagName("MEMBERS")[0];
if (oMembersNode)
{
var oMemberNodeList = oMembersNode.getElementsByTagName("MEMBER");
var oMemberNode,i,sMember,oAttributes;
var FullName,Email,DisplayValue;
var arr = {};
for (i = 0; i < (oMemberNodeList.length); i++)
{
oMemberNode = oMemberNodeList[i];
oAttributes = oMemberNode.attributes;
sMember = GetXMLValue(oAttributes.getNamedItem('ID'));
FullName = GetXMLValue(oMemberNode.getElementsByTagName("FULLNAME")[0]);
Email = GetXMLValue(oMemberNode.getElementsByTagName("EMAIL")[0]);
DisplayValue = FullName + ' [' + Email + ']';
AddContactMemberRow(TABLE_MEMBERS_BODY_ID, sMember, FullName, Email, (i%2 != 0));
}
// untick the Select All checkbox
SetSelectAllGroupCheckbox(TABLE_MEMBERS_HEAD_ID, false);
// sort the list
SortMembersList(TABLE_MEMBERS_BODY_ID, 2, SORT_ORDER_ASC); // sort members list in ascending order
// set the column sort arrow
SetSortHeaderArrow(TABLE_MEMBERS_HEAD_ID, 2, SORT_ORDER_ASC);
}
}
function ProcessContact(BaseNode)
{
if (ProcessContactDetails(BaseNode, arrDatePickers['birthdayPicker']))
{
ShowContactDetails();
var sDirectoryID = GetXMLValue(BaseNode.getElementsByTagName("DIRECTORYID")[0]);
var bIsMyDirectoryEntry = CIM('['+ mMailbox + ']', sDirectoryID);
if ((CurrentSourceType() == SOURCE_DIRECTORY) && (!bIsMyDirectoryEntry))
{
//document.getElementById('tab2').style.display='none'; // dont allow the notes to be edited
MakeEditable(false);
}
else
{
MakeEditable(true);
SetMode(MODE_EDIT);
}
if (CurrentSourceType() == SOURCE_ADDRESSBOOK)
{
var sID = GetXMLValue(BaseNode.getElementsByTagName("ID")[0]);
if ( sID.length > 0)
{
gContactID = sID;
}
else
{
if ( sEmail.length > 0)
{
gContactID = sEmail + ".VCF";
}
else
{
gContactID = "";
}
}
}
else
{
// document.getElementById('tab2').style.display='none'; // dont allow the notes to be edited
gContactID = "";
}
}
}
function ProcessGetSource(BaseNode)
{
var sResult = GetXMLValue(BaseNode.getElementsByTagName("RETURNVALUE")[0]);
if (sResult != "1")
{
ShowAlert(t_('[ME_TXT-DownloadFailed]'), t_('[ME_TXT-ContactNotFound!]'), true);
}
}
function ProcessSaveResult(BaseNode, Mode)
{
var sResult = GetXMLValue(BaseNode.getElementsByTagName("RETURNVALUE")[0]);
var sNotification = "";
if ( sResult == "0" ) // Error
{
var err;
if ( Mode == MODE_ADD )
{
err = t_("[ME_TXT-AddOperationFailed]");
}
else if ( Mode == MODE_EDIT )
{
err = t_("[ME_TXT-UpdateOperationFailed]");
}
var errNodes = BaseNode.getElementsByTagName("ERROR_DESCRIPTION");
if (errNodes != null && errNodes.length > 0)
{
err = GetXMLValue(errNodes[0]);
}
ShowAlert(t_("[ME_TXT-Error]"), err, true);
}
else if ( sResult == "1" ) // Success
{
if (gOptionsMode == 'Options')
{
sNotification = t_("[ME_TXT-DirectoryEntryUpdated]");
if (getTopAppWindow().ShowNotification)
{
getTopAppWindow().ShowNotification(sNotification);
}
}
else
{
if ( Mode == MODE_ADD )
{
HideContactDetails();
sNotification = t_("[ME_TXT-ContactAddedSuccessfully.]");
}
else
{
sNotification = t_("[ME_TXT-Detailsupdatedsuccessfully.]");
}
if (getTopAppWindow().ShowNotification)
{
getTopAppWindow().ShowNotification(sNotification);
}
RefreshList(CurrentSourceType());
}
}
}
function EditMyDirectoryDetails()
{
GetContactDetails('[' + mMailbox + ']', SOURCE_DIRECTORY);
if (!ContactDetailsShowing())
{
// must not have existed... we need to create a new one
AddContact();
}
}
function RemoveContactFromList(ContactID)
{
ItemsArray_DeleteFromArray(ContactID); // delete the contact from our global array
// (which may or may not hold all the contacts in the
// addressbook; it may only hold a subset requested
// from the server)
gItemsDeleted++;
DataItemList_DecrementItemCount(LIST_ID, 1);
gSelectedIM.RemoveItem(ContactID);
var result = 0;
if ( gTotalItems == 0 )
{
// Get rid of the scrollbar
ScrollBar_Hide(SCROLLBAR_DIV, SCROLLBAR_TD);
}
// remove it from our 'All Contacts' list (in Group Details panel)...
result = RemoveFromGroupList(TABLE_ALL_BODY_ID, ContactID);
if (document.getElementById('divGroupDetails').style.display != "none")
{
// apply alternating bordered row styles to the 'All Contacts' list (in Group Details panel)
ApplyBorderedStyles(TABLE_ALL_BODY_ID);
}
return result;
}
function ProcessDeleteResult(BaseNode)
{
//
// Find the first selected item so we can use it to reposition the list
//
var iFirstSelected = DataItemList_GetFirstSelectedRowIndex(LIST_ID);
var sFirstSelectedID = '';
if (iFirstSelected >= 0) {
sFirstSelectedID = DataItemList_GetRowIDByIndex(LIST_ID, iFirstSelected); //messageid of the first selected item in the list
}
var ContactResultNodes = BaseNode.getElementsByTagName("CONTACT");
var failMsgs = {};
var removeResult = 0;
var bRedraw = true;
for (var i = 0; i < ContactResultNodes.length; i++)
{
var ContactResultNode = ContactResultNodes[i];
var ContactID = ContactResultNode.attributes.getNamedItem('ID').nodeValue;
var sResult = GetXMLValue(ContactResultNode.getElementsByTagName("RETURNVALUE")[0]);
if ( sResult == '1' ) // Successfully deleted item on the server side
{
removeResult = RemoveContactFromList(ContactID);
}
else // Failure to delete item on the server side
{
// Display some error message
var errDescNodes = ContactResultNode.getElementsByTagName("ERROR_DESCRIPTION");
var sErrorDesc = t_('[ME_TXT-Noerrorgiven]');
if (errDescNodes && errDescNodes.length > 0)
{
sErrorDesc = GetXMLValue(errDescNodes[0]);
}
if (failMsgs[sErrorDesc])
{
failMsgs[sErrorDesc]++;
}
else
{
failMsgs[sErrorDesc] = 1;
}
}
}
if (removeResult == 1)
{
// apply alternating bordered row styles
ApplyBorderedStyles(TABLE_ALL_BODY_ID);
}
if (gDataListTopOfPageOrdinal > gTotalItems) {
gDataListTopOfPageOrdinal = 1;
}
DataItemList_RewriteTableRows(LIST_ID, gDataListTopOfPageOrdinal-1, arrTableColumns,"result");
if (gSelectedIM.GetSize() == 0) // we have to clear the 'Select All' check box if it was checked;
{
getTopAppWindow().Async_UnlockUI();
gKeepShowingWait = false;
gSelectedIM.SetCallback(null);
SetSelectAllCheckbox(false)
SetActionButtonsStatus();
gListItemSelected = false;
if (!ContactExistsInSelection() && GroupExistsInSelection())
{
// now that all contacts have been deleted we go off and delete any groups
DeleteSelectedGroups();
}
//
// reposition to the next selected item
//
try {
DataItemList_RewriteTableRows(LIST_ID, gDataListTopOfPageOrdinal - 1, arrTableColumns,"result");
// Now select the next message in the list after removing the deleted ones
if (gSelectedIM.GetSize() == 0 && gTotalItems > 0)
{
var iSelected = 0;
if (iFirstSelected > 0)
{
iSelected = iFirstSelected;
}
var sSelectedMessageID = DataItemList_GetRowIDByIndex(LIST_ID, iSelected);
// Unselect all the items in the list
DataItemList_UnselectAllRows(LIST_ID);
DataItemList_SelectRow(LIST_ID, sSelectedMessageID);
}
} catch (ex) {}
// this used to position to the top of the list whenever we deleted, as we used to only support checkbox style removal
// gDataListTopOfPageOrdinal = 1; // set to the top
// DataItemList_RewriteTableRows(LIST_ID, 0, arrTableColumns);
// update the total number of groups and items
getTopAppWindow().SetStatusBarValues(getTopAppWindow().VIEW_CONTACTS, gTotalItems, gTotalGroups);
window.status = t_("[ME_TXT-Done]");
ListGroups();
}
else
{
getTopAppWindow().SetStatusBarValues(getTopAppWindow().VIEW_CONTACTS, gTotalItems, gTotalGroups);
// if we're excuting a batch delete then we need to continue
// until our SelectedItems list is empty!
if (gSelectedIM.CallbackExists())
{
// we need the delay below in order for the list to be redrawn
setTimeout("gSelectedIM.ExecuteCallback()", 500); // execute it!
}
}
var msg = t_('[ME_TXT-Contactdeletionfailures]') + ':\n\n';
var errCount = 0;
for (var failMsg in failMsgs)
{
msg += '[' + failMsgs[failMsg] + 'x] ' + failMsg + '\n';
errCount++;
// limit the number of fail msgs to show in the msg
if (errCount > 5)
{
msg += '...';
break;
}
}
if (errCount > 0)
{
ShowAlert(t_("[ME_TXT-Error]"), msg, true);
}
else
{
// hide the contact details
HideDetails();
}
}
function ProcessImportResult(Result, SourceURI)
{
getTopAppWindow().Async_UnlockUI();
if ( Result == 1 )
{
gSourceURI = SourceURI;
InitLoadList(CurrentSourceType());
ShowAlert(t_("[ME_TXT-ImportContacts]"), t_("[ME_TXT-ContactsSuccessfullyImported]"));
}
else
{
ShowAlert(t_("[ME_TXT-Error]"), t_("[ME_TXT-ImportFailed]"), true);
}
}
function IsGroupID(ItemID)
{
if ( ItemID.match(/[A-Za-z0-9]+\.GRP/i) )
{
return true;
}
return false;
}
function HasMultipleItemsSelected() {
return (gSelectedIM.GetSize() > 1);
}
function IsPopupMenuActive(oSourceElement)
{
return IsElementAAncestorOfElementB(document.getElementById(LIST_ID), oSourceElement);
}
function IsPopupMenuCommandActive(ItemID, MenuIndex)
{
if ( MenuIndex == POPUP_MENU_ID_DOWNLOAD ) {
var ddlSource = document.getElementById('ddlSource');
if (HasMultipleItemsSelected() || (ddlSource.value == SOURCE_DIRECTORY) || IsGroupID(ItemID))
{
// don't allow download of multiple selection, or if it's a directory entry,
// or if it's a group
return false;
}
return true;
}
else if ( MenuIndex == POPUP_MENU_ID_SEND_VCARD )
{
var ddlSource = document.getElementById('ddlSource');
if ( HasMultipleItemsSelected() || (ddlSource.value == SOURCE_DIRECTORY) || IsGroupID(ItemID) )
{
return false;
}
return true;
}
else
{
return ItemID.toUpperCase() != 'TREMPTY';
}
}
function ProcessPopUp(Action)
{
gSelectedIM.AddItem(gPopupItemID);
switch (Action)
{
case 'Delete':
PopUp_HideMenu('menudiv');
if (gSelectedIM.ItemExists(gPopupItemID))
{
// we're acting on a selected list
DeleteSelectedListItems();
}
else
{
// just delete the contact under the right mouse click
HideDetails();
DataItemList_UnselectAllRows(LIST_ID);
DataItemList_SelectRow(LIST_ID, gPopupItemID);
DeleteListItem(gPopupItemID);
}
break;
case 'Email':
PopUp_HideMenu('menudiv');
if (gSelectedIM.ItemExists(gPopupItemID))
{
EmailSelectedContacts();
}
else
{
// just email the contact under the mouse click
EmailContact(gPopupItemID);
}
break;
case 'Download':
PopUp_HideMenu('menudiv');
DownloadSource(gPopupItemID);
break;
case 'SendAsVCard':
PopUp_HideMenu('menudiv');
SendAsVCard(gPopupItemID);
default:
break;
}
}
function DownloadSource(ContactID)
{
ServerRequest('CONTACT-GETSOURCE', 'ID=' + ContactID, false);
}
function SendAsVCard(ContactID)
{
var sURI = "";
if ( gSourceURI && gSourceURI.length > 0 )
{
sURI = '&URI=' + gSourceURI;
}
getTopAppWindow().ComposeEmail("", "..", "&Mode=AttachVCard&ContactID=" + ContactID + sURI);
}
function GetHeaderColStyle(ColName)
{
if (ColName == "Email")
return "dataTable_email";
else if (ColName == "PhoneM")
return "dataTable_phone";
else
return "dataTable_name";
}
function GetHeaderColAltText(ColName)
{
if (ColName == "FullName")
return t_("[ME_TXT-SortByFullName]");
if (ColName == "Nickname")
return t_("[ME_TXT-SortByNickname]");
if (ColName == "Email")
return t_("[ME_TXT-SortByEmailAddress]");
if (ColName == "PhoneM")
return t_("[ME_TXT-SortByCellPhone]");
return "";
}
function SetColumnStyles(arrTableColumns, SourceType, iView)
{
var iNumColumns = 0;
// First need to clear the arrTableColumns{}
ClearAsocArr(arrTableColumns);
if (!iView || iView != 1)
{
if (SourceType == SOURCE_ADDRESSBOOK) {
// Set columns for our own contacts
DataItemList_AddTableColumn(0, arrTableColumns, '', 'SelectAll', 'left', 'dataTable_tickbox', 'dataTable_tickbox', '', t_('[ME_TXT-Select/DeselectAll]'), 'SelectAll', 'Source=' + SourceType + '&Groups=1');
DataItemList_AddTableColumn(1, arrTableColumns, 'ContactGroup', 'ColGroup', 'center', 'dataTable_icon', 'dataTable_icon', '', t_('[ME_TXT-SortByGroup]'), 'ContactGroup', 'Source=' + SourceType + '&Groups=1');
iNumColumns = 2;
}
else {
// Directory & LDAP sources
iNumColumns = 0;
}
var colIndex = (iNumColumns == 0) ? 0 : iNumColumns;
// N.B. we only want to add the columns that are selected (ticked) in our 'View' dropdown list
var oDropDown = document.getElementById("dropDown_viewOptions");
var oListItem;
var oItems;
var sColName = "";
var numSelected = 0;
var lastSelectedIndex = 0;
if (oDropDown) {
oItems = oDropDown.getElementsByTagName("div");
numSelected = dropDown_GetTickCount("dropDown_viewOptions");
lastSelectedIndex = dropDown_GetLastTickIndex("dropDown_viewOptions");
if (numSelected == 1) // only 1 column selected
{
// we need to make the width of this column 100%
sColName = oItems[lastSelectedIndex].firstChild.id;
DataItemList_AddTableColumn(colIndex, arrTableColumns, sColName, sColName, '', "dataTable_noWidth", "dataTable_noWidth", GetViewOptionName(sColName), GetHeaderColAltText(sColName), 'Label', 'Source=' + SourceType + '&Groups=1');
}
else {
for (var i = 0; i < oItems.length; i++) {
oListItem = oItems[i].firstChild;
sColName = oListItem.id;
if (oListItem.className.indexOf(DROPDOWN_TICK_CLASS) != -1) {
if (i == lastSelectedIndex) // last column (so we make width 100%)
{
DataItemList_AddTableColumn(colIndex, arrTableColumns, sColName, sColName, '', "dataTable_noWidth", "dataTable_noWidth", GetViewOptionName(sColName), GetHeaderColAltText(sColName), 'Label', 'Source=' + SourceType + '&Groups=1');
}
else {
DataItemList_AddTableColumn(colIndex, arrTableColumns, sColName, sColName, '', GetHeaderColStyle(sColName), GetHeaderColStyle(sColName), GetViewOptionName(sColName), GetHeaderColAltText(sColName), 'Label', 'Source=' + SourceType + '&Groups=1');
}
colIndex++;
}
}
}
}
iNumColumns += numSelected;
}
else {
//alternate view
DataItemList_AddTableColumn(0, arrTableColumns, 'Received', 'ContactView', '', '', '', t_('[ME_TXT-Summary]'), t_('[ME_TXT-SortByReceivedDate]'), 'ContactView');
iNumColumns = 1;
}
return iNumColumns;
}
function InitCols(SourceType, iView)
{
gNumDataColumns = SetColumnStyles(arrTableColumns, SourceType, iView);
if ((!iView) || (iView != 1)) {
if (gNumDataColumns < 1 || (SourceType == SOURCE_ADDRESSBOOK && gNumDataColumns <= 2))
{
ShowAlert(t_("[ME_TXT-Error]"), t_("[ME_TXT-YouNeedToSelectAtLeast1Column]"), true);
return 0;
}
}
DataItemList_RenderColumnHeaders(LIST_ID, gNumDataColumns, arrTableColumns);
return 1;
}
function ToggleSortOrder()
{
if (gSortOrder == 'Desc')
{
gSortOrder = 'Asc';
}
else
{
gSortOrder = 'Desc';
}
}
function ConfigureView(iView) {
//
// note: gUnitScrollLength adjusts the number of items per page/list area. If this is too small, the bottom items will overflow. If it is too large, the list will not fill the screen area.
// ie: it needs to match the row height when we render each row (which we determine in DataItemList_DrawRowItem_xxx)
//
if (iView != 1) {
gUnitScrollLength = 26;
} else {
gUnitScrollLength = 52;
}
}
function ConfigureListHeader(iView) {
//
// This moves the list header out of view, so that we can render the summary view without a header column (not sure why we did not just set display none and factor the index offset in depending on whether it is shown)
//
if (iView != 1) {
document.getElementById(LIST_CONTAINER).style.backgroundPosition = "0px 0px";
$("#msgList_container_js").attr('class', 'msgList_container_shell');
} else {
document.getElementById(LIST_CONTAINER).style.backgroundPosition = "0px -50px";
$("#msgList_container_js").attr('class', 'msgList_container_shell_summary');
}
}
function ListContacts(SourceType, sRelativeFolderPath, iView)
{
if (InitCols(SourceType, iView)) {
ConfigureListHeader(iView);
InitLoadList(SourceType, sRelativeFolderPath);
}
}
function SelectSource(SourceType, sRelativeFolderPath)
{
var ddlSource = document.getElementById('ddlSource');
if (!ddlSource) return false;
ddlSource.value = SourceType;
if (SourceType == SOURCE_DIRECTORY) {
DisableDropdownButton("bttn_toolbar_new", BTTN_FLOAT_LEFT);
DisableToolbarButton("bttn_toolbar_delete");
DisableToolbarButton("bttn_toolbar_import", BTTN_FLOAT_RIGHT);
<% If AllowExportContacts() Then %>
DisableToolbarButton("bttn_toolbar_export", BTTN_FLOAT_RIGHT);
<% End If %>
}
ListContacts(SourceType, sRelativeFolderPath, CurrentViewType());
}
function SelectShare(URI)
{
gSourceURI = URI;
SetControlState('ddlSharedContacts', true); // Enable the dropdown for Shared Contacts
SelectListItemByValue('ddlSharedContacts', URI); // Select the share
SelectListItemByValue('ddlSource', SOURCE_ADDRESSBOOK); // select our Contacts as source
InitLoadList(SOURCE_ADDRESSBOOK); // Reload the list
}
function SelectMyContacts(sRelativeFolderPath)
{
//we need to work out whether or not to reload the contacts folder or not
if (sRelativeFolderPath)
{
gSourceURI = sRelativeFolderPath;
}
var bReloadContacts = false;
if (document.getElementById('ddlSource').value == SOURCE_DIRECTORY)
{
SelectListItemByValue('ddlSource', SOURCE_ADDRESSBOOK);
bReloadContacts = true;
}
else
{
if (!((IsDefaultContactFolder(sRelativeFolderPath) && document.getElementById('ddlSharedContacts').value == 'Mine') || (document.getElementById('ddlSharedContacts').value == sRelativeFolderPath)))
{
bReloadContacts = true; //reload if the selected folder does not match the selected drop down
}
}
if (bReloadContacts)
{
SetControlState('ddlSharedContacts', true); // Enable the dropdown for Shared Contacts
if (IsDefaultContactFolder(sRelativeFolderPath))
{
SelectListItemByValue('ddlSharedContacts', 'Mine');
}
else
{
SelectListItemByValue('ddlSharedContacts', sRelativeFolderPath);
}
SelectSource(SOURCE_ADDRESSBOOK, sRelativeFolderPath);
}
}
function ShareChanged()
{
var ddlSharedContacts = document.getElementById('ddlSharedContacts');
if (!ddlSharedContacts) return false;
var sURI = ddlSharedContacts.value;
if (sURI.indexOf(':') != -1)
{
if (!getTopAppWindow().HasAccessToShare(sURI))
{
ShowAlert(t_("[ME_TXT-Error]"), t_("[ME_TXT-Youarenotpermittedtoaccessthisshare!Tryreconnectingtotheshare.]"));
}
}
else
{
if (sURI == 'Mine')
{
sURI = '';
}
}
gSourceURI = sURI;
if (document.getElementById('ddlSource').value != SOURCE_ADDRESSBOOK) {
// source is currently Global Address List; so we need to select our Contacts as source
SelectListItemByValue('ddlSource', SOURCE_ADDRESSBOOK);
}
InitLoadList(SOURCE_ADDRESSBOOK);
}
function CurrentViewType() {
var taw = getTopAppWindow();
if (taw)
{
if (taw.g_opt['AllowContactViews'])
{
return (taw.gOptions['ContactViewType'] == '1') ? 1 : 0;
}
else
{
return -1; //not enabled/visible
}
}
return 0;
}
function CurrentSourceType()
{
// if (gOptionsMode == 'Options')
// {
// return SOURCE_DIRECTORY;
// }
if ( document.getElementById('ddlSource').value )
{
return parseInt( document.getElementById('ddlSource').value );
}
}
function MsgListRowSelect(MessageID, ctrlKeyDown, shiftKeyDown)
{
if ((MessageID == undefined) || (MessageID.length <= 0))
{
return false;
}
var iSelectedIndex = -1;
if ( ctrlKeyDown ) // Control key is down
{
if ( document.getElementById(MessageID).className == LIST_ROW_STYLE_SELECTED )
{
// Item already previously selected; hence we unselect it
DataItemList_UnselectRow(LIST_ID, MessageID);
}
else
{
DataItemList_SelectRow(LIST_ID, MessageID, DataItemList_GetRowData(LIST_ID, MessageID));
}
HideDetails();
}
else if ( shiftKeyDown ) // Shift key is down
{
iSelectedIndex = DataItemList_GetRowIndexByID(LIST_ID, MessageID);
DataItemList_UnselectAllRows(LIST_ID);
//var sPrompt = t_("[ME_TXT-ShiftMultiSelectDetected]") + "\n\n" + t_("[ME_TXT-OnlyViewableItemsAreSelected]") + "\n\n" + t_("[ME_TXT-IfYouWishToMultiSelectItemsUseCtrlKey]");
//ShowNotification(sPrompt, true);
if (iSelectedIndex < 0) iSelectedIndex = 0;
if (gFirstSelectedIndex < 0) gFirstSelectedIndex = 0;
if ( iSelectedIndex > gFirstSelectedIndex )
{
DataItemList_SelectRows(LIST_ID, gFirstSelectedIndex, iSelectedIndex);
}
else
{
DataItemList_SelectRows(LIST_ID, iSelectedIndex, gFirstSelectedIndex);
}
HideDetails();
}
else
{
// Unselect all the contacts in the list
DataItemList_UnselectAllRows(LIST_ID);
// now highlight/select the row clicked
DataItemList_SelectRow(LIST_ID, MessageID, DataItemList_GetRowData(LIST_ID, MessageID));
iSelectedIndex = DataItemList_GetRowIndexByID(LIST_ID, MessageID);
}
if (gSelectedIM.GetSize() == gTotalItems)
{
SetSelectAllCheckbox(true);
}
else
{
SetSelectAllCheckbox(false);
}
if (gBrowserType == BROWSER_TYPE_SAFARI)
{
iSelectedIndex = DataItemList_GetRowIndexByID(LIST_ID, MessageID);
gFirstSelectedIndex = iSelectedIndex;
}
if (!ctrlKeyDown && !shiftKeyDown) {
// get contact details
clearTimeout(gGetContactDelayTimeout);
if (gAllowContactGet)
{
GetContactDetails(MessageID, CurrentSourceType());
gGetContactDelayTimeout = setTimeout(function() {
gAllowContactGet = true; }, 1000);
}
else
{
gGetContactDelayTimeout = setTimeout(function() {
GetContactDetails(MessageID, CurrentSourceType());
gAllowContactGet = true; }, 1000);
}
// disallow further contact gets for a time
gAllowContactGet = false;
}
gItemsArrayCurrIndex = ItemsArray_GetCurrIndex(MessageID);
SetActionButtonsStatus();
gListItemSelected = true;
window.status = gSelectedIM.GetSize() + " " + t_("[ME_TXT-Selected]");
}
function DataItemList_GetRowData(ListID, ItemID)
{
var objData = null;
var oItemProps = ItemsArray_GetItem(ItemID);
if (oItemProps) {
objData = { email: oItemProps.Email };
}
return objData;
}
function DataItemList_SelectAllCheckboxCallback(UID)
{
var oChkSelectAll = document.getElementById(UID);
if (oChkSelectAll)
{
if (oChkSelectAll.checked)
{
SelectAllItemIDs();
}
else
{
gExtData = "";
DataItemList_UnselectAllRows(LIST_ID);
SetActionButtonsStatus();
}
window.status = gSelectedIM.GetSize() + " " + t_("[ME_TXT-Selected]");
}
}
function DataItemList_CheckboxCallback(UID)
{
// At this stage the checkbox checked status
// would have already been changed, so
// we need to do any other post cleanup stuff here...
HideDetails(); // always hide the details panel when the checkbox is toggled.
if (gSelectedIM.GetSize() == gTotalItems)
{
SetSelectAllCheckbox(true);
}
else
{
SetSelectAllCheckbox(false);
}
SetActionButtonsStatus();
window.status = gSelectedIM.GetSize() + " " + t_("[ME_TXT-Selected]");
}
function SetSelectAllCheckbox(IsSelected)
{
var oChkSelectAll = document.getElementById(LIST_ID + '_SelectAll');
if (oChkSelectAll)
{
oChkSelectAll.checked = IsSelected;
}
gIsSelectAll = IsSelected;
if (IsSelected)
{
HideDetails();
}
// now return focus back onto the list; so that key events can be fired on the list
SetFieldFocus(LIST_ID);
}
function SelectAllItemIDs()
{
gExtData = "&Mode=SELECT-ALL"; // used on sort function
// let's pop up a wait dialog (busy) before we go off to the server to get the list of messages
getTopAppWindow().Async_LockUI(t_("[ME_TXT-Pleasewait]") + "...");
setTimeout('GetAllServerSelectedIDs()', 200); // wait for a bit; we have to do this in order for the dialog to show up
}
function GetContactDetails(MessageID, SourceType)
{
var sCommand = 'GET-CONTACT';
switch (SourceType)
{
case SOURCE_ADDRESSBOOK:
var sURI='';
var FindPos = ItemsArray_Find(MessageID);
if ( oItemsArray && FindPos != -1 )
{
sURI = oItemsArray[FindPos].URI;
var sClass = oItemsArray[FindPos].Class;
if (sClass == 'ContactGroup')
{
sCommand = 'GET-CONTACTGROUP';
}
}
if (sURI)
{
gSourceURI = sURI;
}
getTopAppWindow().Async_LockUI(t_("[ME_TXT-Loading]") + "...");
window.setTimeout(function() { ServerRequest(sCommand, 'ID=' + MessageID + '&ListMode=1', false); }, 200);
break;
case SOURCE_DIRECTORY:
getTopAppWindow().Async_LockUI(t_("[ME_TXT-Loading]") + "...");
window.setTimeout(function() { ServerRequest(sCommand, 'ID=' + MessageID + '&Folder=' + escape('$DIRECTORY'), false); }, 200);
break;
}
}
function ContactDetailsShowing()
{
return document.getElementById('divContactDetails').style.display != 'none';
}
function ContactGroupDetailsShowing()
{
return document.getElementById('divGroupDetails').style.display != 'none';
}
function SetGroupDetailsSelectAllChkbox()
{
if (GetNumRows(TABLE_MEMBERS_BODY_ID, MODE_COUNT_SELECTED_ONLY) == 0)
{
DisableGroupRemoveBttn();
}
if (GetNumRows(TABLE_ALL_BODY_ID, MODE_COUNT_SELECTED_ONLY) == 0)
{
DisableGroupAddBttn();
}
}
function ShowGroupDetails()
{
HideContactDetails();
if ( document.getElementById('divGroupDetails') )
{
document.getElementById('divGroupDetails').style.display = "";
//Bttn shell centered Width
//var bttn_add_w = document.getElementById("bttn_add_js").clientWidth;
//var bttn_remove_w = document.getElementById("bttn_remove_js").clientWidth;
var bttn_add_w = $('#bttn_add_js').outerWidth();
var bttn_remove_w = $('#bttn_remove_js').outerWidth();
document.getElementById("bttn_shell_addRemove_js").style.width = (bttn_add_w + bttn_remove_w) + 14 + "px";
}
}
function ContactListShowing()
{
return document.getElementById(LIST_CONTAINER).style.display != 'none';
}
function ShowContactDetails()
{
HideGroupDetails();
if ( document.getElementById('divContactDetails') )
{
document.getElementById('divContactDetails').style.display = "";
}
}
function HideContactDetails()
{
if ( document.getElementById('divContactDetails') )
{
document.getElementById('divContactDetails').style.display = "none";
}
}
function HideGroupDetails()
{
if ( document.getElementById('divGroupDetails') )
{
document.getElementById('divGroupDetails').style.display = "none";
}
}
function HideDetails()
{
HideContactDetails();
HideGroupDetails();
}
function ShowImport()
{
oImportDialog.Show();
}
function ShowActionButtons()
{
if ( document.getElementById('divContactActions') )
{
document.getElementById('divContactActions').style.display = "";
}
}
function HideActionButtons()
{
if ( document.getElementById('divContactActions') )
{
document.getElementById('divContactActions').style.display = "none";
}
}
function SetMode(Mode)
{
gMode = Mode;
if (Mode == MODE_ADD)
{
SetOKButtonText("btnSave", t_("[ME_TXT-Add]"));
PrepareForNewContact();
}
else if (Mode == MODE_EDIT)
{
SetOKButtonText("btnSave", t_("[ME_TXT-Save]"));
PrepareToEditContact();
}
}
function MakeEditable(Editable)
{
var bReadOnly = !Editable;
SetFieldsReadOnly(bReadOnly);
SetPhotoEditVisibility((bReadOnly)? 'hidden': 'visible');
if (Editable == true)
{
document.getElementById("btnSave").style.display = "block";
document.getElementById("btnCancel").style.display = "block";
}
else
{
document.getElementById("btnSave").style.display = "none";
document.getElementById("btnCancel").style.display = "none";
}
}
function SetFieldsReadOnly(bReadOnly)
{
// jquery < 1.9
// general details
$('#contact_title, #contact_firstName, #contact_middleName, #contact_lastName, #contact_fullName, #contact_nickName, #contact_email, #contact_messenger').attr('readonly', bReadOnly);
// personal details
$('#contact_phone_H, #contact_phone_M, #contact_phone_W, #contact_pager, #contact_email_other, #contact_address, #contact_locality, #contact_state, #contact_postcode, #contact_country').attr('readonly', bReadOnly);
// company details
$('#contact_company, #contact_compFax, #contact_compHomepage').attr('readonly', bReadOnly);
// company address fields
try
{
$('#contact_homeAddress, #contact_homeLocality, #contact_homeState, #contact_homePostcode, #contact_homeCountry').attr('readonly', bReadOnly);
}
catch (ex) { }
try
{
$('#contact_otherAddress, #contact_otherLocality, #contact_otherState, #contact_otherPostcode, #contact_otherCountry').attr('readonly', bReadOnly);
}
catch (ex) { }
// end company address fields, Notes
$('#contact_compDepartment, #contact_compTitle, #contact_compAssistant, #contact_email_work, #contact_notes').attr('readonly', bReadOnly);
arrDatePickers['birthdayPicker'].setDisabled(bReadOnly);
}
function GetListData(SourceType, ExtraData)
{
// This function goes to the server to retrieve our list of contacts data
// for the selected source type and page.
if (!ExtraData || (ExtraData == undefined))
ExtraData = "";
var fnRequest = null;
var page = (gSecondPageNum)? gSecondPageNum: 1;
switch (SourceType)
{
case SOURCE_ADDRESSBOOK:
gListParams = 'Source=' + SOURCE_ADDRESSBOOK + '&Groups=1';
fnRequest = function() {
var ajaxResult = ServerRequest('LIST-CONTACTS', 'Source=' + SOURCE_ADDRESSBOOK + gSearchStr + '&IPP=' + gDataPageSize + '&Page=' + page + '&Groups=1&SortField=' + gSortColumn + '&SortOrder=' + gSortOrder + ExtraData, false);
if (!ajaxResult) getTopAppWindow().HandleAjaxError();
ListGroups();
};
break;
case SOURCE_DIRECTORY:
gListParams = 'Source=' + SOURCE_DIRECTORY + '&Groups=1';
fnRequest = function() {
var ajaxResult = ServerRequest('LIST-CONTACTS', 'Source=' + SOURCE_DIRECTORY + gSearchStr + '&IPP=' + gDataPageSize + '&Page=' + page + '&SortField=' + gSortColumn + '&SortOrder=' + gSortOrder + ExtraData, false);
if (!ajaxResult) getTopAppWindow().HandleAjaxError();
gTotalGroups = 0;
getTopAppWindow().SetStatusBarValues(getTopAppWindow().VIEW_CONTACTS, gTotalItems, gTotalGroups);
};
break;
case SOURCE_LDAP:
gListParams = 'Source=' + SOURCE_LDAP + '&Groups=1';
fnRequest = function() {
var ajaxResult = ServerRequest('LIST-CONTACTS', 'Source=' + SOURCE_LDAP + gSearchStr + '&IPP=' + gDataPageSize + '&Page=' + page + '&SortField=' + gSortColumn + '&SortOrder=' + gSortOrder + ExtraData, false);
if (!ajaxResult) getTopAppWindow().HandleAjaxError();
ListGroups();
};
break;
}
getTopAppWindow().Async_LockUI(t_("[ME_TXT-LoadingContacts]") + "...");
setTimeout(fnRequest, 200);
}
function ListAddressBook(SourceType)
{
ServerRequest('LIST-ADDRESSBOOK', 'Source=' + SourceType + '&Columns=FullName,Email', false);
}
function GetAllServerSelectedIDs()
{
GetListData(CurrentSourceType(), "&Mode=SELECT-ALL");
}
function ListGroups()
{
ServerRequest('LIST-CONTACTGROUPS', '', false);
}
function ClearItemsArray()
{
iItemsArraySize = 0;
oItemsArray = new Array(iItemsArraySize); //we cant have any items in the items array if there are no items in the
return true;
}
function RefreshList(SourceType)
{
if (SourceType == undefined)
{
SourceType = CurrentSourceType();
}
gListFirstLoad = false;
ClearItemsArray();
GetListData(SourceType); // refresh list
ListAddressBook(SourceType); // refresh the Group Members addressbook
}
function InitLoadList(SourceType,RelativeFolderPath)
{
//
// This function retrieves the list of contacts from the server (from first page).
//
gListFirstLoad = true; // this should cause 'gSelectedIM.Clear()' to be called
gSecondPageNum = 0
HideDetails();
// disable the shared dropdown if need be
if (SourceType == SOURCE_DIRECTORY) { // global address list
document.getElementById("ddlSharedContacts").disabled = true;
}
else {
document.getElementById("ddlSharedContacts").disabled = false;
}
GetListData(SourceType);
}
function AddGroup(GroupName)
{
if (GroupName && (GroupName.length > 0))
{
// now we can issue a commmand to create the group
gSourceURI = GetListItemValue('ddlSharedContacts');
if (gSourceURI == 'Mine')
{
gSourceURI = '';
}
var sData = 'ObjectType=Group&GroupName=' + encodeURIComponent(GroupName);
ServerRequest('ADD-CONTACTGROUP', sData, false);
}
}
function AddContactGroup()
{
gContactID = "";
oInputDialog.Prompt(t_("[ME_TXT-NewGroup]"), "Please enter the name of the group you wish to create...", t_("[ME_TXT-GroupName]") + ":", t_("[ME_TXT-NewGroup]"), function (GroupName){ AddGroup(GroupName); });
}
function AddContact()
{
gContactID = "";
DataItemList_UnselectAllRows(LIST_ID);
ShowContactDetails();
ClearContactDetails();
SelectTab("tab1");
SetMode(MODE_ADD);
MakeEditable(true);
// We need to hide the 'Add / Edit Image...' button
// because this contact has not yet been created (VCF file doesn't exist)
// so if a user tries to add a photo to the VCF (not yet created) it will result in an error.
SetPhotoEditVisibility('hidden');
DataItemList_ToggleKeyNavigation(false);
SetFieldFocus('contact_fullName');
}
function DAVImport(sSource,sDAVURL,sUserName,sPassword,sTargetFolder)
{
try {
var oResult = {};
var sResult = '';
getTopAppWindow().LIBAjax_InlineRequest("IMPORT-FOLDER", "Protocol=" + sSource + "&Source=" + encodeURIComponent(sDAVURL) + "&SourceUserName=" + encodeURIComponent(sUserName) + "&SourcePassword=" + encodeURIComponent(sPassword), oResult);
getTopAppWindow().HideWait();
if (oResult.responseXML)
{
var BaseNode = oResult.responseXML.getElementsByTagName("BASEELEMENT")[0];
if (BaseNode)
{
sResult = GetXMLValue(BaseNode.getElementsByTagName('RETURNVALUE')[0]);
}
if (sResult != '1')
{
oImportDialog.Show();
try {
alert( t_('[ME_TXT-Error]') + ': ' + GetXMLValue(BaseNode.getElementsByTagName('ERROR_DESCRIPTION')[0]));
} catch(ex) {
alert(t_('[ME_TXT-InvalidData]'));
}
}
else
{
RefreshList(CurrentSourceType());
}
}
} catch(ex) {alert(t_('[ME_TXT-Error]') + ':' + ex.message); oImportDialog.Show();}
}
function ImportContacts()
{
try
{
var sFormat = document.getElementById("lstImportFormat").value;
if (sFormat == 'CardDAV')
{
if ($("#txtDAVUserName").val() == null || $("#txtDAVUserName").val() == '') {
alert(t_('[ME_TXT-Youmustenterausername]'));
} else if ($("#txtDAVPassword").val() == null || $("#txtDAVPassword").val() == '') {
alert(t_('[ME_TXT-Youmustenterapassword]'));
} else if (!validateURL($("#txtDAVURL").val())) {
alert(t_('[ME_TXT-DAVURLInvalid]'));
} else {
oImportDialog.Hide();
getTopAppWindow().ShowWait(t_("[ME_TXT-Pleasewait]") + "...");
//issue the import after two seconds, so that the UI updates.
setTimeout(function() {DAVImport('CardDAV',$("#txtDAVURL").val(),$("#txtDAVUserName").val(), $("#txtDAVPassword").val());}, 2000);
}
}
else
{
var oFile = document.getElementById("fileImport");
if (oFile.value == 0)
{
ShowAlert(t_("[ME_TXT-Error]"), t_("[ME_TXT-MustSelectCSVFileBeforeUpload]"), true);
}
else
{
var oFrmImport = document.getElementById("frmImport");
document.getElementById("ME_SOURCE_URI").value = gSourceURI;
getTopAppWindow().Async_LockUI(t_("[ME_TXT-Pleasewait]") + "...");
window.setTimeout(function() { oFrmImport.submit(); }, 200);
}
}
}
catch (ex) { }
}
function ExportContacts()
{
ServerRequest('CONTACT-GETLISTASCSV', 'ME_SID=' + readCookie('MailEnable-SessionId'), false);
}
function GetEmailAddr(ContactID)
{
var oItemProps = ItemsArray_GetItem(ContactID);
if (oItemProps)
return oItemProps.Email;
else
return "";
}
function EmailContact(ContactID)
{
var sAddr = GetEmailAddr(ContactID);
getTopAppWindow().ComposeEmail(sAddr, "..");
}
function EmailSelectedContacts()
{
// Get the selected email addresses
var sAddresses = "";
var objData;
var items = gSelectedIM.GetItems();
var count = 0;
var sb = new StringBuffer();
for (var id in items)
{
objData = gSelectedIM.GetItem(id);
if (objData != null)
{
email = objData.email;
if (email && email.length > 0)
{
if (count > 0)
{
sb.append("; ");
}
sb.append(email);
count++;
}
}
}
sAddresses = sb.toString();
getTopAppWindow().ComposeEmail(sAddresses, "..");
}
// This function handles the DEL key event and performs a delete on a single selected item in the list.
function DeleteListItem(ItemID)
{
if ( CurrentSourceType() == SOURCE_ADDRESSBOOK )
{
if (gAccessMode == ACCESS_MODE_FULL)
{
if (gListItemSelected == true)
{
oConfirmationDialog.Confirm(t_("[ME_TXT-ConfirmDelete]"), t_("[ME_TXT-Deletethecurrentlyselectedcontact?]"), function (){ DeleteContact(ItemID); }, true, function () { SetFieldFocus(LIST_ID); });
}
}
else
{
ShowAlert(t_("[ME_TXT-Error]"), t_("[ME_TXT-NotPermittedToDeleteContact]"), true);
}
}
}
// This function handles the DEL (delete) key event.
// It performs the delete on the selected items in the list (i.e. those highlighted rows).
function DeleteSelectedListItems()
{
if (gSelectedIM.GetSize() == 0) {
return;
}
if (gAccessMode == ACCESS_MODE_FULL)
{
oConfirmationDialog.Confirm(t_("[ME_TXT-ConfirmDelete]"), t_("[ME_TXT-Deletetheselected(highlighted)contacts?]"), function (){ setTimeout("DeleteHighlightedContacts()", 200); }, true, function () { SetFieldFocus(LIST_ID); });
}
else
{
ShowAlert(t_("[ME_TXT-Error]"), t_("[ME_TXT-NotPermittedToDeleteContact]"), true);
}
}
function DeleteContact(ItemID)
{
var FindPos = ItemsArray_Find(ItemID);
var ObjectType='CONTACT'
if ( oItemsArray && FindPos != -1 )
{
var sClass = oItemsArray[FindPos].Class;
if (sClass == 'ContactGroup')
{
ObjectType = 'CONTACTGROUP';
}
}
ServerRequest('DELETE-' + ObjectType, 'ID=' + ItemID, false);
}
function GetSelectedIDs(MaxItems, Extension)
{
var sData = "";
var count = 0;
var sb = new StringBuffer();
var items = gSelectedIM.GetItems();
for (var id in items)
{
if (id.toUpperCase().match(Extension))
{
if (count > 0)
{
sb.append(",");
}
sb.append(id);
count++;
}
if ( MaxItems && (count == MaxItems) )
{
break; // get out; we've done enough damage
}
}
sData = sb.toString();
return sData;
}
function GetSelectedContactIDs(MaxItems)
{
return GetSelectedIDs(MaxItems, ".VCF")
}
function GetSelectedGroupIDs(MaxItems)
{
return GetSelectedIDs(MaxItems, ".GRP")
}
function DeleteNextSelectedBatch(MaxItems)
{
// we need to build a seperate list for wach of the object type supported
var sContactData = 'ID=';
var sContactGroupData = 'ID=';
var ajaxResult = 1;
sContactData += GetSelectedContactIDs(MaxItems);
sContactGroupData += GetSelectedGroupIDs(MaxItems);
if (sContactData.length > 3)
{
ajaxResult = ServerRequest("DELETE-CONTACT", sContactData, false);
}
else
{
getTopAppWindow().Async_UnlockUI(); // get rid of the gui lock (but return AJAX success, because it was not to blame)
}
return ajaxResult;
}
var MAX_DELETE_ITEMS = 20;
function DeleteHighlightedContacts()
{
var sSelectedItemID;
var iTopIndex;
var iSelectedIndex;
var iCurrIndex;
var oList;
oList = document.getElementById(LIST_ID);
if ( !oList )
{
return false;
}
if (gSelectedIM.GetSize() > MAX_DELETE_ITEMS)
{
// we need to split up the list into batches and perform deletes on those batches
gSelectedIM.SetCallback( function () { DeleteNextSelectedBatch(MAX_DELETE_ITEMS) } );
getTopAppWindow().Async_LockUI(t_('[ME_TXT-Pleasewaitwhiletheitemsaredeleted]') + '...');
gKeepShowingWait = true;
window.setTimeout(function() {
var ajaxResult = DeleteNextSelectedBatch(MAX_DELETE_ITEMS);
if (!ajaxResult) getTopAppWindow().HandleAjaxError();
}, 200); // delete the first batch
}
else
{
// number selected is less than MAX_DELETE_ITEMS
var sContactData = 'ID=';
var sContactGroupData = 'ID=';
sContactData += GetSelectedContactIDs(MAX_DELETE_ITEMS);
sContactGroupData += GetSelectedGroupIDs(MAX_DELETE_ITEMS);
getTopAppWindow().Async_LockUI(t_('[ME_TXT-Pleasewaitwhiletheitemsaredeleted]') + '...');
if (sContactData.length > 3)
{
var ajaxResult = ServerRequest("DELETE-CONTACT", sContactData, false);
if (!ajaxResult) getTopAppWindow().HandleAjaxError();
}
else if (sContactGroupData.length > 3)
{
DeleteSelectedGroups();
}
}
}
function GroupExistsInSelection()
{
return ItemExistsInSelection(".GRP");
}
function ContactExistsInSelection()
{
return ItemExistsInSelection(".VCF");
}
function ItemExistsInSelection(Extension)
{
var items = gSelectedIM.GetItems();
var bFound = false;
for (var id in items)
{
if (id.toUpperCase().match(Extension))
{
bFound = true;
break;
}
}
return bFound;
}
function DeleteSelectedGroups()
{
var sContactGroupData = 'ID=';
var ajaxResult = 1;
sContactGroupData += GetSelectedGroupIDs();
if (sContactGroupData.length > 3)
{
ajaxResult = ServerRequest("DELETE-CONTACTGROUP", sContactGroupData, false);
if (!ajaxResult) getTopAppWindow().HandleAjaxError();
}
return ajaxResult;
}
function RefreshContactDetails()
{
var now = new Date();
// change the source of the contact
var sPhotoURL = getAppServletURL() + '?Cmd=GET-CONTACT&Folder=/Contacts&ID=' + gContactID + '&Options=PHOTO&TS=' + now.getTime();
sPhotoURL += '&ME_SID=' + readCookie('MailEnable-SessionId');
sPhotoURL += '&ME_VALIDATIONTOKEN=' + getTopAppWindow().g_opt['ME_VALIDATIONTOKEN'];
SetImgSource('imgPhoto', sPhotoURL);
}
function SaveContactDetails(FileName)
{
if ( IsValidFields() )
{
var ContactID = gContactID;
var bIsDirectoryEntry = false;
if (CurrentSourceType() == SOURCE_DIRECTORY)
{
ContactID = "[" + mMailbox + "]";
bIsDirectoryEntry = true;
}
var sData = GetContactDetailsDataString(ContactID, arrDatePickers['birthdayPicker'], CurrentSourceType());
if (FileName) {
sData += "&Photo=" + FileName;
}
var Command = 'EDIT-CONTACT';
if ( gMode == MODE_ADD )
{
Command = 'ADD-CONTACT';
}
// N.B. if this is a global address list entry, then we need to pass up the
// 'Publish' request variable, otherwise it will get removed from the directory
if (bIsDirectoryEntry)
{
sData += "&Publish=1";
}
ServerRequest(Command, sData, false);
}
}
function ListBlur()
{
gListItemSelected = false;
DataItemList_ToggleKeyNavigation(false);
}
function CopySelectedMessages(ListID, Folder)
{
// Empty implementation function needed by the KeyNavigation library...we don't actually support
// copy action on contacts.
}
function PasteMessages(Folder)
{
// Empty implementation function needed by the KeyNavigation library...we don't actually support
// copy/paste action on contacts.
}
function GetSelectedFolderPath()
{
// Empty implementation function needed by the KeyNavigation library
return '/Contacts';
}
function ViewListItem(ItemID)
{
// This function is required by the KeyNavigation library to handle the ENTER keypress event.
return false;
}
function SetContactActionButtonAltText(ButtonID, Text)
{
var oLnkBut = document.getElementById(ButtonID);
if (!oLnkBut) return false;
oLnkBut.title = Text;
// This is a link button possibly with an image childnode and
// other childnodes (e.g. text), so we need to iterate through
// the child nodes.
for (i=0; i < oLnkBut.childNodes.length; i++)
{
var oChild = oLnkBut.childNodes[i];
if (oChild.nodeType == ELEMENT_NODE_TYPE) // not a text node
{
oChild.alt = Text;
oChild.title = Text;
}
}
}
function DownloadSelectedContact()
{
var items = gSelectedIM.GetItems();
if (Object.keys && Object.keys(items).length == 1) {
DownloadSource(Object.keys(items)[0]);
}
}
function SetActionButtonsStatus()
{
if (gAccessMode == ACCESS_MODE_READ)
{
DisableDropdownButton("bttn_toolbar_new", BTTN_FLOAT_LEFT);
DisableToolbarButton("bttn_toolbar_delete");
DisableToolbarButton("bttn_toolbar_import", BTTN_FLOAT_RIGHT);
}
else // FULL ACCESS mode
{
if (CurrentSourceType() != SOURCE_DIRECTORY)
{
EnableDropdownButton("bttn_toolbar_new", function() { dropDown_toggleDisplay('dropDown_new'); }, BTTN_FLOAT_LEFT);
EnableToolbarButton("bttn_toolbar_import", function() { ShowImport(); }, BTTN_FLOAT_RIGHT);
<% If AllowExportContacts() Then %>
EnableToolbarButton("bttn_toolbar_export", function() { ExportContacts(); }, BTTN_FLOAT_RIGHT);
<% End If %>
}
}
if (gSelectedIM.GetSize() > 0)
{
// enable the email and Delete buttons
EnableToolbarButton("bttn_toolbar_email", function() { EmailSelectedContacts(); });
EnableToolbarButton("bttn_toolbar_downloadSource", function() { DownloadSelectedContact(); });
if (CurrentSourceType() != SOURCE_DIRECTORY)
{
EnableToolbarButton("bttn_toolbar_delete", function() { DeleteSelectedListItems(); });
}
}
else
{
// disable the Email and Delete buttons because nothing is selected
DisableToolbarButton("bttn_toolbar_email");
DisableToolbarButton("bttn_toolbar_downloadSource");
DisableToolbarButton("bttn_toolbar_delete");
}
}
function LogOff()
{
getTopAppWindow().SetOption('WebMail-ContactsListHeight', gMsgListHeight, false);
}
function GetMappingDataArray(TableID)
{
// Returns an associative array { Fullname:ContactID }
var oTable = document.getElementById(TableID);
var arr = {};
var key, value = "";
if (!oTable) return null;
var oRows = oTable.getElementsByTagName("TBODY")[0].childNodes;
var oDataRow = null;
for (var i=0; i < oRows.length; i++)
{
oDataRow = oRows[i].getElementsByTagName("TBODY")[0].getElementsByTagName("TR")[0];
key = GetElementText(oDataRow.childNodes[1].childNodes[0]); // Fullname
value = GetContactIDFromRowID(TableID, oRows[i].id); // ContactID
if (key.length == 0) // no Fullname
{
key = "[n_" + i + "]";
}
arr[key] = value;
}
return arr;
}
function GetDataArray(TableID, Mode)
{
// Returns an associative array (FullName:Email) of all rows in the list
var oTable = document.getElementById(TableID);
var arr = {};
var key, value = "";
if (!oTable) return null;
var oRows = oTable.getElementsByTagName("TBODY")[0].childNodes;
var oDataRow = null;
for (var i=0; i < oRows.length; i++)
{
oDataRow = oRows[i].getElementsByTagName("TBODY")[0].getElementsByTagName("TR")[0];
key = GetElementText(oDataRow.childNodes[1].childNodes[0]); // Fullname
value = GetElementText(oDataRow.childNodes[2].childNodes[0]); // Email
if (key.length == 0) // no Fullname
{
key = "[n_" + i + "]";
}
arr[key] = value;
}
return arr;
}
function GetSelectedDataArray(TableID)
{
// Returns an associative array of selected rows data in the specified table
var oTable = document.getElementById(TableID);
if (!oTable) return null;
var oRows = oTable.getElementsByTagName("TBODY")[0].childNodes;
var oDataRow = null;
var key, value = "";
var arr = {};
for (var i=0; i < oRows.length; i++)
{
oDataRow = oRows[i].getElementsByTagName("TBODY")[0].getElementsByTagName("TR")[0];
if (oRows[i].className == ROW_CLASS_SELECTED)
{
key = GetElementText(oDataRow.childNodes[1].childNodes[0]);
value = GetElementText(oDataRow.childNodes[2].childNodes[0]);
arr[key] = value;
}
}
return arr;
}
function ContactIDExistsInGroupList(ContactID)
{
var bExists = false;
var oTable = document.getElementById(TABLE_MEMBERS_BODY_ID);
if (!oTable) return null;
var oRows = oTable.getElementsByTagName("TBODY")[0].childNodes;
var sContactID = "";
for (var i=0; i < oRows.length; i++)
{
sContactID = GetContactIDFromRowID(TABLE_MEMBERS_BODY_ID, oRows[i].id);
if (sContactID == ContactID)
{
bExists = true;
continue;
}
}
return bExists;
}
function AddToGroupMembers()
{
// This function retrieves the selected rows from the 'All Contacts' list and adds
// them to the 'Group Members' list
var oTable = document.getElementById(TABLE_ALL_BODY_ID);
if (!oTable) return null;
var oRows = oTable.getElementsByTagName("TBODY")[0].childNodes;
var oDataRow = null;
var sFullName, sEmail = "";
var sContactID = "";
var countMembers = GetContactMemberListCount(TABLE_MEMBERS_BODY_ID);
var index = countMembers;
for (var i=0; i < oRows.length; i++)
{
oDataRow = oRows[i].getElementsByTagName("TBODY")[0].getElementsByTagName("TR")[0];
if (oRows[i].className == ROW_CLASS_SELECTED)
{
sContactID = GetContactIDFromRowID(TABLE_ALL_BODY_ID, oRows[i].id);
// we only want to add the contact if the group list does not already
// contain it (ContactID)
if ( !ContactIDExistsInGroupList(sContactID) )
{
sFullName = GetElementText(oDataRow.childNodes[1].childNodes[0]);
sEmail = GetElementText(oDataRow.childNodes[2].childNodes[0]);
AddContactMemberRow(TABLE_MEMBERS_BODY_ID, sContactID, sFullName, sEmail, ( index % 2 != 0));
index++;
}
}
}
// unselect everything again
SelectAllRows(TABLE_ALL_BODY_ID, false);
$('#' + TABLE_ALL_HEAD_ID + ' > tbody > tr').find('td:first input').prop('checked', false);
DisableGroupAddBttn();
}
function RemoveRowFromTable(TableID, RowID)
{
var oTable = document.getElementById(TableID);
if (!oTable) return 0;
var oTBody = oTable.getElementsByTagName("TBODY")[0];
var oRow = oTBody.childNodes[0];
var iResult = 0;
var oNext = null;
do
{
oNext = oRow.nextSibling;
if (oRow.id == RowID) {
oNext = oRow.nextSibling;
oTBody.removeChild(oRow);
iResult = 1;
}
oRow = oNext;
} while (oRow);
return iResult;
}
function RemoveFromGroupList(TableID, ContactID)
{
if ( !ContactID.match(".VCF") )
return false;
var RowID = GetRowID(TableID, ContactID);
return RemoveRowFromTable(TableID, RowID);
}
function RemoveFromGroup()
{
// This function removes all the selected rows from the 'Group Members' list.
var oTable = document.getElementById(TABLE_MEMBERS_BODY_ID);
if (!oTable) return null;
var oTBody = oTable.getElementsByTagName("TBODY")[0];
var oRow = oTBody.childNodes[0];
if (!oRow)
return false;
var oNext = oRow.nextSibling;
var bRemoved = false;
do
{
oNext = oRow.nextSibling;
if (oRow.className == ROW_CLASS_SELECTED) {
oNext = oRow.nextSibling;
oTBody.removeChild(oRow);
bRemoved = true;
}
oRow = oNext;
} while (oRow);
// uncheck the Select All checkbox if it was checked
if (bRemoved && document.getElementById('chkSelectAllMembers').checked)
{
document.getElementById('chkSelectAllMembers').checked = false;
}
// re-apply bordered styles to each row in list
ApplyBorderedStyles(TABLE_MEMBERS_BODY_ID);
DisableGroupRemoveBttn();
}
function SaveGroupDetails()
{
var addresses = "";
var oTable = document.getElementById(TABLE_MEMBERS_BODY_ID);
if (!oTable) return null;
var oRows = oTable.getElementsByTagName("TBODY")[0].childNodes;
var sb = new StringBuffer();
var count = 0;
for (var i=0; i < oRows.length; i++)
{
if (count > 0)
{
sb.append(";");
}
sb.append(GetContactIDFromRowID(TABLE_MEMBERS_BODY_ID, oRows[i].id));
count++;
}
addresses = sb.toString();
// issue the update here:
var sGroupName = document.getElementById('group_name').value;
var sData = 'ID=' + gContactID + '&ObjectType=Group&GroupName=' + encodeURIComponent(sGroupName) + '&Members=' + addresses;
ServerRequest('EDIT-CONTACTGROUP', sData, true);
}
function ResetSearchField() {
var txtField = document.getElementById("txtSearch");
if (txtField) {
txtField.value = t_("[ME_TXT-EnterSearchHere]") + "...";
SetSearchFieldInputClass(false);
gContactSearchStrInputed = false;
}
}
function SetSearchFieldInputClass(Enabled) {
// clear the search text field and set applicable style for the input string
var txtField = document.getElementById("txtSearch");
if (txtField) {
if (Enabled)
txtField.parentNode.className = "search_form_normal";
else
txtField.parentNode.className = "search_form_initial";
}
}
function ClearSearchField() {
SetFieldValue("txtSearch", "");
txtSearchChange("txtSearch");
}
function ClearSearch() {
var oSearchField = document.getElementById("txtSearch");
var PrevSearch = oSearchField.value;
if (!gContactSearchStrInputed) {
gContactSearchStrInputed = true;
if (!HasFocus("txtSearch")) {
ClearSearchField();
SetFieldFocus("txtSearch");
SetSearchFieldInputClass(true);
}
}
else {
if (oSearchField && oSearchField.value.length > 0) {
ClearSearchField();
SetFieldFocus("txtSearch");
}
}
if (PrevSearch)
{
// after clearing search term, need to execute the empty search to clear back to the full list
DoSearch();
}
}
function DoSearch()
{
try
{
gSearchStr = "&Filter=" + encodeURIComponent( document.getElementById('txtSearch').value );
}
catch (ex) { }
InitLoadList(CurrentSourceType());
}
function SearchBtnClicked() {
if (!gContactSearchStrInputed) {
gContactSearchStrInputed = true;
ClearSearchField();
SetSearchFieldInputClass(true);
SetFieldFocus("txtSearch");
return true;
}
// otherwise perform the search if we have focus on the text field
DoSearch();
}
function txtSearchClick() {
// handles the click event on the search text field
if (!gContactSearchStrInputed) {
gContactSearchStrInputed = true;
if (!HasFocus("txtSearch")) {
ClearSearchField();
SetFieldFocus("txtSearch");
SetSearchFieldInputClass(true);
}
}
return true;
}
function txtSearchBlur() {
if (!gContactSearchStrInputed) { // nothing has been entered by the user
var oSearchField = document.getElementById("txtSearch");
if (oSearchField.value.length == 0) {
ResetSearchField();
}
}
return true;
}
function txtSearchChange(txtFieldID) {
gContactSearchStrInputed = true;
}
function PerformSearch(EventObj) {
if (IsEnterKey(EventObj) == true) {
DoSearch();
}
return true;
}
// -->
</script>
<!--[if IE 6]>
<style type="text/css">
.popupWin_tabbedPanel_head {position:relative;overflow:visible;}
.popupWin_tabbedPanel_head ul {position:absolute;top:0;}
.popupWin_tabbedPanel_head li {height:20px;}
.popupWin_tabbedPanel_head li.tabbedPanel_selected {height:25px;}
</style>
<![endif]-->
<!--[if lte IE 7]>
<style type="text/css">
#popupWin_form_table_js {table-layout:fixed;}
.popupWin_form_table_left {width:130px;}
.contacts_img_td {position:relative;vertical-align:top;}
.contacts_img_shell {position:absolute;right:0px;}
#btn_Edit {float:left;position:absolute;top:132px;right:2px;}
.bttn_right {float:left;position:absolute;}
.compose_bttn_okCancel {overflow:hidden;}
.bttn_toolbar_primary_left {float:left;}
.bttn_toolbar_primary_right {float:left;}
.bttn_dropDown_right {float:left;}
.bttn_right {float:left;}
.bttn_small_right {float:left;}
.contactsDetails_shell {position:relative;}
.dataTable_table thead td {margin:0;padding-top:3px;padding-bottom:3px;}
.dataTable_table {margin:0;padding-top:0px;padding-bottom:0px;}
.dataTable_listTable {margin:0;padding-top:0px;padding-bottom:0px;}
.dataTable_listTable_bordered {margin:0;padding-top:0px;padding-bottom:0px;}
.dataTable_listTable input {margin:0;padding:0;height:14px;}
.dataTable_listTable_bordered input {margin:0;padding-top:0px;padding-bottom:0px;height:14px;}
</style>
<![endif]-->
<!--[if IE]>
<style type="text/css">
.popupWin_tabbedPanel_head {width:auto;}
.popupWin_tabbedPanel_shell {width:auto;}
</style>
<![endif]-->
</head>
<body onload="PageLoad();" style="background-color:transparent;">
<div class="level0_shell pane-iframe" style="visibility:hidden;">
<div class="ui-layout-center layout-primary" style="overflow:hidden;"> <!-- Center Pane -->
<!-- Contact List -->
<table class="body_shell_table" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="bodyCol_contactsList">
<div class="toolbar_primary" id="toolbar_primary_js">
<table class="toolbar_primary_table" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="toolbar_primary_table_left_folderList" id="toolbar_new_td_js">
<div class="bttn_dropDown_float_left" id="bttn_toolbar_new" onclick="dropDown_toggleDisplay('dropDown_new')" onselectstart="return false;" <%= MailEnable.Clients.WebMail.Mondo.Request.CheckForRTL(Session("lang"))%>>
<div class="bttn_dropDown_left"><div class="bttn_dropDown_icon_newContact"></div><%=uscToken.GetText("[ME_TXT-New]")%></div>
<div class="bttn_dropDown_right"></div>
</div>
<div class="bttn_toolbar_primary_divider"></div>
<div class="clear_div"></div>
<div class="dropDown_shell_left dropDown_contacts_new" id="dropDown_new" onmouseover="dropDown_over('dropDown_new')" onmouseout="dropDown_out(event, 'dropDown_new')" <%= MailEnable.Clients.WebMail.Mondo.Request.CheckForRTL(Session("lang"))%>>
<ul>
<div class="dropDown_item" onclick="dropDown_hide('dropDown_new');AddContact()"><li class="dropDown_icon_newContact"><%=uscToken.GetText("[ME_TXT-Contact]")%></li></div>
<% If AllowGroups() Then %>
<div class="dropDown_item" onclick="dropDown_hide('dropDown_new');AddContactGroup()"><li class="dropDown_icon_newGroup"><%=uscToken.GetText("[ME_TXT-Group]")%></li></div>
<% End If %>
</ul>
<div class="dropDown_shell_pointer"></div>
</div>
<div class="dropDown_shell_pointer"></div>
</td>
<td id="toolbar_primary_table_left_js" class="toolbar_primary_table_left">
<div class="toolbar_primary_bttns_td_shell" onselectstart="return false;">
<!-- Bttn Email -->
<div class="bttn_toolbar_primary_shell" id="bttn_toolbar_email" title="<%=uscToken.GetText("[ME_TXT-EmailTheSelectedContacts]")%>">
<div class="bttn_toolbar_primary_left">
<div class="toolbar_icon_newEmail"></div>
<div class="bttn_toolbar_primary_text"><div><%=uscToken.GetText("[ME_TXT-Email]")%></div></div>
</div>
<div class="bttn_toolbar_primary_right"></div>
</div>
<div class="bttn_toolbar_primary_divider"></div>
<!-- Bttn Download -->
<div class="bttn_toolbar_primary_shell" id="bttn_toolbar_downloadSource" title="<%=uscToken.GetText("[ME_TXT-DownloadSource]")%>">
<div class="bttn_toolbar_primary_left">
<div class="toolbar_icon_downloadSource"></div>
<div class="bttn_toolbar_primary_text"><%=uscToken.GetText("[ME_TXT-DownloadSource]")%></div>
</div>
<div class="bttn_toolbar_primary_right"></div>
</div>
<div class="bttn_toolbar_primary_divider"></div>
<!-- Bttn Delete -->
<div class="bttn_toolbar_primary_shell" id="bttn_toolbar_delete" title="<%=uscToken.GetText("[ME_TXT-DeleteTheSelectedContacts]")%>">
<div class="bttn_toolbar_primary_left">
<div class="toolbar_icon_delete"></div>
<div class="bttn_toolbar_primary_text"><%=uscToken.GetText("[ME_TXT-Delete]")%></div>
</div>
<div class="bttn_toolbar_primary_right"></div>
</div>
<div class="bttn_toolbar_primary_divider"></div>
</div><!-- toolbar_primary_bttns_td_shell -->
</td>
<td class="toolbar_primary_table_bttn">
<!-- Bttn Refresh -->
<div class="bttn_toolbar_primary_shell_right" onclick="RefreshList(CurrentSourceType())" title="<%=uscToken.GetText("[ME_TXT-RefreshList]")%>" onselectstart="return false;">
<div class="bttn_toolbar_primary_left">
<div class="toolbar_icon_refresh"></div>
</div>
<div class="bttn_toolbar_primary_right"></div>
</div>
</td>
<td class="toolbar_primary_table_left_bttn" id="toolbar_search_td_js">
<!-- Search Field -->
<div class="search_field_shell" id="toolbar_search_js">
<div class="search_field_left"></div>
<div class="search_field_body">
<div class="search_bttn" title="<%=uscToken.GetText("[ME_TXT-Search]")%>" onclick="SearchBtnClicked()"></div>
<div class="search_form_initial"><input id="txtSearch" type="text" style="border:0px;" title="<%=uscToken.GetText("[ME_TXT-EnterSearchHere]")%>..." value="<%=uscToken.GetText("[ME_TXT-EnterSearchHere]")%>..." onclick="txtSearchClick()" onblur="txtSearchBlur()" onchange="txtSearchChange('txtSearch')" onkeypress="return PerformSearch(event);"/></div>
<div class="search_close_bttn" title="<%=uscToken.GetText("[ME_TXT-Clear]")%>" onclick="ClearSearch()"></div>
</div>
<div class="search_field_right"></div>
</div>
</td>
<td class="toolbar_primary_table_left_bttn" id="toolbar_view_td_js">
<!-- View Options -->
<div class="bttn_dropDown_float_right" id="bttn_toolbar_view" onclick="dropDown_toggleDisplay('dropDown_view')" onselectstart="return false;" <%= MailEnable.Clients.WebMail.Mondo.Request.CheckForRTL(Session("lang"))%>>
<div class="bttn_dropDown_left"><%=uscToken.GetText("[ME_TXT-View]")%></div>
<div class="bttn_dropDown_right"></div>
</div>
<div class="bttn_toolbar_primary_divider" style="float:right;"></div>
<div class="clear_div"></div>
<!-- Drop down menu: View Options -->
<div class="dropDown_shell_right checklist" id="dropDown_view" onmouseover="dropDown_over('dropDown_view')" onmouseout="dropDown_out(event, 'dropDown_view')" <%= MailEnable.Clients.WebMail.Mondo.Request.CheckForRTL(Session("lang"))%>>
<div id="dropDown_viewOptions">
<ul>
<!-- Column names get added here in js code -->
</ul>
</div>
<div class="dropDown_hr viewOptions_toggle_menu" style="display: block;"></div>
<div id="dropDown_styleOptions">
<ul>
<!-- Column names get added here in js code -->
</ul>
</div>
<div class="dropDown_shell_pointer"></div>
</div>
</td>
</tr>
</table><!--toolbar_primary_table -->
</div><!-- toolbar_primary -->
<div class="clear_div"></div>
<div id="msgList_shell_js" class="dataTable_shell"></div>
<div class="contacts_foot_shell" id="contacts_foot_shell_js" onselectstart="return false;">
<table class="contacts_foot_table" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="contacts_foot_form_div">
<select id="ddlSource" onchange="if (!DisabledOptionSelected(this)) SelectSource(CurrentSourceType())">
<option disabled="disabled"><%=uscToken.GetText("[ME_TXT-ContactsDirectory]")%>...</option>
<option disabled="disabled">- - - - - - - - - - - - - - - - - - -</option>
</select>
</div>
</div>
<div class="contacts_foot_form_div">
<select id="ddlSharedContacts" onchange="if (!DisabledOptionSelected(this)) ShareChanged()">
<option disabled="disabled"><%=uscToken.GetText("[ME_TXT-SharedContacts]")%>...</option>
<option disabled="disabled" value="sharelist">- - - - - - - - - - - - - - - - - - -</option>
<option disabled="disabled"> </option>
<option value="Mine"><%=uscToken.GetText("[ME_TXT-MyContacts]")%></option>
<option disabled="disabled" value="Mine_">- - - - - - - - - - - - - - - - - - -</option>
</select>
</div>
</td>
<td class="contacts_foot_table_right" id="toolbar_import_td_js">
<% If AllowExportContacts() Then %>
<!-- Bttn Export -->
<div class="bttn_toolbar_primary_shell_right" id="bttn_toolbar_export" style="padding-top:2px;" title="<%=uscToken.GetText("[ME_TXT-Export]")%>">
<div class="bttn_toolbar_primary_left">
<div class="toolbar_icon_export_contacts"></div>
<div class="bttn_toolbar_primary_text"><%=uscToken.GetText("[ME_TXT-Export]")%></div>
</div>
<div class="bttn_toolbar_primary_right"></div>
</div>
<div class="bttn_toolbar_primary_divider" style="float:right;margin-top:1px;"></div>
<% End If %>
<% If AllowImportContacts() Then %>
<!-- Bttn Import -->
<div class="bttn_toolbar_primary_shell_right" id="bttn_toolbar_import" style="padding-top:2px;" title="<%=uscToken.GetText("[ME_TXT-Import]")%>">
<div class="bttn_toolbar_primary_left">
<div class="toolbar_icon_import_contacts"></div>
<div class="bttn_toolbar_primary_text"><%=uscToken.GetText("[ME_TXT-Import]")%></div>
</div>
<div class="bttn_toolbar_primary_right"></div>
</div>
<div class="bttn_toolbar_primary_divider" style="float:right;margin-top:1px;"></div>
<% End If %>
</td>
</tr>
</table>
</div><!-- contacts_foot_shell -->
</td>
</tr>
</table><!-- body_shell_table -->
</div>
<div class="ui-layout-east layout-primary"> <!-- East Pane -->
<!-- Contact/Group Details -->
<div class="bodyCol_contactsDetails"> <!-- sets the background color of the pane -->
<div class="contactsDetails_shell" id="contactsDetails_shell_js">
<div class="contactsDetails_shell_inner">
<div id="divContactDetails" class="contactsDetails_content" style="display:none">
<table class="popupWin_body_table" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="popupWin_tabbedPanel_head">
<ul onselectstart="return false;">
<li id="tabH_tab1" onclick="SelectTab('tab1');" class="tabbedPanel_selected"><%=uscToken.GetText("[ME_TXT-General]")%></li>
<li id="tabH_tab2" onclick="SelectTab('tab2');"><%=uscToken.GetText("[ME_TXT-Personal]")%></li>
<li id="tabH_tab3" onclick="SelectTab('tab3');"><%=uscToken.GetText("[ME_TXT-Company]")%></li>
<li id="tabH_tab4" onclick="SelectTab('tab4');"><%=uscToken.GetText("[ME_TXT-Other]")%></li>
<li id="tabH_tab5" onclick="SelectTab('tab5');"><%=uscToken.GetText("[ME_TXT-Notes]")%></li>
</ul>
</div>
<div class="popupWin_tabbedPanel_shell"> <!-- Contacts tabs -->
<div class="popupWin_tabbedPanel_shell_inner">
<uc4:ContactDetails id="ContactDetails" runat="server"></uc4:ContactDetails>
<!-- OK / Cancel Bttns -->
<div class="popupWin_tabbedPanel_shell_base">
<div class="popupWin_foot_bttns" onselectstart="return false;" style="margin-top:20px;">
<div class="bttn_float_right" id="btnCancel" onclick="HideContactDetails()">
<div class="bttn_left"><div class="compose_bttn_okCancel"><%=uscToken.GetText("[ME_TXT-Cancel]")%></div></div>
<div class="bttn_right"></div>
</div>
<div class="bttn_float_right" id="btnSave" onclick="SaveContactDetails()">
<div class="bttn_left"><div class="compose_bttn_okCancel"><%=uscToken.GetText("[ME_TXT-Save]")%></div></div>
<div class="bttn_right"></div>
</div>
</div>
<div class="clear_div"></div>
</div>
</div>
</div><!-- popupWin_tabbedPanel_shell -->
</td>
</tr>
</table><!-- popupWin_body_table -->
</div>
<div id="divGroupDetails" class="contactsDetails_content" style="display:none">
<div class="optionsPanel_shell">
<div class="optionsPanel_shell_inner">
<table class="options_form_table" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="options_form_table_label"><div class="options_form_label"><h2><%=uscToken.GetText("[ME_TXT-GroupName]")%>:</h2></div></td>
<td><input class="textfield" id="group_name" type="text" onmouseover="enableSelection(document.body)" onmouseout="disableSelection(document.body)"/></td>
</tr>
</table>
<h3><%=uscToken.GetText("[ME_TXT-GroupMembersHeader]")%>:</h3>
<div class="dataTable2_shell">
<div class="dataTable_table_head_shell">
<table class="dataTable2_table_head" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="dataTable_table_head_shell_inner" id="divHeader">
<table class="dataTable_table_head" id="tblMembers_head" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="dataTable_tickbox head"><input id="chkSelectAllMembers" type="checkbox" onclick="SelectAllChkboxCallback(TABLE_MEMBERS_BODY_ID, this.checked)"/></td>
<td class="dataTable_name">
<div class="tableHead_bttn_shell" id="divHead_members_name" onclick="ToggleColSort(TABLE_MEMBERS_HEAD_ID, TABLE_MEMBERS_BODY_ID, this, 2)">
<div class="tableHead_bttn_txt"><%=uscToken.GetText("[ME_TXT-FullName]")%></div>
<div class="tableHead_bttn_arrow_down_selected"></div>
</div>
</td>
<td class="dataTable_noWidth">
<div class="tableHead_bttn_shell" id="divHead_members_email" onclick="ToggleColSort(TABLE_MEMBERS_HEAD_ID, TABLE_MEMBERS_BODY_ID, this, 3)">
<div class="tableHead_bttn_txt"><%=uscToken.GetText("[ME_TXT-EmailAddress]")%></div>
<div class="tableHead_bttn_arrow"></div>
</div>
</td>
</tr>
</table>
</div><!-- dataTable_table_head_shell_inner -->
</td>
<td class="dataTable_table_head_right"></td>
</tr>
</table>
</div><!-- dataTable_table_head_shell -->
<div class="dataTable_body_shell" id="table_div" style="height:200px;">
<div class="dataTable_shell_inner">
<table class="dataTable_table" id="tblMembers_body" border="0" cellspacing="0" cellpadding="0">
<tbody>
<!-- data rows go here -->
</tbody>
</table>
</div><!-- dataTable_shell_inner -->
</div><!-- dataTable_body_shell -->
</div><!-- dataTable2_shell -->
<div class="bttn_shell_centered" id="bttn_shell_addRemove_js" onselectstart="return false;">
<div class="bttn_float_left" id="bttn_add_js" onclick="AddToGroupMembers()">
<div class="bttn_left">
<div class="bttn_icon_up"></div>
<div class="compose_bttn_okCancel"><%=uscToken.GetText("[ME_TXT-Add]")%></div>
</div>
<div class="bttn_right"></div>
</div>
<div class="bttn_float_left" id="bttn_remove_js" onclick="RemoveFromGroup()">
<div class="bttn_left">
<div class="bttn_icon_down"></div>
<div class="compose_bttn_okCancel"><%=uscToken.GetText("[ME_TXT-Remove]")%></div>
</div>
<div class="bttn_right"></div>
</div>
</div>
<h3><%=uscToken.GetText("[ME_TXT-AllContactsHeader]")%>:</h3>
<div class="dataTable2_shell">
<div class="dataTable_table_head_shell">
<table class="dataTable2_table_head" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div class="dataTable_table_head_shell_inner" id="divHeader">
<table class="dataTable_table_head" id="tblAll_head" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="dataTable_tickbox head"><input id="chkSelectAllContacts" type="checkbox" onclick="SelectAllChkboxCallback(TABLE_ALL_BODY_ID, this.checked);" /></td>
<td class="dataTable_name">
<div class="tableHead_bttn_shell" id="divHead_all_name" onclick="ToggleColSort(TABLE_ALL_HEAD_ID, TABLE_ALL_BODY_ID, this, 2)">
<div class="tableHead_bttn_txt"><%=uscToken.GetText("[ME_TXT-FullName]")%></div>
<div class="tableHead_bttn_arrow_down_selected"></div>
</div>
</td>
<td class="dataTable_noWidth">
<div class="tableHead_bttn_shell" id="divHead_all_email" onclick="ToggleColSort(TABLE_ALL_HEAD_ID, TABLE_ALL_BODY_ID, this, 3)">
<div class="tableHead_bttn_txt"><%=uscToken.GetText("[ME_TXT-EmailAddress]")%></div>
<div class="tableHead_bttn_arrow"></div>
</div>
</td>
</tr>
</table>
</div><!-- dataTable_table_head_shell_inner -->
</td>
<td class="dataTable_table_head_right"></td>
</tr>
</table>
</div><!-- dataTable_table_head_shell -->
<div class="dataTable_body_shell" id="table_div" style="height:200px;">
<div class="dataTable_shell_inner">
<table class="dataTable_table" id="tblAll_body" border="0" cellspacing="0" cellpadding="0">
<tbody>
<!-- data rows go here -->
</tbody>
</table>
</div><!-- dataTable_shell_inner -->
</div><!-- dataTable_body_shell -->
</div><!-- dataTable2_shell -->
<br />
<!-- OK / Cancel Bttns -->
<div class="optionsPanel_foot_bttns" onselectstart="return false;">
<div class="bttn_float_right" id="btnCancelGrp" onclick="HideGroupDetails()">
<div class="bttn_left"><div class="compose_bttn_okCancel"><%=uscToken.GetText("[ME_TXT-Cancel]")%></div></div>
<div class="bttn_right"></div>
</div>
<div class="bttn_float_right" id="btnSaveGrp" onclick="SaveGroupDetails()">
<div class="bttn_left"><div class="compose_bttn_okCancel"><%=uscToken.GetText("[ME_TXT-Save]")%></div></div>
<div class="bttn_right"></div>
</div>
<div class="clear_div"></div>
</div>
</div><!-- optionsPanel_shell_inner -->
</div><!-- optionsPanel_shell -->
</div>
</div>
</div>
</div>
</div>
<div style="display:none;"> <!-- Hide dialog contents initially, it will be controlled by the dialog -->
<div id="divImport" class="optionsPanel_shell" style="border:0;">
<div class="optionsPanel_shell2">
<table class="options_form_table" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="options_form_table_label"><div class="options_form_label"><h2><%=uscToken.GetText("[ME_TXT-Source]")%>:</h2></div></td>
<td><select id="lstImportFormat" name="ImportFormat">
<%If AllowCardDAVImport() Then%>
<option value="CardDAV">CardDAV (AddressBook) Server</option>
<%End If%>
<option value="CSV">CSV File</option>
</select></td>
</tr>
</table>
<div <%=IIf(AllowCardDAVImport(),"","style=""display:none""")%> id="dvCardDAV">
<table class="options_form_table" border="0" cellpadding="0" cellspacing="0" style="width:450px">
<tr><td class="options_form_table_label"><div class="options_form_label"><h2><%=uscToken.GetText("[ME_TXT-Username]")%>:</h2></div></td><td><input id="txtDAVUserName" type="text"/></td></tr>
<tr><td class="options_form_table_label"><div class="options_form_label"><h2><%=uscToken.GetText("[ME_TXT-Password]")%>:</h2></div></td><td><input id="txtDAVPassword" type="password"/></td></tr>
<tr><td class="options_form_table_label"><div class="options_form_label"><h2><%=uscToken.GetText("[ME_TXT-CardDAVURL]")%>:</h2></div></td><td><input id="txtDAVURL" type="text" style="width:300px"/></td></tr>
<tr><td class="options_form_table_label" colspan="2" align="right"><br /><input id="btnImportCardDAV" type="button" value='<%=uscToken.GetText("[ME_TXT-Import]")%>' style="float:right;height:22px;width:100px;margin-left:2px;cursor:pointer;" onclick="ImportContacts();" /></td></tr>
</table>
<div class="clear_div"></div>
</div>
<div <%=IIf(AllowCardDAVImport(),"style=""display:none""","")%> id="dvFile">
<form id="frmImport" runat="server" enctype="multipart/form-data" method="post"><%WriteFormValidationField()%>
<%=uscToken.GetText("[ME_TXT-YoumustfirstexportalistofyourcontactsfromOutlookorOutlookExpressandusethisCSVfileastheimportsource.]")%>
<br />
<br />
<%=uscToken.GetText("[ME_TXT-PleaseselecttheCSVfileofthecontactsyouwishtoimport]")%>:
<br />
<br />
<input id="fileImport" runat="server" type="file" style="float:left;height:22px;width:280px;margin-left:2px;"/>
<div class="clear_div"></div>
<div style="color:#333;font-style:italic"><%=sMaxUploadSizeMessage%></div>
<table class="options_form_table" border="0" cellpadding="0" cellspacing="0" style="width:450px">
<tr><td class="options_form_table_label" colspan="2" align="right"><input id="btnImport" type="button" value='<%=uscToken.GetText("[ME_TXT-Import]")%>' style="float:right;height:22px;width:100px;margin-left:2px;cursor:pointer;" onclick="ImportContacts();" /></td></tr>
</table>
<input type="hidden" id="ME_SOURCE_URI" value="" />
</form>
</div>
</div>
</div>
</div>
<!-- Message List - PopUp List Control -->
<div id="menudiv" style="position:absolute;display:none;top:0px;left:0px;z-index:10099;" onmouseover="PopUp_MenuSetState(2);" onmouseout="PopUp_MenuOutOfScope(event, 'menudiv');">
<table>
<tr>
<td>
<table id="menuItemsdiv" class="rightClickMenu_shell" border="0" cellpadding="0" cellspacing="0" onmouseover="PopUp_MenuSetState(1);">
<tbody>
<tr>
<td class="rightClickMenu_shell_topleft"><div class="rightClickMenu_shell_topleft_div"></div></td>
<td class="rightClickMenu_shell_top"></td>
<td class="rightClickMenu_shell_topRight"></td>
</tr>
<tr>
<td class="rightClickMenu_shell_left"></td>
<td class="rightClickMenu_shell_mid">
<div class="rightClickMenu_body_shell">
<ul>
<!-- Popup row items get added here -->
</ul>
</div>
</td>
<td class="rightClickMenu_shell_right"></td>
</tr>
<tr>
<td class="rightClickMenu_shell_botLeft"><div class="rightClickMenu_shell_botLeft_div"></div></td>
<td class="rightClickMenu_shell_bot"></td>
<td class="rightClickMenu_shell_botRight"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</div>
<uc3:uscFileUpload id="uscFileUpload" runat="server" SubmitCallback="OnSubmitUpload();" CompletionCallback="OnSubmitComplete();" ControlType="CLIENT"></uc3:uscFileUpload>
</div><!-- level0_shell -->
</body>
</html>