<% 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 %>
Calendar Setting
nowrap valign="top" width="30%" nowrap>Calendar Name  > " maxlength="50">
nowrap valign="top" nowrap>Private Calendar (purely group based)?  > class="radiocheck">
nowrap valign="top" nowrap>Can Member add events?  >
nowrap valign="top" nowrap>Can Member Delete Own Events?  > class="radiocheck">
nowrap valign="top" nowrap>Can Member Subscribe to Calendar?  > class="radiocheck">
nowrap valign="top" nowrap>Event Discussions should take place in:  >
nowrap valign="top">Upload:  > kb;
(0=not allowed)
"> extensions (e.g. "txt/gif/jpg")
(empty = not allowed)
nowrap valign="top" nowrap>Is this calendar active?  > class="radiocheck">

<% if types="editcal" then %> <% End If %> <% if types="editcal" then %>

<% End If %>
<% 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) %>
<% if isArray(arrGroupIn) then for i = 0 to ubound(arrGroupIn,2) %> > <% next else %> <% end if i = 0 %>
Current User Group(s) in Permission Table
<%= isActiveGroup(arrGroupIn(2,i),HTMLEncode(""&arrGroupIn(0,i))) %> Edit | Remove?
> Not Available.
* italicized = inactive setting

<% if isArray(arrGroupNotIn) then for i = 0 to ubound(arrGroupNotIn,2) %> > <% next else %> <% end if %>
Current User Group(s) not in Permission Table
<%= HTMLEncode(""&arrGroupNotIn(0,i)) %> Add?
> Not Available.
<% 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) %>
Permission Setting
nowrap valign="top">General Permission:  >
nowrap valign="top">Can Create Recurring:  > class="radiocheck">
nowrap valign="top">Is Moderator?   > class="radiocheck" onclick="checkModerator()">
nowrap valign="top" nowrap>Can Delete Own Events?  > class="radiocheck">
nowrap valign="top" nowrap>Can Subscribe to Calendar?  > class="radiocheck">
nowrap valign="top">Upload:  > kb;
(0=not allowed)
"> extensions (e.g. "txt/gif/jpg")
(empty = not allowed)
nowrap valign="top">Is this setting active?  > class="radiocheck">


   
<% 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 %>
<% If isArray(allCal) then %> <% for i = 0 to ubound(allCal,2) %> <% next %> <% Else %> <% End If %>
All Calendars
class="cat" width="90%">Calendar Name class="cat" width="*" nowrap>Private Calendar? class="cat" width="*" nowrap>Is Active?
class="c2"> <%= HTMLEncode(""&allCal(1,i)) %> align=center><%= iff(allCal(2,i),calyesgif,calnogif) %> align=center><%= iff(allCal(3,i),calyesgif,calnogif) %>
class="c2" colspan=3>There is currently no calendar defined.


Subscription Notification
>Calendar Subscription Message:
>

<% END SELECT %>