%
'##########################################
public function CAL_ViewOneEvent(setEvent, DayColumns , OneEventViewType)
dim sH: sH =""
dim setCAT
dim loCATNAME
dim loCATBGCOLOR
dim loCATFGCOLOR
dim IDCat
dim loCATTYPE, blCalendar
EventCOUNT=0
if CAL_Wcal_CheckGroupAccess(setEvent("ID")) then
EventCOUNT=1
strSQL = "SELECT wcal_category.IDCAt as IDCat, *, wcal_category.CatType as CType from wcal_category left join wcal_eventcat ON wcal_eventcat.IDCat=wcal_category.IDCat where IDEvent=" & setEvent("ID")
set setCAT = Server.CreateObject("ADODB.Recordset")
setCAT.CursorLocation = 3
setCAT.Open strSql, my_conn
setCAT.CacheSize = 100
loCATNAME = setCAT("Name")
loCATBGCOLOR = setCAT("bgColor")
loCATFGCOLOR = setCAT("fgColor")
loCATTYPE = setCAT("CType")
IDCat = setCAT("IDCat")
setCAT.Close
set setCAT = nothing
' Apply style according to category
dim strSTYLE
if loCATBGCOLOR<>"" AND loCATFGCOLOR<>"" then
strSTYLE="STYLE=""Background:" & loCATBGCOLOR & "; Color: " & loCATFGCOLOR & "; """
else
strSTYLE=""
end if
OneEventViewType = "SHORT"
if instr(1, session("WebCAL_SH"), "("&setEvent("ID")&")")> 0 then OneEventViewType = "LONG"
' TEST OF REPEATING
dim CountID
strSQL="SELECT COUNT(IDEvent) as C from wcal_eventrec where IDEvent=" & setEvent("ID")
CountID = my_conn.execute(strSQL)("C")
dim imgREC, strICO
if CountID>1 then
imgREC = "
"
end if
if ucase(request("view"))="WEEKPLACE" then OneEventViewType="WEEK/PLACE"
' DISPLAY FORMATED EVENT
select case OneEventViewType
case "SHORT"
' BEGIN: SHORT VIEW
sH = sH & VbCrlf & VbCrlf & VbCrlf
sH = sH & "" & VbCrlf
sH = sH & "
| " & VbCrlf
sH = sH & " | " & VbCrlf
sH = sH & " " & VbCrlf
sH = sH & " " & VbCrlf strICO="" if CountID>1 then strICO="ALL" ' Ico edit sH = sH & " | " & VbCrlf
sH = sH & "|
| Time | " & VbCrlf sH = sH & "" '& replace(formatdatetime(setEvent("StartTime"), VBLongTime), ":00 ","") & "-" & replace(formatdatetime(setEvent("EndTime"), VBLongTime), ":00 ","") & " | " & VbCrlf sH = sH & CAL_CheckTIMEINPUT(setEvent("StartTime"), setEvent("EndTime")) & "" & VbCrlf sH = sH & "|
| " & VbCrlf
sH = sH & " | " & VbCrlf
sH = sH & " " & VbCrlf sH = sH & " " & setEvent("EventName") & imgREC & " " & VbCrlf sH = sH & " | " & VbCrlf sH = sH & "|
| Time | " & VbCrlf sH = sH & "" & replace(formatdatetime(setEvent("StartTime"), VBLongTime), ":00 ","") & "-" & replace(formatdatetime(setEvent("EndTime"), VBLongTime), ":00 ","") & " | " & VbCrlf sH = sH & "|
| " & VbCrlf
sH = sH & " " & VbCrlf strICO="" if CountID>1 then strICO="ALL" ' Ico edit sH = sH & " | " & VbCrlf
sH = sH & "|
| Time | " & VbCrlf sH = sH & "" & replace(formatdatetime(setEvent("StartTime"), VBLongTime), ":00 ","") & "-" & replace(formatdatetime(setEvent("EndTime"), VBLongTime), ":00 ","") & " | " & VbCrlf sH = sH & "
| Description | " & VbCrlf sH = sH & "" & funcs.ShortEvenHeader(setEvent("Description"),500) & " | " & VbCrlf sH = sH & "
| Place | " & VbCrlf sH = sH & "" & setEvent("Place") & " | " & VbCrlf sH = sH & "
| Category | " & VbCrlf sH = sH & "" & CATEGORY_FINDTOP(IDCat) & " | " & VbCrlf sH = sH & "
| " & strCust1 & " | " & setEvent("Cust1") & " |
| " & strCust2 & " | " & setEvent("Cust2") & " |
| " & strCust3 & " | " & setEvent("Cust3") & " |
| " & strCust4 & " | " & setEvent("Cust4") & " |
| " & strCust5 & " | " & setEvent("Cust5") & " |