%
Dim types, arrPM, i, objRS, disHead, disTitle, id, strSQL, searchBy, criteria, SQL , gid,allCal
Dim uploadRestriction,uploadSize
Dim tempArr
types = request.queryString("types")
calendarID = request.queryString("calendarID")
%>
Calendar Management
<%= OutputCSS() %>
<%
SELECT Case types
Case "addcal","editcal"
disHead = _
"Calendars Configuration : "&_
"
"
Dim calendarID,calendarname,isPrivate,canMemberAdd,discussInForumID,isActive,canMemberDelete,canMemberSubscribe
if types = "editcal" then
' response.write "SELECT calendarname,isPublic,canMemberAdd,discussInForumID,isActive FROM pgd_calendars WHERE calendarID="&calendarID
' response.end
set objRS = server.createobject("adodb.recordset")
with objRS
.CacheSize = 1
.open "SELECT calendarname,isPrivate,canMemberAdd,discussInForumID,isActive,uploadRestriction,canMemberDelete,canMemberSubscribe FROM pgd_calendars WHERE calendarID="&calendarID, datastore, , , adCmdText
If not (.EOF or .BOF) then
allCal = .getrows
End if
.close
end with
set objRS=nothing
calendarname = allCal(0,0)
isPrivate = allCal(1,0)
canMemberAdd = allCal(2,0)
discussInForumID = allCal(3,0)
isActive = allCal(4,0)
uploadRestriction= allCal(5,0)
canMemberDelete = allCal(6,0)
canMemberSubscribe = allCal(7,0)
if uploadRestriction <> "" then
tempArr = split(uploadRestriction,"|")
if isArray(tempArr) then
uploadSize = tempArr(0)
if ubound(tempArr)=1 then uploadFormat = tempArr(1)
end if
end if
else
calendarname = ""
isPrivate = 0
canMemberAdd = 2
discussInForumID = 0
isActive = 1
uploadSize = 0
uploadFormat = ""
canMemberDelete = 0
canMemberSubscribe = 0
end if
%>
<%= disHead %>
<%
Case "group"
strSQL = dbOwnerPrefix&"spCalendarGroupPermissionSetup ("&calendarID&")"
disHead = _
"Calendar Group Permission : "&_
"
"
Dim arrGroupIn, arrGroupNotIn, arrUserIn
set objRS = server.createobject("adodb.recordset")
With objRS
.open strSQL, datastore, , , adCmdStoredProc
if not (.eof and .bof) then arrGroupIn = .getrows
End With
set objRS = objRS.NextRecordset
With objRS
if not (.eof and .bof) then arrGroupNotIn = .getrows
End With
set objRS = nothing
%>
<% response.write (disHead) %>
Current User Group(s) in Permission Table
<%
if isArray(arrGroupIn) then
for i = 0 to ubound(arrGroupIn,2)
%>
<%
Case "editgroup","addgroup"
gid = request.querystring("gid")
Dim permission,canCreateRecurring,isModerator
Dim groupPermissionSet
disHead = _
"Calendar Group Permission : "&_
"
"
if types = "editgroup" then
strSQL = "SELECT permission,canCreateRecurring,isModerator,isActive, uploadrestriction, canMemberDelete, canMemberSubscribe from pgd_calendarPermission where CalendarID="&CalendarID&" and GID="&gid
set objRS = server.createobject("adodb.recordset")
with objRS
.CacheSize = 150
.open strSQL, datastore, , , adCmdText
If not (.EOF or .BOF) then
groupPermissionSet = .getrows
End if
.close
end with
set objRS=nothing
permission = groupPermissionSet(0,0)
canCreateRecurring = groupPermissionSet(1,0)
isModerator = groupPermissionSet(2,0)
isActive = groupPermissionSet(3,0)
uploadRestriction= groupPermissionSet(4,0)
canMemberDelete = groupPermissionSet(5,0)
canMemberSubscribe = groupPermissionSet(6,0)
if uploadRestriction <> "" then
tempArr = split(uploadRestriction,"|")
if isArray(tempArr) then
uploadSize = tempArr(0)
if ubound(tempArr)=1 then uploadFormat = tempArr(1)
end if
end if
else
permission = 3
canCreateRecurring = 1
isModerator = 0
isActive = 1
uploadSize = 0
uploadFormat = ""
canMemberDelete = 0
canMemberSubscribe = 0
end if
%>
<% response.write (disHead) %>
<%
Case "removegroup"
Dim objCon
SET objCon = server.createObject("ADODB.connection")
with objCon
.open datastore
.execute "delete from pgd_calendarpermission where calendarID="&calendarID&" and gid="&request.querystring("gid"), , adExecuteNoRecords + adCmdtext 'adCmdStoredProc
.close
end with
Set objCon = nothing
response.redirect ("admin_calendar.asp?types=group&calendarID="&calendarID)
%>
<%
Case else
disHead = _
"Calendars Configuration : "&_
"
"
set objRS = server.createobject("adodb.recordset")
with objRS
.CacheSize = 150
.open "SELECT calendarID, calendarName, isPrivate, isActive FROM pgd_calendars ORDER By isPrivate DESC, calendarName", datastore, , , adCmdText
If not (.EOF or .BOF) then
allCal = .getrows
End if
.close
.open "SELECT calNotify_msg FROM pgd_srvmsg", datastore, , , adCmdText
calNotify_msg = .fields(0)
.close
end with
set objRS=nothing
Dim calNotify_msg
Dim calyesgif,calnogif
calyesgif = ""
calnogif = ""
%>
<%= disHead %>
<%
END SELECT
%>