<%@LANGUAGE="VBSCRIPT"%> <% ' ================================ ' AIS Debug variables ' ================================ Dim AISdebugSet AISdebugSet = "N" ' ===================================== ' Make sure to catch any database error ' ===================================== On Error Resume Next ' ================================ ' AISNews Recordset and variables ' ================================ Dim AISNews Dim AISNewsError Dim AISNewsIndex Set AISNews = Server.CreateObject("ADODB.Recordset") AISNews.ActiveConnection = MM_Foundation_STRING AISNews.Source = "select M.msg_id,M.title,M.abstract,M.author,M.details,M.urgency,M.msg_date,M.expiry_date,M.app_name,A.name from navigator.app_messages M, navigator.sys_applications A where M.app_name = A.code and trunc(sysdate) between M.msg_date and M.expiry_date-1 order by msg_date desc" AISNews.CursorType = 0 AISNews.CursorLocation = 2 AISNews.LockType = 1 AISNews.Open() ' Check that DB connection and SQL run went fine If Err.Number <> 0 Then AISNewsError= Err.Description Else AISNewsError= "None" End If AISNewsIndex = 0 ' ================================ ' AISFocus Recordset and variables ' ================================ Dim AISFocus Dim AISFocusError Dim AISFocusIndex Dim AISFocusShownAlways Dim AISFocusToBeShown Dim AISFocusRequestedId Dim AISFocusContent Dim AISUpperLeftImage Dim AISUpperRightImage Dim AISNextFocusId Dim AISPreviousFocusId Set AISFocus = Server.CreateObject("ADODB.Recordset") AISFocus.ActiveConnection = MM_AISweb_STRING AISFocus.Source = "SELECT id, title, text, upper_right_image, upper_left_image, date_from, date_to, always_shown FROM articles WHERE (articles.date_from<=Date() Or IsNull(articles.date_from)) And (articles.date_to>=Date() Or IsNull(articles.date_to)) ORDER BY articles.always_shown,articles.id;" AISFocus.CursorType = 0 AISFocus.CursorLocation = 2 AISFocus.LockType = 1 AISFocus.Open() ' Check that DB connection and SQL run went fine If Err.Number <> 0 Then AISFocusError= Err.Description Response.Write(""&AISFocusError&"") Else AISFocusError= "None" End If AISFocusRequestedId = Request.QueryString("focusid") ' ================================ ' AIS Procedures used in page ' ================================ sub getFocus() ' =========================================== ' GET FOCUS ' This procedure build the focus and store it ' in the AISFocusContent variable ' =========================================== If (AISFocus.EOF OR AISFocusError<> "None") Then Call AISdebug("Focus query returned NO records - maybe database connection error or no focus active") ' No focus found, maybe an error connecting the database or none is active... ' Display a default hardcoded focus item AISFocusContent= "" AISFocusContent = AISFocusContent & "

AIS: the unique entry point to all administrative computing at CERN

" AISFocusContent = AISFocusContent & "
" AISFocusContent = AISFocusContent & "The AIS website provides you with links, documentation, Frequently Asked Questions pages, Quick Reference Guides etc on all administrative applications and projects at CERN." AISFocusContent = AISFocusContent & "

