//var LIST_ROW_STYLE_SELECTED = 'MsgList_SelectedRow'; var LIST_ID = 'MENoteList'; var gListFirstLoad = true; var gListMethod = 'LIST-ITEMS'; var gListParams = ''; function ProcessMessageList(BaseNode, arrTableColumns) { var BaseNodeAttributes; var XMLNode; var XMLNodeAttributes; var iStartIndex; // Index of the first item (from our global items array) that is to be added to // our list (table). var iEndIndex; // Index of the last item (from our global items array) that is to be added to // our list (table). var oNoteAttributes; var iItemsArraySize = 0; var iRowsAdded = 0; var iSelectedPage; var MessageID, Size, Subject, RecvDate, Flags, Importance, Sensitivity; DataItemList_ValidateContext(BaseNode); BaseNodeAttributes = BaseNode.attributes; gTotalItems = parseInt(GetXMLValue(BaseNodeAttributes.getNamedItem('TOTAL_ITEMS'))); iSelectedPage = parseInt(GetXMLValue(BaseNodeAttributes.getNamedItem('PAGE'))); gItemsArrayServerTopIndex = parseInt(GetXMLValue(BaseNodeAttributes.getNamedItem('TOP_INDEX'))); SortCol = GetXMLValue(BaseNodeAttributes.getNamedItem('SORT_COLUMN')); SortOrder = GetXMLValue(BaseNodeAttributes.getNamedItem('SORT_ORDER')); gItemsPerPage = CalculateItemsPerPage(gMsgListHeight, gUnitScrollLength); gSecondPageNum = iSelectedPage; gThirdPageNum = gSecondPageNum + 1; gFirstPageNum = gSecondPageNum - 1; if ( gTotalItems < gItemsPerPage ) { iStartIndex = 0; iEndIndex = gTotalItems - 1; } else { iStartIndex = 0; iEndIndex = gItemsPerPage - 1; } if (BaseNode.getElementsByTagName('ELEMENT')) { iItemsArraySize = BaseNode.getElementsByTagName('ELEMENT').length; } oItemsArray = new Array(iItemsArraySize); if (gListFirstLoad) { DataItemList_ClearListContents(LIST_ID); } if (iItemsArraySize == 0) { DataItemList_AddEmptyListMessageRow(LIST_ID, t_('[ME_TXT-Therearenoitemstoshowinthisview]')); } // Add tasks to our global array for (var i = 0; i < iItemsArraySize; i++) { XMLNode = BaseNode.childNodes[i]; XMLNodeAttributes = XMLNode.attributes; MessageID = GetXMLValue(XMLNodeAttributes.getNamedItem('ID')); Size = GetXMLValue(XMLNode.getElementsByTagName("SIZE")[0]); Subject = GetXMLValue(XMLNode.getElementsByTagName("SUBJECT")[0]); RecvDate = GetXMLValue(XMLNode.getElementsByTagName("RECEIVED")[0]); RecvDateFull = GetXMLValue(XMLNode.getElementsByTagName("RECEIVED_FULL")[0]); Flags = GetXMLValue(XMLNode.getElementsByTagName("FLAGS")[0]); Importance = GetXMLValue(XMLNode.getElementsByTagName("IMPORTANCE")[0]); Sensitivity = GetXMLValue(XMLNode.getElementsByTagName("SENSITIVITY")[0]); // importance and status need some conversion if (Importance <= 0) { Importance = IMPORTANCE_NONE; // unknown } else if (Importance < 5) { Importance = IMPORTANCE_HIGH; } else if (Importance == 5) { Importance = IMPORTANCE_NORMAL; } else if (Importance < 10) { Importance = IMPORTANCE_LOW; } else { Importance = IMPORTANCE_NONE; // unknown } if (Sensitivity == 0) { Sensitivity = t_('[ME_TXT-Normal]'); } else if (Sensitivity == 1) { Sensitivity = t_('[ME_TXT-Personal]'); } else if (Sensitivity == 2) { Sensitivity = t_('[ME_TXT-Private]'); } else if (Sensitivity == 3) { Sensitivity = t_('[ME_TXT-Confidential]'); } oNoteAttributes = new Array(); oNoteAttributes['MessageID'] = MessageID; oNoteAttributes['Importance'] = Importance; oNoteAttributes['Subject'] = Subject; oNoteAttributes['Subject_Full'] = Subject; oNoteAttributes['Size'] = Size; oNoteAttributes['RecvDate'] = RecvDate; oNoteAttributes['RecvDate_Full'] = RecvDateFull; oNoteAttributes['Read'] = 1; oNoteAttributes['Sensitivity'] = Sensitivity; oNoteAttributes['Sensitivity_Full'] = Sensitivity; oItemsArray[i] = oNoteAttributes; if ( gListFirstLoad ) { // Now we add each task (row) into our list (table) if ( (i >= iStartIndex) && (i <= iEndIndex) ) { // Add task to the list (tasks table)...since it is within the selected viewing page DataItemList_AddRowToList(LIST_ID, oItemsArray[i], arrTableColumns, i); iRowsAdded++; } gCurrSelectedPage = 1; } } gRowsDrawn = iRowsAdded; // lets set the sort order icon on the sorted column DataItemList_SetSortColumnIcon(SortCol, SortOrder); DataItemList_SetItemCount(LIST_ID, gTotalItems); if (iSelectedPage <= 1) { DataItemList_SetScrollBarPosition(0); // reset scroller position to the top of the scrollbar } return true; } function ProcessSelectedIDs(BaseNode) { var xmlString = ""; var sSelectedIDs = ""; if ( IsIE(gBrowserType) ) { xmlString = BaseNode.xml; } else { xmlString = (new XMLSerializer()).serializeToString(BaseNode); } sSelectedIDs = GetXMLNodeVal(xmlString, "SELECTED_MESSAGES"); if (sSelectedIDs.length > 0) { gSelectedIM.Clear(); var arrIDs = sSelectedIDs.split(","); for (var i = 0; i < arrIDs.length; i++) { gSelectedIM.AddItem(arrIDs[i]); } } // now we select the rows (that are visible/drawn in the list) DataItemList_SelectSelectedRows(LIST_ID); }