_PAGETITLE = GetLocString("sakitmsg.dll", "4001000F", "") End If L_ALERT_DETAILS_MESSAGE = GetLocString("sakitmsg.dll", "40010011", "") L_NOALERTS_MESSAGE = GetLocString("sakitmsg.dll", "40010010", "") %> <%=Server.HtmlEncode(L_PAGETITLE)%> <% Call SA_EmitAdditionalStyleSheetReferences("") %> <% Call ServeAlerts() %> <% '---------------------------------------------------------------------------- ' ' Function : ServeAlerts ' ' Synopsis : Serves the messages ' ' Arguments: None ' ' Returns : None ' '---------------------------------------------------------------------------- Function ServeAlerts Call ServeStandardHeaderBar(L_PAGETITLE, "") Response.Write("
") Call ServeAlertHTML() Response.Write("
") End Function '---------------------------------------------------------------------------- ' ' Function : ServeAlertHTML ' ' Synopsis : Generate HTML for the messages ' ' Arguments: None ' ' Returns : None ' '---------------------------------------------------------------------------- Function ServeAlertHTML() on error resume next Err.Clear Dim objElement Dim objElementCol Dim objAlertElementCol Dim objAlertElement Dim strElementID Dim strMsg Dim strAlertURL Dim strAlertSrc Dim arrAlerts() Dim strViewer Dim strDefaultViewer Dim strReturnURL Dim varReplacementStrings Dim i, j Dim blnSameType Dim sDefaultTarget Dim sAlertDefContainer Dim oValidator Dim oEncoder Set oValidator = New CSAValidator Set oEncoder = New CSAEncoder sDefaultTarget = Request.QueryString("ContentTarget") If ( Len(sDefaultTarget) > 0 ) Then If ( oValidator.IsValidIdentifier(sDefaultTarget) ) Then sDefaultTarget = " target='" + sDefaultTarget + "' " Else Call SA_TraceOut("sh_alertpanel.asp", "Function ServeAlertHTML detected invalid QueryString(ContentTarget) parameter: " & sDefaultTarget) sDefaultTarget = "" End If End If strReturnURL = Request.QueryString("ReturnURL") sAlertDefContainer = Request.QueryString("AlertContainer") If ( Len(sAlertDefContainer) <= 0 ) Then sAlertDefContainer = "AlertDefinitions" End If %> <% Set objElementCol = GetElements("SA_Alerts") If objElementCol.Count=0 or Err.Number <> 0 Then If ( Err.Number <> 0 ) Then Call SA_TraceOut("SH_ALERTVIEWER", "GetElements(SA_Alerts) failed: " + CStr(Hex(Err.Number)) + " " + Err.Description) End If Err.Clear %> <% Else Set objAlertElementCol = GetElements(sAlertDefContainer) If ( Err.Number <> 0 ) Then Call SA_TraceOut("SH_ALERTVIEWER", "GetElements(AlertDefinitions) failed: " + CStr(Hex(Err.Number)) + " " + Err.Description) End If i = 0 blnSameType = True ReDim arrAlerts(objElementCol.Count, 3) For Each objElement in objElementCol Err.Clear strAlertSrc = objElement.GetProperty("AlertLog") strElementID = strAlertSrc & Hex(objElement.GetProperty("AlertID")) strMsg = "" Err.Clear Set objAlertElement = objAlertElementCol.Item(sAlertDefContainer+strElementID) If ( Err.Number <> 0 ) Then Err.Clear Set objAlertElement = objAlertElementCol.Item(strElementID) If (Err.Number <> 0) Then Set objAlertElement = Nothing End If Else strAlertSrc = objAlertElement.GetProperty("Source") End If If ( objAlertElement <> Nothing ) Then varReplacementStrings = objElement.GetProperty("ReplacementStrings") strMsg = GetLocString(strAlertSrc, objAlertElement.GetProperty("CaptionRID"), varReplacementStrings) arrAlerts(i, 0) = strMsg arrAlerts(i, 1) = objElement.GetProperty("Cookie") arrAlerts(i, 2) = objElement.GetProperty("AlertType") arrAlerts(i, 3) = Trim(objAlertElement.GetProperty("URL")) ' adjust alert types for the current display sort order Select Case arrAlerts(i, 2) Case 0 arrAlerts(i, 2) = 2 Case 1 arrAlerts(i, 2) = 1 Case 2 arrAlerts(i, 2) = 3 Case Else Call SA_TraceOut(SA_GetScriptFileName(), "Unexpected AlertType: " + CStr(arrAlerts(i, 2))) arrAlerts(i, 2) = 3 End Select If i > 0 Then If arrAlerts(i, 2) <> arrAlerts(i-1, 2) Then blnSameType = False End If End If i = i + 1 End If Next ReDim Preserve arrAlerts(i,3) ' sort by Type if needed If Not blnSameType Then QuickSort arrAlerts, LBound(arrAlerts,1), UBound(arrAlerts,1)-1, 2 End If strDefaultViewer = m_VirtualRoot & "sh_alertdetails.asp" Call SA_MungeURL( strDefaultViewer, "AlertDefinitions", sAlertDefContainer) 'strReturnURL = GetScriptPath() 'strReturnURL = "" For i = 0 To UBound(arrAlerts,1) strMsg = arrAlerts(i, 0) If strMsg <> "" Then If arrAlerts(i, 3) <> "" Then strViewer = arrAlerts(i, 3) Else strViewer = strDefaultViewer End If strAlertURL = strViewer Call SA_MungeURL( strAlertURL, "Tab1", GetTab1()) Call SA_MungeURL( strAlertURL, "Tab2", GetTab2()) Call SA_MungeURL( strAlertURL, "Cookie", CStr(arrAlerts(i, 1)) ) Call SA_MungeURL( strAlertURL, "ReturnURL", strReturnURL) Call SA_MungeURL( strAlertURL, "R", CStr(Rnd)) Call SA_MungeURL( strAlertURL, SAI_FLD_PAGEKEY, SAI_GetPageKey()) %> <% End If Next End If Response.Write "
    <%=Server.HtmlEncode(L_NOALERTS_MESSAGE)%>
"> href=<%=oEncoder.EncodeAttribute(strAlertURL)%> title=<%=oEncoder.EncodeAttribute(L_ALERT_DETAILS_MESSAGE)%> onMouseOver="window.status='<%=Server.HTMLEncode(EscapeQuotes(L_ALERTDETAILS_MESSAGE))%>';return true;"> <%=oEncoder.EncodeElement(arrAlerts(i,0))%>
" Set oEncoder = Nothing Set oValidator = Nothing Set objElement = Nothing Set objElementCol = Nothing Set objAlertElement = Nothing Set objAlertElementCol = Nothing End Function %>