" AISFocusContent = AISFocusContent & "Choose one of the menu items on the left. If you are not sure on which option to use, the shortcuts on the right may help you finding the good one." Else Call AISdebug("Focus query returned records") AISFocusToBeShown = 0 ' Check if a given focus has been past as parameter ' In that case search for that focus (supposing it is active and therefore in the query results) If (AISFocusRequestedId) <> "" Then Call AISdebug("Requested focus: " & AISFocusRequestedId) AISFocus.MoveFirst Do Until (AISFocus.EOF) If (Cstr(AISFocus.Fields.Item("id")) = AISFocusRequestedId) Then AISFocusToBeShown = 1 Call AISdebug("Requested focus found: " & AISFocus.Fields.Item("title")) Exit Do Else Call AISdebug("Current focus id = " & AISFocus.Fields.Item("id")& ". Check next.") AISFocus.MoveNext End if Loop If (AISFocus.EOF) Then Call AISdebug("Requested focus not found or not active") End if End if ' Check if there was no requested focus or it has not been found or it is not active If (AISFocusToBeShown = 0) Then Call AISdebug("Choose a focus randomly") AISFocus.MoveFirst ' Check if there are any "Always Shown" focus (should always be on first record) AISFocusShownAlways = AISFocus.Fields.Item("always_shown").Value Call AISdebug("Always shown focus exists = " & AISFocusShownAlways) ' Check how many focus may be displayed (taking into account existence of "always shown" ones) While (NOT AISFocus.EOF) If AISFocusShownAlways Then ' There is at least one "Always Shown" focus, count only those ones If AISFocus.Fields.Item("always_shown").Value Then AISFocusIndex = AISFocusIndex+1 End If Else ' There are no "Always Shown" focus, all are counted AISFocusIndex = AISFocusIndex+1 End If AISFocus.MoveNext Wend Call AISdebug("Number of potential focus found = " & AISFocusIndex) ' Now decides (random) which focus is to be shown Randomize AISFocusToBeShown = Int((AISFocusIndex*Rnd)+1) Call AISdebug("Chosen focus = " & AISFocusToBeShown & "/" & AISFocusIndex) ' Move back to the randomly chosen focus AISFocus.MoveFirst For i = 1 to AISFocusToBeShown-1 AISFocus.MoveNext Next End if ' Now we should be placed on the focus to be displayed ' Get the to be displayed focus id AISFocusToBeShownId = AISFocus.Fields.Item("id") Call AISdebug("Chosen focus id = " & AISFocusToBeShownId) ' Find out what is the next focus id AISFocus.MoveNext If AISFocus.EOF Then AISFocus.MoveFirst End if AISNextFocusId = AISFocus.Fields.Item("id") Call AISdebug("Next focus id = " & AISNextFocusId) ' Move back to shown focus and find out at the same time which is the previous focus id AISFocus.MoveFirst If (AISFocus.Fields.Item("id") = AISFocusToBeShownId) Then ' Chosen focus was the first one, the previous one is therefore the last one Call AISdebug("Chosen focus is the first one") Do Until (AISFocus.EOF) AISPreviousFocusId = AISFocus.Fields.Item("id") AISFocus.MoveNext Loop AISFocus.MoveFirst Else Do While (AISFocus.Fields.Item("id") <> AISFocusToBeShownId) AISPreviousFocusId = AISFocus.Fields.Item("id") Call AISdebug(" - Current focus id = " & AISFocus.Fields.Item("id")) AISFocus.MoveNext Loop End If Call AISdebug(" - Moved back to chosen focus") Call AISdebug("Previous focus id = " & AISPreviousFocusId) ' Display the focus Call AISdebug("Build focus") AISUpperLeftImage = AISFocus.Fields.Item("upper_left_image") AISUpperRightImage = AISFocus.Fields.Item("upper_right_image") AISFocusContent = "" If (Len(AISUpperLeftImage)>0) Then Call AISdebug(" - upper left image is #" & AISUpperLeftImage & "#") AISFocusContent = AISFocusContent & "" Else Call AISdebug(" - no upper left image") End if If (Len(AISUpperRightImage)>0) Then Call AISdebug(" - upper right image is #" & AISUpperRightImage & "#") AISFocusContent = AISFocusContent & "" Else Call AISdebug(" - no upper right image") End if AISFocusContent = AISFocusContent & "

" & AISFocus.Fields.Item("Title").Value & "

" AISFocusContent = AISFocusContent & "
" AISFocusContent = AISFocusContent & AISFocus.Fields.Item("text") End If ' Checked if "any" focus was found end sub %> AIS
CERN home > GS Department AIS home

AIS Administrative Information Services

CERN Home GS Department News Site Map
Applications
Project
Business Map
Link
Presentations
AIS People
Ais Support

ADRESSAGE

 

 

Welcome to ADRESSAGE Home page. The Adressage application was initially implemented by and for the mail office. It allows them to define static or dynamic address lists (e.g. everyone in the IT-AIS group). These lists can be printed in certain ways, either for internal or external distribution.

In 1998, part of the application was ported to the Web to allow divisional or experiment secretariats to define their email distribution lists. The application is now also used by the IT division to maintain the MOWGLI email lists (e.g. it-dep-ais@listbox.cern.ch).

Please click on the icon below to access the Adressage application on the Web.

 

Last update: Wednesday, 19-Mar-2008 17:38
Contact: AIS Webmaster