<% '########################################## 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 sH = sH & "" & VbCrlf ' Time sH = sH & "" & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & VbCrlf sH = sH & CAL_CheckTIMEINPUT(setEvent("StartTime"), setEvent("EndTime")) & "" & VbCrlf sH = sH & "" & VbCrlf sH = sH & "
" & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & setEvent("EventName") & imgREC & " " & VbCrlf ' Edit/modify link for admin or owner of event if intUSERPERMISSION="1" OR (session("WCAL_USERID") = setEvent("IDUser") AND intUSERPERMISSION="2") or blCalendar then sH = sH & "
" & VbCrlf strICO="" if CountID>1 then strICO="ALL" ' Ico edit sH = sH & " " & VbCrLf ' Ico delete sH = sH & " " & VbCrLf ' Event is repeated if CountID>1 then ' Ico edit sH = sH & " " & VbCrLf ' Ico delete sH = sH & " " & VbCrLf end if end If sH = sH & "
Time" '& replace(formatdatetime(setEvent("StartTime"), VBLongTime), ":00 ","") & "-" & replace(formatdatetime(setEvent("EndTime"), VBLongTime), ":00 ","") & "
" & VbCrlf sH = sH & "
" & VbCrlf sH = sH & "" & VbCrlf sH = sH & VbCrlf & VbCrlf & VbCrlf ' END: SHORT VIEW case "WEEK/PLACE" ' BEGIN: WEEK/PLACE VIEW sH = sH & VbCrlf & VbCrlf & VbCrlf sH = sH & "" & VbCrlf sH = sH & "" & VbCrlf sH = sH & "" & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & VbCrlf sH = sH & "" & VbCrlf ' Time sH = sH & "" & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & VbCrlf sH = sH & "" & VbCrlf sH = sH & "
" & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & setEvent("EventName") & imgREC & " " & VbCrlf sH = sH & "
Time" & replace(formatdatetime(setEvent("StartTime"), VBLongTime), ":00 ","") & "-" & replace(formatdatetime(setEvent("EndTime"), VBLongTime), ":00 ","") & "
" & VbCrlf sH = sH & "
" & VbCrlf sH = sH & "" & VbCrlf sH = sH & VbCrlf & VbCrlf & VbCrlf ' END: WEEK/PLACE VIEW case ELSE ' BEGIN: LONG VIEW sH = sH & VbCrlf & VbCrlf & VbCrlf sH = sH & "" & VbCrlf sH = sH & "" & VbCrlf sH = sH & "" & VbCrlf sH = sH & " " & VbCrlf sH = sH & "" & VbCrlf sH = sH & "" & VbCrlf sH = sH & "" & VbCrlf sH = sH & "" & VbCrlf ' Time sH = sH & "" & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & VbCrlf sH = sH & "" & VbCrlf ' Description sH = sH & "" & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & VbCrlf sH = sH & "" & VbCrlf ' Place sH = sH & "" & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & VbCrlf sH = sH & "" & VbCrlf ' Category sH = sH & "" & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & VbCrlf sH = sH & "" & VbCrlf ' Custfields dim intRowspan intRowspan = 7 if UseCustFields then if strCust1<>"" then sH = sH & "" & VbCrLf intRowspan = intRowspan +1 end if if strCust2<>"" then sH = sH & "" & VbCrLf intRowspan = intRowspan +1 end if if strCust3<>"" then sH = sH & "" & VbCrLf intRowspan = intRowspan +1 end if if strCust4<>"" then sH = sH & "" & VbCrLf intRowspan = intRowspan +1 end if if strCust5<>"" then sH = sH & "" & VbCrLf intRowspan = intRowspan +1 end if end if sH = replace(sH,"rowspan=7","rowspan="&intRowspan) sH = sH & "
" & VbCrlf sH = sH & " " & VbCrlf sH = sH & " " & setEvent("EventName") & imgREC & " " & VbCrlf ' Edit/modify link for admin or owner of event if intUSERPERMISSION="1" OR (session("WCAL_USERID") = setEvent("IDUser") AND intUSERPERMISSION="2") or blCalendar then sH = sH & "
" & VbCrlf strICO="" if CountID>1 then strICO="ALL" ' Ico edit sH = sH & " " & VbCrLf ' Ico delete sH = sH & " " & VbCrLf ' Event is repeated if CountID>1 then ' Ico edit sH = sH & " " & VbCrLf ' Ico delete sH = sH & " " & VbCrLf end if end If sH = sH & " 
Time" & replace(formatdatetime(setEvent("StartTime"), VBLongTime), ":00 ","") & "-" & replace(formatdatetime(setEvent("EndTime"), VBLongTime), ":00 ","") & "
Description" & funcs.ShortEvenHeader(setEvent("Description"),500) & " 
Place" & setEvent("Place") & " 
Category" & CATEGORY_FINDTOP(IDCat) & " 
" & strCust1 & "" & setEvent("Cust1") & "
" & strCust2 & "" & setEvent("Cust2") & "
" & strCust3 & "" & setEvent("Cust3") & "
" & strCust4 & "" & setEvent("Cust4") & "
" & strCust5 & "" & setEvent("Cust5") & "
" & VbCrlf sH = sH & "
" & VbCrlf sH = sH & "" & VbCrlf sH = sH & VbCrlf & VbCrlf & VbCrlf ' END: LONG VIEW end select end if CAL_ViewOneEvent = sH end function %>